{
  "typeName" : "AWS::DataZone::DomainUnit",
  "description" : "A domain unit enables you to easily organize your assets and other domain entities under specific business units and teams.",
  "definitions" : {
    "DomainUnitGroupProperties" : {
      "type" : "object",
      "description" : "The properties of a domain unit group.",
      "properties" : {
        "GroupId" : {
          "type" : "string",
          "description" : "The ID of the domain unit group."
        }
      },
      "additionalProperties" : false
    },
    "DomainUnitUserProperties" : {
      "type" : "object",
      "description" : "The properties of the domain unit user.",
      "properties" : {
        "UserId" : {
          "type" : "string",
          "description" : "The ID of the domain unit user."
        }
      },
      "additionalProperties" : false
    },
    "DomainUnitOwnerProperties" : {
      "type" : "object",
      "description" : "The properties of the domain unit owner.",
      "properties" : {
        "Group" : {
          "$ref" : "#/definitions/DomainUnitGroupProperties"
        },
        "User" : {
          "$ref" : "#/definitions/DomainUnitUserProperties"
        }
      },
      "additionalProperties" : false
    }
  },
  "properties" : {
    "DomainIdentifier" : {
      "type" : "string",
      "description" : "The ID of the domain where you want to create a domain unit.",
      "pattern" : "^dzd[-_][a-zA-Z0-9_-]{1,36}$"
    },
    "Description" : {
      "type" : "string",
      "description" : "The description of the domain unit.",
      "minLength" : 0,
      "maxLength" : 2048
    },
    "Name" : {
      "type" : "string",
      "description" : "The name of the domain unit.",
      "pattern" : "^[\\w -]+$",
      "minLength" : 1,
      "maxLength" : 128
    },
    "ParentDomainUnitIdentifier" : {
      "type" : "string",
      "description" : "The ID of the parent domain unit.",
      "pattern" : "^[a-z0-9_-]+$",
      "minLength" : 1,
      "maxLength" : 256
    },
    "CreatedAt" : {
      "type" : "string",
      "description" : "The timestamp at which the domain unit was created.",
      "format" : "date-time"
    },
    "DomainId" : {
      "type" : "string",
      "description" : "The ID of the domain where the domain unit was created.",
      "pattern" : "^dzd[-_][a-zA-Z0-9_-]{1,36}$"
    },
    "Id" : {
      "type" : "string",
      "description" : "The ID of the domain unit.",
      "pattern" : "^[a-z0-9_-]+$",
      "minLength" : 1,
      "maxLength" : 256
    },
    "ParentDomainUnitId" : {
      "type" : "string",
      "description" : "The ID of the parent domain unit.",
      "pattern" : "^[a-z0-9_-]+$",
      "minLength" : 1,
      "maxLength" : 256
    },
    "Identifier" : {
      "type" : "string",
      "description" : "The identifier of the domain unit that you want to get.",
      "pattern" : "^[a-z0-9_-]+$",
      "minLength" : 1,
      "maxLength" : 256
    },
    "LastUpdatedAt" : {
      "type" : "string",
      "description" : "The timestamp at which the domain unit was last updated.",
      "format" : "date-time"
    }
  },
  "required" : [ "DomainIdentifier", "Name", "ParentDomainUnitIdentifier" ],
  "readOnlyProperties" : [ "/properties/CreatedAt", "/properties/DomainId", "/properties/Id", "/properties/Identifier", "/properties/ParentDomainUnitId", "/properties/LastUpdatedAt" ],
  "createOnlyProperties" : [ "/properties/DomainIdentifier", "/properties/ParentDomainUnitIdentifier" ],
  "primaryIdentifier" : [ "/properties/DomainId", "/properties/Id" ],
  "tagging" : {
    "taggable" : false,
    "tagOnCreate" : false,
    "tagUpdatable" : false,
    "cloudFormationSystemTags" : false
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "datazone:CreateDomainUnit", "datazone:GetDomainUnit" ]
    },
    "read" : {
      "permissions" : [ "datazone:GetDomainUnit" ]
    },
    "update" : {
      "permissions" : [ "datazone:UpdateDomainUnit", "datazone:GetDomainUnit" ]
    },
    "delete" : {
      "permissions" : [ "datazone:DeleteDomainUnit", "datazone:GetDomainUnit" ]
    },
    "list" : {
      "handlerSchema" : {
        "properties" : {
          "DomainIdentifier" : {
            "type" : "string",
            "description" : "The ID of the domain where you want to create a domain unit.",
            "pattern" : "^dzd[-_][a-zA-Z0-9_-]{1,36}$"
          },
          "ParentDomainUnitIdentifier" : {
            "type" : "string",
            "description" : "The ID of the parent domain unit.",
            "pattern" : "^[a-z0-9_-]+$",
            "minLength" : 1,
            "maxLength" : 256
          }
        },
        "required" : [ "DomainIdentifier", "ParentDomainUnitIdentifier" ]
      },
      "permissions" : [ "datazone:ListDomainUnitsForParent" ]
    }
  },
  "additionalProperties" : false
}