{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-connect/json-schema/amazon-connect-associate-instance-storage-config-request-schema.json",
  "title": "AssociateInstanceStorageConfigRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-connect-storage-config-api-openapi.yml#/components/schemas/AssociateInstanceStorageConfigRequest",
  "type": "object",
  "properties": {
    "InstanceId": {
      "type": "string",
      "description": "The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance."
    },
    "ResourceType": {
      "type": "string",
      "enum": [
        "CHAT_TRANSCRIPTS",
        "CALL_RECORDINGS",
        "SCHEDULED_REPORTS",
        "MEDIA_STREAMS",
        "CONTACT_TRACE_RECORDS",
        "AGENT_EVENTS",
        "REAL_TIME_CONTACT_ANALYSIS_SEGMENTS",
        "ATTACHMENTS",
        "CONTACT_EVALUATIONS",
        "SCREEN_RECORDINGS",
        "REAL_TIME_CONTACT_ANALYSIS_CHAT_SEGMENTS",
        "REAL_TIME_CONTACT_ANALYSIS_VOICE_SEGMENTS",
        "EMAIL_MESSAGES"
      ],
      "description": "A valid resource type. To enable streaming for real-time analysis of contacts, use the following types: For chat contacts, use REAL_TIME_CONTACT_ANALYSIS_CHAT_SEGMENTS. For voice contacts, use REAL_TIME_CONTACT_ANALYSIS_VOICE_SEGMENTS. REAL_TIME_CONTACT_ANALYSIS_SEGMENTS is deprecated, but it is still supported and will apply only to VOICE channel contacts. Use REAL_TIME_CONTACT_ANALYSIS_VOICE_SEGMENTS for voice contacts moving forward. If you have previously associated a stream with REAL_TIME_CONTACT_ANALYSIS_SEGMENTS, no action is needed to update the stream to REAL_TIME_CONTACT_ANALYSIS_VOI"
    },
    "StorageConfig": {
      "$ref": "#/$defs/InstanceStorageConfig"
    },
    "ClientToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs."
    }
  },
  "required": [
    "InstanceId",
    "ResourceType",
    "StorageConfig"
  ],
  "$defs": {
    "EncryptionConfig": {
      "type": "object",
      "properties": {
        "EncryptionType": {
          "type": "string",
          "enum": [
            "KMS"
          ],
          "description": "The type of encryption."
        },
        "KeyId": {
          "type": "string",
          "description": "The full ARN of the encryption key. Be sure to provide the full ARN of the encryption key, not just the ID. Connect Customer supports only KMS keys with the default key spec of SYMMETRIC_DEFAULT ."
        }
      },
      "required": [
        "EncryptionType",
        "KeyId"
      ]
    },
    "InstanceStorageConfig": {
      "type": "object",
      "properties": {
        "AssociationId": {
          "type": "string",
          "description": "The existing association identifier that uniquely identifies the resource type and storage config for the given instance ID."
        },
        "StorageType": {
          "type": "string",
          "enum": [
            "S3",
            "KINESIS_VIDEO_STREAM",
            "KINESIS_STREAM",
            "KINESIS_FIREHOSE"
          ],
          "description": "A valid storage type."
        },
        "S3Config": {
          "$ref": "#/$defs/S3Config"
        },
        "KinesisVideoStreamConfig": {
          "$ref": "#/$defs/KinesisVideoStreamConfig"
        },
        "KinesisStreamConfig": {
          "$ref": "#/$defs/KinesisStreamConfig"
        },
        "KinesisFirehoseConfig": {
          "$ref": "#/$defs/KinesisFirehoseConfig"
        }
      },
      "required": [
        "StorageType"
      ]
    },
    "KinesisFirehoseConfig": {
      "type": "object",
      "properties": {
        "FirehoseArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the delivery stream."
        }
      },
      "required": [
        "FirehoseArn"
      ]
    },
    "KinesisStreamConfig": {
      "type": "object",
      "properties": {
        "StreamArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the data stream."
        }
      },
      "required": [
        "StreamArn"
      ]
    },
    "KinesisVideoStreamConfig": {
      "type": "object",
      "properties": {
        "Prefix": {
          "type": "string",
          "description": "The prefix of the video stream."
        },
        "RetentionPeriodHours": {
          "type": "integer",
          "description": "The number of hours data is retained in the stream. Kinesis Video Streams retains the data in a data store that is associated with the stream. The default value is 0, indicating that the stream does not persist data."
        },
        "EncryptionConfig": {
          "$ref": "#/$defs/EncryptionConfig"
        }
      },
      "required": [
        "Prefix",
        "RetentionPeriodHours",
        "EncryptionConfig"
      ]
    },
    "S3Config": {
      "type": "object",
      "properties": {
        "BucketName": {
          "type": "string",
          "description": "The S3 bucket name."
        },
        "BucketPrefix": {
          "type": "string",
          "description": "The S3 bucket prefix."
        },
        "EncryptionConfig": {
          "$ref": "#/$defs/EncryptionConfig"
        }
      },
      "required": [
        "BucketName",
        "BucketPrefix"
      ]
    }
  }
}