{
  "typeName" : "AWS::Connect::PhoneNumber",
  "description" : "Resource Type definition for AWS::Connect::PhoneNumber",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-connect",
  "definitions" : {
    "Tag" : {
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Key" : {
          "type" : "string",
          "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 -. ",
          "pattern" : "^(?!aws:)[a-zA-Z+-=._:/]+$",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "description" : "The value for the tag. You can specify a value that is 1 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 -. ",
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ]
    }
  },
  "properties" : {
    "TargetArn" : {
      "description" : "The ARN of the target the phone number is claimed to.",
      "type" : "string",
      "pattern" : "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:(instance|traffic-distribution-group)/[-a-zA-Z0-9]*$"
    },
    "PhoneNumberArn" : {
      "description" : "The phone number ARN",
      "type" : "string",
      "pattern" : "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:phone-number/[-a-zA-Z0-9]*$"
    },
    "Description" : {
      "description" : "The description of the phone number.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 500
    },
    "Type" : {
      "description" : "The phone number type, either TOLL_FREE or DID.",
      "type" : "string",
      "pattern" : "TOLL_FREE|DID"
    },
    "CountryCode" : {
      "description" : "The phone number country code.",
      "type" : "string",
      "pattern" : "^[A-Z]{2}"
    },
    "Prefix" : {
      "description" : "The phone number prefix.",
      "type" : "string",
      "pattern" : "^\\+[0-9]{1,15}"
    },
    "Address" : {
      "description" : "The phone number e164 address.",
      "type" : "string",
      "pattern" : "^\\+[0-9]{2,15}"
    },
    "Tags" : {
      "type" : "array",
      "maxItems" : 50,
      "uniqueItems" : true,
      "insertionOrder" : false,
      "description" : "One or more tags.",
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags"
  },
  "required" : [ "TargetArn", "Type", "CountryCode" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "connect:ClaimPhoneNumber", "connect:SearchAvailablePhoneNumbers", "connect:DescribePhoneNumber", "connect:TagResource" ]
    },
    "read" : {
      "permissions" : [ "connect:DescribePhoneNumber" ]
    },
    "delete" : {
      "permissions" : [ "connect:ReleasePhoneNumber", "connect:UntagResource" ]
    },
    "update" : {
      "permissions" : [ "connect:UpdatePhoneNumber", "connect:DescribePhoneNumber", "connect:TagResource", "connect:UntagResource" ]
    }
  },
  "additionalProperties" : false,
  "primaryIdentifier" : [ "/properties/PhoneNumberArn" ],
  "readOnlyProperties" : [ "/properties/PhoneNumberArn", "/properties/Address" ],
  "writeOnlyProperties" : [ "/properties/Prefix" ],
  "createOnlyProperties" : [ "/properties/Type", "/properties/CountryCode", "/properties/Prefix", "/properties/Description" ]
}