ConnectCases / Client / create_case_rule

create_case_rule#

ConnectCases.Client.create_case_rule(**kwargs)#

Creates a new case rule. In the Amazon Connect admin website, case rules are known as case field conditions. For more information about case field conditions, see Add case field conditions to a case template.

See also: AWS API Documentation

Request Syntax

response = client.create_case_rule(
    description='string',
    domainId='string',
    name='string',
    rule={
        'required': {
            'conditions': [
                {
                    'equalTo': {
                        'operandOne': {
                            'fieldId': 'string'
                        },
                        'operandTwo': {
                            'booleanValue': True|False,
                            'doubleValue': 123.0,
                            'emptyValue': {}
                            ,
                            'stringValue': 'string'
                        },
                        'result': True|False
                    },
                    'notEqualTo': {
                        'operandOne': {
                            'fieldId': 'string'
                        },
                        'operandTwo': {
                            'booleanValue': True|False,
                            'doubleValue': 123.0,
                            'emptyValue': {}
                            ,
                            'stringValue': 'string'
                        },
                        'result': True|False
                    }
                },
            ],
            'defaultValue': True|False
        }
    }
)
Parameters:
  • description (string) – The description of a case rule.

  • domainId (string) –

    [REQUIRED]

    Unique identifier of a Cases domain.

  • name (string) –

    [REQUIRED]

    Name of the case rule.

  • rule (dict) –

    [REQUIRED]

    Represents what rule type should take place, under what conditions.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: required.

    • required (dict) –

      Required rule type, used to indicate whether a field is required.

      • conditions (list) – [REQUIRED]

        List of conditions for the required rule; the first condition to evaluate to true dictates the value of the rule.

        • (dict) –

          Boolean condition for a rule. In the Amazon Connect admin website, case rules are known as case field conditions. For more information about case field conditions, see Add case field conditions to a case template.

          Note

          This is a Tagged Union structure. Only one of the following top level keys can be set: equalTo, notEqualTo.

          • equalTo (dict) –

            Tests that operandOne is equal to operandTwo.

            • operandOne (dict) – [REQUIRED]

              Represents the left hand operand in the condition.

              Note

              This is a Tagged Union structure. Only one of the following top level keys can be set: fieldId.

              • fieldId (string) –

                The field ID that this operand should take the value of.

            • operandTwo (dict) – [REQUIRED]

              Represents the right hand operand in the condition.

              Note

              This is a Tagged Union structure. Only one of the following top level keys can be set: booleanValue, doubleValue, emptyValue, stringValue.

              • booleanValue (boolean) –

                Boolean value type.

              • doubleValue (float) –

                Double value type.

              • emptyValue (dict) –

                Empty value type.

              • stringValue (string) –

                String value type.

            • result (boolean) – [REQUIRED]

              The value of the outer rule if the condition evaluates to true.

          • notEqualTo (dict) –

            Tests that operandOne is not equal to operandTwo.

            • operandOne (dict) – [REQUIRED]

              Represents the left hand operand in the condition.

              Note

              This is a Tagged Union structure. Only one of the following top level keys can be set: fieldId.

              • fieldId (string) –

                The field ID that this operand should take the value of.

            • operandTwo (dict) – [REQUIRED]

              Represents the right hand operand in the condition.

              Note

              This is a Tagged Union structure. Only one of the following top level keys can be set: booleanValue, doubleValue, emptyValue, stringValue.

              • booleanValue (boolean) –

                Boolean value type.

              • doubleValue (float) –

                Double value type.

              • emptyValue (dict) –

                Empty value type.

              • stringValue (string) –

                String value type.

            • result (boolean) – [REQUIRED]

              The value of the outer rule if the condition evaluates to true.

      • defaultValue (boolean) – [REQUIRED]

        The value of the rule (that is, whether the field is required) should none of the conditions evaluate to true.

Return type:

dict

Returns:

Response Syntax

{
    'caseRuleArn': 'string',
    'caseRuleId': 'string'
}

Response Structure

  • (dict) –

    • caseRuleArn (string) –

      The Amazon Resource Name (ARN) of a case rule.

    • caseRuleId (string) –

      Unique identifier of a case rule.

Exceptions