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

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto/tree/main/CodeGenerator. DO NOT EDIT.

import Foundation
import SotoCore

extension QLDB {
    // MARK: Enums

    public enum ErrorCause: String, CustomStringConvertible, Codable {
        case iamPermissionRevoked = "IAM_PERMISSION_REVOKED"
        case kinesisStreamNotFound = "KINESIS_STREAM_NOT_FOUND"
        public var description: String { return self.rawValue }
    }

    public enum ExportStatus: String, CustomStringConvertible, Codable {
        case cancelled = "CANCELLED"
        case completed = "COMPLETED"
        case inProgress = "IN_PROGRESS"
        public var description: String { return self.rawValue }
    }

    public enum LedgerState: String, CustomStringConvertible, Codable {
        case active = "ACTIVE"
        case creating = "CREATING"
        case deleted = "DELETED"
        case deleting = "DELETING"
        public var description: String { return self.rawValue }
    }

    public enum PermissionsMode: String, CustomStringConvertible, Codable {
        case allowAll = "ALLOW_ALL"
        public var description: String { return self.rawValue }
    }

    public enum S3ObjectEncryptionType: String, CustomStringConvertible, Codable {
        case noEncryption = "NO_ENCRYPTION"
        case sseKms = "SSE_KMS"
        case sseS3 = "SSE_S3"
        public var description: String { return self.rawValue }
    }

