{
  "typeName" : "AWS::Connect::HoursOfOperation",
  "description" : "Resource Type definition for AWS::Connect::HoursOfOperation",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-connect",
  "definitions" : {
    "HoursOfOperationTimeSlice" : {
      "description" : "The start time or end time for an hours of operation.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Hours" : {
          "type" : "integer",
          "description" : "The hours.",
          "minimum" : 0,
          "maximum" : 23
        },
        "Minutes" : {
          "type" : "integer",
          "description" : "The minutes.",
          "minimum" : 0,
          "maximum" : 59
        }
      },
      "required" : [ "Hours", "Minutes" ]
    },
    "HoursOfOperationConfig" : {
      "description" : "Contains information about the hours of operation.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Day" : {
          "type" : "string",
          "description" : "The day that the hours of operation applies to.",
          "enum" : [ "SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY" ]
        },
        "StartTime" : {
          "description" : "The start time that your contact center opens.",
          "$ref" : "#/definitions/HoursOfOperationTimeSlice"
        },
        "EndTime" : {
          "description" : "The end time that your contact center closes.",
          "$ref" : "#/definitions/HoursOfOperationTimeSlice"
        }
      },
      "required" : [ "Day", "StartTime", "EndTime" ]
    },
    "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" ]
    },
    "OverrideTimeSlice" : {
      "description" : "The start time or end time for an an hours of operation override.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Hours" : {
          "type" : "integer",
          "description" : "The hours.",
          "minimum" : 0,
          "maximum" : 23
        },
        "Minutes" : {
          "type" : "integer",
          "description" : "The minutes.",
          "minimum" : 0,
          "maximum" : 59
        }
      },
      "required" : [ "Hours", "Minutes" ]
    },
    "HoursOfOperationOverrideConfig" : {
      "description" : "Contains information about the hours of operation override.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Day" : {
          "type" : "string",
          "description" : "The day that the hours of operation override applies to.",
          "enum" : [ "SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY" ]
        },
        "StartTime" : {
          "description" : "The new start time that your contact center opens for the overriden days.",
          "$ref" : "#/definitions/OverrideTimeSlice"
        },
        "EndTime" : {
          "description" : "The new end time that your contact center closes for the overriden days.",
          "$ref" : "#/definitions/OverrideTimeSlice"
        }
      },
      "required" : [ "Day", "StartTime", "EndTime" ]
    },
    "HoursOfOperationOverride" : {
      "description" : "Overrides attached to the hours of operation.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "OverrideName" : {
          "$ref" : "#/definitions/OverrideName"
        },
        "OverrideDescription" : {
          "$ref" : "#/definitions/OverrideDescription"
        },
        "EffectiveFrom" : {
          "$ref" : "#/definitions/EffectiveFrom"
        },
        "EffectiveTill" : {
          "$ref" : "#/definitions/EffectiveTill"
        },
        "OverrideConfig" : {
          "$ref" : "#/definitions/OverrideConfig"
        },
        "HoursOfOperationOverrideId" : {
          "$ref" : "#/definitions/HoursOfOperationOverrideId"
        },
        "RecurrenceConfig" : {
          "$ref" : "#/definitions/RecurrenceConfig"
        },
        "OverrideType" : {
          "$ref" : "#/definitions/OverrideType"
        }
      },
      "required" : [ "OverrideName", "EffectiveFrom", "EffectiveTill", "OverrideConfig" ]
    },
    "OverrideName" : {
      "description" : "The name of the hours of operation override.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 127
    },
    "OverrideDescription" : {
      "description" : "The description of the hours of operation override.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 250
    },
    "EffectiveFrom" : {
      "description" : "The date from which the hours of operation override would be effective.",
      "type" : "string",
      "pattern" : "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "EffectiveTill" : {
      "description" : "The date till which the hours of operation override would be effective.",
      "type" : "string",
      "pattern" : "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "OverrideConfig" : {
      "description" : "Configuration information for the hours of operation override: day, start time, and end time.",
      "type" : "array",
      "maxItems" : 100,
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/HoursOfOperationOverrideConfig"
      }
    },
    "HoursOfOperationOverrideId" : {
      "description" : "The Resource Identifier for the hours of operation override.",
      "type" : "string",
      "pattern" : "^[-a-zA-Z0-9]*$"
    },
    "OverrideType" : {
      "description" : "The type of hours of operation override.",
      "type" : "string",
      "enum" : [ "STANDARD", "OPEN", "CLOSED" ]
    },
    "RecurrenceConfig" : {
      "description" : "Configuration for recurring hours of operation overrides.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "RecurrencePattern" : {
          "$ref" : "#/definitions/RecurrencePattern"
        }
      },
      "required" : [ "RecurrencePattern" ]
    },
    "RecurrencePattern" : {
      "description" : "Pattern for recurring hours of operation overrides.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Frequency" : {
          "$ref" : "#/definitions/RecurrenceFrequency"
        },
        "Interval" : {
          "type" : "integer",
          "minimum" : 1,
          "maximum" : 6
        },
        "ByMonth" : {
          "$ref" : "#/definitions/MonthList"
        },
        "ByMonthDay" : {
          "$ref" : "#/definitions/MonthDayList"
        },
        "ByWeekdayOccurrence" : {
          "type" : "array",
          "minItems" : 0,
          "maxItems" : 1,
          "items" : {
            "type" : "integer",
            "minimum" : -1,
            "maximum" : 4
          }
        }
      }
    },
    "RecurrenceFrequency" : {
      "description" : "The frequency of recurrence for hours of operation overrides.",
      "type" : "string",
      "enum" : [ "WEEKLY", "MONTHLY", "YEARLY" ]
    },
    "MonthList" : {
      "description" : "List of months (1-12) for recurrence pattern.",
      "type" : "array",
      "items" : {
        "type" : "integer",
        "minimum" : 1,
        "maximum" : 12
      }
    },
    "MonthDayList" : {
      "description" : "List of month days (-1 to 31) for recurrence pattern.",
      "type" : "array",
      "items" : {
        "type" : "integer",
        "minimum" : -1,
        "maximum" : 31
      }
    },
    "HoursOfOperationsIdentifier" : {
      "description" : "Identifier for hours of operation.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Name" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 127,
          "description" : "The name of the hours of operation."
        },
        "Id" : {
          "type" : "string",
          "description" : "The identifier for the hours of operation."
        }
      },
      "required" : [ "Id" ]
    }
  },
  "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 hours of operation.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 127
    },
    "Description" : {
      "description" : "The description of the hours of operation.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 250
    },
    "TimeZone" : {
      "description" : "The time zone of the hours of operation.",
      "type" : "string"
    },
    "Config" : {
      "description" : "Configuration information for the hours of operation: day, start time, and end time.",
      "type" : "array",
      "maxItems" : 100,
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/HoursOfOperationConfig"
      }
    },
    "HoursOfOperationArn" : {
      "description" : "The Amazon Resource Name (ARN) for the hours of operation.",
      "type" : "string",
      "pattern" : "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/operating-hours/[-a-zA-Z0-9]*$"
    },
    "Tags" : {
      "description" : "One or more tags.",
      "type" : "array",
      "maxItems" : 50,
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "HoursOfOperationOverrides" : {
      "description" : "One or more hours of operation overrides assigned to an hour of operation.",
      "type" : "array",
      "maxItems" : 50,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/HoursOfOperationOverride"
      }
    },
    "ChildHoursOfOperations" : {
      "description" : "List of child hours of operations.",
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/HoursOfOperationsIdentifier"
      }
    },
    "ParentHoursOfOperations" : {
      "description" : "List of parent hours of operations.",
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/HoursOfOperationsIdentifier"
      }
    }
  },
  "required" : [ "InstanceArn", "Name", "TimeZone", "Config" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "connect:CreateHoursOfOperation", "connect:TagResource", "connect:CreateHoursOfOperationOverride" ]
    },
    "read" : {
      "permissions" : [ "connect:DescribeHoursOfOperation", "connect:ListHoursOfOperationOverrides", "connect:ListChildHoursOfOperations" ]
    },
    "delete" : {
      "permissions" : [ "connect:DeleteHoursOfOperation", "connect:UntagResource" ]
    },
    "update" : {
      "permissions" : [ "connect:UpdateHoursOfOperation", "connect:CreateHoursOfOperationOverride", "connect:UpdateHoursOfOperationOverride", "connect:DeleteHoursOfOperationOverride", "connect:ListHoursOfOperationOverrides", "connect:TagResource", "connect:UntagResource", "connect:AssociateHoursOfOperations", "connect:DisassociateHoursOfOperations" ]
    },
    "list" : {
      "handlerSchema" : {
        "properties" : {
          "InstanceArn" : {
            "$ref" : "resource-schema.json#/properties/InstanceArn"
          }
        },
        "required" : [ "InstanceArn" ]
      },
      "permissions" : [ "connect:ListHoursOfOperations" ]
    }
  },
  "additionalProperties" : false,
  "primaryIdentifier" : [ "/properties/HoursOfOperationArn" ],
  "readOnlyProperties" : [ "/properties/HoursOfOperationArn" ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "connect:TagResource", "connect:UntagResource" ]
  }
}