{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--aws-connect-rule.json",
  "title": "AWSConnectRuleProperties",
  "description": "Resource Type definition for AWS:Connect::Rule. Source:- <https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-connect>",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/lalcebo/json-schema/master/serverless/resources/cloudformation-modified/aws-connect-rule.json",
    "sourceSha256": "cfa019fd6548027cf29c035348d245a8ce7bb850d1443e2722f7c5b3b6ece0e2"
  },
  "type": "object",
  "properties": {
    "Name": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "^[a-zA-Z0-9._-]{1,200}$"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "The name of the rule."
    },
    "InstanceArn": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "The Amazon Resource Name (ARN) of the instance."
    },
    "TriggerEventSource": {
      "description": "The event source that triggers the rule.",
      "$ref": "#/$defs/RuleTriggerEventSource"
    },
    "Function": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "The conditions of a rule."
    },
    "Actions": {
      "description": "The list of actions that will be executed when a rule is triggered.",
      "$ref": "#/$defs/Actions"
    },
    "PublishStatus": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "DRAFT",
            "PUBLISHED"
          ]
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "The publish status of a rule, either draft or published."
    },
    "Tags": {
      "description": "One or more tags.",
      "type": "array",
      "maxItems": 50,
      "uniqueItems": true,
      "insertionOrder": false,
      "items": {
        "$ref": "#/$defs/Tag"
      }
    }
  },
  "typeName": "AWS::Connect::Rule",
  "replacementStrategy": "delete_then_create",
  "sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-connect",
  "additionalProperties": false,
  "createOnlyProperties": [
    "/properties/TriggerEventSource",
    "/properties/InstanceArn"
  ],
  "required": [
    "Name",
    "InstanceArn",
    "TriggerEventSource",
    "Function",
    "Actions",
    "PublishStatus"
  ],
  "tagging": {
    "taggable": true,
    "tagOnCreate": false,
    "tagUpdatable": true,
    "cloudFormationSystemTags": true,
    "tagProperty": "/properties/Tags"
  },
  "$defs": {
    "UserArn": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "^$|arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/agent/[-a-zA-Z0-9]*$"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "The Amazon Resource Name (ARN) of the user.",
      "title": "AWSConnectRuleUserArnDefinition"
    },
    "NotificationRecipientType": {
      "description": "The type of notification recipient.",
      "type": "object",
      "properties": {
        "UserTags": {
          "description": "The collection of recipients who are identified by user tags",
          "additionalProperties": false,
          "patternProperties": {
            "^(?=.{1,128}$).+$": {
              "type": "string"
            }
          }
        },
        "UserArns": {
          "description": "The list of recipients by user arns.",
          "type": "array",
          "minItems": 1,
          "maxItems": 5,
          "uniqueItems": true,
          "insertionOrder": false,
          "items": {
            "$ref": "#/$defs/UserArn"
          }
        }
      },
      "title": "AWSConnectRuleNotificationRecipientTypeDefinition",
      "additionalProperties": false
    },
    "Reference": {
      "description": "A contact reference.",
      "type": "object",
      "properties": {
        "Value": {
          "oneOf": [
            {
              "type": "string",
              "pattern": "^(/|https:)"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        },
        "Type": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "URL",
                "ATTACHMENT",
                "NUMBER",
                "STRING",
                "DATE",
                "EMAIL"
              ]
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        }
      },
      "required": [
        "Value",
        "Type"
      ],
      "title": "AWSConnectRuleReferenceDefinition",
      "additionalProperties": false
    },
    "TaskAction": {
      "description": "The definition of task action.",
      "type": "object",
      "properties": {
        "Name": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The name which appears in the agent's Contact Control Panel (CCP)."
        },
        "Description": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 0,
              "maxLength": 4096
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The description which appears in the agent's Contact Control Panel (CCP)."
        },
        "ContactFlowArn": {
          "oneOf": [
            {
              "type": "string",
              "pattern": "^$|arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/contact-flow/[-a-zA-Z0-9]*$"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The Amazon Resource Name (ARN) of the contact flow."
        },
        "References": {
          "description": "A formatted URL that is shown to an agent in the Contact Control Panel (CCP).",
          "additionalProperties": false,
          "patternProperties": {
            "^(?=.{1,4096}$).+$": {
              "$ref": "#/$defs/Reference"
            }
          }
        }
      },
      "required": [
        "Name",
        "ContactFlowArn"
      ],
      "title": "AWSConnectRuleTaskActionDefinition",
      "additionalProperties": false
    },
    "EventBridgeAction": {
      "description": "The definition for event bridge action.",
      "type": "object",
      "properties": {
        "Name": {
          "oneOf": [
            {
              "type": "string",
              "pattern": "^[a-zA-Z0-9._-]{1,100}$"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The name of the event bridge action."
        }
      },
      "required": [
        "Name"
      ],
      "title": "AWSConnectRuleEventBridgeActionDefinition",
      "additionalProperties": false
    },
    "AssignContactCategoryAction": {
      "description": "The definition for assigning contact category action.",
      "type": "object",
      "title": "AWSConnectRuleAssignContactCategoryActionDefinition"
    },
    "SendNotificationAction": {
      "description": "The definition for sending notification action.",
      "type": "object",
      "properties": {
        "DeliveryMethod": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "EMAIL"
              ]
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The means of delivery."
        },
        "Subject": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The subject of notification."
        },
        "Content": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The content of notification."
        },
        "ContentType": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "PLAIN_TEXT"
              ]
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The type of content."
        },
        "Recipient": {
          "$ref": "#/$defs/NotificationRecipientType"
        }
      },
      "required": [
        "DeliveryMethod",
        "Content",
        "Recipient",
        "ContentType"
      ],
      "title": "AWSConnectRuleSendNotificationActionDefinition",
      "additionalProperties": false
    },
    "AssignContactCategoryActions": {
      "description": "This action will assign contact category when a rule is triggered.",
      "type": "array",
      "insertionOrder": false,
      "uniqueItems": true,
      "items": {
        "$ref": "#/$defs/AssignContactCategoryAction"
      },
      "minItems": 1,
      "maxItems": 1,
      "title": "AWSConnectRuleAssignContactCategoryActionsDefinition"
    },
    "EventBridgeActions": {
      "description": "This action will send event bridge notification when a rule is triggered.",
      "type": "array",
      "insertionOrder": false,
      "uniqueItems": true,
      "items": {
        "$ref": "#/$defs/EventBridgeAction"
      },
      "minItems": 1,
      "maxItems": 1,
      "title": "AWSConnectRuleEventBridgeActionsDefinition"
    },
    "RuleTriggerEventSource": {
      "description": "The event source that will trigger the rule.",
      "type": "object",
      "properties": {
        "EventSourceName": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "OnContactEvaluationSubmit",
                "OnPostCallAnalysisAvailable",
                "OnRealTimeCallAnalysisAvailable",
                "OnPostChatAnalysisAvailable",
                "OnZendeskTicketCreate",
                "OnZendeskTicketStatusUpdate",
                "OnSalesforceCaseCreate"
              ]
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The name of event source."
        },
        "IntegrationAssociationArn": {
          "oneOf": [
            {
              "type": "string",
              "pattern": "^$|arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/integration-association/[-a-zA-Z0-9]*$"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The Amazon Resource Name (ARN) for the AppIntegration association."
        }
      },
      "required": [
        "EventSourceName"
      ],
      "title": "AWSConnectRuleRuleTriggerEventSourceDefinition",
      "additionalProperties": false
    },
    "TaskActions": {
      "description": "This action will generate a task when a rule is triggered.",
      "type": "array",
      "insertionOrder": false,
      "uniqueItems": true,
      "items": {
        "$ref": "#/$defs/TaskAction"
      },
      "minItems": 1,
      "maxItems": 1,
      "title": "AWSConnectRuleTaskActionsDefinition"
    },
    "SendNotificationActions": {
      "description": "The action will send notification when a rule is triggered.",
      "type": "array",
      "insertionOrder": false,
      "uniqueItems": true,
      "items": {
        "$ref": "#/$defs/SendNotificationAction"
      },
      "minItems": 1,
      "maxItems": 1,
      "title": "AWSConnectRuleSendNotificationActionsDefinition"
    },
    "Actions": {
      "description": "The list of actions that will be executed when a rule is triggered.",
      "type": "object",
      "properties": {
        "AssignContactCategoryActions": {
          "$ref": "#/$defs/AssignContactCategoryActions"
        },
        "EventBridgeActions": {
          "$ref": "#/$defs/EventBridgeActions"
        },
        "TaskActions": {
          "$ref": "#/$defs/TaskActions"
        },
        "SendNotificationActions": {
          "$ref": "#/$defs/SendNotificationActions"
        }
      },
      "title": "AWSConnectRuleActionsDefinition",
      "additionalProperties": false
    },
    "Tag": {
      "description": "A key-value pair to associate with a resource.",
      "type": "object",
      "title": "AWSConnectRuleTagDefinition",
      "properties": {
        "Key": {
          "oneOf": [
            {
              "type": "string",
              "pattern": "^(?!aws:)[a-zA-Z+-=._:/]+$",
              "minLength": 1,
              "maxLength": 128
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. "
        },
        "Value": {
          "oneOf": [
            {
              "type": "string",
              "maxLength": 256
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The value for the tag. You can specify a value that's 1 to 256 characters in length."
        }
      },
      "required": [
        "Key",
        "Value"
      ],
      "additionalProperties": false
    }
  },
  "primaryIdentifier": [
    "/properties/RuleArn"
  ],
  "readOnlyProperties": [
    "/properties/RuleArn"
  ]
}
