{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--events.json",
  "description": "Sub schema containing definitions for Events",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/lalcebo/json-schema/master/serverless/components/events.json",
    "sourceSha256": "96d557d6fe4f2dd56abca2b0c4f73585846832247a6b08a9aa85991afcefdc6c"
  },
  "type": "object",
  "id": "https://raw.githubusercontent.com/lalcebo/json-schema/master/serverless/components/events.json",
  "schema": "https://json-schema.org/draft-07/schema#",
  "AwsScheduleEvent": {
    "title": "AwsScheduleEvent",
    "properties": {
      "description": {
        "type": "string"
      },
      "enabled": {
        "type": "boolean"
      },
      "input": {
        "additionalProperties": {},
        "type": "object"
      },
      "inputPath": {
        "type": "string"
      },
      "inputTransformer": {
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--common.json#/AwsInputTransformer"
      },
      "name": {
        "type": "string"
      },
      "rate": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          {
            "type": "array",
            "items": {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          },
          {
            "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
          }
        ]
      }
    },
    "type": "object"
  },
  "additionalProperties": false,
  "required": [
    "AwsActiveMq",
    "AwsSns",
    "AwsSnsDeadLetterTargetImport",
    "AwsSnsRedrivePolicy",
    "AwsSqs",
    "AwsCloudwatchEvent",
    "AwsScheduleEvent"
  ],
  "AwsActiveMq": {
    "type": "object",
    "properties": {
      "arn": {
        "anyOf": [
          {
            "type": "string",
            "pattern": "arn:[a-z-]+:mq:[a-z0-9-]+:\\d+:broker:[A-Za-z0-9/_+=.@-]+:b-[a-z0-9-]+"
          },
          {
            "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/FnImportValue"
          },
          {
            "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/FnRef"
          }
        ]
      },
      "basicAuthArn": {
        "anyOf": [
          {
            "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--common.json#/AwsSecretsManagerArnString"
          },
          {
            "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/FnImportValue"
          },
          {
            "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/FnRef"
          }
        ]
      },
      "batchSize": {
        "type": "number",
        "minimum": 1,
        "maximum": 10000
      },
      "maximumBatchingWindow": {
        "type": "number",
        "minimum": 0,
        "maximum": 300
      },
      "enabled": {
        "type": "boolean"
      },
      "queue": {
        "type": "string"
      },
      "filterPatterns": {
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--common.json#/AwsFilterPatterns"
      }
    },
    "additionalProperties": false,
    "required": [
      "basicAuthArn",
      "arn",
      "queue"
    ]
  },
  "AwsSns": {
    "title": "AwsSns",
    "description": "Event definition for Aws Sns topics",
    "properties": {
      "displayName": {
        "type": "string"
      },
      "filterPolicy": {
        "anyOf": [
          {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "object"
          }
        ]
      },
      "redrivePolicy": {
        "$ref": "#/AwsSnsRedrivePolicy"
      },
      "topicName": {
        "type": "string",
        "maxLength": 256,
        "pattern": "^[\\w-]+$"
      },
      "arn": {
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--common.json#/AwsArnReference"
      },
      "filterPolicyScope": {
        "type": "string"
      }
    },
    "type": "object",
    "anyOf": [
      {
        "required": [
          "arn"
        ]
      },
      {
        "required": [
          "topicName"
        ]
      }
    ],
    "additionalProperties": false
  },
  "AwsSnsRedrivePolicy": {
    "properties": {
      "deadLetterTargetArn": {
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--common.json#/AwsArnReference"
      },
      "deadLetterTargetImport": {
        "$ref": "#/AwsSnsDeadLetterTargetImport"
      },
      "deadLetterTargetRef": {
        "type": "string",
        "minLength": 1
      }
    },
    "type": "object",
    "additionalProperties": false,
    "oneOf": [
      {
        "required": [
          "deadLetterTargetArn"
        ]
      },
      {
        "required": [
          "deadLetterTargetRef"
        ]
      },
      {
        "required": [
          "deadLetterTargetImport"
        ]
      }
    ]
  },
  "AwsSnsDeadLetterTargetImport": {
    "properties": {
      "arn": {
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--common.json#/AwsArnReference"
      },
      "url": {
        "type": "string"
      }
    },
    "type": "object"
  },
  "AwsSqs": {
    "properties": {
      "arn": {
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--common.json#/AwsArnReference"
      },
      "batchSize": {
        "type": "number",
        "maximum": 10000,
        "minimum": 1
      },
      "enabled": {
        "type": "boolean",
        "default": true
      },
      "maximumBatchingWindow": {
        "type": "number",
        "minimum": 2,
        "maximum": 300
      },
      "maximumConcurrency": {
        "type": "number",
        "minimum": 2,
        "maximum": 1000
      },
      "maximumRetryAttempts": {
        "type": [
          "string",
          "number"
        ]
      },
      "functionResponseType": {
        "type": "string",
        "enum": [
          "ReportBatchItemFailures"
        ]
      },
      "filterPatterns": {
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--common.json#/AwsFilterPatterns"
      }
    },
    "type": "object",
    "required": [
      "arn"
    ],
    "additionalProperties": false
  },
  "AwsAlbEvent": {
    "properties": {
      "conditions": {
        "properties": {
          "host": {
            "type": "string"
          },
          "path": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "listenerArn": {
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--common.json#/AwsArnReference"
      },
      "priority": {
        "type": [
          "string",
          "number"
        ]
      }
    },
    "type": "object"
  },
  "AwsAlexaSkill": {
    "properties": {
      "appId": {
        "type": "string"
      },
      "enabled": {
        "type": "boolean"
      }
    },
    "type": "object"
  },
  "AwsCloudwatchEvent": {
    "properties": {
      "description": {
        "type": "string"
      },
      "enabled": {
        "type": "boolean",
        "default": true
      },
      "event": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "$ref": "#/AwsCloudwatchEventInternal"
          }
        ]
      },
      "input": {
        "type": "object",
        "additionalProperties": {}
      },
      "inputPath": {
        "type": "string"
      },
      "inputTransformer": {
        "$ref": "#/AwsEventInputTransformer"
      },
      "name": {
        "type": "string"
      }
    },
    "type": "object"
  },
  "AwsCloudwatchEventInternal": {
    "properties": {
      "source": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        ]
      },
      "detail-type": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        ]
      },
      "detail": {
        "type": "object"
      },
      "region": {
        "type": "string"
      },
      "resources": {
        "type": "array",
        "description": "This is an array of arns",
        "items": {
          "type": "string"
        }
      },
      "version": {
        "type": "string"
      },
      "id": {
        "type": "string"
      },
      "time": {
        "type": "string"
      },
      "account": {
        "type": "string"
      }
    },
    "required": [
      "source"
    ]
  },
  "AwsEventInputTransformer": {
    "title": "AwsEventInputTransformer",
    "properties": {
      "inputPathsMap": {
        "additionalProperties": {
          "type": "string",
          "minLength": 1
        },
        "type": "object"
      },
      "inputTemplate": {
        "type": "string",
        "minLength": 1,
        "maxLength": 8192
      }
    },
    "type": "object",
    "required": [
      "inputTemplate"
    ]
  }
}
