{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--aws-rekognition-streamprocessor.json",
  "title": "AWSRekognitionStreamProcessorProperties",
  "description": "The AWS::Rekognition::StreamProcessor type is used to create an Amazon Rekognition StreamProcessor that you can use to analyze streaming videos.\n\n. Source:- <https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git>",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/lalcebo/json-schema/master/serverless/resources/cloudformation-modified/aws-rekognition-streamprocessor.json",
    "sourceSha256": "9789ef7619094a01abc39f189587e54ba84792a2b022bff05f5d73323a00ea62"
  },
  "type": "object",
  "properties": {
    "Name": {
      "oneOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "[a-zA-Z0-9_.\\-]+"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "Name of the stream processor. It's an identifier you assign to the stream processor. You can use it to manage the stream processor."
    },
    "KmsKeyId": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "The KMS key that is used by Rekognition to encrypt any intermediate customer metadata and store in the customer's S3 bucket."
    },
    "RoleArn": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 2048,
          "pattern": "arn:aws(-[\\w]+)*:iam::[0-9]{12}:role/.*"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "ARN of the IAM role that allows access to the stream processor, and provides Rekognition read permissions for KVS stream and write permissions to S3 bucket and SNS topic."
    },
    "KinesisVideoStream": {
      "$ref": "#/$defs/KinesisVideoStream"
    },
    "FaceSearchSettings": {
      "$ref": "#/$defs/FaceSearchSettings"
    },
    "ConnectedHomeSettings": {
      "$ref": "#/$defs/ConnectedHomeSettings"
    },
    "KinesisDataStream": {
      "$ref": "#/$defs/KinesisDataStream"
    },
    "S3Destination": {
      "$ref": "#/$defs/S3Destination"
    },
    "NotificationChannel": {
      "$ref": "#/$defs/NotificationChannel"
    },
    "DataSharingPreference": {
      "$ref": "#/$defs/DataSharingPreference"
    },
    "PolygonRegionsOfInterest": {
      "description": "The PolygonRegionsOfInterest specifies a set of polygon areas of interest in the video frames to analyze, as part of connected home feature. Each polygon is in turn, an ordered list of Point",
      "type": "array",
      "uniqueItems": true,
      "insertionOrder": false,
      "minItems": 0,
      "items": {
        "$ref": "#/$defs/Polygon"
      }
    },
    "BoundingBoxRegionsOfInterest": {
      "description": "The BoundingBoxRegionsOfInterest specifies an array of bounding boxes of interest in the video frames to analyze, as part of connected home feature. If an object is partially in a region of interest, Rekognition will tag it as detected if the overlap of the object with the region-of-interest is greater than 20%.",
      "type": "array",
      "uniqueItems": true,
      "insertionOrder": false,
      "minItems": 0,
      "items": {
        "$ref": "#/$defs/BoundingBox"
      }
    },
    "Tags": {
      "description": "An array of key-value pairs to apply to this resource.",
      "type": "array",
      "uniqueItems": true,
      "insertionOrder": false,
      "minItems": 0,
      "maxItems": 200,
      "items": {
        "$ref": "#/$defs/Tag"
      }
    }
  },
  "typeName": "AWS::Rekognition::StreamProcessor",
  "replacementStrategy": "delete_then_create",
  "sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
  "additionalProperties": false,
  "$comment": "We explicitly specify the replacement strategy to be delete_then_create because we cannot create a new SP resource with the same name or same KVS input before deleting the old one",
  "taggable": true,
  "$defs": {
    "Arn": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 2048
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "The ARN of the stream processor",
      "title": "AWSRekognitionStreamProcessorArnDefinition"
    },
    "KinesisVideoStream": {
      "description": "The Kinesis Video Stream that streams the source video.",
      "type": "object",
      "properties": {
        "Arn": {
          "oneOf": [
            {
              "type": "string",
              "maxLength": 2048,
              "pattern": "(^arn:([a-z0-9-]+):kinesisvideo:([a-z0-9-]+):\\d{12}:.+$)"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "ARN of the Kinesis Video Stream that streams the source video."
        }
      },
      "required": [
        "Arn"
      ],
      "title": "AWSRekognitionStreamProcessorKinesisVideoStreamDefinition",
      "additionalProperties": false
    },
    "S3Destination": {
      "description": "The S3 location in customer's account where inference output & artifacts are stored, as part of connected home feature.",
      "type": "object",
      "properties": {
        "BucketName": {
          "oneOf": [
            {
              "type": "string",
              "maxLength": 63
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "Name of the S3 bucket."
        },
        "ObjectKeyPrefix": {
          "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 object key prefix path where the results will be stored. Default is no prefix path"
        }
      },
      "required": [
        "BucketName"
      ],
      "title": "AWSRekognitionStreamProcessorS3DestinationDefinition",
      "additionalProperties": false
    },
    "KinesisDataStream": {
      "description": "The Amazon Kinesis Data Stream stream to which the Amazon Rekognition stream processor streams the analysis results, as part of face search feature.",
      "type": "object",
      "properties": {
        "Arn": {
          "oneOf": [
            {
              "type": "string",
              "maxLength": 2048,
              "pattern": "(^arn:([a-z0-9-]+):kinesis:([a-z0-9-]+):\\d{12}:.+$)"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "ARN of the Kinesis Data Stream stream."
        }
      },
      "required": [
        "Arn"
      ],
      "title": "AWSRekognitionStreamProcessorKinesisDataStreamDefinition",
      "additionalProperties": false
    },
    "Labels": {
      "description": "List of labels that need to be detected in the video stream. Current supported values are PERSON, PET, PACKAGE, ALL.",
      "type": "array",
      "uniqueItems": true,
      "insertionOrder": false,
      "minItems": 1,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128
      },
      "title": "AWSRekognitionStreamProcessorLabelsDefinition"
    },
    "ConnectedHomeSettings": {
      "description": "Connected home settings to use on a streaming video. Note that either ConnectedHomeSettings or FaceSearchSettings should be set. Not both",
      "type": "object",
      "properties": {
        "Labels": {
          "$ref": "#/$defs/Labels"
        },
        "MinConfidence": {
          "description": "Minimum object class match confidence score that must be met to return a result for a recognized object.",
          "type": "number",
          "minimum": 0,
          "maximum": 100
        }
      },
      "required": [
        "Labels"
      ],
      "title": "AWSRekognitionStreamProcessorConnectedHomeSettingsDefinition",
      "additionalProperties": false
    },
    "FaceSearchSettings": {
      "description": "Face search settings to use on a streaming video. Note that either FaceSearchSettings or ConnectedHomeSettings should be set. Not both",
      "type": "object",
      "properties": {
        "CollectionId": {
          "oneOf": [
            {
              "type": "string",
              "maxLength": 255,
              "pattern": "^[a-zA-Z0-9_\\.\\-]+$"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The ID of a collection that contains faces that you want to search for."
        },
        "FaceMatchThreshold": {
          "description": "Minimum face match confidence score percentage that must be met to return a result for a recognized face. The default is 80. 0 is the lowest confidence. 100 is the highest confidence. Values between 0 and 100 are accepted.",
          "type": "number",
          "minimum": 0,
          "maximum": 100
        }
      },
      "required": [
        "CollectionId"
      ],
      "title": "AWSRekognitionStreamProcessorFaceSearchSettingsDefinition",
      "additionalProperties": false
    },
    "NotificationChannel": {
      "description": "The ARN of the SNS notification channel where events of interests are published, as part of connected home feature.",
      "type": "object",
      "properties": {
        "Arn": {
          "oneOf": [
            {
              "type": "string",
              "maxLength": 2048
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "ARN of the SNS topic."
        }
      },
      "required": [
        "Arn"
      ],
      "title": "AWSRekognitionStreamProcessorNotificationChannelDefinition",
      "additionalProperties": false
    },
    "Point": {
      "description": "An (X, Y) cartesian coordinate denoting a point on the frame",
      "type": "object",
      "properties": {
        "X": {
          "description": "The X coordinate of the point.",
          "type": "number"
        },
        "Y": {
          "description": "The Y coordinate of the point.",
          "type": "number"
        }
      },
      "required": [
        "X",
        "Y"
      ],
      "title": "AWSRekognitionStreamProcessorPointDefinition",
      "additionalProperties": false
    },
    "Polygon": {
      "description": "A polygon showing a region of interest. Note that the ordering of the Point entries matter in defining the polygon",
      "type": "array",
      "uniqueItems": true,
      "insertionOrder": true,
      "minItems": 3,
      "items": {
        "$ref": "#/$defs/Point"
      },
      "title": "AWSRekognitionStreamProcessorPolygonDefinition"
    },
    "BoundingBox": {
      "description": "A bounding box denoting a region of interest in the frame to be analyzed.",
      "type": "object",
      "properties": {
        "Height": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "Width": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "Left": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "Top": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        }
      },
      "required": [
        "Height",
        "Width",
        "Left",
        "Top"
      ],
      "title": "AWSRekognitionStreamProcessorBoundingBoxDefinition",
      "additionalProperties": false
    },
    "DataSharingPreference": {
      "description": "Indicates whether Rekognition is allowed to store the video stream data for model-training.",
      "properties": {
        "OptIn": {
          "description": "Flag to enable data-sharing",
          "type": "boolean"
        }
      },
      "required": [
        "OptIn"
      ],
      "type": "object",
      "title": "AWSRekognitionStreamProcessorDataSharingPreferenceDefinition",
      "additionalProperties": false
    },
    "Tag": {
      "description": "A key-value pair to associate with a resource.",
      "type": "object",
      "properties": {
        "Key": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^(?!aws:)[a-zA-Z0-9+\\-=\\._\\:\\/@]+$"
            },
            {
              "$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",
              "minLength": 0,
              "maxLength": 256,
              "pattern": "^[a-zA-Z0-9+\\-=\\._\\:\\/@]+$"
            },
            {
              "$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 is 0 to 256 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 -."
        }
      },
      "required": [
        "Key",
        "Value"
      ],
      "title": "AWSRekognitionStreamProcessorTagDefinition",
      "additionalProperties": false
    }
  },
  "required": [
    "RoleArn",
    "KinesisVideoStream"
  ],
  "oneOf": [
    {
      "required": [
        "ConnectedHomeSettings",
        "S3Destination",
        "NotificationChannel"
      ]
    },
    {
      "required": [
        "FaceSearchSettings",
        "KinesisDataStream"
      ]
    }
  ],
  "readOnlyProperties": [
    "/properties/Arn",
    "/properties/Status",
    "/properties/StatusMessage"
  ],
  "primaryIdentifier": [
    "/properties/Name"
  ],
  "createOnlyProperties": [
    "/properties/Name",
    "/properties/KmsKeyId",
    "/properties/RoleArn",
    "/properties/KinesisVideoStream",
    "/properties/ConnectedHomeSettings",
    "/properties/FaceSearchSettings",
    "/properties/KinesisDataStream",
    "/properties/S3Destination",
    "/properties/NotificationChannel",
    "/properties/BoundingBoxRegionsOfInterest",
    "/properties/PolygonRegionsOfInterest",
    "/properties/DataSharingPreference"
  ]
}
