{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-s3/json-schema/amazon-s3-put-bucket-analytics-configuration-request-schema.json",
  "title": "PutBucketAnalyticsConfigurationRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-s3-analytics-api-openapi.yml#/components/schemas/PutBucketAnalyticsConfigurationRequest",
  "type": "object",
  "properties": {
    "Bucket": {
      "type": "string",
      "description": "The name of the bucket to which an analytics configuration is stored."
    },
    "Id": {
      "type": "string",
      "description": "The ID that identifies the analytics configuration."
    },
    "AnalyticsConfiguration": {
      "$ref": "#/$defs/AnalyticsConfiguration"
    },
    "ExpectedBucketOwner": {
      "type": "string",
      "description": "The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied)."
    }
  },
  "required": [
    "Bucket",
    "Id",
    "AnalyticsConfiguration"
  ],
  "$defs": {
    "AnalyticsAndOperator": {
      "type": "object",
      "properties": {
        "Prefix": {
          "type": "string",
          "description": "The prefix to use when evaluating an AND predicate: The prefix that an object must have to be included in the metrics results."
        },
        "Tags": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Tag"
          },
          "description": "The list of tags to use when evaluating an AND predicate."
        }
      }
    },
    "AnalyticsConfiguration": {
      "type": "object",
      "properties": {
        "Id": {
          "type": "string",
          "description": "The ID that identifies the analytics configuration."
        },
        "Filter": {
          "$ref": "#/$defs/AnalyticsFilter"
        },
        "StorageClassAnalysis": {
          "$ref": "#/$defs/StorageClassAnalysis"
        }
      },
      "required": [
        "Id",
        "StorageClassAnalysis"
      ]
    },
    "AnalyticsExportDestination": {
      "type": "object",
      "properties": {
        "S3BucketDestination": {
          "$ref": "#/$defs/AnalyticsS3BucketDestination"
        }
      },
      "required": [
        "S3BucketDestination"
      ]
    },
    "AnalyticsFilter": {
      "type": "object",
      "properties": {
        "Prefix": {
          "type": "string",
          "description": "The prefix to use when evaluating an analytics filter."
        },
        "Tag": {
          "$ref": "#/$defs/Tag"
        },
        "And": {
          "$ref": "#/$defs/AnalyticsAndOperator"
        }
      },
      "description": "Exactly one member is set."
    },
    "AnalyticsS3BucketDestination": {
      "type": "object",
      "properties": {
        "Format": {
          "type": "string",
          "enum": [
            "CSV"
          ],
          "description": "Specifies the file format used when exporting data to Amazon S3."
        },
        "BucketAccountId": {
          "type": "string",
          "description": "The account ID that owns the destination S3 bucket. If no account ID is provided, the owner is not validated before exporting data. Although this value is optional, we strongly recommend that you set it to help prevent problems if the destination bucket ownership changes."
        },
        "Bucket": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the bucket to which data is exported."
        },
        "Prefix": {
          "type": "string",
          "description": "The prefix to use when exporting data. The prefix is prepended to all results."
        }
      },
      "required": [
        "Format",
        "Bucket"
      ]
    },
    "StorageClassAnalysis": {
      "type": "object",
      "properties": {
        "DataExport": {
          "$ref": "#/$defs/StorageClassAnalysisDataExport"
        }
      }
    },
    "StorageClassAnalysisDataExport": {
      "type": "object",
      "properties": {
        "OutputSchemaVersion": {
          "type": "string",
          "enum": [
            "V_1"
          ],
          "description": "The version of the output schema to use when exporting data. Must be V_1."
        },
        "Destination": {
          "$ref": "#/$defs/AnalyticsExportDestination"
        }
      },
      "required": [
        "OutputSchemaVersion",
        "Destination"
      ]
    },
    "Tag": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "Name of the object key."
        },
        "Value": {
          "type": "string",
          "description": "Value of the tag."
        }
      },
      "required": [
        "Key",
        "Value"
      ]
    }
  }
}