{
  "typeName" : "AWS::Glue::Schema",
  "description" : "This resource represents a schema of Glue Schema Registry.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-glue.git",
  "definitions" : {
    "Registry" : {
      "type" : "object",
      "description" : "Identifier for the registry which the schema is part of.",
      "properties" : {
        "Name" : {
          "description" : "Name of the registry in which the schema will be created.",
          "type" : "string",
          "maxLength" : 255,
          "minLength" : 1
        },
        "Arn" : {
          "description" : "Amazon Resource Name for the Registry.",
          "type" : "string",
          "pattern" : "arn:(aws|aws-us-gov|aws-cn):glue:.*"
        }
      },
      "additionalProperties" : false
    },
    "SchemaVersion" : {
      "type" : "object",
      "description" : "Specify checkpoint version for update. This is only required to update the Compatibility.",
      "properties" : {
        "IsLatest" : {
          "description" : "Indicates if the latest version needs to be updated.",
          "type" : "boolean"
        },
        "VersionNumber" : {
          "description" : "Indicates the version number in the schema to update.",
          "type" : "integer",
          "minimum" : 1,
          "maximum" : 100000
        }
      },
      "additionalProperties" : false
    },
    "Tag" : {
      "type" : "object",
      "properties" : {
        "Key" : {
          "description" : "A key to identify the tag.",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "description" : "Corresponding tag value for the key.",
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "Arn" : {
      "description" : "Amazon Resource Name for the Schema.",
      "type" : "string",
      "pattern" : "arn:(aws|aws-us-gov|aws-cn):glue:.*"
    },
    "Registry" : {
      "$ref" : "#/definitions/Registry"
    },
    "Name" : {
      "description" : "Name of the schema.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 255
    },
    "Description" : {
      "description" : "A description of the schema. If description is not provided, there will not be any default value for this.",
      "type" : "string",
      "minLength" : 0,
      "maxLength" : 1000
    },
    "DataFormat" : {
      "description" : "Data format name to use for the schema. Accepted values: 'AVRO', 'JSON', 'PROTOBUF'",
      "type" : "string",
      "enum" : [ "AVRO", "JSON", "PROTOBUF" ]
    },
    "Compatibility" : {
      "description" : "Compatibility setting for the schema.",
      "type" : "string",
      "enum" : [ "NONE", "DISABLED", "BACKWARD", "BACKWARD_ALL", "FORWARD", "FORWARD_ALL", "FULL", "FULL_ALL" ]
    },
    "SchemaDefinition" : {
      "description" : "Definition for the initial schema version in plain-text.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 170000
    },
    "CheckpointVersion" : {
      "$ref" : "#/definitions/SchemaVersion"
    },
    "Tags" : {
      "description" : "List of tags to tag the schema",
      "type" : "array",
      "minItems" : 0,
      "maxItems" : 10,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "InitialSchemaVersionId" : {
      "type" : "string",
      "description" : "Represents the version ID associated with the initial schema version.",
      "pattern" : "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"
    }
  },
  "additionalProperties" : false,
  "required" : [ "Name", "DataFormat", "SchemaDefinition", "Compatibility" ],
  "readOnlyProperties" : [ "/properties/Arn", "/properties/InitialSchemaVersionId" ],
  "createOnlyProperties" : [ "/properties/Registry", "/properties/Name", "/properties/DataFormat", "/properties/SchemaDefinition" ],
  "writeOnlyProperties" : [ "/properties/SchemaDefinition" ],
  "primaryIdentifier" : [ "/properties/Arn" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "glue:CreateSchema" ]
    },
    "read" : {
      "permissions" : [ "glue:GetSchemaVersion", "glue:GetSchema", "glue:GetTags" ]
    },
    "delete" : {
      "permissions" : [ "glue:DeleteSchema", "glue:GetSchema" ]
    },
    "update" : {
      "permissions" : [ "glue:UpdateSchema", "glue:GetSchemaVersion", "glue:GetSchema", "glue:GetTags", "glue:TagResource", "glue:UntagResource" ]
    },
    "list" : {
      "permissions" : [ "glue:ListSchemas" ]
    }
  }
}