{
  "typeName" : "AWS::ApiGateway::ApiKey",
  "description" : "Resource Type definition for AWS::ApiGateway::ApiKey",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-apigateway",
  "additionalProperties" : false,
  "properties" : {
    "APIKeyId" : {
      "description" : "A Unique Key ID which identifies the API Key. Generated by the Create API and returned by the Read and List APIs ",
      "type" : "string"
    },
    "CustomerId" : {
      "description" : "An AWS Marketplace customer identifier to use when integrating with the AWS SaaS Marketplace.",
      "type" : "string"
    },
    "Description" : {
      "description" : "A description of the purpose of the API key.",
      "type" : "string"
    },
    "Enabled" : {
      "description" : "Indicates whether the API key can be used by clients.",
      "default" : false,
      "type" : "boolean"
    },
    "GenerateDistinctId" : {
      "description" : "Specifies whether the key identifier is distinct from the created API key value. This parameter is deprecated and should not be used.",
      "type" : "boolean"
    },
    "Name" : {
      "description" : "A name for the API key. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the API key name.",
      "type" : "string"
    },
    "StageKeys" : {
      "description" : "A list of stages to associate with this API key.",
      "type" : "array",
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/StageKey"
      }
    },
    "Tags" : {
      "description" : "An array of arbitrary tags (key-value pairs) to associate with the API key.",
      "type" : "array",
      "uniqueItems" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "Value" : {
      "description" : "The value of the API key. Must be at least 20 characters long.",
      "type" : "string"
    }
  },
  "definitions" : {
    "StageKey" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "RestApiId" : {
          "description" : "The ID of a RestApi resource that includes the stage with which you want to associate the API key.",
          "type" : "string"
        },
        "StageName" : {
          "description" : "The name of the stage with which to associate the API key. The stage must be included in the RestApi resource that you specified in the RestApiId property. ",
          "type" : "string"
        }
      }
    },
    "Tag" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Key" : {
          "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 -.",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "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 -. ",
          "type" : "string",
          "maxLength" : 256
        }
      },
      "required" : [ "Value", "Key" ]
    }
  },
  "createOnlyProperties" : [ "/properties/GenerateDistinctId", "/properties/Name", "/properties/Value" ],
  "writeOnlyProperties" : [ "/properties/GenerateDistinctId" ],
  "primaryIdentifier" : [ "/properties/APIKeyId" ],
  "readOnlyProperties" : [ "/properties/APIKeyId" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "apigateway:POST", "apigateway:GET" ]
    },
    "read" : {
      "permissions" : [ "apigateway:GET" ]
    },
    "update" : {
      "permissions" : [ "apigateway:GET", "apigateway:PATCH", "apigateway:PUT", "apigateway:DELETE" ]
    },
    "delete" : {
      "permissions" : [ "apigateway:DELETE" ]
    },
    "list" : {
      "permissions" : [ "apigateway:GET" ]
    }
  }
}