//===----------------------------------------------------------------------===//
//
// This source file is part of the AWSSDKSwift open source project
//
// Copyright (c) 2017-2020 the AWSSDKSwift project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AWSSDKSwift project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/swift-aws/aws-sdk-swift/blob/master/CodeGenerator/Sources/CodeGenerator/main.swift. DO NOT EDIT.

import AWSSDKSwiftCore
import Foundation

extension WorkMail {
    //MARK: Enums

    public enum AccessControlRuleEffect: String, CustomStringConvertible, Codable {
        case allow = "ALLOW"
        case deny = "DENY"
        public var description: String { return self.rawValue }
    }

    public enum EntityState: String, CustomStringConvertible, Codable {
        case enabled = "ENABLED"
        case disabled = "DISABLED"
        case deleted = "DELETED"
        public var description: String { return self.rawValue }
    }

    public enum MemberType: String, CustomStringConvertible, Codable {
        case group = "GROUP"
        case user = "USER"
        public var description: String { return self.rawValue }
    }

    public enum PermissionType: String, CustomStringConvertible, Codable {
        case fullAccess = "FULL_ACCESS"
        case sendAs = "SEND_AS"
        case sendOnBehalf = "SEND_ON_BEHALF"
        public var description: String { return self.rawValue }
    }

    public enum ResourceType: String, CustomStringConvertible, Codable {
        case room = "ROOM"
        case equipment = "EQUIPMENT"
        public var description: String { return self.rawValue }
    }

    public enum UserRole: String, CustomStringConvertible, Codable {
        case user = "USER"
        case resource = "RESOURCE"
        case systemUser = "SYSTEM_USER"
        public var description: String { return self.rawValue }
    }

    //MARK: Shapes

    public struct AccessControlRule: AWSDecodableShape {

        /// Access protocol actions to include in the rule. Valid values include ActiveSync, AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail.
        public let actions: [String]?
        /// The date that the rule was created.
        public let dateCreated: TimeStamp?
        /// The date that the rule was modified.
        public let dateModified: TimeStamp?
        /// The rule description.
        public let description: String?
        /// The rule effect.
        public let effect: AccessControlRuleEffect?
        /// IPv4 CIDR ranges to include in the rule.
        public let ipRanges: [String]?
        /// The rule name.
        public let name: String?
        /// Access protocol actions to exclude from the rule. Valid values include ActiveSync, AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail.
        public let notActions: [String]?
        /// IPv4 CIDR ranges to exclude from the rule.
        public let notIpRanges: [String]?
        /// User IDs to exclude from the rule.
        public let notUserIds: [String]?
        /// User IDs to include in the rule.
        public let userIds: [String]?

        public init(actions: [String]? = nil, dateCreated: TimeStamp? = nil, dateModified: TimeStamp? = nil, description: String? = nil, effect: AccessControlRuleEffect? = nil, ipRanges: [String]? = nil, name: String? = nil, notActions: [String]? = nil, notIpRanges: [String]? = nil, notUserIds: [String]? = nil, userIds: [String]? = nil) {
            self.actions = actions
            self.dateCreated = dateCreated
            self.dateModified = dateModified
            self.description = description
            self.effect = effect
            self.ipRanges = ipRanges
            self.name = name
            self.notActions = notActions
            self.notIpRanges = notIpRanges
            self.notUserIds = notUserIds
            self.userIds = userIds
        }

        private enum CodingKeys: String, CodingKey {
            case actions = "Actions"
            case dateCreated = "DateCreated"
            case dateModified = "DateModified"
            case description = "Description"
            case effect = "Effect"
            case ipRanges = "IpRanges"
            case name = "Name"
            case notActions = "NotActions"
            case notIpRanges = "NotIpRanges"
            case notUserIds = "NotUserIds"
            case userIds = "UserIds"
        }
    }

    public struct AssociateDelegateToResourceRequest: AWSEncodableShape {

        /// The member (user or group) to associate to the resource.
        public let entityId: String
        /// The organization under which the resource exists.
        public let organizationId: String
        /// The resource for which members (users or groups) are associated.
        public let resourceId: String

        public init(entityId: String, organizationId: String, resourceId: String) {
            self.entityId = entityId
            self.organizationId = organizationId
            self.resourceId = resourceId
        }

        public func validate(name: String) throws {
            try validate(self.entityId, name: "entityId", parent: name, max: 256)
            try validate(self.entityId, name: "entityId", parent: name, min: 12)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try validate(self.resourceId, name: "resourceId", parent: name, pattern: "^r-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case entityId = "EntityId"
            case organizationId = "OrganizationId"
            case resourceId = "ResourceId"
        }
    }

    public struct AssociateDelegateToResourceResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct AssociateMemberToGroupRequest: AWSEncodableShape {

        /// The group to which the member (user or group) is associated.
        public let groupId: String
        /// The member (user or group) to associate to the group.
        public let memberId: String
        /// The organization under which the group exists.
        public let organizationId: String

        public init(groupId: String, memberId: String, organizationId: String) {
            self.groupId = groupId
            self.memberId = memberId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.groupId, name: "groupId", parent: name, max: 256)
            try validate(self.groupId, name: "groupId", parent: name, min: 12)
            try validate(self.memberId, name: "memberId", parent: name, max: 256)
            try validate(self.memberId, name: "memberId", parent: name, min: 12)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case groupId = "GroupId"
            case memberId = "MemberId"
            case organizationId = "OrganizationId"
        }
    }

    public struct AssociateMemberToGroupResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct BookingOptions: AWSEncodableShape & AWSDecodableShape {

        /// The resource's ability to automatically reply to requests. If disabled, delegates must be associated to the resource.
        public let autoAcceptRequests: Bool?
        /// The resource's ability to automatically decline any conflicting requests.
        public let autoDeclineConflictingRequests: Bool?
        /// The resource's ability to automatically decline any recurring requests.
        public let autoDeclineRecurringRequests: Bool?

        public init(autoAcceptRequests: Bool? = nil, autoDeclineConflictingRequests: Bool? = nil, autoDeclineRecurringRequests: Bool? = nil) {
            self.autoAcceptRequests = autoAcceptRequests
            self.autoDeclineConflictingRequests = autoDeclineConflictingRequests
            self.autoDeclineRecurringRequests = autoDeclineRecurringRequests
        }

        private enum CodingKeys: String, CodingKey {
            case autoAcceptRequests = "AutoAcceptRequests"
            case autoDeclineConflictingRequests = "AutoDeclineConflictingRequests"
            case autoDeclineRecurringRequests = "AutoDeclineRecurringRequests"
        }
    }

    public struct CreateAliasRequest: AWSEncodableShape {

        /// The alias to add to the member set.
        public let alias: String
        /// The member (user or group) to which this alias is added.
        public let entityId: String
        /// The organization under which the member (user or group) exists.
        public let organizationId: String

