//===----------------------------------------------------------------------===//
//
// 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 DLM {
    //MARK: Enums

    public enum GettablePolicyStateValues: String, CustomStringConvertible, Codable {
        case enabled = "ENABLED"
        case disabled = "DISABLED"
        case error = "ERROR"
        public var description: String { return self.rawValue }
    }

    public enum IntervalUnitValues: String, CustomStringConvertible, Codable {
        case hours = "HOURS"
        public var description: String { return self.rawValue }
    }

    public enum PolicyTypeValues: String, CustomStringConvertible, Codable {
        case ebsSnapshotManagement = "EBS_SNAPSHOT_MANAGEMENT"
        public var description: String { return self.rawValue }
    }

    public enum ResourceTypeValues: String, CustomStringConvertible, Codable {
        case volume = "VOLUME"
        case instance = "INSTANCE"
        public var description: String { return self.rawValue }
    }

    public enum RetentionIntervalUnitValues: String, CustomStringConvertible, Codable {
        case days = "DAYS"
        case weeks = "WEEKS"
        case months = "MONTHS"
        case years = "YEARS"
        public var description: String { return self.rawValue }
    }

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

    //MARK: Shapes

    public struct CreateLifecyclePolicyRequest: AWSEncodableShape {

        /// A description of the lifecycle policy. The characters ^[0-9A-Za-z _-]+$ are supported.
        public let description: String
        /// The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.
        public let executionRoleArn: String
        /// The configuration details of the lifecycle policy.
        public let policyDetails: PolicyDetails
        /// The desired activation state of the lifecycle policy after creation.
        public let state: SettablePolicyStateValues
        /// The tags to apply to the lifecycle policy during creation.
        public let tags: [String: String]?

        public init(description: String, executionRoleArn: String, policyDetails: PolicyDetails, state: SettablePolicyStateValues, tags: [String: String]? = nil) {
            self.description = description
            self.executionRoleArn = executionRoleArn
            self.policyDetails = policyDetails
            self.state = state
            self.tags = tags
        }

        public func validate(name: String) throws {
            try validate(self.description, name: "description", parent: name, max: 500)
            try validate(self.description, name: "description", parent: name, min: 0)
            try validate(self.description, name: "description", parent: name, pattern: "[0-9A-Za-z _-]+")
            try validate(self.executionRoleArn, name: "executionRoleArn", parent: name, max: 2048)
            try validate(self.executionRoleArn, name: "executionRoleArn", parent: name, min: 0)
            try validate(self.executionRoleArn, name: "executionRoleArn", parent: name, pattern: "arn:aws(-[a-z]{1,3}){0,2}:iam::\\d+:role/.*")
            try self.policyDetails.validate(name: "\(name).policyDetails")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, pattern: "[\\p{all}]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case executionRoleArn = "ExecutionRoleArn"
            case policyDetails = "PolicyDetails"
            case state = "State"
            case tags = "Tags"
        }
    }

    public struct CreateLifecyclePolicyResponse: AWSDecodableShape {

        /// The identifier of the lifecycle policy.
        public let policyId: String?

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

        private enum CodingKeys: String, CodingKey {
            case policyId = "PolicyId"
        }
    }

    public struct CreateRule: AWSEncodableShape & AWSDecodableShape {

        /// The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24.
        public let interval: Int
        /// The interval unit.
        public let intervalUnit: IntervalUnitValues
        /// The time, in UTC, to start the operation. The supported format is hh:mm. The operation occurs within a one-hour window following the specified time.
        public let times: [String]?

        public init(interval: Int, intervalUnit: IntervalUnitValues, times: [String]? = nil) {
            self.interval = interval
            self.intervalUnit = intervalUnit
            self.times = times
        }

        public func validate(name: String) throws {
            try validate(self.interval, name: "interval", parent: name, min: 1)
            try self.times?.forEach {
                try validate($0, name: "times[]", parent: name, max: 5)
                try validate($0, name: "times[]", parent: name, min: 5)
                try validate($0, name: "times[]", parent: name, pattern: "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$")
            }
            try validate(self.times, name: "times", parent: name, max: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case interval = "Interval"
            case intervalUnit = "IntervalUnit"
            case times = "Times"
        }
    }

    public struct CrossRegionCopyRetainRule: AWSEncodableShape & AWSDecodableShape {

        /// The amount of time to retain each snapshot. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.
        public let interval: Int?
        /// The unit of time for time-based retention.
        public let intervalUnit: RetentionIntervalUnitValues?

        public init(interval: Int? = nil, intervalUnit: RetentionIntervalUnitValues? = nil) {
            self.interval = interval
            self.intervalUnit = intervalUnit
        }

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

        private enum CodingKeys: String, CodingKey {
            case interval = "Interval"
            case intervalUnit = "IntervalUnit"
        }
    }

    public struct CrossRegionCopyRule: AWSEncodableShape & AWSDecodableShape {

        /// The Amazon Resource Name (ARN) of the AWS KMS customer master key (CMK) to use for EBS encryption. If this parameter is not specified, your AWS managed CMK for EBS is used.
        public let cmkArn: String?
        /// Copy all user-defined tags from the source snapshot to the copied snapshot.
        public let copyTags: Bool?
        /// To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using this parameter. Copies of encrypted snapshots are encrypted, even if this parameter is false or if encryption by default is not enabled.
        public let encrypted: Bool
        /// The retention rule.
        public let retainRule: CrossRegionCopyRetainRule?
        /// The target Region.
        public let targetRegion: String

        public init(cmkArn: String? = nil, copyTags: Bool? = nil, encrypted: Bool, retainRule: CrossRegionCopyRetainRule? = nil, targetRegion: String) {
            self.cmkArn = cmkArn
            self.copyTags = copyTags
            self.encrypted = encrypted
            self.retainRule = retainRule
            self.targetRegion = targetRegion
        }

        public func validate(name: String) throws {
            try validate(self.cmkArn, name: "cmkArn", parent: name, max: 2048)
            try validate(self.cmkArn, name: "cmkArn", parent: name, min: 0)
            try validate(self.cmkArn, name: "cmkArn", parent: name, pattern: "arn:aws(-[a-z]{1,3}){0,2}:kms:([a-z]+-){2,3}\\d:\\d+:key/.*")
            try self.retainRule?.validate(name: "\(name).retainRule")
            try validate(self.targetRegion, name: "targetRegion", parent: name, max: 16)
            try validate(self.targetRegion, name: "targetRegion", parent: name, min: 0)
            try validate(self.targetRegion, name: "targetRegion", parent: name, pattern: "([a-z]+-){2,3}\\d")
        }

        private enum CodingKeys: String, CodingKey {
            case cmkArn = "CmkArn"
            case copyTags = "CopyTags"
            case encrypted = "Encrypted"
            case retainRule = "RetainRule"
            case targetRegion = "TargetRegion"
        }
    }

    public struct DeleteLifecyclePolicyRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "policyId", location: .uri(locationName: "policyId"))
        ]

        /// The identifier of the lifecycle policy.
        public let policyId: String

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

        public func validate(name: String) throws {
            try validate(self.policyId, name: "policyId", parent: name, max: 64)
            try validate(self.policyId, name: "policyId", parent: name, min: 0)
            try validate(self.policyId, name: "policyId", parent: name, pattern: "policy-[A-Za-z0-9]+")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteLifecyclePolicyResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct FastRestoreRule: AWSEncodableShape & AWSDecodableShape {

        /// The Availability Zones in which to enable fast snapshot restore.
        public let availabilityZones: [String]
        /// The number of snapshots to be enabled with fast snapshot restore.
        public let count: Int?
        /// The amount of time to enable fast snapshot restore. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.
        public let interval: Int?
        /// The unit of time for enabling fast snapshot restore.
        public let intervalUnit: RetentionIntervalUnitValues?

        public init(availabilityZones: [String], count: Int? = nil, interval: Int? = nil, intervalUnit: RetentionIntervalUnitValues? = nil) {
            self.availabilityZones = availabilityZones
            self.count = count
            self.interval = interval
            self.intervalUnit = intervalUnit
        }

        public func validate(name: String) throws {
            try self.availabilityZones.forEach {
                try validate($0, name: "availabilityZones[]", parent: name, max: 16)
                try validate($0, name: "availabilityZones[]", parent: name, min: 0)
                try validate($0, name: "availabilityZones[]", parent: name, pattern: "([a-z]+-){2,3}\\d[a-z]")
            }
            try validate(self.availabilityZones, name: "availabilityZones", parent: name, max: 10)
            try validate(self.availabilityZones, name: "availabilityZones", parent: name, min: 1)
            try validate(self.count, name: "count", parent: name, max: 1000)
            try validate(self.count, name: "count", parent: name, min: 1)
            try validate(self.interval, name: "interval", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case availabilityZones = "AvailabilityZones"
            case count = "Count"
            case interval = "Interval"
            case intervalUnit = "IntervalUnit"
        }
    }

    public struct GetLifecyclePoliciesRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "policyIds", location: .querystring(locationName: "policyIds")), 
            AWSMemberEncoding(label: "resourceTypes", location: .querystring(locationName: "resourceTypes")), 
            AWSMemberEncoding(label: "state", location: .querystring(locationName: "state")), 
            AWSMemberEncoding(label: "tagsToAdd", location: .querystring(locationName: "tagsToAdd")), 
            AWSMemberEncoding(label: "targetTags", location: .querystring(locationName: "targetTags"))
        ]

        /// The identifiers of the data lifecycle policies.
        public let policyIds: [String]?
        /// The resource type.
        public let resourceTypes: [ResourceTypeValues]?
        /// The activation state.
        public let state: GettablePolicyStateValues?
        /// The tags to add to objects created by the policy. Tags are strings in the format key=value. These user-defined tags are added in addition to the AWS-added lifecycle tags.
        public let tagsToAdd: [String]?
        /// The target tag for a policy. Tags are strings in the format key=value.
        public let targetTags: [String]?

        public init(policyIds: [String]? = nil, resourceTypes: [ResourceTypeValues]? = nil, state: GettablePolicyStateValues? = nil, tagsToAdd: [String]? = nil, targetTags: [String]? = nil) {
            self.policyIds = policyIds
            self.resourceTypes = resourceTypes
            self.state = state
            self.tagsToAdd = tagsToAdd
            self.targetTags = targetTags
        }

        public func validate(name: String) throws {
            try self.policyIds?.forEach {
                try validate($0, name: "policyIds[]", parent: name, max: 64)
                try validate($0, name: "policyIds[]", parent: name, min: 0)
                try validate($0, name: "policyIds[]", parent: name, pattern: "policy-[A-Za-z0-9]+")
            }
            try validate(self.resourceTypes, name: "resourceTypes", parent: name, max: 1)
            try validate(self.resourceTypes, name: "resourceTypes", parent: name, min: 1)
            try self.tagsToAdd?.forEach {
                try validate($0, name: "tagsToAdd[]", parent: name, max: 256)
                try validate($0, name: "tagsToAdd[]", parent: name, min: 0)
                try validate($0, name: "tagsToAdd[]", parent: name, pattern: "[\\p{all}]*")
            }
            try validate(self.tagsToAdd, name: "tagsToAdd", parent: name, max: 50)
            try validate(self.tagsToAdd, name: "tagsToAdd", parent: name, min: 0)
            try self.targetTags?.forEach {
                try validate($0, name: "targetTags[]", parent: name, max: 256)
                try validate($0, name: "targetTags[]", parent: name, min: 0)
                try validate($0, name: "targetTags[]", parent: name, pattern: "[\\p{all}]*")
            }
            try validate(self.targetTags, name: "targetTags", parent: name, max: 50)
            try validate(self.targetTags, name: "targetTags", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetLifecyclePoliciesResponse: AWSDecodableShape {

        /// Summary information about the lifecycle policies.
        public let policies: [LifecyclePolicySummary]?

        public init(policies: [LifecyclePolicySummary]? = nil) {
            self.policies = policies
        }

        private enum CodingKeys: String, CodingKey {
            case policies = "Policies"
        }
    }

    public struct GetLifecyclePolicyRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "policyId", location: .uri(locationName: "policyId"))
        ]

        /// The identifier of the lifecycle policy.
        public let policyId: String

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

        public func validate(name: String) throws {
            try validate(self.policyId, name: "policyId", parent: name, max: 64)
            try validate(self.policyId, name: "policyId", parent: name, min: 0)
            try validate(self.policyId, name: "policyId", parent: name, pattern: "policy-[A-Za-z0-9]+")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetLifecyclePolicyResponse: AWSDecodableShape {

        /// Detailed information about the lifecycle policy.
        public let policy: LifecyclePolicy?

        public init(policy: LifecyclePolicy? = nil) {
            self.policy = policy
        }

        private enum CodingKeys: String, CodingKey {
            case policy = "Policy"
        }
    }

    public struct LifecyclePolicy: AWSDecodableShape {

        /// The local date and time when the lifecycle policy was created.
        public let dateCreated: TimeStamp?
        /// The local date and time when the lifecycle policy was last modified.
        public let dateModified: TimeStamp?
        /// The description of the lifecycle policy.
        public let description: String?
        /// The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.
        public let executionRoleArn: String?
        /// The Amazon Resource Name (ARN) of the policy.
        public let policyArn: String?
        /// The configuration of the lifecycle policy
        public let policyDetails: PolicyDetails?
        /// The identifier of the lifecycle policy.
        public let policyId: String?
        /// The activation state of the lifecycle policy.
        public let state: GettablePolicyStateValues?
        /// The description of the status.
        public let statusMessage: String?
        /// The tags.
        public let tags: [String: String]?

        public init(dateCreated: TimeStamp? = nil, dateModified: TimeStamp? = nil, description: String? = nil, executionRoleArn: String? = nil, policyArn: String? = nil, policyDetails: PolicyDetails? = nil, policyId: String? = nil, state: GettablePolicyStateValues? = nil, statusMessage: String? = nil, tags: [String: String]? = nil) {
            self.dateCreated = dateCreated
            self.dateModified = dateModified
            self.description = description
            self.executionRoleArn = executionRoleArn
            self.policyArn = policyArn
            self.policyDetails = policyDetails
            self.policyId = policyId
            self.state = state
            self.statusMessage = statusMessage
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case dateCreated = "DateCreated"
            case dateModified = "DateModified"
            case description = "Description"
            case executionRoleArn = "ExecutionRoleArn"
            case policyArn = "PolicyArn"
            case policyDetails = "PolicyDetails"
            case policyId = "PolicyId"
            case state = "State"
            case statusMessage = "StatusMessage"
            case tags = "Tags"
        }
    }

    public struct LifecyclePolicySummary: AWSDecodableShape {

        /// The description of the lifecycle policy.
        public let description: String?
        /// The identifier of the lifecycle policy.
        public let policyId: String?
        /// The activation state of the lifecycle policy.
        public let state: GettablePolicyStateValues?
        /// The tags.
        public let tags: [String: String]?

        public init(description: String? = nil, policyId: String? = nil, state: GettablePolicyStateValues? = nil, tags: [String: String]? = nil) {
            self.description = description
            self.policyId = policyId
            self.state = state
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case policyId = "PolicyId"
            case state = "State"
            case tags = "Tags"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri(locationName: "resourceArn"))
        ]

        /// The Amazon Resource Name (ARN) of the resource.
        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: 2048)
            try validate(self.resourceArn, name: "resourceArn", parent: name, min: 0)
            try validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws(-[a-z]{1,3}){0,2}:dlm:[A-Za-z0-9_/.-]{0,63}:\\d+:policy/[0-9A-Za-z_-]{1,128}$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {

        /// Information about the tags.
        public let tags: [String: String]?

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

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

    public struct Parameters: AWSEncodableShape & AWSDecodableShape {

        /// [EBS Snapshot Management – Instance policies only] Indicates whether to exclude the root volume from snapshots created using CreateSnapshots. The default is false.
        public let excludeBootVolume: Bool?

        public init(excludeBootVolume: Bool? = nil) {
            self.excludeBootVolume = excludeBootVolume
        }

        private enum CodingKeys: String, CodingKey {
            case excludeBootVolume = "ExcludeBootVolume"
        }
    }

    public struct PolicyDetails: AWSEncodableShape & AWSDecodableShape {

        /// A set of optional parameters for the policy. 
        public let parameters: Parameters?
        /// The valid target resource types and actions a policy can manage. The default is EBS_SNAPSHOT_MANAGEMENT.
        public let policyType: PolicyTypeValues?
        /// The resource type.
        public let resourceTypes: [ResourceTypeValues]?
        /// The schedule of policy-defined actions.
        public let schedules: [Schedule]?
        /// The single tag that identifies targeted resources for this policy.
        public let targetTags: [Tag]?

        public init(parameters: Parameters? = nil, policyType: PolicyTypeValues? = nil, resourceTypes: [ResourceTypeValues]? = nil, schedules: [Schedule]? = nil, targetTags: [Tag]? = nil) {
            self.parameters = parameters
            self.policyType = policyType
            self.resourceTypes = resourceTypes
            self.schedules = schedules
            self.targetTags = targetTags
        }

        public func validate(name: String) throws {
            try validate(self.resourceTypes, name: "resourceTypes", parent: name, max: 1)
            try validate(self.resourceTypes, name: "resourceTypes", parent: name, min: 1)
            try self.schedules?.forEach {
                try $0.validate(name: "\(name).schedules[]")
            }
            try validate(self.schedules, name: "schedules", parent: name, max: 1)
            try validate(self.schedules, name: "schedules", parent: name, min: 1)
            try self.targetTags?.forEach {
                try $0.validate(name: "\(name).targetTags[]")
            }
            try validate(self.targetTags, name: "targetTags", parent: name, max: 50)
            try validate(self.targetTags, name: "targetTags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case parameters = "Parameters"
            case policyType = "PolicyType"
            case resourceTypes = "ResourceTypes"
            case schedules = "Schedules"
            case targetTags = "TargetTags"
        }
    }

    public struct RetainRule: AWSEncodableShape & AWSDecodableShape {

        /// The number of snapshots to retain for each volume, up to a maximum of 1000.
        public let count: Int?
        /// The amount of time to retain each snapshot. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.
        public let interval: Int?
        /// The unit of time for time-based retention.
        public let intervalUnit: RetentionIntervalUnitValues?

        public init(count: Int? = nil, interval: Int? = nil, intervalUnit: RetentionIntervalUnitValues? = nil) {
            self.count = count
            self.interval = interval
            self.intervalUnit = intervalUnit
        }

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

        private enum CodingKeys: String, CodingKey {
            case count = "Count"
            case interval = "Interval"
            case intervalUnit = "IntervalUnit"
        }
    }

    public struct Schedule: AWSEncodableShape & AWSDecodableShape {

        /// Copy all user-defined tags on a source volume to snapshots of the volume created by this policy.
        public let copyTags: Bool?
        /// The creation rule.
        public let createRule: CreateRule?
        /// The rule for cross-Region snapshot copies.
        public let crossRegionCopyRules: [CrossRegionCopyRule]?
        /// The rule for enabling fast snapshot restore.
        public let fastRestoreRule: FastRestoreRule?
        /// The name of the schedule.
        public let name: String?
        /// The retention rule.
        public let retainRule: RetainRule?
        /// The tags to apply to policy-created resources. These user-defined tags are in addition to the AWS-added lifecycle tags.
        public let tagsToAdd: [Tag]?
        /// A collection of key/value pairs with values determined dynamically when the policy is executed. Keys may be any valid Amazon EC2 tag key. Values must be in one of the two following formats: $(instance-id) or $(timestamp). Variable tags are only valid for EBS Snapshot Management – Instance policies.
        public let variableTags: [Tag]?

        public init(copyTags: Bool? = nil, createRule: CreateRule? = nil, crossRegionCopyRules: [CrossRegionCopyRule]? = nil, fastRestoreRule: FastRestoreRule? = nil, name: String? = nil, retainRule: RetainRule? = nil, tagsToAdd: [Tag]? = nil, variableTags: [Tag]? = nil) {
            self.copyTags = copyTags
            self.createRule = createRule
            self.crossRegionCopyRules = crossRegionCopyRules
            self.fastRestoreRule = fastRestoreRule
            self.name = name
            self.retainRule = retainRule
            self.tagsToAdd = tagsToAdd
            self.variableTags = variableTags
        }

        public func validate(name: String) throws {
            try self.createRule?.validate(name: "\(name).createRule")
            try self.crossRegionCopyRules?.forEach {
                try $0.validate(name: "\(name).crossRegionCopyRules[]")
            }
            try validate(self.crossRegionCopyRules, name: "crossRegionCopyRules", parent: name, max: 3)
            try validate(self.crossRegionCopyRules, name: "crossRegionCopyRules", parent: name, min: 0)
            try self.fastRestoreRule?.validate(name: "\(name).fastRestoreRule")
            try validate(self.name, name: "name", parent: name, max: 500)
            try validate(self.name, name: "name", parent: name, min: 0)
            try validate(self.name, name: "name", parent: name, pattern: "[\\p{all}]*")
            try self.retainRule?.validate(name: "\(name).retainRule")
            try self.tagsToAdd?.forEach {
                try $0.validate(name: "\(name).tagsToAdd[]")
            }
            try validate(self.tagsToAdd, name: "tagsToAdd", parent: name, max: 45)
            try validate(self.tagsToAdd, name: "tagsToAdd", parent: name, min: 0)
            try self.variableTags?.forEach {
                try $0.validate(name: "\(name).variableTags[]")
            }
            try validate(self.variableTags, name: "variableTags", parent: name, max: 45)
            try validate(self.variableTags, name: "variableTags", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case copyTags = "CopyTags"
            case createRule = "CreateRule"
            case crossRegionCopyRules = "CrossRegionCopyRules"
            case fastRestoreRule = "FastRestoreRule"
            case name = "Name"
            case retainRule = "RetainRule"
            case tagsToAdd = "TagsToAdd"
            case variableTags = "VariableTags"
        }
    }

    public struct Tag: AWSEncodableShape & AWSDecodableShape {

        /// The tag key.
        public let key: String
        /// The tag value.
        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: 500)
            try validate(self.key, name: "key", parent: name, min: 0)
            try validate(self.key, name: "key", parent: name, pattern: "[\\p{all}]*")
            try validate(self.value, name: "value", parent: name, max: 500)
            try validate(self.value, name: "value", parent: name, min: 0)
            try validate(self.value, name: "value", parent: name, pattern: "[\\p{all}]*")
        }

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

    public struct TagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri(locationName: "resourceArn"))
        ]

        /// The Amazon Resource Name (ARN) of the resource.
        public let resourceArn: String
        /// One or more tags.
        public let tags: [String: String]

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

        public func validate(name: String) throws {
            try validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try validate(self.resourceArn, name: "resourceArn", parent: name, min: 0)
            try validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws(-[a-z]{1,3}){0,2}:dlm:[A-Za-z0-9_/.-]{0,63}:\\d+:policy/[0-9A-Za-z_-]{1,128}$")
            try self.tags.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, pattern: "[\\p{all}]*")
            }
        }

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

    public struct TagResourceResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct UntagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri(locationName: "resourceArn")), 
            AWSMemberEncoding(label: "tagKeys", location: .querystring(locationName: "tagKeys"))
        ]

        /// The Amazon Resource Name (ARN) of the resource.
        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: 2048)
            try validate(self.resourceArn, name: "resourceArn", parent: name, min: 0)
            try validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws(-[a-z]{1,3}){0,2}:dlm:[A-Za-z0-9_/.-]{0,63}:\\d+:policy/[0-9A-Za-z_-]{1,128}$")
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
                try validate($0, name: "tagKeys[]", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
            }
            try validate(self.tagKeys, name: "tagKeys", parent: name, max: 200)
            try validate(self.tagKeys, name: "tagKeys", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct UntagResourceResponse: AWSDecodableShape {


        public init() {
        }

    }

    public struct UpdateLifecyclePolicyRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "policyId", location: .uri(locationName: "policyId"))
        ]

        /// A description of the lifecycle policy.
        public let description: String?
        /// The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.
        public let executionRoleArn: String?
        /// The configuration of the lifecycle policy. You cannot update the policy type or the resource type.
        public let policyDetails: PolicyDetails?
        /// The identifier of the lifecycle policy.
        public let policyId: String
        /// The desired activation state of the lifecycle policy after creation.
        public let state: SettablePolicyStateValues?

        public init(description: String? = nil, executionRoleArn: String? = nil, policyDetails: PolicyDetails? = nil, policyId: String, state: SettablePolicyStateValues? = nil) {
            self.description = description
            self.executionRoleArn = executionRoleArn
            self.policyDetails = policyDetails
            self.policyId = policyId
            self.state = state
        }

        public func validate(name: String) throws {
            try validate(self.description, name: "description", parent: name, max: 500)
            try validate(self.description, name: "description", parent: name, min: 0)
            try validate(self.description, name: "description", parent: name, pattern: "[0-9A-Za-z _-]+")
            try validate(self.executionRoleArn, name: "executionRoleArn", parent: name, max: 2048)
            try validate(self.executionRoleArn, name: "executionRoleArn", parent: name, min: 0)
            try validate(self.executionRoleArn, name: "executionRoleArn", parent: name, pattern: "arn:aws(-[a-z]{1,3}){0,2}:iam::\\d+:role/.*")
            try self.policyDetails?.validate(name: "\(name).policyDetails")
            try validate(self.policyId, name: "policyId", parent: name, max: 64)
            try validate(self.policyId, name: "policyId", parent: name, min: 0)
            try validate(self.policyId, name: "policyId", parent: name, pattern: "policy-[A-Za-z0-9]+")
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case executionRoleArn = "ExecutionRoleArn"
            case policyDetails = "PolicyDetails"
            case state = "State"
        }
    }

    public struct UpdateLifecyclePolicyResponse: AWSDecodableShape {


        public init() {
        }

    }
}
