{
  "typeName" : "AWS::Connect::QuickConnect",
  "description" : "Resource Type definition for AWS::Connect::QuickConnect",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-connect",
  "definitions" : {
    "PhoneNumber" : {
      "description" : "The phone number in E.164 format.",
      "type" : "string",
      "pattern" : "^\\+[1-9]\\d{1,14}$"
    },
    "ContactFlowArn" : {
      "description" : "The identifier of the contact flow.",
      "type" : "string",
      "pattern" : "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/contact-flow/[-a-zA-Z0-9]*$"
    },
    "QueueArn" : {
      "description" : "The identifier for the queue.",
      "type" : "string",
      "pattern" : "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/queue/[-a-zA-Z0-9]*$"
    },
    "UserArn" : {
      "description" : "The identifier of the user.",
      "type" : "string",
      "pattern" : "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/agent/[-a-zA-Z0-9]*$"
    },
    "PhoneNumberQuickConnectConfig" : {
      "description" : "The phone configuration. This is required only if QuickConnectType is PHONE_NUMBER.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "PhoneNumber" : {
          "$ref" : "#/definitions/PhoneNumber"
        }
      },
      "required" : [ "PhoneNumber" ]
    },
    "QueueQuickConnectConfig" : {
      "description" : "The queue configuration. This is required only if QuickConnectType is QUEUE.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ContactFlowArn" : {
          "$ref" : "#/definitions/ContactFlowArn"
        },
        "QueueArn" : {
          "$ref" : "#/definitions/QueueArn"
        }
      },
      "required" : [ "ContactFlowArn", "QueueArn" ]
    },
    "UserQuickConnectConfig" : {
      "description" : "The user configuration. This is required only if QuickConnectType is USER.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ContactFlowArn" : {
          "$ref" : "#/definitions/ContactFlowArn"
        },
        "UserArn" : {
          "$ref" : "#/definitions/UserArn"
        }
      },
      "required" : [ "ContactFlowArn", "UserArn" ]
    },
    "QuickConnectConfig" : {
      "description" : "Configuration settings for the quick connect.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "QuickConnectType" : {
          "$ref" : "#/definitions/QuickConnectType"
        },
        "PhoneConfig" : {
          "$ref" : "#/definitions/PhoneNumberQuickConnectConfig"
        },
        "QueueConfig" : {
          "$ref" : "#/definitions/QueueQuickConnectConfig"
        },
        "UserConfig" : {
          "$ref" : "#/definitions/UserQuickConnectConfig"
        }
      },
      "required" : [ "QuickConnectType" ]
    },
    "QuickConnectType" : {
      "description" : "The type of quick connect. In the Amazon Connect console, when you create a quick connect, you are prompted to assign one of the following types: Agent (USER), External (PHONE_NUMBER), or Queue (QUEUE).",
      "type" : "string",
      "enum" : [ "PHONE_NUMBER", "QUEUE", "USER" ]
    },
    "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 -. ",
          "minLength" : 1,
          "maxLength" : 128,
          "pattern" : "^(?!aws:)[a-zA-Z+-=._:/]+$"
        },
        "Value" : {
          "type" : "string",
          "description" : "The value for the tag. You can specify a value that is maximum of 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" : {
    "InstanceArn" : {
      "description" : "The identifier of the Amazon Connect instance.",
      "type" : "string",
      "pattern" : "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$"
    },
    "Name" : {
      "description" : "The name of the quick connect.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 127
    },
    "Description" : {
      "description" : "The description of the quick connect.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 250
    },
    "QuickConnectConfig" : {
      "description" : "Configuration settings for the quick connect.",
      "$ref" : "#/definitions/QuickConnectConfig"
    },
    "QuickConnectArn" : {
      "description" : "The Amazon Resource Name (ARN) for the quick connect.",
      "type" : "string",
      "pattern" : "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/transfer-destination/[-a-zA-Z0-9]*$"
    },
    "Tags" : {
      "type" : "array",
      "maxItems" : 200,
      "uniqueItems" : true,
      "insertionOrder" : false,
      "description" : "One or more tags.",
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "QuickConnectType" : {
      "description" : "The type of quick connect. In the Amazon Connect console, when you create a quick connect, you are prompted to assign one of the following types: Agent (USER), External (PHONE_NUMBER), or Queue (QUEUE).",
      "type" : "string",
      "enum" : [ "PHONE_NUMBER", "QUEUE", "USER" ]
    }
  },
  "required" : [ "Name", "InstanceArn", "QuickConnectConfig" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "connect:CreateQuickConnect", "connect:TagResource" ]
    },
    "read" : {
      "permissions" : [ "connect:DescribeQuickConnect" ]
    },
    "delete" : {
      "permissions" : [ "connect:DeleteQuickConnect", "connect:UntagResource" ]
    },
    "update" : {
      "permissions" : [ "connect:UpdateQuickConnectName", "connect:UpdateQuickConnectConfig", "connect:TagResource", "connect:UntagResource" ]
    },
    "list" : {
      "handlerSchema" : {
        "properties" : {
          "InstanceArn" : {
            "$ref" : "resource-schema.json#/properties/InstanceArn"
          }
        },
        "required" : [ "InstanceArn" ]
      },
      "permissions" : [ "connect:ListQuickConnects" ]
    }
  },
  "additionalProperties" : false,
  "primaryIdentifier" : [ "/properties/QuickConnectArn" ],
  "readOnlyProperties" : [ "/properties/QuickConnectArn", "/properties/QuickConnectType" ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "connect:TagResource", "connect:UntagResource" ]
  }
}