        public init(alias: String, entityId: String, organizationId: String) {
            self.alias = alias
            self.entityId = entityId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.alias, name: "alias", parent: name, max: 254)
            try validate(self.alias, name: "alias", parent: name, min: 1)
            try validate(self.alias, name: "alias", parent: name, pattern: "[a-zA-Z0-9._%+-]{1,64}@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}")
            try validate(self.entityId, name: "entityId", parent: name, max: 256)
            try validate(self.entityId, name: "entityId", parent: name, min: 12)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case alias = "Alias"
            case entityId = "EntityId"
            case organizationId = "OrganizationId"
        }
    }

    public struct CreateAliasResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct CreateGroupRequest: AWSEncodableShape {

        /// The name of the group.
        public let name: String
        /// The organization under which the group is to be created.
        public let organizationId: String

        public init(name: String, organizationId: String) {
            self.name = name
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.name, name: "name", parent: name, max: 256)
            try validate(self.name, name: "name", parent: name, min: 1)
            try validate(self.name, name: "name", parent: name, pattern: "[\\u0020-\\u00FF]+")
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case organizationId = "OrganizationId"
        }
    }

    public struct CreateGroupResponse: AWSDecodableShape {

        /// The identifier of the group.
        public let groupId: String?

        public init(groupId: String? = nil) {
            self.groupId = groupId
        }

        private enum CodingKeys: String, CodingKey {
            case groupId = "GroupId"
        }
    }

    public struct CreateResourceRequest: AWSEncodableShape {

        /// The name of the new resource.
        public let name: String
        /// The identifier associated with the organization for which the resource is created.
        public let organizationId: String
        /// The type of the new resource. The available types are equipment and room.
        public let `type`: ResourceType

        public init(name: String, organizationId: String, type: ResourceType) {
            self.name = name
            self.organizationId = organizationId
            self.`type` = `type`
        }

        public func validate(name: String) throws {
            try validate(self.name, name: "name", parent: name, max: 20)
            try validate(self.name, name: "name", parent: name, min: 1)
            try validate(self.name, name: "name", parent: name, pattern: "[\\w\\-.]+(@[a-zA-Z0-9.\\-]+\\.[a-zA-Z0-9]{2,})?")
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case organizationId = "OrganizationId"
            case `type` = "Type"
        }
    }

    public struct CreateResourceResponse: AWSDecodableShape {

        /// The identifier of the new resource.
        public let resourceId: String?

        public init(resourceId: String? = nil) {
            self.resourceId = resourceId
        }

        private enum CodingKeys: String, CodingKey {
            case resourceId = "ResourceId"
        }
    }

    public struct CreateUserRequest: AWSEncodableShape {

        /// The display name for the new user.
        public let displayName: String
        /// The name for the new user. Simple AD or AD Connector user names have a maximum length of 20. All others have a maximum length of 64.
        public let name: String
        /// The identifier of the organization for which the user is created.
        public let organizationId: String
        /// The password for the new user.
        public let password: String

        public init(displayName: String, name: String, organizationId: String, password: String) {
            self.displayName = displayName
            self.name = name
            self.organizationId = organizationId
            self.password = password
        }

        public func validate(name: String) throws {
            try validate(self.displayName, name: "displayName", parent: name, max: 256)
            try validate(self.name, name: "name", parent: name, max: 64)
            try validate(self.name, name: "name", parent: name, min: 1)
            try validate(self.name, name: "name", parent: name, pattern: "[\\w\\-.]+(@[a-zA-Z0-9.\\-]+\\.[a-zA-Z0-9]{2,})?")
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try validate(self.password, name: "password", parent: name, max: 256)
            try validate(self.password, name: "password", parent: name, pattern: "[\\u0020-\\u00FF]+")
        }

        private enum CodingKeys: String, CodingKey {
            case displayName = "DisplayName"
            case name = "Name"
            case organizationId = "OrganizationId"
            case password = "Password"
        }
    }

    public struct CreateUserResponse: AWSDecodableShape {

        /// The identifier for the new user.
        public let userId: String?

        public init(userId: String? = nil) {
            self.userId = userId
        }

        private enum CodingKeys: String, CodingKey {
            case userId = "UserId"
        }
    }

    public struct Delegate: AWSDecodableShape {

        /// The identifier for the user or group associated as the resource's delegate.
        public let id: String
        /// The type of the delegate: user or group.
        public let `type`: MemberType

        public init(id: String, type: MemberType) {
            self.id = id
            self.`type` = `type`
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case `type` = "Type"
        }
    }

    public struct DeleteAccessControlRuleRequest: AWSEncodableShape {

        /// The name of the access control rule.
        public let name: String
        /// The identifier for the organization.
        public let organizationId: String?

        public init(name: String, organizationId: String? = nil) {
            self.name = name
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.name, name: "name", parent: name, max: 64)
            try validate(self.name, name: "name", parent: name, min: 1)
            try validate(self.name, name: "name", parent: name, pattern: "[a-zA-Z0-9_-]+")
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case organizationId = "OrganizationId"
        }
    }

    public struct DeleteAccessControlRuleResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct DeleteAliasRequest: AWSEncodableShape {

        /// The aliases to be removed from the user's set of aliases. Duplicate entries in the list are collapsed into single entries (the list is transformed into a set).
        public let alias: String
        /// The identifier for the member (user or group) from which to have the aliases removed.
        public let entityId: String
        /// The identifier for the organization under which the user exists.
        public let organizationId: String

        public init(alias: String, entityId: String, organizationId: String) {
            self.alias = alias
            self.entityId = entityId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.alias, name: "alias", parent: name, max: 254)
            try validate(self.alias, name: "alias", parent: name, min: 1)
            try validate(self.alias, name: "alias", parent: name, pattern: "[a-zA-Z0-9._%+-]{1,64}@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}")
            try validate(self.entityId, name: "entityId", parent: name, max: 256)
            try validate(self.entityId, name: "entityId", parent: name, min: 12)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case alias = "Alias"
            case entityId = "EntityId"
            case organizationId = "OrganizationId"
        }
    }

    public struct DeleteAliasResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct DeleteGroupRequest: AWSEncodableShape {

        /// The identifier of the group to be deleted.
        public let groupId: String
        /// The organization that contains the group.
        public let organizationId: String

        public init(groupId: String, organizationId: String) {
            self.groupId = groupId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.groupId, name: "groupId", parent: name, max: 256)
            try validate(self.groupId, name: "groupId", parent: name, min: 12)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case groupId = "GroupId"
            case organizationId = "OrganizationId"
        }
    }

    public struct DeleteGroupResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct DeleteMailboxPermissionsRequest: AWSEncodableShape {

        /// The identifier of the member (user or group)that owns the mailbox.
        public let entityId: String
        /// The identifier of the member (user or group) for which to delete granted permissions.
        public let granteeId: String
        /// The identifier of the organization under which the member (user or group) exists.
        public let organizationId: String

        public init(entityId: String, granteeId: String, organizationId: String) {
            self.entityId = entityId
            self.granteeId = granteeId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.entityId, name: "entityId", parent: name, max: 256)
            try validate(self.entityId, name: "entityId", parent: name, min: 12)
            try validate(self.granteeId, name: "granteeId", parent: name, max: 256)
            try validate(self.granteeId, name: "granteeId", parent: name, min: 12)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case entityId = "EntityId"
            case granteeId = "GranteeId"
            case organizationId = "OrganizationId"
        }
    }

    public struct DeleteMailboxPermissionsResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct DeleteResourceRequest: AWSEncodableShape {

        /// The identifier associated with the organization from which the resource is deleted.
        public let organizationId: String
        /// The identifier of the resource to be deleted.
        public let resourceId: String

        public init(organizationId: String, resourceId: String) {
            self.organizationId = organizationId
            self.resourceId = resourceId
        }

        public func validate(name: String) throws {
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try validate(self.resourceId, name: "resourceId", parent: name, pattern: "^r-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
            case resourceId = "ResourceId"
        }
    }

    public struct DeleteResourceResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct DeleteUserRequest: AWSEncodableShape {

        /// The organization that contains the user to be deleted.
        public let organizationId: String
        /// The identifier of the user to be deleted.
        public let userId: String

        public init(organizationId: String, userId: String) {
            self.organizationId = organizationId
            self.userId = userId
        }

        public func validate(name: String) throws {
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try validate(self.userId, name: "userId", parent: name, max: 256)
            try validate(self.userId, name: "userId", parent: name, min: 12)
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
            case userId = "UserId"
        }
    }

    public struct DeleteUserResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct DeregisterFromWorkMailRequest: AWSEncodableShape {

        /// The identifier for the member (user or group) to be updated.
        public let entityId: String
        /// The identifier for the organization under which the Amazon WorkMail entity exists.
        public let organizationId: String

        public init(entityId: String, organizationId: String) {
            self.entityId = entityId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.entityId, name: "entityId", parent: name, max: 256)
            try validate(self.entityId, name: "entityId", parent: name, min: 12)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case entityId = "EntityId"
            case organizationId = "OrganizationId"
        }
    }

    public struct DeregisterFromWorkMailResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct DescribeGroupRequest: AWSEncodableShape {

        /// The identifier for the group to be described.
        public let groupId: String
        /// The identifier for the organization under which the group exists.
        public let organizationId: String

        public init(groupId: String, organizationId: String) {
            self.groupId = groupId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.groupId, name: "groupId", parent: name, max: 256)
            try validate(self.groupId, name: "groupId", parent: name, min: 12)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case groupId = "GroupId"
            case organizationId = "OrganizationId"
        }
    }

    public struct DescribeGroupResponse: AWSDecodableShape {

        /// The date and time when a user was deregistered from WorkMail, in UNIX epoch time format.
        public let disabledDate: TimeStamp?
        /// The email of the described group.
        public let email: String?
        /// The date and time when a user was registered to WorkMail, in UNIX epoch time format.
        public let enabledDate: TimeStamp?
        /// The identifier of the described group.
        public let groupId: String?
        /// The name of the described group.
        public let name: String?
        /// The state of the user: enabled (registered to Amazon WorkMail) or disabled (deregistered or never registered to WorkMail).
        public let state: EntityState?

        public init(disabledDate: TimeStamp? = nil, email: String? = nil, enabledDate: TimeStamp? = nil, groupId: String? = nil, name: String? = nil, state: EntityState? = nil) {
            self.disabledDate = disabledDate
            self.email = email
            self.enabledDate = enabledDate
            self.groupId = groupId
            self.name = name
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case disabledDate = "DisabledDate"
            case email = "Email"
            case enabledDate = "EnabledDate"
            case groupId = "GroupId"
            case name = "Name"
            case state = "State"
        }
    }

    public struct DescribeOrganizationRequest: AWSEncodableShape {

        /// The identifier for the organization to be described.
        public let organizationId: String

        public init(organizationId: String) {
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
        }
    }

    public struct DescribeOrganizationResponse: AWSDecodableShape {

        /// The alias for an organization.
        public let alias: String?
        /// The Amazon Resource Name (ARN) of the organization.
        public let arn: String?
        /// The date at which the organization became usable in the WorkMail context, in UNIX epoch time format.
        public let completedDate: TimeStamp?
        /// The default mail domain associated with the organization.
        public let defaultMailDomain: String?
        /// The identifier for the directory associated with an Amazon WorkMail organization.
        public let directoryId: String?
        /// The type of directory associated with the WorkMail organization.
        public let directoryType: String?
        /// (Optional) The error message indicating if unexpected behavior was encountered with regards to the organization.
        public let errorMessage: String?
        /// The identifier of an organization.
        public let organizationId: String?
        /// The state of an organization.
        public let state: String?

        public init(alias: String? = nil, arn: String? = nil, completedDate: TimeStamp? = nil, defaultMailDomain: String? = nil, directoryId: String? = nil, directoryType: String? = nil, errorMessage: String? = nil, organizationId: String? = nil, state: String? = nil) {
            self.alias = alias
            self.arn = arn
            self.completedDate = completedDate
            self.defaultMailDomain = defaultMailDomain
            self.directoryId = directoryId
            self.directoryType = directoryType
            self.errorMessage = errorMessage
            self.organizationId = organizationId
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case alias = "Alias"
            case arn = "ARN"
            case completedDate = "CompletedDate"
            case defaultMailDomain = "DefaultMailDomain"
            case directoryId = "DirectoryId"
            case directoryType = "DirectoryType"
            case errorMessage = "ErrorMessage"
            case organizationId = "OrganizationId"
            case state = "State"
        }
    }

    public struct DescribeResourceRequest: AWSEncodableShape {

        /// The identifier associated with the organization for which the resource is described.
        public let organizationId: String
        /// The identifier of the resource to be described.
        public let resourceId: String

        public init(organizationId: String, resourceId: String) {
            self.organizationId = organizationId
            self.resourceId = resourceId
        }

        public func validate(name: String) throws {
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try validate(self.resourceId, name: "resourceId", parent: name, pattern: "^r-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
            case resourceId = "ResourceId"
        }
    }

    public struct DescribeResourceResponse: AWSDecodableShape {

        /// The booking options for the described resource.
        public let bookingOptions: BookingOptions?
        /// The date and time when a resource was disabled from WorkMail, in UNIX epoch time format.
        public let disabledDate: TimeStamp?
        /// The email of the described resource.
        public let email: String?
        /// The date and time when a resource was enabled for WorkMail, in UNIX epoch time format.
        public let enabledDate: TimeStamp?
        /// The name of the described resource.
        public let name: String?
        /// The identifier of the described resource.
        public let resourceId: String?
        /// The state of the resource: enabled (registered to Amazon WorkMail), disabled (deregistered or never registered to WorkMail), or deleted.
        public let state: EntityState?
        /// The type of the described resource.
        public let `type`: ResourceType?

        public init(bookingOptions: BookingOptions? = nil, disabledDate: TimeStamp? = nil, email: String? = nil, enabledDate: TimeStamp? = nil, name: String? = nil, resourceId: String? = nil, state: EntityState? = nil, type: ResourceType? = nil) {
            self.bookingOptions = bookingOptions
            self.disabledDate = disabledDate
            self.email = email
            self.enabledDate = enabledDate
            self.name = name
            self.resourceId = resourceId
            self.state = state
            self.`type` = `type`
        }

        private enum CodingKeys: String, CodingKey {
            case bookingOptions = "BookingOptions"
            case disabledDate = "DisabledDate"
            case email = "Email"
            case enabledDate = "EnabledDate"
            case name = "Name"
            case resourceId = "ResourceId"
            case state = "State"
            case `type` = "Type"
        }
    }

    public struct DescribeUserRequest: AWSEncodableShape {

        /// The identifier for the organization under which the user exists.
        public let organizationId: String
        /// The identifier for the user to be described.
        public let userId: String

        public init(organizationId: String, userId: String) {
            self.organizationId = organizationId
            self.userId = userId
        }

        public func validate(name: String) throws {
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try validate(self.userId, name: "userId", parent: name, max: 256)
            try validate(self.userId, name: "userId", parent: name, min: 12)
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
            case userId = "UserId"
        }
    }

    public struct DescribeUserResponse: AWSDecodableShape {

        /// The date and time at which the user was disabled for Amazon WorkMail usage, in UNIX epoch time format.
        public let disabledDate: TimeStamp?
        /// The display name of the user.
        public let displayName: String?
        /// The email of the user.
        public let email: String?
        /// The date and time at which the user was enabled for Amazon WorkMail usage, in UNIX epoch time format.
        public let enabledDate: TimeStamp?
        /// The name for the user.
        public let name: String?
        /// The state of a user: enabled (registered to Amazon WorkMail) or disabled (deregistered or never registered to WorkMail).
        public let state: EntityState?
        /// The identifier for the described user.
        public let userId: String?
        /// In certain cases, other entities are modeled as users. If interoperability is enabled, resources are imported into Amazon WorkMail as users. Because different WorkMail organizations rely on different directory types, administrators can distinguish between an unregistered user (account is disabled and has a user role) and the directory administrators. The values are USER, RESOURCE, and SYSTEM_USER.
        public let userRole: UserRole?

        public init(disabledDate: TimeStamp? = nil, displayName: String? = nil, email: String? = nil, enabledDate: TimeStamp? = nil, name: String? = nil, state: EntityState? = nil, userId: String? = nil, userRole: UserRole? = nil) {
            self.disabledDate = disabledDate
            self.displayName = displayName
            self.email = email
            self.enabledDate = enabledDate
            self.name = name
            self.state = state
            self.userId = userId
            self.userRole = userRole
        }

        private enum CodingKeys: String, CodingKey {
            case disabledDate = "DisabledDate"
            case displayName = "DisplayName"
            case email = "Email"
            case enabledDate = "EnabledDate"
            case name = "Name"
            case state = "State"
            case userId = "UserId"
            case userRole = "UserRole"
        }
    }

    public struct DisassociateDelegateFromResourceRequest: AWSEncodableShape {

        /// The identifier for the member (user, group) to be removed from the resource's delegates.
        public let entityId: String
        /// The identifier for the organization under which the resource exists.
        public let organizationId: String
        /// The identifier of the resource from which delegates' set members are removed. 
        public let resourceId: String

        public init(entityId: String, organizationId: String, resourceId: String) {
            self.entityId = entityId
            self.organizationId = organizationId
            self.resourceId = resourceId
        }

        public func validate(name: String) throws {
            try validate(self.entityId, name: "entityId", parent: name, max: 256)
            try validate(self.entityId, name: "entityId", parent: name, min: 12)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try validate(self.resourceId, name: "resourceId", parent: name, pattern: "^r-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case entityId = "EntityId"
            case organizationId = "OrganizationId"
            case resourceId = "ResourceId"
        }
    }

    public struct DisassociateDelegateFromResourceResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct DisassociateMemberFromGroupRequest: AWSEncodableShape {

        /// The identifier for the group from which members are removed.
        public let groupId: String
        /// The identifier for the member to be removed to the group.
        public let memberId: String
        /// The identifier for the organization under which the group exists.
        public let organizationId: String

        public init(groupId: String, memberId: String, organizationId: String) {
            self.groupId = groupId
            self.memberId = memberId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.groupId, name: "groupId", parent: name, max: 256)
            try validate(self.groupId, name: "groupId", parent: name, min: 12)
            try validate(self.memberId, name: "memberId", parent: name, max: 256)
            try validate(self.memberId, name: "memberId", parent: name, min: 12)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case groupId = "GroupId"
            case memberId = "MemberId"
            case organizationId = "OrganizationId"
        }
    }

    public struct DisassociateMemberFromGroupResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct GetAccessControlEffectRequest: AWSEncodableShape {

        /// The access protocol action. Valid values include ActiveSync, AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail.
        public let action: String
        /// The IPv4 address.
        public let ipAddress: String
        /// The identifier for the organization.
        public let organizationId: String
        /// The user ID.
        public let userId: String

        public init(action: String, ipAddress: String, organizationId: String, userId: String) {
            self.action = action
            self.ipAddress = ipAddress
            self.organizationId = organizationId
            self.userId = userId
        }

        public func validate(name: String) throws {
            try validate(self.action, name: "action", parent: name, max: 64)
            try validate(self.action, name: "action", parent: name, min: 1)
            try validate(self.action, name: "action", parent: name, pattern: "[a-zA-Z]+")
            try validate(self.ipAddress, name: "ipAddress", parent: name, max: 15)
            try validate(self.ipAddress, name: "ipAddress", parent: name, min: 1)
            try validate(self.ipAddress, name: "ipAddress", parent: name, pattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$")
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try validate(self.userId, name: "userId", parent: name, max: 256)
            try validate(self.userId, name: "userId", parent: name, min: 12)
        }

        private enum CodingKeys: String, CodingKey {
            case action = "Action"
            case ipAddress = "IpAddress"
            case organizationId = "OrganizationId"
            case userId = "UserId"
        }
    }

    public struct GetAccessControlEffectResponse: AWSDecodableShape {

        /// The rule effect.
        public let effect: AccessControlRuleEffect?
        /// The rules that match the given parameters, resulting in an effect.
        public let matchedRules: [String]?

        public init(effect: AccessControlRuleEffect? = nil, matchedRules: [String]? = nil) {
            self.effect = effect
            self.matchedRules = matchedRules
        }

        private enum CodingKeys: String, CodingKey {
            case effect = "Effect"
            case matchedRules = "MatchedRules"
        }
    }

    public struct GetMailboxDetailsRequest: AWSEncodableShape {

        /// The identifier for the organization that contains the user whose mailbox details are being requested.
        public let organizationId: String
        /// The identifier for the user whose mailbox details are being requested.
        public let userId: String

        public init(organizationId: String, userId: String) {
            self.organizationId = organizationId
            self.userId = userId
        }

        public func validate(name: String) throws {
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try validate(self.userId, name: "userId", parent: name, max: 256)
            try validate(self.userId, name: "userId", parent: name, min: 12)
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
            case userId = "UserId"
        }
    }

    public struct GetMailboxDetailsResponse: AWSDecodableShape {

        /// The maximum allowed mailbox size, in MB, for the specified user.
        public let mailboxQuota: Int?
        /// The current mailbox size, in MB, for the specified user.
        public let mailboxSize: Double?

        public init(mailboxQuota: Int? = nil, mailboxSize: Double? = nil) {
            self.mailboxQuota = mailboxQuota
            self.mailboxSize = mailboxSize
        }

        private enum CodingKeys: String, CodingKey {
            case mailboxQuota = "MailboxQuota"
            case mailboxSize = "MailboxSize"
        }
    }

    public struct Group: AWSDecodableShape {

        /// The date indicating when the group was disabled from Amazon WorkMail use.
        public let disabledDate: TimeStamp?
        /// The email of the group.
        public let email: String?
        /// The date indicating when the group was enabled for Amazon WorkMail use.
        public let enabledDate: TimeStamp?
        /// The identifier of the group.
        public let id: String?
        /// The name of the group.
        public let name: String?
        /// The state of the group, which can be ENABLED, DISABLED, or DELETED.
        public let state: EntityState?

        public init(disabledDate: TimeStamp? = nil, email: String? = nil, enabledDate: TimeStamp? = nil, id: String? = nil, name: String? = nil, state: EntityState? = nil) {
            self.disabledDate = disabledDate
            self.email = email
            self.enabledDate = enabledDate
            self.id = id
            self.name = name
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case disabledDate = "DisabledDate"
            case email = "Email"
            case enabledDate = "EnabledDate"
            case id = "Id"
            case name = "Name"
            case state = "State"
        }
    }

    public struct ListAccessControlRulesRequest: AWSEncodableShape {

        /// The identifier for the organization.
        public let organizationId: String

        public init(organizationId: String) {
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
        }
    }

    public struct ListAccessControlRulesResponse: AWSDecodableShape {

        /// The access control rules.
        public let rules: [AccessControlRule]?

        public init(rules: [AccessControlRule]? = nil) {
            self.rules = rules
        }

        private enum CodingKeys: String, CodingKey {
            case rules = "Rules"
        }
    }

    public struct ListAliasesRequest: AWSEncodableShape {

        /// The identifier for the entity for which to list the aliases.
        public let entityId: String
        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results. The first call does not contain any tokens.
        public let nextToken: String?
        /// The identifier for the organization under which the entity exists.
        public let organizationId: String

        public init(entityId: String, maxResults: Int? = nil, nextToken: String? = nil, organizationId: String) {
            self.entityId = entityId
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.entityId, name: "entityId", parent: name, max: 256)
            try validate(self.entityId, name: "entityId", parent: name, min: 12)
            try validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case entityId = "EntityId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case organizationId = "OrganizationId"
        }
    }

    public struct ListAliasesResponse: AWSDecodableShape {

        /// The entity's paginated aliases.
        public let aliases: [String]?
        /// The token to use to retrieve the next page of results. The value is "null" when there are no more results to return.
        public let nextToken: String?

        public init(aliases: [String]? = nil, nextToken: String? = nil) {
            self.aliases = aliases
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case aliases = "Aliases"
            case nextToken = "NextToken"
        }
    }

    public struct ListGroupMembersRequest: AWSEncodableShape {

        /// The identifier for the group to which the members (users or groups) are associated.
        public let groupId: String
        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        ///  The token to use to retrieve the next page of results. The first call does not contain any tokens.
        public let nextToken: String?
        /// The identifier for the organization under which the group exists.
        public let organizationId: String

        public init(groupId: String, maxResults: Int? = nil, nextToken: String? = nil, organizationId: String) {
            self.groupId = groupId
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.groupId, name: "groupId", parent: name, max: 256)
            try validate(self.groupId, name: "groupId", parent: name, min: 12)
            try validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case groupId = "GroupId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case organizationId = "OrganizationId"
        }
    }

    public struct ListGroupMembersResponse: AWSDecodableShape {

        /// The members associated to the group.
        public let members: [Member]?
        /// The token to use to retrieve the next page of results. The first call does not contain any tokens.
        public let nextToken: String?

        public init(members: [Member]? = nil, nextToken: String? = nil) {
            self.members = members
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case members = "Members"
            case nextToken = "NextToken"
        }
    }

    public struct ListGroupsRequest: AWSEncodableShape {

        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results. The first call does not contain any tokens.
        public let nextToken: String?
        /// The identifier for the organization under which the groups exist.
        public let organizationId: String

        public init(maxResults: Int? = nil, nextToken: String? = nil, organizationId: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case organizationId = "OrganizationId"
        }
    }

    public struct ListGroupsResponse: AWSDecodableShape {

        /// The overview of groups for an organization.
        public let groups: [Group]?
        /// The token to use to retrieve the next page of results. The value is "null" when there are no more results to return.
        public let nextToken: String?

        public init(groups: [Group]? = nil, nextToken: String? = nil) {
            self.groups = groups
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case groups = "Groups"
            case nextToken = "NextToken"
        }
    }

    public struct ListMailboxPermissionsRequest: AWSEncodableShape {

        /// The identifier of the user, group, or resource for which to list mailbox permissions.
        public let entityId: String
        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results. The first call does not contain any tokens.
        public let nextToken: String?
        /// The identifier of the organization under which the user, group, or resource exists.
        public let organizationId: String

        public init(entityId: String, maxResults: Int? = nil, nextToken: String? = nil, organizationId: String) {
            self.entityId = entityId
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.entityId, name: "entityId", parent: name, max: 256)
            try validate(self.entityId, name: "entityId", parent: name, min: 12)
            try validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case entityId = "EntityId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case organizationId = "OrganizationId"
        }
    }

    public struct ListMailboxPermissionsResponse: AWSDecodableShape {

        /// The token to use to retrieve the next page of results. The value is "null" when there are no more results to return.
        public let nextToken: String?
        /// One page of the user, group, or resource mailbox permissions.
        public let permissions: [Permission]?

        public init(nextToken: String? = nil, permissions: [Permission]? = nil) {
            self.nextToken = nextToken
            self.permissions = permissions
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case permissions = "Permissions"
        }
    }

    public struct ListOrganizationsRequest: AWSEncodableShape {

        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results. The first call does not contain any tokens.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListOrganizationsResponse: AWSDecodableShape {

        /// The token to use to retrieve the next page of results. The value is "null" when there are no more results to return.
        public let nextToken: String?
        /// The overview of owned organizations presented as a list of organization summaries.
        public let organizationSummaries: [OrganizationSummary]?

        public init(nextToken: String? = nil, organizationSummaries: [OrganizationSummary]? = nil) {
            self.nextToken = nextToken
            self.organizationSummaries = organizationSummaries
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case organizationSummaries = "OrganizationSummaries"
        }
    }

    public struct ListResourceDelegatesRequest: AWSEncodableShape {

        /// The number of maximum results in a page.
        public let maxResults: Int?
        /// The token used to paginate through the delegates associated with a resource.
        public let nextToken: String?
        /// The identifier for the organization that contains the resource for which delegates are listed.
        public let organizationId: String
        /// The identifier for the resource whose delegates are listed.
        public let resourceId: String

        public init(maxResults: Int? = nil, nextToken: String? = nil, organizationId: String, resourceId: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.organizationId = organizationId
            self.resourceId = resourceId
        }

        public func validate(name: String) throws {
            try validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try validate(self.resourceId, name: "resourceId", parent: name, max: 256)
            try validate(self.resourceId, name: "resourceId", parent: name, min: 12)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case organizationId = "OrganizationId"
            case resourceId = "ResourceId"
        }
    }

    public struct ListResourceDelegatesResponse: AWSDecodableShape {

        /// One page of the resource's delegates.
        public let delegates: [Delegate]?
        /// The token used to paginate through the delegates associated with a resource. While results are still available, it has an associated value. When the last page is reached, the token is empty. 
        public let nextToken: String?

        public init(delegates: [Delegate]? = nil, nextToken: String? = nil) {
            self.delegates = delegates
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case delegates = "Delegates"
            case nextToken = "NextToken"
        }
    }

    public struct ListResourcesRequest: AWSEncodableShape {

        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results. The first call does not contain any tokens.
        public let nextToken: String?
        /// The identifier for the organization under which the resources exist.
        public let organizationId: String

        public init(maxResults: Int? = nil, nextToken: String? = nil, organizationId: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case organizationId = "OrganizationId"
        }
    }

    public struct ListResourcesResponse: AWSDecodableShape {

        ///  The token used to paginate through all the organization's resources. While results are still available, it has an associated value. When the last page is reached, the token is empty.
        public let nextToken: String?
        /// One page of the organization's resource representation.
        public let resources: [Resource]?

        public init(nextToken: String? = nil, resources: [Resource]? = nil) {
            self.nextToken = nextToken
            self.resources = resources
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case resources = "Resources"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {

        /// The resource ARN.
        public let resourceARN: String

        public init(resourceARN: String) {
            self.resourceARN = resourceARN
        }

        public func validate(name: String) throws {
            try validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
        }
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {

        /// A list of tag key-value pairs.
        public let tags: [Tag]?

        public init(tags: [Tag]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct ListUsersRequest: AWSEncodableShape {

        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results. The first call does not contain any tokens.
        public let nextToken: String?
        /// The identifier for the organization under which the users exist.
        public let organizationId: String

        public init(maxResults: Int? = nil, nextToken: String? = nil, organizationId: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case organizationId = "OrganizationId"
        }
    }

    public struct ListUsersResponse: AWSDecodableShape {

        ///  The token to use to retrieve the next page of results. This value is `null` when there are no more results to return.
        public let nextToken: String?
        /// The overview of users for an organization.
        public let users: [User]?

        public init(nextToken: String? = nil, users: [User]? = nil) {
            self.nextToken = nextToken
            self.users = users
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case users = "Users"
        }
    }

    public struct Member: AWSDecodableShape {

        /// The date indicating when the member was disabled from Amazon WorkMail use.
        public let disabledDate: TimeStamp?
        /// The date indicating when the member was enabled for Amazon WorkMail use.
        public let enabledDate: TimeStamp?
        /// The identifier of the member.
        public let id: String?
        /// The name of the member.
        public let name: String?
        /// The state of the member, which can be ENABLED, DISABLED, or DELETED.
        public let state: EntityState?
        /// A member can be a user or group.
        public let `type`: MemberType?

        public init(disabledDate: TimeStamp? = nil, enabledDate: TimeStamp? = nil, id: String? = nil, name: String? = nil, state: EntityState? = nil, type: MemberType? = nil) {
            self.disabledDate = disabledDate
            self.enabledDate = enabledDate
            self.id = id
            self.name = name
            self.state = state
            self.`type` = `type`
        }

        private enum CodingKeys: String, CodingKey {
            case disabledDate = "DisabledDate"
            case enabledDate = "EnabledDate"
            case id = "Id"
            case name = "Name"
            case state = "State"
            case `type` = "Type"
        }
    }

    public struct OrganizationSummary: AWSDecodableShape {

        /// The alias associated with the organization.
        public let alias: String?
        /// The error message associated with the organization. It is only present if unexpected behavior has occurred with regards to the organization. It provides insight or solutions regarding unexpected behavior.
        public let errorMessage: String?
        /// The identifier associated with the organization.
        public let organizationId: String?
        /// The state associated with the organization.
        public let state: String?

        public init(alias: String? = nil, errorMessage: String? = nil, organizationId: String? = nil, state: String? = nil) {
            self.alias = alias
            self.errorMessage = errorMessage
            self.organizationId = organizationId
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case alias = "Alias"
            case errorMessage = "ErrorMessage"
            case organizationId = "OrganizationId"
            case state = "State"
        }
    }

    public struct Permission: AWSDecodableShape {

        /// The identifier of the user, group, or resource to which the permissions are granted.
        public let granteeId: String
        /// The type of user, group, or resource referred to in GranteeId.
        public let granteeType: MemberType
        /// The permissions granted to the grantee. SEND_AS allows the grantee to send email as the owner of the mailbox (the grantee is not mentioned on these emails). SEND_ON_BEHALF allows the grantee to send email on behalf of the owner of the mailbox (the grantee is not mentioned as the physical sender of these emails). FULL_ACCESS allows the grantee full access to the mailbox, irrespective of other folder-level permissions set on the mailbox.
        public let permissionValues: [PermissionType]

        public init(granteeId: String, granteeType: MemberType, permissionValues: [PermissionType]) {
            self.granteeId = granteeId
            self.granteeType = granteeType
            self.permissionValues = permissionValues
        }

        private enum CodingKeys: String, CodingKey {
            case granteeId = "GranteeId"
            case granteeType = "GranteeType"
            case permissionValues = "PermissionValues"
        }
    }

    public struct PutAccessControlRuleRequest: AWSEncodableShape {

        /// Access protocol actions to include in the rule. Valid values include ActiveSync, AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail.
        public let actions: [String]?
        /// The rule description.
        public let description: String
        /// The rule effect.
        public let effect: AccessControlRuleEffect
        /// IPv4 CIDR ranges to include in the rule.
        public let ipRanges: [String]?
        /// The rule name.
        public let name: String
        /// Access protocol actions to exclude from the rule. Valid values include ActiveSync, AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail.
        public let notActions: [String]?
        /// IPv4 CIDR ranges to exclude from the rule.
        public let notIpRanges: [String]?
        /// User IDs to exclude from the rule.
        public let notUserIds: [String]?
        /// The identifier of the organization.
        public let organizationId: String
        /// User IDs to include in the rule.
        public let userIds: [String]?

        public init(actions: [String]? = nil, description: String, effect: AccessControlRuleEffect, ipRanges: [String]? = nil, name: String, notActions: [String]? = nil, notIpRanges: [String]? = nil, notUserIds: [String]? = nil, organizationId: String, userIds: [String]? = nil) {
            self.actions = actions
            self.description = description
            self.effect = effect
            self.ipRanges = ipRanges
            self.name = name
            self.notActions = notActions
            self.notIpRanges = notIpRanges
            self.notUserIds = notUserIds
            self.organizationId = organizationId
            self.userIds = userIds
        }

        public func validate(name: String) throws {
            try self.actions?.forEach {
                try validate($0, name: "actions[]", parent: name, max: 64)
                try validate($0, name: "actions[]", parent: name, min: 1)
                try validate($0, name: "actions[]", parent: name, pattern: "[a-zA-Z]+")
            }
            try validate(self.actions, name: "actions", parent: name, max: 10)
            try validate(self.actions, name: "actions", parent: name, min: 0)
            try validate(self.description, name: "description", parent: name, max: 255)
            try validate(self.description, name: "description", parent: name, min: 0)
            try validate(self.description, name: "description", parent: name, pattern: "[\\u0020-\\u00FF]+")
            try self.ipRanges?.forEach {
                try validate($0, name: "ipRanges[]", parent: name, max: 18)
                try validate($0, name: "ipRanges[]", parent: name, min: 1)
                try validate($0, name: "ipRanges[]", parent: name, pattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([0-9]|[12][0-9]|3[0-2])$")
            }
            try validate(self.ipRanges, name: "ipRanges", parent: name, max: 10)
            try validate(self.ipRanges, name: "ipRanges", parent: name, min: 0)
            try validate(self.name, name: "name", parent: name, max: 64)
            try validate(self.name, name: "name", parent: name, min: 1)
            try validate(self.name, name: "name", parent: name, pattern: "[a-zA-Z0-9_-]+")
            try self.notActions?.forEach {
                try validate($0, name: "notActions[]", parent: name, max: 64)
                try validate($0, name: "notActions[]", parent: name, min: 1)
                try validate($0, name: "notActions[]", parent: name, pattern: "[a-zA-Z]+")
            }
            try validate(self.notActions, name: "notActions", parent: name, max: 10)
            try validate(self.notActions, name: "notActions", parent: name, min: 0)
            try self.notIpRanges?.forEach {
                try validate($0, name: "notIpRanges[]", parent: name, max: 18)
                try validate($0, name: "notIpRanges[]", parent: name, min: 1)
                try validate($0, name: "notIpRanges[]", parent: name, pattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([0-9]|[12][0-9]|3[0-2])$")
            }
            try validate(self.notIpRanges, name: "notIpRanges", parent: name, max: 10)
            try validate(self.notIpRanges, name: "notIpRanges", parent: name, min: 0)
            try self.notUserIds?.forEach {
                try validate($0, name: "notUserIds[]", parent: name, max: 256)
                try validate($0, name: "notUserIds[]", parent: name, min: 12)
            }
            try validate(self.notUserIds, name: "notUserIds", parent: name, max: 10)
            try validate(self.notUserIds, name: "notUserIds", parent: name, min: 0)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try self.userIds?.forEach {
                try validate($0, name: "userIds[]", parent: name, max: 256)
                try validate($0, name: "userIds[]", parent: name, min: 12)
            }
            try validate(self.userIds, name: "userIds", parent: name, max: 10)
            try validate(self.userIds, name: "userIds", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case actions = "Actions"
            case description = "Description"
            case effect = "Effect"
            case ipRanges = "IpRanges"
            case name = "Name"
            case notActions = "NotActions"
            case notIpRanges = "NotIpRanges"
            case notUserIds = "NotUserIds"
            case organizationId = "OrganizationId"
            case userIds = "UserIds"
        }
    }

    public struct PutAccessControlRuleResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct PutMailboxPermissionsRequest: AWSEncodableShape {

        /// The identifier of the user, group, or resource for which to update mailbox permissions.
        public let entityId: String
        /// The identifier of the user, group, or resource to which to grant the permissions.
        public let granteeId: String
        /// The identifier of the organization under which the user, group, or resource exists.
        public let organizationId: String
        /// The permissions granted to the grantee. SEND_AS allows the grantee to send email as the owner of the mailbox (the grantee is not mentioned on these emails). SEND_ON_BEHALF allows the grantee to send email on behalf of the owner of the mailbox (the grantee is not mentioned as the physical sender of these emails). FULL_ACCESS allows the grantee full access to the mailbox, irrespective of other folder-level permissions set on the mailbox.
        public let permissionValues: [PermissionType]

        public init(entityId: String, granteeId: String, organizationId: String, permissionValues: [PermissionType]) {
            self.entityId = entityId
            self.granteeId = granteeId
            self.organizationId = organizationId
            self.permissionValues = permissionValues
        }

        public func validate(name: String) throws {
            try validate(self.entityId, name: "entityId", parent: name, max: 256)
            try validate(self.entityId, name: "entityId", parent: name, min: 12)
            try validate(self.granteeId, name: "granteeId", parent: name, max: 256)
            try validate(self.granteeId, name: "granteeId", parent: name, min: 12)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case entityId = "EntityId"
            case granteeId = "GranteeId"
            case organizationId = "OrganizationId"
            case permissionValues = "PermissionValues"
        }
    }

    public struct PutMailboxPermissionsResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct RegisterToWorkMailRequest: AWSEncodableShape {

        /// The email for the user, group, or resource to be updated.
        public let email: String
        /// The identifier for the user, group, or resource to be updated.
        public let entityId: String
        /// The identifier for the organization under which the user, group, or resource exists.
        public let organizationId: String

        public init(email: String, entityId: String, organizationId: String) {
            self.email = email
            self.entityId = entityId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.email, name: "email", parent: name, max: 254)
            try validate(self.email, name: "email", parent: name, min: 1)
            try validate(self.email, name: "email", parent: name, pattern: "[a-zA-Z0-9._%+-]{1,64}@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}")
            try validate(self.entityId, name: "entityId", parent: name, max: 256)
            try validate(self.entityId, name: "entityId", parent: name, min: 12)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case email = "Email"
            case entityId = "EntityId"
            case organizationId = "OrganizationId"
        }
    }

    public struct RegisterToWorkMailResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct ResetPasswordRequest: AWSEncodableShape {

        /// The identifier of the organization that contains the user for which the password is reset.
        public let organizationId: String
        /// The new password for the user.
        public let password: String
        /// The identifier of the user for whom the password is reset.
        public let userId: String

        public init(organizationId: String, password: String, userId: String) {
            self.organizationId = organizationId
            self.password = password
            self.userId = userId
        }

        public func validate(name: String) throws {
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try validate(self.password, name: "password", parent: name, max: 256)
            try validate(self.password, name: "password", parent: name, pattern: "[\\u0020-\\u00FF]+")
            try validate(self.userId, name: "userId", parent: name, max: 256)
            try validate(self.userId, name: "userId", parent: name, min: 12)
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
            case password = "Password"
            case userId = "UserId"
        }
    }

    public struct ResetPasswordResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct Resource: AWSDecodableShape {

        /// The date indicating when the resource was disabled from Amazon WorkMail use.
        public let disabledDate: TimeStamp?
        /// The email of the resource.
        public let email: String?
        /// The date indicating when the resource was enabled for Amazon WorkMail use.
        public let enabledDate: TimeStamp?
        /// The identifier of the resource.
        public let id: String?
        /// The name of the resource.
        public let name: String?
        /// The state of the resource, which can be ENABLED, DISABLED, or DELETED.
        public let state: EntityState?
        /// The type of the resource: equipment or room.
        public let `type`: ResourceType?

        public init(disabledDate: TimeStamp? = nil, email: String? = nil, enabledDate: TimeStamp? = nil, id: String? = nil, name: String? = nil, state: EntityState? = nil, type: ResourceType? = nil) {
            self.disabledDate = disabledDate
            self.email = email
            self.enabledDate = enabledDate
            self.id = id
            self.name = name
            self.state = state
            self.`type` = `type`
        }

        private enum CodingKeys: String, CodingKey {
            case disabledDate = "DisabledDate"
            case email = "Email"
            case enabledDate = "EnabledDate"
            case id = "Id"
            case name = "Name"
            case state = "State"
            case `type` = "Type"
        }
    }

    public struct Tag: AWSEncodableShape & AWSDecodableShape {

        /// The key of the tag.
        public let key: String
        /// The value of the tag.
        public let value: String

        public init(key: String, value: String) {
            self.key = key
            self.value = value
        }

        public func validate(name: String) throws {
            try validate(self.key, name: "key", parent: name, max: 128)
            try validate(self.key, name: "key", parent: name, min: 1)
            try validate(self.value, name: "value", parent: name, max: 256)
            try validate(self.value, name: "value", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case value = "Value"
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {

        /// The resource ARN.
        public let resourceARN: String
        /// The tag key-value pairs.
        public let tags: [Tag]

        public init(resourceARN: String, tags: [Tag]) {
            self.resourceARN = resourceARN
            self.tags = tags
        }

        public func validate(name: String) throws {
            try validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.tags.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try validate(self.tags, name: "tags", parent: name, max: 50)
            try validate(self.tags, name: "tags", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tags = "Tags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct UntagResourceRequest: AWSEncodableShape {

        /// The resource ARN.
        public let resourceARN: String
        /// The tag keys.
        public let tagKeys: [String]

        public init(resourceARN: String, tagKeys: [String]) {
            self.resourceARN = resourceARN
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
            }
            try validate(self.tagKeys, name: "tagKeys", parent: name, max: 50)
            try validate(self.tagKeys, name: "tagKeys", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tagKeys = "TagKeys"
        }
    }

    public struct UntagResourceResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct UpdateMailboxQuotaRequest: AWSEncodableShape {

        /// The updated mailbox quota, in MB, for the specified user.
        public let mailboxQuota: Int
        /// The identifier for the organization that contains the user for whom to update the mailbox quota.
        public let organizationId: String
        /// The identifer for the user for whom to update the mailbox quota.
        public let userId: String

        public init(mailboxQuota: Int, organizationId: String, userId: String) {
            self.mailboxQuota = mailboxQuota
            self.organizationId = organizationId
            self.userId = userId
        }

        public func validate(name: String) throws {
            try validate(self.mailboxQuota, name: "mailboxQuota", parent: name, min: 1)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try validate(self.userId, name: "userId", parent: name, max: 256)
            try validate(self.userId, name: "userId", parent: name, min: 12)
        }

        private enum CodingKeys: String, CodingKey {
            case mailboxQuota = "MailboxQuota"
            case organizationId = "OrganizationId"
            case userId = "UserId"
        }
    }

    public struct UpdateMailboxQuotaResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct UpdatePrimaryEmailAddressRequest: AWSEncodableShape {

        /// The value of the email to be updated as primary.
        public let email: String
        /// The user, group, or resource to update.
        public let entityId: String
        /// The organization that contains the user, group, or resource to update.
        public let organizationId: String

        public init(email: String, entityId: String, organizationId: String) {
            self.email = email
            self.entityId = entityId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try validate(self.email, name: "email", parent: name, max: 254)
            try validate(self.email, name: "email", parent: name, min: 1)
            try validate(self.email, name: "email", parent: name, pattern: "[a-zA-Z0-9._%+-]{1,64}@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}")
            try validate(self.entityId, name: "entityId", parent: name, max: 256)
            try validate(self.entityId, name: "entityId", parent: name, min: 12)
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case email = "Email"
            case entityId = "EntityId"
            case organizationId = "OrganizationId"
        }
    }

    public struct UpdatePrimaryEmailAddressResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct UpdateResourceRequest: AWSEncodableShape {

        /// The resource's booking options to be updated.
        public let bookingOptions: BookingOptions?
        /// The name of the resource to be updated.
        public let name: String?
        /// The identifier associated with the organization for which the resource is updated.
        public let organizationId: String
        /// The identifier of the resource to be updated.
        public let resourceId: String

        public init(bookingOptions: BookingOptions? = nil, name: String? = nil, organizationId: String, resourceId: String) {
            self.bookingOptions = bookingOptions
            self.name = name
            self.organizationId = organizationId
            self.resourceId = resourceId
        }

        public func validate(name: String) throws {
            try validate(self.name, name: "name", parent: name, max: 20)
            try validate(self.name, name: "name", parent: name, min: 1)
            try validate(self.name, name: "name", parent: name, pattern: "[\\w\\-.]+(@[a-zA-Z0-9.\\-]+\\.[a-zA-Z0-9]{2,})?")
            try validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try validate(self.resourceId, name: "resourceId", parent: name, pattern: "^r-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case bookingOptions = "BookingOptions"
            case name = "Name"
            case organizationId = "OrganizationId"
            case resourceId = "ResourceId"
        }
    }

    public struct UpdateResourceResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct User: AWSDecodableShape {

        /// The date indicating when the user was disabled from Amazon WorkMail use.
        public let disabledDate: TimeStamp?
        /// The display name of the user.
        public let displayName: String?
        /// The email of the user.
        public let email: String?
        /// The date indicating when the user was enabled for Amazon WorkMail use.
        public let enabledDate: TimeStamp?
        /// The identifier of the user.
        public let id: String?
        /// The name of the user.
        public let name: String?
        /// The state of the user, which can be ENABLED, DISABLED, or DELETED.
        public let state: EntityState?
        /// The role of the user.
        public let userRole: UserRole?

        public init(disabledDate: TimeStamp? = nil, displayName: String? = nil, email: String? = nil, enabledDate: TimeStamp? = nil, id: String? = nil, name: String? = nil, state: EntityState? = nil, userRole: UserRole? = nil) {
            self.disabledDate = disabledDate
            self.displayName = displayName
            self.email = email
            self.enabledDate = enabledDate
            self.id = id
            self.name = name
            self.state = state
            self.userRole = userRole
        }

        private enum CodingKeys: String, CodingKey {
            case disabledDate = "DisabledDate"
            case displayName = "DisplayName"
            case email = "Email"
            case enabledDate = "EnabledDate"
            case id = "Id"
            case name = "Name"
            case state = "State"
            case userRole = "UserRole"
        }
    }
}
