{
 "additionalProperties": false,
 "definitions": {
  "AfterContactWorkTimeLimit": {
   "minimum": 0,
   "type": "integer"
  },
  "AttributeName": {
   "maxLength": 64,
   "minLength": 1,
   "type": "string"
  },
  "AttributeValue": {
   "maxLength": 64,
   "minLength": 1,
   "type": "string"
  },
  "AutoAccept": {
   "type": "boolean"
  },
  "DeskPhoneNumber": {
   "pattern": "\\\\+[1-9]\\\\d{1,14}$",
   "type": "string"
  },
  "Email": {
   "type": "string"
  },
  "FirstName": {
   "maxLength": 255,
   "type": "string"
  },
  "LastName": {
   "maxLength": 300,
   "type": "string"
  },
  "Level": {
   "maximum": 5,
   "minimum": 1,
   "type": "number"
  },
  "Mobile": {
   "pattern": "^\\+[1-9]\\d{1,14}$",
   "type": "string"
  },
  "PersistentConnection": {
   "type": "boolean"
  },
  "PhoneType": {
   "enum": [
    "SOFT_PHONE",
    "DESK_PHONE"
   ],
   "type": "string"
  },
  "SecondaryEmail": {
   "pattern": "(?=^.{0,265}$)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,63}",
   "type": "string"
  },
  "SecurityProfileArn": {
   "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/security-profile/[-a-zA-Z0-9]*$",
   "type": "string"
  },
  "Tag": {
   "additionalProperties": false,
   "properties": {
    "Key": {
     "maxLength": 128,
     "minLength": 1,
     "pattern": "^(?!aws:)[a-zA-Z+-=._:/]+$",
     "type": "string"
    },
    "Value": {
     "maxLength": 256,
     "type": "string"
    }
   },
   "required": [
    "Key",
    "Value"
   ],
   "type": "object"
  },
  "UserIdentityInfo": {
   "additionalProperties": false,
   "properties": {
    "Email": {
     "$ref": "#/definitions/Email"
    },
    "FirstName": {
     "$ref": "#/definitions/FirstName"
    },
    "LastName": {
     "$ref": "#/definitions/LastName"
    },
    "Mobile": {
     "$ref": "#/definitions/Mobile"
    },
    "SecondaryEmail": {
     "$ref": "#/definitions/SecondaryEmail"
    }
   },
   "type": "object"
  },
  "UserPhoneConfig": {
   "additionalProperties": false,
   "properties": {
    "AfterContactWorkTimeLimit": {
     "$ref": "#/definitions/AfterContactWorkTimeLimit"
    },
    "AutoAccept": {
     "$ref": "#/definitions/AutoAccept"
    },
    "DeskPhoneNumber": {
     "$ref": "#/definitions/DeskPhoneNumber"
    },
    "PersistentConnection": {
     "$ref": "#/definitions/PersistentConnection"
    },
    "PhoneType": {
     "$ref": "#/definitions/PhoneType"
    }
   },
   "required": [
    "PhoneType"
   ],
   "type": "object"
  },
  "UserProficiency": {
   "additionalProperties": false,
   "properties": {
    "AttributeName": {
     "$ref": "#/definitions/AttributeName"
    },
    "AttributeValue": {
     "$ref": "#/definitions/AttributeValue"
    },
    "Level": {
     "$ref": "#/definitions/Level"
    }
   },
   "required": [
    "AttributeName",
    "AttributeValue",
    "Level"
   ],
   "type": "object"
  }
 },
 "primaryIdentifier": [
  "/properties/UserArn"
 ],
 "properties": {
  "DirectoryUserId": {
   "type": "string"
  },
  "HierarchyGroupArn": {
   "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/agent-group/[-a-zA-Z0-9]*$",
   "type": "string"
  },
  "IdentityInfo": {
   "$ref": "#/definitions/UserIdentityInfo"
  },
  "InstanceArn": {
   "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$",
   "type": "string"
  },
  "Password": {
   "pattern": "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d\\S]{8,64}$",
   "type": "string"
  },
  "PhoneConfig": {
   "$ref": "#/definitions/UserPhoneConfig"
  },
  "RoutingProfileArn": {
   "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/routing-profile/[-a-zA-Z0-9]*$",
   "type": "string"
  },
  "SecurityProfileArns": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/SecurityProfileArn"
   },
   "maxItems": 10,
   "minItems": 1,
   "type": "array",
   "uniqueItems": true
  },
  "Tags": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/Tag"
   },
   "maxItems": 50,
   "type": "array",
   "uniqueItems": true
  },
  "UserArn": {
   "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/agent/[-a-zA-Z0-9]*$",
   "type": "string"
  },
  "UserProficiencies": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/UserProficiency"
   },
   "type": "array"
  },
  "Username": {
   "maxLength": 64,
   "minLength": 1,
   "pattern": "[a-zA-Z0-9\\_\\-\\.\\@]+",
   "type": "string"
  }
 },
 "readOnlyProperties": [
  "/properties/UserArn"
 ],
 "required": [
  "InstanceArn",
  "PhoneConfig",
  "RoutingProfileArn",
  "SecurityProfileArns",
  "Username"
 ],
 "sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-connect",
 "tagging": {
  "cloudFormationSystemTags": true,
  "tagOnCreate": true,
  "tagProperty": "/properties/Tags",
  "tagUpdatable": true,
  "taggable": true
 },
 "typeName": "AWS::Connect::User",
 "writeOnlyProperties": [
  "/properties/Password"
 ]
}
