{
  "typeName" : "AWS::Cases::Layout",
  "description" : "A layout in the Cases domain. Layouts define the following configuration in the top section and More Info tab of the Cases user interface: Fields to display to the users and Field ordering.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
  "definitions" : {
    "BasicLayout" : {
      "type" : "object",
      "description" : "Defines the field layout for the agent's case interface. Configures which fields appear in the top panel (immediately visible) and More Info tab (expandable section) of the case view, allowing customization of the agent experience.",
      "properties" : {
        "TopPanel" : {
          "$ref" : "#/definitions/LayoutSections"
        },
        "MoreInfo" : {
          "$ref" : "#/definitions/LayoutSections"
        }
      },
      "additionalProperties" : false
    },
    "FieldGroup" : {
      "type" : "object",
      "description" : "Consists of a group of fields and associated properties.",
      "properties" : {
        "Name" : {
          "type" : "string",
          "maxLength" : 100,
          "description" : "A descriptive name for the field group. Helps organize related fields together in the layout interface."
        },
        "Fields" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/FieldItem"
          },
          "maxItems" : 220,
          "description" : "An ordered list of fields to display in this group. The order determines the sequence in which fields appear in the agent interface. Each field is referenced by its unique field ID."
        }
      },
      "required" : [ "Fields" ],
      "additionalProperties" : false
    },
    "FieldItem" : {
      "type" : "object",
      "description" : "Field specific properties.",
      "properties" : {
        "Id" : {
          "type" : "string",
          "maxLength" : 500,
          "minLength" : 1,
          "description" : "The unique identifier of a field."
        }
      },
      "required" : [ "Id" ],
      "additionalProperties" : false
    },
    "LayoutContent" : {
      "description" : "Defines the layout structure and field organization for the case interface. Specifies which fields appear in the top panel and More Info tab, and their display order.",
      "oneOf" : [ {
        "type" : "object",
        "title" : "Basic",
        "properties" : {
          "Basic" : {
            "$ref" : "#/definitions/BasicLayout"
          }
        },
        "required" : [ "Basic" ],
        "additionalProperties" : false
      } ]
    },
    "LayoutSections" : {
      "type" : "object",
      "description" : "Sections within a panel or tab of the page layout.",
      "properties" : {
        "Sections" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Section"
          },
          "maxItems" : 1,
          "description" : "Defines the sections within a panel or tab. Contains field groups that organize related fields together."
        }
      },
      "additionalProperties" : false
    },
    "Section" : {
      "description" : "A section can be a grouped list of fields.",
      "oneOf" : [ {
        "type" : "object",
        "title" : "FieldGroup",
        "properties" : {
          "FieldGroup" : {
            "$ref" : "#/definitions/FieldGroup"
          }
        },
        "required" : [ "FieldGroup" ],
        "additionalProperties" : false
      } ]
    },
    "Tags" : {
      "type" : "array",
      "description" : "The tags that you attach to this layout.",
      "uniqueItems" : false,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "Tag" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Key" : {
          "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 -.",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128,
          "pattern" : "^(?!aws:)[a-zA-Z+-=._:/]+$"
        },
        "Value" : {
          "description" : "The value for the tag. You can specify a value that is 0 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 -.",
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Value", "Key" ]
    }
  },
  "properties" : {
    "Content" : {
      "$ref" : "#/definitions/LayoutContent"
    },
    "CreatedTime" : {
      "type" : "string",
      "description" : "The time at which the layout was created.",
      "format" : "date-time"
    },
    "DomainId" : {
      "type" : "string",
      "maxLength" : 500,
      "minLength" : 1,
      "description" : "The unique identifier of the Cases domain."
    },
    "LastModifiedTime" : {
      "type" : "string",
      "description" : "The time at which the layout was created or last modified.",
      "format" : "date-time"
    },
    "LayoutArn" : {
      "type" : "string",
      "maxLength" : 500,
      "minLength" : 1,
      "description" : "The Amazon Resource Name (ARN) of the layout."
    },
    "LayoutId" : {
      "type" : "string",
      "maxLength" : 500,
      "minLength" : 1,
      "description" : "The unique identifier of the layout."
    },
    "Name" : {
      "type" : "string",
      "maxLength" : 100,
      "minLength" : 1,
      "pattern" : "^.*[\\S]$",
      "description" : "A descriptive name for the layout. Must be unique within the Cases domain and should clearly indicate the layout's purpose and field organization."
    },
    "Tags" : {
      "$ref" : "#/definitions/Tags"
    }
  },
  "required" : [ "Content", "Name" ],
  "createOnlyProperties" : [ "/properties/DomainId" ],
  "readOnlyProperties" : [ "/properties/CreatedTime", "/properties/LastModifiedTime", "/properties/LayoutArn", "/properties/LayoutId" ],
  "primaryIdentifier" : [ "/properties/LayoutArn" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "cases:CreateLayout", "cases:GetLayout", "cases:TagResource" ]
    },
    "read" : {
      "permissions" : [ "cases:GetLayout" ]
    },
    "update" : {
      "permissions" : [ "cases:UpdateLayout", "cases:TagResource", "cases:UntagResource", "cases:GetLayout" ]
    },
    "delete" : {
      "permissions" : [ "cases:DeleteLayout", "cases:UntagResource" ]
    },
    "list" : {
      "permissions" : [ "cases:ListLayouts" ],
      "handlerSchema" : {
        "properties" : {
          "DomainId" : {
            "$ref" : "resource-schema.json#/properties/DomainId"
          }
        },
        "required" : [ "DomainId" ]
      }
    }
  },
  "tagging" : {
    "cloudFormationSystemTags" : true,
    "permissions" : [ "cases:GetLayout", "cases:TagResource", "cases:UntagResource" ],
    "tagOnCreate" : false,
    "tagProperty" : "/properties/Tags",
    "tagUpdatable" : true,
    "taggable" : true
  },
  "additionalProperties" : false
}