{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-iam-access-analyzer/json-schema/amazon-iam-access-analyzer-start-policy-generation-request-schema.json",
  "title": "StartPolicyGenerationRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-iam-access-analyzer-policy-api-openapi.yml#/components/schemas/StartPolicyGenerationRequest",
  "type": "object",
  "properties": {
    "policyGenerationDetails": {
      "$ref": "#/$defs/PolicyGenerationDetails"
    },
    "cloudTrailDetails": {
      "$ref": "#/$defs/CloudTrailDetails"
    },
    "clientToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK."
    }
  },
  "required": [
    "policyGenerationDetails"
  ],
  "$defs": {
    "CloudTrailDetails": {
      "type": "object",
      "properties": {
        "trails": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Trail"
          },
          "description": "A Trail object that contains settings for a trail."
        },
        "accessRole": {
          "type": "string",
          "description": "The ARN of the service role that IAM Access Analyzer uses to access your CloudTrail trail and service last accessed information."
        },
        "startTime": {
          "type": "string",
          "format": "date-time",
          "description": "The start of the time range for which IAM Access Analyzer reviews your CloudTrail events. Events with a timestamp before this time are not considered to generate a policy."
        },
        "endTime": {
          "type": "string",
          "format": "date-time",
          "description": "The end of the time range for which IAM Access Analyzer reviews your CloudTrail events. Events with a timestamp after this time are not considered to generate a policy. If this is not included in the request, the default value is the current time."
        }
      },
      "required": [
        "trails",
        "accessRole",
        "startTime"
      ]
    },
    "PolicyGenerationDetails": {
      "type": "object",
      "properties": {
        "principalArn": {
          "type": "string",
          "description": "The ARN of the IAM entity (user or role) for which you are generating a policy."
        }
      },
      "required": [
        "principalArn"
      ]
    },
    "Trail": {
      "type": "object",
      "properties": {
        "cloudTrailArn": {
          "type": "string",
          "description": "Specifies the ARN of the trail. The format of a trail ARN is arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail."
        },
        "regions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of regions to get CloudTrail data from and analyze to generate a policy."
        },
        "allRegions": {
          "type": "boolean",
          "description": "Possible values are true or false. If set to true, IAM Access Analyzer retrieves CloudTrail data from all regions to analyze and generate a policy."
        }
      },
      "required": [
        "cloudTrailArn"
      ]
    }
  }
}