{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-verified-permissions/json-schema/amazon-verified-permissions-create-policy-input-schema.json",
  "title": "CreatePolicyInput",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-verified-permissions-createpolicy-api-openapi.yml#/components/schemas/CreatePolicyInput",
  "type": "object",
  "properties": {
    "clientToken": {
      "type": "string",
      "description": "Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value.. If you don't provide this value, then Amazon Web Services generates a random one for you. If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an ConflictException error. V"
    },
    "policyStoreId": {
      "type": "string",
      "description": "Specifies the PolicyStoreId of the policy store you want to store the policy in. To specify a policy store, use its ID or alias name. When using an alias name, prefix it with policy-store-alias/. For example: ID: PSEXAMPLEabcdefg111111 Alias name: policy-store-alias/example-policy-store To view aliases, use ListPolicyStoreAliases."
    },
    "definition": {
      "$ref": "#/$defs/PolicyDefinition"
    },
    "name": {
      "type": "string",
      "description": "Specifies a name for the policy that is unique among all policies within the policy store. You can use the name in place of the policy ID in API operations that reference the policy. The name must be prefixed with name/. If you specify a name that is already associated with another policy in the policy store, you receive a ConflictException error."
    }
  },
  "required": [
    "policyStoreId",
    "definition"
  ],
  "$defs": {
    "EntityIdentifier": {
      "type": "object",
      "properties": {
        "entityType": {
          "type": "string",
          "description": "The type of an entity. Example: \"entityType\":\"typeName\""
        },
        "entityId": {
          "type": "string",
          "description": "The identifier of an entity. \"entityId\":\"identifier\""
        }
      },
      "required": [
        "entityType",
        "entityId"
      ]
    },
    "PolicyDefinition": {
      "type": "object",
      "properties": {
        "static": {
          "$ref": "#/$defs/StaticPolicyDefinition"
        },
        "templateLinked": {
          "$ref": "#/$defs/TemplateLinkedPolicyDefinition"
        }
      },
      "description": "Exactly one member is set."
    },
    "StaticPolicyDefinition": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "description": "The description of the static policy."
        },
        "statement": {
          "type": "string",
          "description": "The policy content of the static policy, written in the Cedar policy language."
        }
      },
      "required": [
        "statement"
      ]
    },
    "TemplateLinkedPolicyDefinition": {
      "type": "object",
      "properties": {
        "policyTemplateId": {
          "type": "string",
          "description": "The unique identifier of the policy template used to create this policy."
        },
        "principal": {
          "$ref": "#/$defs/EntityIdentifier"
        },
        "resource": {
          "$ref": "#/$defs/EntityIdentifier"
        }
      },
      "required": [
        "policyTemplateId"
      ]
    }
  }
}