    public enum StreamStatus: String, CustomStringConvertible, Codable {
        case active = "ACTIVE"
        case canceled = "CANCELED"
        case completed = "COMPLETED"
        case failed = "FAILED"
        case impaired = "IMPAIRED"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct CancelJournalKinesisStreamRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "ledgerName", location: .uri(locationName: "name")),
            AWSMemberEncoding(label: "streamId", location: .uri(locationName: "streamId"))
        ]

        /// The name of the ledger.
        public let ledgerName: String
        /// The unique ID that QLDB assigns to each QLDB journal stream.
        public let streamId: String

        public init(ledgerName: String, streamId: String) {
            self.ledgerName = ledgerName
            self.streamId = streamId
        }

        public func validate(name: String) throws {
            try self.validate(self.ledgerName, name: "ledgerName", parent: name, max: 32)
            try self.validate(self.ledgerName, name: "ledgerName", parent: name, min: 1)
            try self.validate(self.ledgerName, name: "ledgerName", parent: name, pattern: "(?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$")
            try self.validate(self.streamId, name: "streamId", parent: name, max: 22)
            try self.validate(self.streamId, name: "streamId", parent: name, min: 22)
            try self.validate(self.streamId, name: "streamId", parent: name, pattern: "^[A-Za-z-0-9]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct CancelJournalKinesisStreamResponse: AWSDecodableShape {
        /// The unique ID that QLDB assigns to each QLDB journal stream.
        public let streamId: String?

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

        private enum CodingKeys: String, CodingKey {
            case streamId = "StreamId"
        }
    }

    public struct CreateLedgerRequest: AWSEncodableShape {
        /// The flag that prevents a ledger from being deleted by any user. If not provided on ledger creation, this feature is enabled (true) by default. If deletion protection is enabled, you must first disable it before you can delete the ledger using the QLDB API or the AWS Command Line Interface (AWS CLI). You can disable it by calling the UpdateLedger operation to set the flag to false. The QLDB console disables deletion protection for you when you use it to delete a ledger.
        public let deletionProtection: Bool?
        /// The name of the ledger that you want to create. The name must be unique among all of your ledgers in the current AWS Region. Naming constraints for ledger names are defined in Quotas in Amazon QLDB in the Amazon QLDB Developer Guide.
        public let name: String
        /// The permissions mode to assign to the ledger that you want to create.
        public let permissionsMode: PermissionsMode
        /// The key-value pairs to add as tags to the ledger that you want to create. Tag keys are case sensitive. Tag values are case sensitive and can be null.
        public let tags: [String: String]?

        public init(deletionProtection: Bool? = nil, name: String, permissionsMode: PermissionsMode, tags: [String: String]? = nil) {
            self.deletionProtection = deletionProtection
            self.name = name
            self.permissionsMode = permissionsMode
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 32)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "(?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$")
            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.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, min: 0)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case deletionProtection = "DeletionProtection"
            case name = "Name"
            case permissionsMode = "PermissionsMode"
            case tags = "Tags"
        }
    }

    public struct CreateLedgerResponse: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) for the ledger.
        public let arn: String?
        /// The date and time, in epoch time format, when the ledger was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)
        public let creationDateTime: Date?
        /// The flag that prevents a ledger from being deleted by any user. If not provided on ledger creation, this feature is enabled (true) by default. If deletion protection is enabled, you must first disable it before you can delete the ledger using the QLDB API or the AWS Command Line Interface (AWS CLI). You can disable it by calling the UpdateLedger operation to set the flag to false. The QLDB console disables deletion protection for you when you use it to delete a ledger.
        public let deletionProtection: Bool?
        /// The name of the ledger.
        public let name: String?
        /// The current status of the ledger.
        public let state: LedgerState?

        public init(arn: String? = nil, creationDateTime: Date? = nil, deletionProtection: Bool? = nil, name: String? = nil, state: LedgerState? = nil) {
            self.arn = arn
            self.creationDateTime = creationDateTime
            self.deletionProtection = deletionProtection
            self.name = name
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case creationDateTime = "CreationDateTime"
            case deletionProtection = "DeletionProtection"
            case name = "Name"
            case state = "State"
        }
    }

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

        /// The name of the ledger that you want to delete.
        public let name: String

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

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 32)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "(?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DescribeJournalKinesisStreamRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "ledgerName", location: .uri(locationName: "name")),
            AWSMemberEncoding(label: "streamId", location: .uri(locationName: "streamId"))
        ]

        /// The name of the ledger.
        public let ledgerName: String
        /// The unique ID that QLDB assigns to each QLDB journal stream.
        public let streamId: String

        public init(ledgerName: String, streamId: String) {
            self.ledgerName = ledgerName
            self.streamId = streamId
        }

        public func validate(name: String) throws {
            try self.validate(self.ledgerName, name: "ledgerName", parent: name, max: 32)
            try self.validate(self.ledgerName, name: "ledgerName", parent: name, min: 1)
            try self.validate(self.ledgerName, name: "ledgerName", parent: name, pattern: "(?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$")
            try self.validate(self.streamId, name: "streamId", parent: name, max: 22)
            try self.validate(self.streamId, name: "streamId", parent: name, min: 22)
            try self.validate(self.streamId, name: "streamId", parent: name, pattern: "^[A-Za-z-0-9]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DescribeJournalKinesisStreamResponse: AWSDecodableShape {
        /// Information about the QLDB journal stream returned by a DescribeJournalS3Export request.
        public let stream: JournalKinesisStreamDescription?

        public init(stream: JournalKinesisStreamDescription? = nil) {
            self.stream = stream
        }

        private enum CodingKeys: String, CodingKey {
            case stream = "Stream"
        }
    }

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

        /// The unique ID of the journal export job that you want to describe.
        public let exportId: String
        /// The name of the ledger.
        public let name: String

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

        public func validate(name: String) throws {
            try self.validate(self.exportId, name: "exportId", parent: name, max: 22)
            try self.validate(self.exportId, name: "exportId", parent: name, min: 22)
            try self.validate(self.exportId, name: "exportId", parent: name, pattern: "^[A-Za-z-0-9]+$")
            try self.validate(self.name, name: "name", parent: name, max: 32)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "(?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DescribeJournalS3ExportResponse: AWSDecodableShape {
        /// Information about the journal export job returned by a DescribeJournalS3Export request.
        public let exportDescription: JournalS3ExportDescription

        public init(exportDescription: JournalS3ExportDescription) {
            self.exportDescription = exportDescription
        }

        private enum CodingKeys: String, CodingKey {
            case exportDescription = "ExportDescription"
        }
    }

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

        /// The name of the ledger that you want to describe.
        public let name: String

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

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 32)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "(?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DescribeLedgerResponse: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) for the ledger.
        public let arn: String?
        /// The date and time, in epoch time format, when the ledger was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)
        public let creationDateTime: Date?
        /// The flag that prevents a ledger from being deleted by any user. If not provided on ledger creation, this feature is enabled (true) by default. If deletion protection is enabled, you must first disable it before you can delete the ledger using the QLDB API or the AWS Command Line Interface (AWS CLI). You can disable it by calling the UpdateLedger operation to set the flag to false. The QLDB console disables deletion protection for you when you use it to delete a ledger.
        public let deletionProtection: Bool?
        /// The name of the ledger.
        public let name: String?
        /// The current status of the ledger.
        public let state: LedgerState?

        public init(arn: String? = nil, creationDateTime: Date? = nil, deletionProtection: Bool? = nil, name: String? = nil, state: LedgerState? = nil) {
            self.arn = arn
            self.creationDateTime = creationDateTime
            self.deletionProtection = deletionProtection
            self.name = name
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case creationDateTime = "CreationDateTime"
            case deletionProtection = "DeletionProtection"
            case name = "Name"
            case state = "State"
        }
    }

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

        /// The exclusive end date and time for the range of journal contents that you want to export. The ExclusiveEndTime must be in ISO 8601 date and time format and in Universal Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z  The ExclusiveEndTime must be less than or equal to the current UTC date and time.
        public let exclusiveEndTime: Date
        /// The inclusive start date and time for the range of journal contents that you want to export. The InclusiveStartTime must be in ISO 8601 date and time format and in Universal Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z  The InclusiveStartTime must be before ExclusiveEndTime. If you provide an InclusiveStartTime that is before the ledger's CreationDateTime, Amazon QLDB defaults it to the ledger's CreationDateTime.
        public let inclusiveStartTime: Date
        /// The name of the ledger.
        public let name: String
        /// The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal export job to do the following:   Write objects into your Amazon Simple Storage Service (Amazon S3) bucket.   (Optional) Use your customer master key (CMK) in AWS Key Management Service (AWS KMS) for server-side encryption of your exported data.
        public let roleArn: String
        /// The configuration settings of the Amazon S3 bucket destination for your export request.
        public let s3ExportConfiguration: S3ExportConfiguration

        public init(exclusiveEndTime: Date, inclusiveStartTime: Date, name: String, roleArn: String, s3ExportConfiguration: S3ExportConfiguration) {
            self.exclusiveEndTime = exclusiveEndTime
            self.inclusiveStartTime = inclusiveStartTime
            self.name = name
            self.roleArn = roleArn
            self.s3ExportConfiguration = s3ExportConfiguration
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 32)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "(?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$")
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 1600)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 20)
            try self.s3ExportConfiguration.validate(name: "\(name).s3ExportConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case exclusiveEndTime = "ExclusiveEndTime"
            case inclusiveStartTime = "InclusiveStartTime"
            case roleArn = "RoleArn"
            case s3ExportConfiguration = "S3ExportConfiguration"
        }
    }

    public struct ExportJournalToS3Response: AWSDecodableShape {
        /// The unique ID that QLDB assigns to each journal export job. To describe your export request and check the status of the job, you can use ExportId to call DescribeJournalS3Export.
        public let exportId: String

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

        private enum CodingKeys: String, CodingKey {
            case exportId = "ExportId"
        }
    }

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

        /// The location of the block that you want to request. An address is an Amazon Ion structure that has two fields: strandId and sequenceNo. For example: {strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:14}
        public let blockAddress: ValueHolder
        /// The latest block location covered by the digest for which to request a proof. An address is an Amazon Ion structure that has two fields: strandId and sequenceNo. For example: {strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:49}
        public let digestTipAddress: ValueHolder?
        /// The name of the ledger.
        public let name: String

        public init(blockAddress: ValueHolder, digestTipAddress: ValueHolder? = nil, name: String) {
            self.blockAddress = blockAddress
            self.digestTipAddress = digestTipAddress
            self.name = name
        }

        public func validate(name: String) throws {
            try self.blockAddress.validate(name: "\(name).blockAddress")
            try self.digestTipAddress?.validate(name: "\(name).digestTipAddress")
            try self.validate(self.name, name: "name", parent: name, max: 32)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "(?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case blockAddress = "BlockAddress"
            case digestTipAddress = "DigestTipAddress"
        }
    }

    public struct GetBlockResponse: AWSDecodableShape {
        /// The block data object in Amazon Ion format.
        public let block: ValueHolder
        /// The proof object in Amazon Ion format returned by a GetBlock request. A proof contains the list of hash values required to recalculate the specified digest using a Merkle tree, starting with the specified block.
        public let proof: ValueHolder?

        public init(block: ValueHolder, proof: ValueHolder? = nil) {
            self.block = block
            self.proof = proof
        }

        private enum CodingKeys: String, CodingKey {
            case block = "Block"
            case proof = "Proof"
        }
    }

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

        /// The name of the ledger.
        public let name: String

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

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 32)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "(?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetDigestResponse: AWSDecodableShape {
        /// The 256-bit hash value representing the digest returned by a GetDigest request.
        public let digest: Data
        /// The latest block location covered by the digest that you requested. An address is an Amazon Ion structure that has two fields: strandId and sequenceNo.
        public let digestTipAddress: ValueHolder

        public init(digest: Data, digestTipAddress: ValueHolder) {
            self.digest = digest
            self.digestTipAddress = digestTipAddress
        }

        private enum CodingKeys: String, CodingKey {
            case digest = "Digest"
            case digestTipAddress = "DigestTipAddress"
        }
    }

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

        /// The block location of the document revision to be verified. An address is an Amazon Ion structure that has two fields: strandId and sequenceNo. For example: {strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:14}
        public let blockAddress: ValueHolder
        /// The latest block location covered by the digest for which to request a proof. An address is an Amazon Ion structure that has two fields: strandId and sequenceNo. For example: {strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:49}
        public let digestTipAddress: ValueHolder?
        /// The unique ID of the document to be verified.
        public let documentId: String
        /// The name of the ledger.
        public let name: String

        public init(blockAddress: ValueHolder, digestTipAddress: ValueHolder? = nil, documentId: String, name: String) {
            self.blockAddress = blockAddress
            self.digestTipAddress = digestTipAddress
            self.documentId = documentId
            self.name = name
        }

        public func validate(name: String) throws {
            try self.blockAddress.validate(name: "\(name).blockAddress")
            try self.digestTipAddress?.validate(name: "\(name).digestTipAddress")
            try self.validate(self.documentId, name: "documentId", parent: name, max: 22)
            try self.validate(self.documentId, name: "documentId", parent: name, min: 22)
            try self.validate(self.documentId, name: "documentId", parent: name, pattern: "^[A-Za-z-0-9]+$")
            try self.validate(self.name, name: "name", parent: name, max: 32)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "(?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case blockAddress = "BlockAddress"
            case digestTipAddress = "DigestTipAddress"
            case documentId = "DocumentId"
        }
    }

    public struct GetRevisionResponse: AWSDecodableShape {
        /// The proof object in Amazon Ion format returned by a GetRevision request. A proof contains the list of hash values that are required to recalculate the specified digest using a Merkle tree, starting with the specified document revision.
        public let proof: ValueHolder?
        /// The document revision data object in Amazon Ion format.
        public let revision: ValueHolder

        public init(proof: ValueHolder? = nil, revision: ValueHolder) {
            self.proof = proof
            self.revision = revision
        }

        private enum CodingKeys: String, CodingKey {
            case proof = "Proof"
            case revision = "Revision"
        }
    }

    public struct JournalKinesisStreamDescription: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the QLDB journal stream.
        public let arn: String?
        /// The date and time, in epoch time format, when the QLDB journal stream was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)
        public let creationTime: Date?
        /// The error message that describes the reason that a stream has a status of IMPAIRED or FAILED. This is not applicable to streams that have other status values.
        public let errorCause: ErrorCause?
        /// The exclusive date and time that specifies when the stream ends. If this parameter is blank, the stream runs indefinitely until you cancel it.
        public let exclusiveEndTime: Date?
        /// The inclusive start date and time from which to start streaming journal data.
        public let inclusiveStartTime: Date?
        /// The configuration settings of the Amazon Kinesis Data Streams destination for your QLDB journal stream.
        public let kinesisConfiguration: KinesisConfiguration
        /// The name of the ledger.
        public let ledgerName: String
        /// The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal stream to write data records to a Kinesis Data Streams resource.
        public let roleArn: String
        /// The current state of the QLDB journal stream.
        public let status: StreamStatus
        /// The unique ID that QLDB assigns to each QLDB journal stream.
        public let streamId: String
        /// The user-defined name of the QLDB journal stream.
        public let streamName: String

        public init(arn: String? = nil, creationTime: Date? = nil, errorCause: ErrorCause? = nil, exclusiveEndTime: Date? = nil, inclusiveStartTime: Date? = nil, kinesisConfiguration: KinesisConfiguration, ledgerName: String, roleArn: String, status: StreamStatus, streamId: String, streamName: String) {
            self.arn = arn
            self.creationTime = creationTime
            self.errorCause = errorCause
            self.exclusiveEndTime = exclusiveEndTime
            self.inclusiveStartTime = inclusiveStartTime
            self.kinesisConfiguration = kinesisConfiguration
            self.ledgerName = ledgerName
            self.roleArn = roleArn
            self.status = status
            self.streamId = streamId
            self.streamName = streamName
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case creationTime = "CreationTime"
            case errorCause = "ErrorCause"
            case exclusiveEndTime = "ExclusiveEndTime"
            case inclusiveStartTime = "InclusiveStartTime"
            case kinesisConfiguration = "KinesisConfiguration"
            case ledgerName = "LedgerName"
            case roleArn = "RoleArn"
            case status = "Status"
            case streamId = "StreamId"
            case streamName = "StreamName"
        }
    }

    public struct JournalS3ExportDescription: AWSDecodableShape {
        /// The exclusive end date and time for the range of journal contents that are specified in the original export request.
        public let exclusiveEndTime: Date
        /// The date and time, in epoch time format, when the export job was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)
        public let exportCreationTime: Date
        /// The unique ID of the journal export job.
        public let exportId: String
        /// The inclusive start date and time for the range of journal contents that are specified in the original export request.
        public let inclusiveStartTime: Date
        /// The name of the ledger.
        public let ledgerName: String
        /// The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal export job to do the following:   Write objects into your Amazon Simple Storage Service (Amazon S3) bucket.   (Optional) Use your customer master key (CMK) in AWS Key Management Service (AWS KMS) for server-side encryption of your exported data.
        public let roleArn: String
        public let s3ExportConfiguration: S3ExportConfiguration
        /// The current state of the journal export job.
        public let status: ExportStatus

        public init(exclusiveEndTime: Date, exportCreationTime: Date, exportId: String, inclusiveStartTime: Date, ledgerName: String, roleArn: String, s3ExportConfiguration: S3ExportConfiguration, status: ExportStatus) {
            self.exclusiveEndTime = exclusiveEndTime
            self.exportCreationTime = exportCreationTime
            self.exportId = exportId
            self.inclusiveStartTime = inclusiveStartTime
            self.ledgerName = ledgerName
            self.roleArn = roleArn
            self.s3ExportConfiguration = s3ExportConfiguration
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case exclusiveEndTime = "ExclusiveEndTime"
            case exportCreationTime = "ExportCreationTime"
            case exportId = "ExportId"
            case inclusiveStartTime = "InclusiveStartTime"
            case ledgerName = "LedgerName"
            case roleArn = "RoleArn"
            case s3ExportConfiguration = "S3ExportConfiguration"
            case status = "Status"
        }
    }

    public struct KinesisConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Enables QLDB to publish multiple data records in a single Kinesis Data Streams record. To learn more, see KPL Key Concepts in the Amazon Kinesis Data Streams Developer Guide.
        public let aggregationEnabled: Bool?
        /// The Amazon Resource Name (ARN) of the Kinesis data stream resource.
        public let streamArn: String

        public init(aggregationEnabled: Bool? = nil, streamArn: String) {
            self.aggregationEnabled = aggregationEnabled
            self.streamArn = streamArn
        }

        public func validate(name: String) throws {
            try self.validate(self.streamArn, name: "streamArn", parent: name, max: 1600)
            try self.validate(self.streamArn, name: "streamArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case aggregationEnabled = "AggregationEnabled"
            case streamArn = "StreamArn"
        }
    }

    public struct LedgerSummary: AWSDecodableShape {
        /// The date and time, in epoch time format, when the ledger was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)
        public let creationDateTime: Date?
        /// The name of the ledger.
        public let name: String?
        /// The current status of the ledger.
        public let state: LedgerState?

        public init(creationDateTime: Date? = nil, name: String? = nil, state: LedgerState? = nil) {
            self.creationDateTime = creationDateTime
            self.name = name
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case creationDateTime = "CreationDateTime"
            case name = "Name"
            case state = "State"
        }
    }

    public struct ListJournalKinesisStreamsForLedgerRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "ledgerName", location: .uri(locationName: "name")),
            AWSMemberEncoding(label: "maxResults", location: .querystring(locationName: "max_results")),
            AWSMemberEncoding(label: "nextToken", location: .querystring(locationName: "next_token"))
        ]

        /// The name of the ledger.
        public let ledgerName: String
        /// The maximum number of results to return in a single ListJournalKinesisStreamsForLedger request. (The actual number of results returned might be fewer.)
        public let maxResults: Int?
        /// A pagination token, indicating that you want to retrieve the next page of results. If you received a value for NextToken in the response from a previous ListJournalKinesisStreamsForLedger call, you should use that value as input here.
        public let nextToken: String?

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

        public func validate(name: String) throws {
            try self.validate(self.ledgerName, name: "ledgerName", parent: name, max: 32)
            try self.validate(self.ledgerName, name: "ledgerName", parent: name, min: 1)
            try self.validate(self.ledgerName, name: "ledgerName", parent: name, pattern: "(?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 4)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[A-Za-z-0-9+/=]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListJournalKinesisStreamsForLedgerResponse: AWSDecodableShape {
        ///   If NextToken is empty, the last page of results has been processed and there are no more results to be retrieved.   If NextToken is not empty, more results are available. To retrieve the next page of results, use the value of NextToken in a subsequent ListJournalKinesisStreamsForLedger call.
        public let nextToken: String?
        /// The array of QLDB journal stream descriptors that are associated with the given ledger.
        public let streams: [JournalKinesisStreamDescription]?

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

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case streams = "Streams"
        }
    }

    public struct ListJournalS3ExportsForLedgerRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring(locationName: "max_results")),
            AWSMemberEncoding(label: "name", location: .uri(locationName: "name")),
            AWSMemberEncoding(label: "nextToken", location: .querystring(locationName: "next_token"))
        ]

        /// The maximum number of results to return in a single ListJournalS3ExportsForLedger request. (The actual number of results returned might be fewer.)
        public let maxResults: Int?
        /// The name of the ledger.
        public let name: String
        /// A pagination token, indicating that you want to retrieve the next page of results. If you received a value for NextToken in the response from a previous ListJournalS3ExportsForLedger call, then you should use that value as input here.
        public let nextToken: String?

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

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 32)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "(?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$")
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 4)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[A-Za-z-0-9+/=]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListJournalS3ExportsForLedgerResponse: AWSDecodableShape {
        /// The array of journal export job descriptions that are associated with the specified ledger.
        public let journalS3Exports: [JournalS3ExportDescription]?
        ///   If NextToken is empty, then the last page of results has been processed and there are no more results to be retrieved.   If NextToken is not empty, then there are more results available. To retrieve the next page of results, use the value of NextToken in a subsequent ListJournalS3ExportsForLedger call.
        public let nextToken: String?

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

        private enum CodingKeys: String, CodingKey {
            case journalS3Exports = "JournalS3Exports"
            case nextToken = "NextToken"
        }
    }

    public struct ListJournalS3ExportsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring(locationName: "max_results")),
            AWSMemberEncoding(label: "nextToken", location: .querystring(locationName: "next_token"))
        ]

        /// The maximum number of results to return in a single ListJournalS3Exports request. (The actual number of results returned might be fewer.)
        public let maxResults: Int?
        /// A pagination token, indicating that you want to retrieve the next page of results. If you received a value for NextToken in the response from a previous ListJournalS3Exports call, then you should use that value as input here.
        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 self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 4)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[A-Za-z-0-9+/=]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListJournalS3ExportsResponse: AWSDecodableShape {
        /// The array of journal export job descriptions for all ledgers that are associated with the current AWS account and Region.
        public let journalS3Exports: [JournalS3ExportDescription]?
        ///   If NextToken is empty, then the last page of results has been processed and there are no more results to be retrieved.   If NextToken is not empty, then there are more results available. To retrieve the next page of results, use the value of NextToken in a subsequent ListJournalS3Exports call.
        public let nextToken: String?

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

        private enum CodingKeys: String, CodingKey {
            case journalS3Exports = "JournalS3Exports"
            case nextToken = "NextToken"
        }
    }

    public struct ListLedgersRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring(locationName: "max_results")),
            AWSMemberEncoding(label: "nextToken", location: .querystring(locationName: "next_token"))
        ]

        /// The maximum number of results to return in a single ListLedgers request. (The actual number of results returned might be fewer.)
        public let maxResults: Int?
        /// A pagination token, indicating that you want to retrieve the next page of results. If you received a value for NextToken in the response from a previous ListLedgers call, then you should use that value as input here.
        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 self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 4)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[A-Za-z-0-9+/=]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListLedgersResponse: AWSDecodableShape {
        /// The array of ledger summaries that are associated with the current AWS account and Region.
        public let ledgers: [LedgerSummary]?
        /// A pagination token, indicating whether there are more results available:   If NextToken is empty, then the last page of results has been processed and there are no more results to be retrieved.   If NextToken is not empty, then there are more results available. To retrieve the next page of results, use the value of NextToken in a subsequent ListLedgers call.
        public let nextToken: String?

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

        private enum CodingKeys: String, CodingKey {
            case ledgers = "Ledgers"
            case nextToken = "NextToken"
        }
    }

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

        /// The Amazon Resource Name (ARN) for which you want to list the tags. For example:  arn:aws:qldb:us-east-1:123456789012:ledger/exampleLedger
        public let resourceArn: String

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

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1600)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 20)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// The tags that are currently associated with the specified Amazon QLDB resource.
        public let tags: [String: String]?

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

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

    public struct S3EncryptionConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The Amazon Resource Name (ARN) for a symmetric customer master key (CMK) in AWS Key Management Service (AWS KMS). Amazon QLDB does not support asymmetric CMKs. You must provide a KmsKeyArn if you specify SSE_KMS as the ObjectEncryptionType.  KmsKeyArn is not required if you specify SSE_S3 as the ObjectEncryptionType.
        public let kmsKeyArn: String?
        /// The Amazon S3 object encryption type. To learn more about server-side encryption options in Amazon S3, see Protecting Data Using Server-Side Encryption in the Amazon S3 Developer Guide.
        public let objectEncryptionType: S3ObjectEncryptionType

        public init(kmsKeyArn: String? = nil, objectEncryptionType: S3ObjectEncryptionType) {
            self.kmsKeyArn = kmsKeyArn
            self.objectEncryptionType = objectEncryptionType
        }

        public func validate(name: String) throws {
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, max: 1600)
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case kmsKeyArn = "KmsKeyArn"
            case objectEncryptionType = "ObjectEncryptionType"
        }
    }

    public struct S3ExportConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The Amazon S3 bucket name in which a journal export job writes the journal contents. The bucket name must comply with the Amazon S3 bucket naming conventions. For more information, see Bucket Restrictions and Limitations in the Amazon S3 Developer Guide.
        public let bucket: String
        /// The encryption settings that are used by a journal export job to write data in an Amazon S3 bucket.
        public let encryptionConfiguration: S3EncryptionConfiguration
        /// The prefix for the Amazon S3 bucket in which a journal export job writes the journal contents. The prefix must comply with Amazon S3 key naming rules and restrictions. For more information, see Object Key and Metadata in the Amazon S3 Developer Guide. The following are examples of valid Prefix values:    JournalExports-ForMyLedger/Testing/     JournalExports     My:Tests/
        public let prefix: String

        public init(bucket: String, encryptionConfiguration: S3EncryptionConfiguration, prefix: String) {
            self.bucket = bucket
            self.encryptionConfiguration = encryptionConfiguration
            self.prefix = prefix
        }

        public func validate(name: String) throws {
            try self.validate(self.bucket, name: "bucket", parent: name, max: 255)
            try self.validate(self.bucket, name: "bucket", parent: name, min: 3)
            try self.validate(self.bucket, name: "bucket", parent: name, pattern: "^[A-Za-z-0-9-_.]+$")
            try self.encryptionConfiguration.validate(name: "\(name).encryptionConfiguration")
            try self.validate(self.prefix, name: "prefix", parent: name, max: 128)
            try self.validate(self.prefix, name: "prefix", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case bucket = "Bucket"
            case encryptionConfiguration = "EncryptionConfiguration"
            case prefix = "Prefix"
        }
    }

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

        /// The exclusive date and time that specifies when the stream ends. If you don't define this parameter, the stream runs indefinitely until you cancel it. The ExclusiveEndTime must be in ISO 8601 date and time format and in Universal Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z
        public let exclusiveEndTime: Date?
        /// The inclusive start date and time from which to start streaming journal data. This parameter must be in ISO 8601 date and time format and in Universal Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z  The InclusiveStartTime cannot be in the future and must be before ExclusiveEndTime. If you provide an InclusiveStartTime that is before the ledger's CreationDateTime, QLDB effectively defaults it to the ledger's CreationDateTime.
        public let inclusiveStartTime: Date
        /// The configuration settings of the Kinesis Data Streams destination for your stream request.
        public let kinesisConfiguration: KinesisConfiguration
        /// The name of the ledger.
        public let ledgerName: String
        /// The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal stream to write data records to a Kinesis Data Streams resource.
        public let roleArn: String
        /// The name that you want to assign to the QLDB journal stream. User-defined names can help identify and indicate the purpose of a stream. Your stream name must be unique among other active streams for a given ledger. Stream names have the same naming constraints as ledger names, as defined in Quotas in Amazon QLDB in the Amazon QLDB Developer Guide.
        public let streamName: String
        /// The key-value pairs to add as tags to the stream that you want to create. Tag keys are case sensitive. Tag values are case sensitive and can be null.
        public let tags: [String: String]?

        public init(exclusiveEndTime: Date? = nil, inclusiveStartTime: Date, kinesisConfiguration: KinesisConfiguration, ledgerName: String, roleArn: String, streamName: String, tags: [String: String]? = nil) {
            self.exclusiveEndTime = exclusiveEndTime
            self.inclusiveStartTime = inclusiveStartTime
            self.kinesisConfiguration = kinesisConfiguration
            self.ledgerName = ledgerName
            self.roleArn = roleArn
            self.streamName = streamName
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.kinesisConfiguration.validate(name: "\(name).kinesisConfiguration")
            try self.validate(self.ledgerName, name: "ledgerName", parent: name, max: 32)
            try self.validate(self.ledgerName, name: "ledgerName", parent: name, min: 1)
            try self.validate(self.ledgerName, name: "ledgerName", parent: name, pattern: "(?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$")
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 1600)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 20)
            try self.validate(self.streamName, name: "streamName", parent: name, max: 32)
            try self.validate(self.streamName, name: "streamName", parent: name, min: 1)
            try self.validate(self.streamName, name: "streamName", parent: name, pattern: "(?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$")
            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.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, min: 0)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case exclusiveEndTime = "ExclusiveEndTime"
            case inclusiveStartTime = "InclusiveStartTime"
            case kinesisConfiguration = "KinesisConfiguration"
            case roleArn = "RoleArn"
            case streamName = "StreamName"
            case tags = "Tags"
        }
    }

    public struct StreamJournalToKinesisResponse: AWSDecodableShape {
        /// The unique ID that QLDB assigns to each QLDB journal stream.
        public let streamId: String?

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

        private enum CodingKeys: String, CodingKey {
            case streamId = "StreamId"
        }
    }

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

        /// The Amazon Resource Name (ARN) to which you want to add the tags. For example:  arn:aws:qldb:us-east-1:123456789012:ledger/exampleLedger
        public let resourceArn: String
        /// The key-value pairs to add as tags to the specified QLDB resource. Tag keys are case sensitive. If you specify a key that already exists for the resource, your request fails and returns an error. Tag values are case sensitive and can be null.
        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 self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1600)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 20)
            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.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, min: 0)
            }
        }

        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) from which you want to remove the tags. For example:  arn:aws:qldb:us-east-1:123456789012:ledger/exampleLedger
        public let resourceArn: String
        /// The list of tag keys that you want to remove.
        public let tagKeys: [String]

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

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1600)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 20)
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 200)
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, min: 0)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

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

        /// The flag that prevents a ledger from being deleted by any user. If not provided on ledger creation, this feature is enabled (true) by default. If deletion protection is enabled, you must first disable it before you can delete the ledger using the QLDB API or the AWS Command Line Interface (AWS CLI). You can disable it by calling the UpdateLedger operation to set the flag to false. The QLDB console disables deletion protection for you when you use it to delete a ledger.
        public let deletionProtection: Bool?
        /// The name of the ledger.
        public let name: String

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

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 32)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "(?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case deletionProtection = "DeletionProtection"
        }
    }

    public struct UpdateLedgerResponse: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) for the ledger.
        public let arn: String?
        /// The date and time, in epoch time format, when the ledger was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)
        public let creationDateTime: Date?
        /// The flag that prevents a ledger from being deleted by any user. If not provided on ledger creation, this feature is enabled (true) by default. If deletion protection is enabled, you must first disable it before you can delete the ledger using the QLDB API or the AWS Command Line Interface (AWS CLI). You can disable it by calling the UpdateLedger operation to set the flag to false. The QLDB console disables deletion protection for you when you use it to delete a ledger.
        public let deletionProtection: Bool?
        /// The name of the ledger.
        public let name: String?
        /// The current status of the ledger.
        public let state: LedgerState?

        public init(arn: String? = nil, creationDateTime: Date? = nil, deletionProtection: Bool? = nil, name: String? = nil, state: LedgerState? = nil) {
            self.arn = arn
            self.creationDateTime = creationDateTime
            self.deletionProtection = deletionProtection
            self.name = name
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case creationDateTime = "CreationDateTime"
            case deletionProtection = "DeletionProtection"
            case name = "Name"
            case state = "State"
        }
    }

    public struct ValueHolder: AWSEncodableShape & AWSDecodableShape {
        /// An Amazon Ion plaintext value contained in a ValueHolder structure.
        public let ionText: String?

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

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

        private enum CodingKeys: String, CodingKey {
            case ionText = "IonText"
        }
    }
}
