{
  "typeName" : "AWS::Connect::UserHierarchyGroup",
  "description" : "Resource Type definition for AWS::Connect::UserHierarchyGroup",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-connect",
  "definitions" : {
    "UserHierarchyGroupArn" : {
      "description" : "The Amazon Resource Name (ARN) for the User hierarchy group.",
      "type" : "string",
      "pattern" : "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/agent-group/[-a-zA-Z0-9]*$"
    },
    "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]*$"
    },
    "UserHierarchyGroupArn" : {
      "description" : "The Amazon Resource Name (ARN) for the user hierarchy group.",
      "$ref" : "#/definitions/UserHierarchyGroupArn"
    },
    "ParentGroupArn" : {
      "description" : "The Amazon Resource Name (ARN) for the parent user hierarchy group.",
      "$ref" : "#/definitions/UserHierarchyGroupArn"
    },
    "Name" : {
      "description" : "The name of the user hierarchy group.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 100
    },
    "Tags" : {
      "type" : "array",
      "maxItems" : 50,
      "uniqueItems" : true,
      "insertionOrder" : false,
      "description" : "One or more tags.",
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "required" : [ "Name", "InstanceArn" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "connect:CreateUserHierarchyGroup", "connect:TagResource" ]
    },
    "read" : {
      "permissions" : [ "connect:DescribeUserHierarchyGroup" ]
    },
    "delete" : {
      "permissions" : [ "connect:DeleteUserHierarchyGroup", "connect:UntagResource" ]
    },
    "update" : {
      "permissions" : [ "connect:UpdateUserHierarchyGroupName", "connect:TagResource", "connect:UntagResource" ]
    },
    "list" : {
      "handlerSchema" : {
        "properties" : {
          "InstanceArn" : {
            "$ref" : "resource-schema.json#/properties/InstanceArn"
          }
        },
        "required" : [ "InstanceArn" ]
      },
      "permissions" : [ "connect:ListUserHierarchyGroups" ]
    }
  },
  "additionalProperties" : false,
  "primaryIdentifier" : [ "/properties/UserHierarchyGroupArn" ],
  "readOnlyProperties" : [ "/properties/UserHierarchyGroupArn" ],
  "createOnlyProperties" : [ "/properties/ParentGroupArn" ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "connect:TagResource", "connect:UntagResource" ]
  }
}