antimatter.builders.read_context_rule#

Module Contents#

Classes#

ReadContextRuleBuilder

Builder class for creating a ReadContextConfigRule.

ReadContextRuleFactArgumentBuilder

Builder class for creating a ReadContextConfigRuleFactArgument.

class antimatter.builders.read_context_rule.ReadContextRuleBuilder#

Builder class for creating a ReadContextConfigRule.

add_match_expression(source: antimatter.constants.Source | str, key: str, operator: antimatter.constants.Operator | str, values: List[str] | None = None, value: str | None = None) ReadContextRuleBuilder#

Add a match expression to the rule.

Parameters:
  • source – The source of the match expression.

  • key – The key of the match expression.

  • operator – The operator of the match expression.

  • values – The values of the match expression.

  • value – The value of the match expression.

Returns:

The builder instance.

set_action(action: antimatter.constants.Action | str) ReadContextRuleBuilder#

Set the action of the rule.

Parameters:

action – The action of the rule.

Returns:

The builder instance.

set_token_scope(token_scope: antimatter.constants.TokenScope | str) ReadContextRuleBuilder#

Set the token scope of the rule.

Parameters:

token_scope – The token scope of the rule.

Returns:

The builder instance.

set_token_format(token_format: antimatter.constants.TokenFormat | str) ReadContextRuleBuilder#

Set the token format of the rule.

Parameters:

token_format – The token format of the rule.

Returns:

The builder instance.

set_priority(priority: int) ReadContextRuleBuilder#

Set the priority of the rule.

Parameters:

priority – The priority of the rule.

Returns:

The builder instance.

add_fact(operator: antimatter.builders.fact_policy.FactOperator | str, name: str, arguments_builder: ReadContextRuleFactArgumentBuilder = None) ReadContextRuleBuilder#

Add a fact to the rule.

Parameters:
  • operator – The operator of the fact.

  • name – The name of the fact.

  • arguments_builder – The arguments builder of the fact.

Returns:

The builder instance.

build() antimatter.client.NewReadContextConfigRule#

Build the rule.

Returns:

The built rule.

class antimatter.builders.read_context_rule.ReadContextRuleFactArgumentBuilder#

Builder class for creating a ReadContextConfigRuleFactArgument.

add_argument(source: antimatter.constants.Source | str, key: str = None, value: str = None) ReadContextRuleFactArgumentBuilder#

Add an argument to the fact.

Parameters:
  • source – The source of the argument.

  • key – The key of the argument.

  • value – The value of the argument.

Returns:

The builder instance.

build() List[antimatter.client.ReadContextRuleFactsInnerArgumentsInner]#

Build the arguments.

Returns:

The built arguments.