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

    public enum AdditionalResultAttributeValueType: String, CustomStringConvertible, Codable {
        case textWithHighlightsValue = "TEXT_WITH_HIGHLIGHTS_VALUE"
        public var description: String { return self.rawValue }
    }

    public enum ConfluenceAttachmentFieldName: String, CustomStringConvertible, Codable {
        case author = "AUTHOR"
        case contentType = "CONTENT_TYPE"
        case createdDate = "CREATED_DATE"
        case displayUrl = "DISPLAY_URL"
        case fileSize = "FILE_SIZE"
        case itemType = "ITEM_TYPE"
        case parentId = "PARENT_ID"
        case spaceKey = "SPACE_KEY"
        case spaceName = "SPACE_NAME"
        case url = "URL"
        case version = "VERSION"
        public var description: String { return self.rawValue }
    }

    public enum ConfluenceBlogFieldName: String, CustomStringConvertible, Codable {
        case author = "AUTHOR"
        case displayUrl = "DISPLAY_URL"
        case itemType = "ITEM_TYPE"
        case labels = "LABELS"
        case publishDate = "PUBLISH_DATE"
        case spaceKey = "SPACE_KEY"
        case spaceName = "SPACE_NAME"
        case url = "URL"
        case version = "VERSION"
        public var description: String { return self.rawValue }
    }

    public enum ConfluencePageFieldName: String, CustomStringConvertible, Codable {
        case author = "AUTHOR"
        case contentStatus = "CONTENT_STATUS"
        case createdDate = "CREATED_DATE"
        case displayUrl = "DISPLAY_URL"
        case itemType = "ITEM_TYPE"
        case labels = "LABELS"
        case modifiedDate = "MODIFIED_DATE"
        case parentId = "PARENT_ID"
        case spaceKey = "SPACE_KEY"
        case spaceName = "SPACE_NAME"
        case url = "URL"
        case version = "VERSION"
        public var description: String { return self.rawValue }
    }

    public enum ConfluenceSpaceFieldName: String, CustomStringConvertible, Codable {
        case displayUrl = "DISPLAY_URL"
        case itemType = "ITEM_TYPE"
        case spaceKey = "SPACE_KEY"
        case url = "URL"
        public var description: String { return self.rawValue }
    }

    public enum ConfluenceVersion: String, CustomStringConvertible, Codable {
        case cloud = "CLOUD"
        case server = "SERVER"
        public var description: String { return self.rawValue }
    }

    public enum ContentType: String, CustomStringConvertible, Codable {
        case html = "HTML"
        case msWord = "MS_WORD"
        case pdf = "PDF"
        case plainText = "PLAIN_TEXT"
        case ppt = "PPT"
        public var description: String { return self.rawValue }
    }

    public enum DataSourceStatus: String, CustomStringConvertible, Codable {
        case active = "ACTIVE"
        case creating = "CREATING"
        case deleting = "DELETING"
        case failed = "FAILED"
        case updating = "UPDATING"
        public var description: String { return self.rawValue }
    }

    public enum DataSourceSyncJobStatus: String, CustomStringConvertible, Codable {
        case aborted = "ABORTED"
        case failed = "FAILED"
        case incomplete = "INCOMPLETE"
        case stopping = "STOPPING"
        case succeeded = "SUCCEEDED"
        case syncing = "SYNCING"
        case syncingIndexing = "SYNCING_INDEXING"
        public var description: String { return self.rawValue }
    }

    public enum DataSourceType: String, CustomStringConvertible, Codable {
        case confluence = "CONFLUENCE"
        case custom = "CUSTOM"
        case database = "DATABASE"
        case googledrive = "GOOGLEDRIVE"
        case onedrive = "ONEDRIVE"
        case s3 = "S3"
        case salesforce = "SALESFORCE"
        case servicenow = "SERVICENOW"
        case sharepoint = "SHAREPOINT"
        public var description: String { return self.rawValue }
    }

    public enum DatabaseEngineType: String, CustomStringConvertible, Codable {
        case rdsAuroraMysql = "RDS_AURORA_MYSQL"
        case rdsAuroraPostgresql = "RDS_AURORA_POSTGRESQL"
        case rdsMysql = "RDS_MYSQL"
        case rdsPostgresql = "RDS_POSTGRESQL"
        public var description: String { return self.rawValue }
    }

    public enum DocumentAttributeValueType: String, CustomStringConvertible, Codable {
        case dateValue = "DATE_VALUE"
        case longValue = "LONG_VALUE"
        case stringListValue = "STRING_LIST_VALUE"
        case stringValue = "STRING_VALUE"
        public var description: String { return self.rawValue }
    }

    public enum ErrorCode: String, CustomStringConvertible, Codable {
        case internalerror = "InternalError"
        case invalidrequest = "InvalidRequest"
        public var description: String { return self.rawValue }
    }

    public enum FaqFileFormat: String, CustomStringConvertible, Codable {
        case csv = "CSV"
        case csvWithHeader = "CSV_WITH_HEADER"
        case json = "JSON"
        public var description: String { return self.rawValue }
    }

    public enum FaqStatus: String, CustomStringConvertible, Codable {
        case active = "ACTIVE"
        case creating = "CREATING"
        case deleting = "DELETING"
        case failed = "FAILED"
        case updating = "UPDATING"
        public var description: String { return self.rawValue }
    }

    public enum HighlightType: String, CustomStringConvertible, Codable {
        case standard = "STANDARD"
        case thesaurusSynonym = "THESAURUS_SYNONYM"
        public var description: String { return self.rawValue }
    }

    public enum IndexEdition: String, CustomStringConvertible, Codable {
        case developerEdition = "DEVELOPER_EDITION"
        case enterpriseEdition = "ENTERPRISE_EDITION"
        public var description: String { return self.rawValue }
    }

    public enum IndexStatus: String, CustomStringConvertible, Codable {
        case active = "ACTIVE"
        case creating = "CREATING"
        case deleting = "DELETING"
        case failed = "FAILED"
        case systemUpdating = "SYSTEM_UPDATING"
        case updating = "UPDATING"
        public var description: String { return self.rawValue }
    }

    public enum KeyLocation: String, CustomStringConvertible, Codable {
        case secretManager = "SECRET_MANAGER"
        case url = "URL"
        public var description: String { return self.rawValue }
    }

    public enum Order: String, CustomStringConvertible, Codable {
        case ascending = "ASCENDING"
        case descending = "DESCENDING"
        public var description: String { return self.rawValue }
    }

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

    public enum QueryIdentifiersEnclosingOption: String, CustomStringConvertible, Codable {
        case doubleQuotes = "DOUBLE_QUOTES"
        case none = "NONE"
        public var description: String { return self.rawValue }
    }

    public enum QueryResultType: String, CustomStringConvertible, Codable {
        case answer = "ANSWER"
        case document = "DOCUMENT"
        case questionAnswer = "QUESTION_ANSWER"
        public var description: String { return self.rawValue }
    }

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

    public enum RelevanceType: String, CustomStringConvertible, Codable {
        case notRelevant = "NOT_RELEVANT"
        case relevant = "RELEVANT"
        public var description: String { return self.rawValue }
    }

    public enum SalesforceChatterFeedIncludeFilterType: String, CustomStringConvertible, Codable {
        case activeUser = "ACTIVE_USER"
        case standardUser = "STANDARD_USER"
        public var description: String { return self.rawValue }
    }

    public enum SalesforceKnowledgeArticleState: String, CustomStringConvertible, Codable {
        case archived = "ARCHIVED"
        case draft = "DRAFT"
        case published = "PUBLISHED"
        public var description: String { return self.rawValue }
    }

    public enum SalesforceStandardObjectName: String, CustomStringConvertible, Codable {
        case account = "ACCOUNT"
        case campaign = "CAMPAIGN"
        case `case` = "CASE"
        case contact = "CONTACT"
        case contract = "CONTRACT"
        case document = "DOCUMENT"
        case group = "GROUP"
        case idea = "IDEA"
        case lead = "LEAD"
        case opportunity = "OPPORTUNITY"
        case partner = "PARTNER"
        case pricebook = "PRICEBOOK"
        case product = "PRODUCT"
        case profile = "PROFILE"
        case solution = "SOLUTION"
        case task = "TASK"
        case user = "USER"
        public var description: String { return self.rawValue }
    }

    public enum ScoreConfidence: String, CustomStringConvertible, Codable {
        case high = "HIGH"
        case low = "LOW"
        case medium = "MEDIUM"
        case veryHigh = "VERY_HIGH"
        public var description: String { return self.rawValue }
    }

    public enum ServiceNowBuildVersionType: String, CustomStringConvertible, Codable {
        case london = "LONDON"
        case others = "OTHERS"
        public var description: String { return self.rawValue }
    }

    public enum SharePointVersion: String, CustomStringConvertible, Codable {
        case sharepointOnline = "SHAREPOINT_ONLINE"
        public var description: String { return self.rawValue }
    }

    public enum SortOrder: String, CustomStringConvertible, Codable {
        case asc = "ASC"
        case desc = "DESC"
        public var description: String { return self.rawValue }
    }

    public enum ThesaurusStatus: String, CustomStringConvertible, Codable {
        case active = "ACTIVE"
        case activeButUpdateFailed = "ACTIVE_BUT_UPDATE_FAILED"
        case creating = "CREATING"
        case deleting = "DELETING"
        case failed = "FAILED"
        case updating = "UPDATING"
        public var description: String { return self.rawValue }
    }

    public enum UserContextPolicy: String, CustomStringConvertible, Codable {
        case attributeFilter = "ATTRIBUTE_FILTER"
        case userToken = "USER_TOKEN"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AccessControlListConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Path to the AWS S3 bucket that contains the ACL files.
        public let keyPath: String?

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

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

        private enum CodingKeys: String, CodingKey {
            case keyPath = "KeyPath"
        }
    }

    public struct AclConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// A list of groups, separated by semi-colons, that filters a query response based on user context. The document is only returned to users that are in one of the groups specified in the UserContext field of the Query operation.
        public let allowedGroupsColumnName: String

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

        public func validate(name: String) throws {
            try self.validate(self.allowedGroupsColumnName, name: "allowedGroupsColumnName", parent: name, max: 100)
            try self.validate(self.allowedGroupsColumnName, name: "allowedGroupsColumnName", parent: name, min: 1)
            try self.validate(self.allowedGroupsColumnName, name: "allowedGroupsColumnName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case allowedGroupsColumnName = "AllowedGroupsColumnName"
        }
    }

    public struct AdditionalResultAttribute: AWSDecodableShape {
        /// The key that identifies the attribute.
        public let key: String
        /// An object that contains the attribute value.
        public let value: AdditionalResultAttributeValue
        /// The data type of the Value property.
        public let valueType: AdditionalResultAttributeValueType

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

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

    public struct AdditionalResultAttributeValue: AWSDecodableShape {
        /// The text associated with the attribute and information about the highlight to apply to the text.
        public let textWithHighlightsValue: TextWithHighlights?

        public init(textWithHighlightsValue: TextWithHighlights? = nil) {
            self.textWithHighlightsValue = textWithHighlightsValue
        }

        private enum CodingKeys: String, CodingKey {
            case textWithHighlightsValue = "TextWithHighlightsValue"
        }
    }

    public class AttributeFilter: AWSEncodableShape {
        /// Performs a logical AND operation on all supplied filters.
        public let andAllFilters: [AttributeFilter]?
        /// Returns true when a document contains all of the specified document attributes. This filter is only applicable to StringListValue metadata.
        public let containsAll: DocumentAttribute?
        /// Returns true when a document contains any of the specified document attributes. This filter is only applicable to StringListValue metadata.
        public let containsAny: DocumentAttribute?
        /// Performs an equals operation on two document attributes.
        public let equalsTo: DocumentAttribute?
        /// Performs a greater than operation on two document attributes. Use with a document attribute of type Integer or Long.
        public let greaterThan: DocumentAttribute?
        /// Performs a greater or equals than operation on two document attributes. Use with a document attribute of type Integer or Long.
        public let greaterThanOrEquals: DocumentAttribute?
        /// Performs a less than operation on two document attributes. Use with a document attribute of type Integer or Long.
        public let lessThan: DocumentAttribute?
        /// Performs a less than or equals operation on two document attributes. Use with a document attribute of type Integer or Long.
        public let lessThanOrEquals: DocumentAttribute?
        /// Performs a logical NOT operation on all supplied filters.
        public let notFilter: AttributeFilter?
        /// Performs a logical OR operation on all supplied filters.
        public let orAllFilters: [AttributeFilter]?

        public init(andAllFilters: [AttributeFilter]? = nil, containsAll: DocumentAttribute? = nil, containsAny: DocumentAttribute? = nil, equalsTo: DocumentAttribute? = nil, greaterThan: DocumentAttribute? = nil, greaterThanOrEquals: DocumentAttribute? = nil, lessThan: DocumentAttribute? = nil, lessThanOrEquals: DocumentAttribute? = nil, notFilter: AttributeFilter? = nil, orAllFilters: [AttributeFilter]? = nil) {
            self.andAllFilters = andAllFilters
            self.containsAll = containsAll
            self.containsAny = containsAny
            self.equalsTo = equalsTo
            self.greaterThan = greaterThan
            self.greaterThanOrEquals = greaterThanOrEquals
            self.lessThan = lessThan
            self.lessThanOrEquals = lessThanOrEquals
            self.notFilter = notFilter
            self.orAllFilters = orAllFilters
        }

        public func validate(name: String) throws {
            try self.andAllFilters?.forEach {
                try $0.validate(name: "\(name).andAllFilters[]")
            }
            try self.containsAll?.validate(name: "\(name).containsAll")
            try self.containsAny?.validate(name: "\(name).containsAny")
            try self.equalsTo?.validate(name: "\(name).equalsTo")
            try self.greaterThan?.validate(name: "\(name).greaterThan")
            try self.greaterThanOrEquals?.validate(name: "\(name).greaterThanOrEquals")
            try self.lessThan?.validate(name: "\(name).lessThan")
            try self.lessThanOrEquals?.validate(name: "\(name).lessThanOrEquals")
            try self.notFilter?.validate(name: "\(name).notFilter")
            try self.orAllFilters?.forEach {
                try $0.validate(name: "\(name).orAllFilters[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case andAllFilters = "AndAllFilters"
            case containsAll = "ContainsAll"
            case containsAny = "ContainsAny"
            case equalsTo = "EqualsTo"
            case greaterThan = "GreaterThan"
            case greaterThanOrEquals = "GreaterThanOrEquals"
            case lessThan = "LessThan"
            case lessThanOrEquals = "LessThanOrEquals"
            case notFilter = "NotFilter"
            case orAllFilters = "OrAllFilters"
        }
    }

    public struct BatchDeleteDocumentRequest: AWSEncodableShape {
        public let dataSourceSyncJobMetricTarget: DataSourceSyncJobMetricTarget?
        /// One or more identifiers for documents to delete from the index.
        public let documentIdList: [String]
        /// The identifier of the index that contains the documents to delete.
        public let indexId: String

        public init(dataSourceSyncJobMetricTarget: DataSourceSyncJobMetricTarget? = nil, documentIdList: [String], indexId: String) {
            self.dataSourceSyncJobMetricTarget = dataSourceSyncJobMetricTarget
            self.documentIdList = documentIdList
            self.indexId = indexId
        }

        public func validate(name: String) throws {
            try self.dataSourceSyncJobMetricTarget?.validate(name: "\(name).dataSourceSyncJobMetricTarget")
            try self.documentIdList.forEach {
                try validate($0, name: "documentIdList[]", parent: name, max: 2048)
                try validate($0, name: "documentIdList[]", parent: name, min: 1)
            }
            try self.validate(self.documentIdList, name: "documentIdList", parent: name, max: 10)
            try self.validate(self.documentIdList, name: "documentIdList", parent: name, min: 1)
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
        }

        private enum CodingKeys: String, CodingKey {
            case dataSourceSyncJobMetricTarget = "DataSourceSyncJobMetricTarget"
            case documentIdList = "DocumentIdList"
            case indexId = "IndexId"
        }
    }

    public struct BatchDeleteDocumentResponse: AWSDecodableShape {
        /// A list of documents that could not be removed from the index. Each entry contains an error message that indicates why the document couldn't be removed from the index.
        public let failedDocuments: [BatchDeleteDocumentResponseFailedDocument]?

        public init(failedDocuments: [BatchDeleteDocumentResponseFailedDocument]? = nil) {
            self.failedDocuments = failedDocuments
        }

        private enum CodingKeys: String, CodingKey {
            case failedDocuments = "FailedDocuments"
        }
    }

    public struct BatchDeleteDocumentResponseFailedDocument: AWSDecodableShape {
        /// The error code for why the document couldn't be removed from the index.
        public let errorCode: ErrorCode?
        /// An explanation for why the document couldn't be removed from the index.
        public let errorMessage: String?
        /// The identifier of the document that couldn't be removed from the index.
        public let id: String?

        public init(errorCode: ErrorCode? = nil, errorMessage: String? = nil, id: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
            self.id = id
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
            case id = "Id"
        }
    }

    public struct BatchPutDocumentRequest: AWSEncodableShape {
        /// One or more documents to add to the index.  Documents have the following file size limits.   5 MB total size for inline documents   50 MB total size for files from an S3 bucket   5 MB extracted text for any file   For more information about file size and transaction per second quotas, see Quotas.
        public let documents: [Document]
        /// The identifier of the index to add the documents to. You need to create the index first using the CreateIndex operation.
        public let indexId: String
        /// The Amazon Resource Name (ARN) of a role that is allowed to run the BatchPutDocument operation. For more information, see IAM Roles for Amazon Kendra.
        public let roleArn: String?

        public init(documents: [Document], indexId: String, roleArn: String? = nil) {
            self.documents = documents
            self.indexId = indexId
            self.roleArn = roleArn
        }

        public func validate(name: String) throws {
            try self.documents.forEach {
                try $0.validate(name: "\(name).documents[]")
            }
            try self.validate(self.documents, name: "documents", parent: name, max: 10)
            try self.validate(self.documents, name: "documents", parent: name, min: 1)
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 1284)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 1)
            try self.validate(self.roleArn, name: "roleArn", parent: name, pattern: "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}")
        }

        private enum CodingKeys: String, CodingKey {
            case documents = "Documents"
            case indexId = "IndexId"
            case roleArn = "RoleArn"
        }
    }

    public struct BatchPutDocumentResponse: AWSDecodableShape {
        /// A list of documents that were not added to the index because the document failed a validation check. Each document contains an error message that indicates why the document couldn't be added to the index. If there was an error adding a document to an index the error is reported in your AWS CloudWatch log. For more information, see Monitoring Amazon Kendra with Amazon CloudWatch Logs
        public let failedDocuments: [BatchPutDocumentResponseFailedDocument]?

        public init(failedDocuments: [BatchPutDocumentResponseFailedDocument]? = nil) {
            self.failedDocuments = failedDocuments
        }

        private enum CodingKeys: String, CodingKey {
            case failedDocuments = "FailedDocuments"
        }
    }

    public struct BatchPutDocumentResponseFailedDocument: AWSDecodableShape {
        /// The type of error that caused the document to fail to be indexed.
        public let errorCode: ErrorCode?
        /// A description of the reason why the document could not be indexed.
        public let errorMessage: String?
        /// The unique identifier of the document.
        public let id: String?

        public init(errorCode: ErrorCode? = nil, errorMessage: String? = nil, id: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
            self.id = id
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
            case id = "Id"
        }
    }

    public struct CapacityUnitsConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The amount of extra query capacity for an index. Each capacity unit provides 0.5 queries per second and 40,000 queries per day.
        public let queryCapacityUnits: Int
        /// The amount of extra storage capacity for an index. Each capacity unit provides 150 Gb of storage space or 500,000 documents, whichever is reached first.
        public let storageCapacityUnits: Int

        public init(queryCapacityUnits: Int, storageCapacityUnits: Int) {
            self.queryCapacityUnits = queryCapacityUnits
            self.storageCapacityUnits = storageCapacityUnits
        }

        public func validate(name: String) throws {
            try self.validate(self.queryCapacityUnits, name: "queryCapacityUnits", parent: name, min: 0)
            try self.validate(self.storageCapacityUnits, name: "storageCapacityUnits", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case queryCapacityUnits = "QueryCapacityUnits"
            case storageCapacityUnits = "StorageCapacityUnits"
        }
    }

    public struct ClickFeedback: AWSEncodableShape {
        /// The Unix timestamp of the date and time that the result was clicked.
        public let clickTime: Date
        /// The unique identifier of the search result that was clicked.
        public let resultId: String

        public init(clickTime: Date, resultId: String) {
            self.clickTime = clickTime
            self.resultId = resultId
        }

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

        private enum CodingKeys: String, CodingKey {
            case clickTime = "ClickTime"
            case resultId = "ResultId"
        }
    }

    public struct ColumnConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// One to five columns that indicate when a document in the database has changed.
        public let changeDetectingColumns: [String]
        /// The column that contains the contents of the document.
        public let documentDataColumnName: String
        /// The column that provides the document's unique identifier.
        public let documentIdColumnName: String
        /// The column that contains the title of the document.
        public let documentTitleColumnName: String?
        /// An array of objects that map database column names to the corresponding fields in an index. You must first create the fields in the index using the UpdateIndex operation.
        public let fieldMappings: [DataSourceToIndexFieldMapping]?

        public init(changeDetectingColumns: [String], documentDataColumnName: String, documentIdColumnName: String, documentTitleColumnName: String? = nil, fieldMappings: [DataSourceToIndexFieldMapping]? = nil) {
            self.changeDetectingColumns = changeDetectingColumns
            self.documentDataColumnName = documentDataColumnName
            self.documentIdColumnName = documentIdColumnName
            self.documentTitleColumnName = documentTitleColumnName
            self.fieldMappings = fieldMappings
        }

        public func validate(name: String) throws {
            try self.changeDetectingColumns.forEach {
                try validate($0, name: "changeDetectingColumns[]", parent: name, max: 100)
                try validate($0, name: "changeDetectingColumns[]", parent: name, min: 1)
                try validate($0, name: "changeDetectingColumns[]", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_]*$")
            }
            try self.validate(self.changeDetectingColumns, name: "changeDetectingColumns", parent: name, max: 5)
            try self.validate(self.changeDetectingColumns, name: "changeDetectingColumns", parent: name, min: 1)
            try self.validate(self.documentDataColumnName, name: "documentDataColumnName", parent: name, max: 100)
            try self.validate(self.documentDataColumnName, name: "documentDataColumnName", parent: name, min: 1)
            try self.validate(self.documentDataColumnName, name: "documentDataColumnName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_]*$")
            try self.validate(self.documentIdColumnName, name: "documentIdColumnName", parent: name, max: 100)
            try self.validate(self.documentIdColumnName, name: "documentIdColumnName", parent: name, min: 1)
            try self.validate(self.documentIdColumnName, name: "documentIdColumnName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_]*$")
            try self.validate(self.documentTitleColumnName, name: "documentTitleColumnName", parent: name, max: 100)
            try self.validate(self.documentTitleColumnName, name: "documentTitleColumnName", parent: name, min: 1)
            try self.validate(self.documentTitleColumnName, name: "documentTitleColumnName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_]*$")
            try self.fieldMappings?.forEach {
                try $0.validate(name: "\(name).fieldMappings[]")
            }
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, max: 100)
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case changeDetectingColumns = "ChangeDetectingColumns"
            case documentDataColumnName = "DocumentDataColumnName"
            case documentIdColumnName = "DocumentIdColumnName"
            case documentTitleColumnName = "DocumentTitleColumnName"
            case fieldMappings = "FieldMappings"
        }
    }

    public struct ConfluenceAttachmentConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Defines how attachment metadata fields should be mapped to index fields. Before you can map a field, you must first create an index field with a matching type using the console or the UpdateIndex operation. If you specify the AttachentFieldMappings parameter, you must specify at least one field mapping.
        public let attachmentFieldMappings: [ConfluenceAttachmentToIndexFieldMapping]?
        /// Indicates whether Amazon Kendra indexes attachments to the pages and blogs in the Confluence data source.
        public let crawlAttachments: Bool?

        public init(attachmentFieldMappings: [ConfluenceAttachmentToIndexFieldMapping]? = nil, crawlAttachments: Bool? = nil) {
            self.attachmentFieldMappings = attachmentFieldMappings
            self.crawlAttachments = crawlAttachments
        }

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

        private enum CodingKeys: String, CodingKey {
            case attachmentFieldMappings = "AttachmentFieldMappings"
            case crawlAttachments = "CrawlAttachments"
        }
    }

    public struct ConfluenceAttachmentToIndexFieldMapping: AWSEncodableShape & AWSDecodableShape {
        /// The name of the field in the data source.  You must first create the index field using the operation.
        public let dataSourceFieldName: ConfluenceAttachmentFieldName?
        /// The format for date fields in the data source. If the field specified in DataSourceFieldName is a date field you must specify the date format. If the field is not a date field, an exception is thrown.
        public let dateFieldFormat: String?
        /// The name of the index field to map to the Confluence data source field. The index field type must match the Confluence field type.
        public let indexFieldName: String?

        public init(dataSourceFieldName: ConfluenceAttachmentFieldName? = nil, dateFieldFormat: String? = nil, indexFieldName: String? = nil) {
            self.dataSourceFieldName = dataSourceFieldName
            self.dateFieldFormat = dateFieldFormat
            self.indexFieldName = indexFieldName
        }

        public func validate(name: String) throws {
            try self.validate(self.dateFieldFormat, name: "dateFieldFormat", parent: name, max: 40)
            try self.validate(self.dateFieldFormat, name: "dateFieldFormat", parent: name, min: 4)
            try self.validate(self.dateFieldFormat, name: "dateFieldFormat", parent: name, pattern: "^(?!\\s).*(?<!\\s)$")
            try self.validate(self.indexFieldName, name: "indexFieldName", parent: name, max: 30)
            try self.validate(self.indexFieldName, name: "indexFieldName", parent: name, min: 1)
            try self.validate(self.indexFieldName, name: "indexFieldName", parent: name, pattern: "^\\P{C}*$")
        }

        private enum CodingKeys: String, CodingKey {
            case dataSourceFieldName = "DataSourceFieldName"
            case dateFieldFormat = "DateFieldFormat"
            case indexFieldName = "IndexFieldName"
        }
    }

    public struct ConfluenceBlogConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Defines how blog metadata fields should be mapped to index fields. Before you can map a field, you must first create an index field with a matching type using the console or the UpdateIndex operation. If you specify the BlogFieldMappings parameter, you must specify at least one field mapping.
        public let blogFieldMappings: [ConfluenceBlogToIndexFieldMapping]?

        public init(blogFieldMappings: [ConfluenceBlogToIndexFieldMapping]? = nil) {
            self.blogFieldMappings = blogFieldMappings
        }

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

        private enum CodingKeys: String, CodingKey {
            case blogFieldMappings = "BlogFieldMappings"
        }
    }

    public struct ConfluenceBlogToIndexFieldMapping: AWSEncodableShape & AWSDecodableShape {
        /// The name of the field in the data source.
        public let dataSourceFieldName: ConfluenceBlogFieldName?
        /// The format for date fields in the data source. If the field specified in DataSourceFieldName is a date field you must specify the date format. If the field is not a date field, an exception is thrown.
        public let dateFieldFormat: String?
        /// The name of the index field to map to the Confluence data source field. The index field type must match the Confluence field type.
        public let indexFieldName: String?

        public init(dataSourceFieldName: ConfluenceBlogFieldName? = nil, dateFieldFormat: String? = nil, indexFieldName: String? = nil) {
            self.dataSourceFieldName = dataSourceFieldName
            self.dateFieldFormat = dateFieldFormat
            self.indexFieldName = indexFieldName
        }

        public func validate(name: String) throws {
            try self.validate(self.dateFieldFormat, name: "dateFieldFormat", parent: name, max: 40)
            try self.validate(self.dateFieldFormat, name: "dateFieldFormat", parent: name, min: 4)
            try self.validate(self.dateFieldFormat, name: "dateFieldFormat", parent: name, pattern: "^(?!\\s).*(?<!\\s)$")
            try self.validate(self.indexFieldName, name: "indexFieldName", parent: name, max: 30)
            try self.validate(self.indexFieldName, name: "indexFieldName", parent: name, min: 1)
            try self.validate(self.indexFieldName, name: "indexFieldName", parent: name, pattern: "^\\P{C}*$")
        }

        private enum CodingKeys: String, CodingKey {
            case dataSourceFieldName = "DataSourceFieldName"
            case dateFieldFormat = "DateFieldFormat"
            case indexFieldName = "IndexFieldName"
        }
    }

    public struct ConfluenceConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Specifies configuration information for indexing attachments to Confluence blogs and pages.
        public let attachmentConfiguration: ConfluenceAttachmentConfiguration?
        ///  Specifies configuration information for indexing Confluence blogs.
        public let blogConfiguration: ConfluenceBlogConfiguration?
        /// A list of regular expression patterns that apply to a URL on the Confluence server. An exclusion pattern can apply to a blog post, a page, a space, or an attachment. Items that match the pattern are excluded from the index. Items that don't match the pattern are included in the index. If a item matches both an exclusion pattern and an inclusion pattern, the item isn't included in the index.
        public let exclusionPatterns: [String]?
        /// A list of regular expression patterns that apply to a URL on the Confluence server. An inclusion pattern can apply to a blog post, a page, a space, or an attachment. Items that match the patterns are included in the index. Items that don't match the pattern are excluded from the index. If an item matches both an inclusion pattern and an exclusion pattern, the item isn't included in the index.
        public let inclusionPatterns: [String]?
        /// Specifies configuration information for indexing Confluence pages.
        public let pageConfiguration: ConfluencePageConfiguration?
        /// The Amazon Resource Name (ARN) of an AWS Secrets Manager secret that contains the key/value pairs required to connect to your Confluence server. The secret must contain a JSON structure with the following keys:   username - The user name or email address of a user with administrative privileges for the Confluence server.   password - The password associated with the user logging in to the Confluence server.
        public let secretArn: String
        /// The URL of your Confluence instance. Use the full URL of the server. For example, https://server.example.com:port/. You can also use an IP address, for example, https://192.168.1.113/.
        public let serverUrl: String
        /// Specifies configuration information for indexing Confluence spaces.
        public let spaceConfiguration: ConfluenceSpaceConfiguration?
        /// Specifies the version of the Confluence installation that you are connecting to.
        public let version: ConfluenceVersion
        /// Specifies the information for connecting to an Amazon VPC.
        public let vpcConfiguration: DataSourceVpcConfiguration?

        public init(attachmentConfiguration: ConfluenceAttachmentConfiguration? = nil, blogConfiguration: ConfluenceBlogConfiguration? = nil, exclusionPatterns: [String]? = nil, inclusionPatterns: [String]? = nil, pageConfiguration: ConfluencePageConfiguration? = nil, secretArn: String, serverUrl: String, spaceConfiguration: ConfluenceSpaceConfiguration? = nil, version: ConfluenceVersion, vpcConfiguration: DataSourceVpcConfiguration? = nil) {
            self.attachmentConfiguration = attachmentConfiguration
            self.blogConfiguration = blogConfiguration
            self.exclusionPatterns = exclusionPatterns
            self.inclusionPatterns = inclusionPatterns
            self.pageConfiguration = pageConfiguration
            self.secretArn = secretArn
            self.serverUrl = serverUrl
            self.spaceConfiguration = spaceConfiguration
            self.version = version
            self.vpcConfiguration = vpcConfiguration
        }

        public func validate(name: String) throws {
            try self.attachmentConfiguration?.validate(name: "\(name).attachmentConfiguration")
            try self.blogConfiguration?.validate(name: "\(name).blogConfiguration")
            try self.exclusionPatterns?.forEach {
                try validate($0, name: "exclusionPatterns[]", parent: name, max: 150)
                try validate($0, name: "exclusionPatterns[]", parent: name, min: 1)
            }
            try self.validate(self.exclusionPatterns, name: "exclusionPatterns", parent: name, max: 100)
            try self.validate(self.exclusionPatterns, name: "exclusionPatterns", parent: name, min: 0)
            try self.inclusionPatterns?.forEach {
                try validate($0, name: "inclusionPatterns[]", parent: name, max: 150)
                try validate($0, name: "inclusionPatterns[]", parent: name, min: 1)
            }
            try self.validate(self.inclusionPatterns, name: "inclusionPatterns", parent: name, max: 100)
            try self.validate(self.inclusionPatterns, name: "inclusionPatterns", parent: name, min: 0)
            try self.pageConfiguration?.validate(name: "\(name).pageConfiguration")
            try self.validate(self.secretArn, name: "secretArn", parent: name, max: 1284)
            try self.validate(self.secretArn, name: "secretArn", parent: name, min: 1)
            try self.validate(self.secretArn, name: "secretArn", parent: name, pattern: "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}")
            try self.validate(self.serverUrl, name: "serverUrl", parent: name, max: 2048)
            try self.validate(self.serverUrl, name: "serverUrl", parent: name, min: 1)
            try self.validate(self.serverUrl, name: "serverUrl", parent: name, pattern: "^(https?|ftp|file):\\/\\/([^\\s]*)")
            try self.spaceConfiguration?.validate(name: "\(name).spaceConfiguration")
            try self.vpcConfiguration?.validate(name: "\(name).vpcConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case attachmentConfiguration = "AttachmentConfiguration"
            case blogConfiguration = "BlogConfiguration"
            case exclusionPatterns = "ExclusionPatterns"
            case inclusionPatterns = "InclusionPatterns"
            case pageConfiguration = "PageConfiguration"
            case secretArn = "SecretArn"
            case serverUrl = "ServerUrl"
            case spaceConfiguration = "SpaceConfiguration"
            case version = "Version"
            case vpcConfiguration = "VpcConfiguration"
        }
    }

    public struct ConfluencePageConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Defines how page metadata fields should be mapped to index fields. Before you can map a field, you must first create an index field with a matching type using the console or the UpdateIndex operation. If you specify the PageFieldMappings parameter, you must specify at least one field mapping.
        public let pageFieldMappings: [ConfluencePageToIndexFieldMapping]?

        public init(pageFieldMappings: [ConfluencePageToIndexFieldMapping]? = nil) {
            self.pageFieldMappings = pageFieldMappings
        }

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

        private enum CodingKeys: String, CodingKey {
            case pageFieldMappings = "PageFieldMappings"
        }
    }

    public struct ConfluencePageToIndexFieldMapping: AWSEncodableShape & AWSDecodableShape {
        /// The name of the field in the data source.
        public let dataSourceFieldName: ConfluencePageFieldName?
        /// The format for date fields in the data source. If the field specified in DataSourceFieldName is a date field you must specify the date format. If the field is not a date field, an exception is thrown.
        public let dateFieldFormat: String?
        /// The name of the index field to map to the Confluence data source field. The index field type must match the Confluence field type.
        public let indexFieldName: String?

        public init(dataSourceFieldName: ConfluencePageFieldName? = nil, dateFieldFormat: String? = nil, indexFieldName: String? = nil) {
            self.dataSourceFieldName = dataSourceFieldName
            self.dateFieldFormat = dateFieldFormat
            self.indexFieldName = indexFieldName
        }

        public func validate(name: String) throws {
            try self.validate(self.dateFieldFormat, name: "dateFieldFormat", parent: name, max: 40)
            try self.validate(self.dateFieldFormat, name: "dateFieldFormat", parent: name, min: 4)
            try self.validate(self.dateFieldFormat, name: "dateFieldFormat", parent: name, pattern: "^(?!\\s).*(?<!\\s)$")
            try self.validate(self.indexFieldName, name: "indexFieldName", parent: name, max: 30)
            try self.validate(self.indexFieldName, name: "indexFieldName", parent: name, min: 1)
            try self.validate(self.indexFieldName, name: "indexFieldName", parent: name, pattern: "^\\P{C}*$")
        }

        private enum CodingKeys: String, CodingKey {
            case dataSourceFieldName = "DataSourceFieldName"
            case dateFieldFormat = "DateFieldFormat"
            case indexFieldName = "IndexFieldName"
        }
    }

    public struct ConfluenceSpaceConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Specifies whether Amazon Kendra should index archived spaces.
        public let crawlArchivedSpaces: Bool?
        /// Specifies whether Amazon Kendra should index personal spaces. Users can add restrictions to items in personal spaces. If personal spaces are indexed, queries without user context information may return restricted items from a personal space in their results. For more information, see Filtering on user context.
        public let crawlPersonalSpaces: Bool?
        /// A list of space keys of Confluence spaces. If you include a key, the blogs, documents, and attachments in the space are not indexed. If a space is in both the ExcludeSpaces and the IncludeSpaces list, the space is excluded.
        public let excludeSpaces: [String]?
        /// A list of space keys for Confluence spaces. If you include a key, the blogs, documents, and attachments in the space are indexed. Spaces that aren't in the list aren't indexed. A space in the list must exist. Otherwise, Amazon Kendra logs an error when the data source is synchronized. If a space is in both the IncludeSpaces and the ExcludeSpaces list, the space is excluded.
        public let includeSpaces: [String]?
        /// Defines how space metadata fields should be mapped to index fields. Before you can map a field, you must first create an index field with a matching type using the console or the UpdateIndex operation. If you specify the SpaceFieldMappings parameter, you must specify at least one field mapping.
        public let spaceFieldMappings: [ConfluenceSpaceToIndexFieldMapping]?

        public init(crawlArchivedSpaces: Bool? = nil, crawlPersonalSpaces: Bool? = nil, excludeSpaces: [String]? = nil, includeSpaces: [String]? = nil, spaceFieldMappings: [ConfluenceSpaceToIndexFieldMapping]? = nil) {
            self.crawlArchivedSpaces = crawlArchivedSpaces
            self.crawlPersonalSpaces = crawlPersonalSpaces
            self.excludeSpaces = excludeSpaces
            self.includeSpaces = includeSpaces
            self.spaceFieldMappings = spaceFieldMappings
        }

        public func validate(name: String) throws {
            try self.excludeSpaces?.forEach {
                try validate($0, name: "excludeSpaces[]", parent: name, max: 255)
                try validate($0, name: "excludeSpaces[]", parent: name, min: 1)
                try validate($0, name: "excludeSpaces[]", parent: name, pattern: "^\\P{C}*$")
            }
            try self.validate(self.excludeSpaces, name: "excludeSpaces", parent: name, min: 1)
            try self.includeSpaces?.forEach {
                try validate($0, name: "includeSpaces[]", parent: name, max: 255)
                try validate($0, name: "includeSpaces[]", parent: name, min: 1)
                try validate($0, name: "includeSpaces[]", parent: name, pattern: "^\\P{C}*$")
            }
            try self.validate(self.includeSpaces, name: "includeSpaces", parent: name, min: 1)
            try self.spaceFieldMappings?.forEach {
                try $0.validate(name: "\(name).spaceFieldMappings[]")
            }
            try self.validate(self.spaceFieldMappings, name: "spaceFieldMappings", parent: name, max: 4)
            try self.validate(self.spaceFieldMappings, name: "spaceFieldMappings", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case crawlArchivedSpaces = "CrawlArchivedSpaces"
            case crawlPersonalSpaces = "CrawlPersonalSpaces"
            case excludeSpaces = "ExcludeSpaces"
            case includeSpaces = "IncludeSpaces"
            case spaceFieldMappings = "SpaceFieldMappings"
        }
    }

    public struct ConfluenceSpaceToIndexFieldMapping: AWSEncodableShape & AWSDecodableShape {
        /// The name of the field in the data source.
        public let dataSourceFieldName: ConfluenceSpaceFieldName?
        /// The format for date fields in the data source. If the field specified in DataSourceFieldName is a date field you must specify the date format. If the field is not a date field, an exception is thrown.
        public let dateFieldFormat: String?
        /// The name of the index field to map to the Confluence data source field. The index field type must match the Confluence field type.
        public let indexFieldName: String?

        public init(dataSourceFieldName: ConfluenceSpaceFieldName? = nil, dateFieldFormat: String? = nil, indexFieldName: String? = nil) {
            self.dataSourceFieldName = dataSourceFieldName
            self.dateFieldFormat = dateFieldFormat
            self.indexFieldName = indexFieldName
        }

        public func validate(name: String) throws {
            try self.validate(self.dateFieldFormat, name: "dateFieldFormat", parent: name, max: 40)
            try self.validate(self.dateFieldFormat, name: "dateFieldFormat", parent: name, min: 4)
            try self.validate(self.dateFieldFormat, name: "dateFieldFormat", parent: name, pattern: "^(?!\\s).*(?<!\\s)$")
            try self.validate(self.indexFieldName, name: "indexFieldName", parent: name, max: 30)
            try self.validate(self.indexFieldName, name: "indexFieldName", parent: name, min: 1)
            try self.validate(self.indexFieldName, name: "indexFieldName", parent: name, pattern: "^\\P{C}*$")
        }

        private enum CodingKeys: String, CodingKey {
            case dataSourceFieldName = "DataSourceFieldName"
            case dateFieldFormat = "DateFieldFormat"
            case indexFieldName = "IndexFieldName"
        }
    }

    public struct ConnectionConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The name of the host for the database. Can be either a string (host.subdomain.domain.tld) or an IPv4 or IPv6 address.
        public let databaseHost: String
        /// The name of the database containing the document data.
        public let databaseName: String
        /// The port that the database uses for connections.
        public let databasePort: Int
        /// The Amazon Resource Name (ARN) of credentials stored in AWS Secrets Manager. The credentials should be a user/password pair. For more information, see Using a Database Data Source. For more information about AWS Secrets Manager, see  What Is AWS Secrets Manager  in the AWS Secrets Manager user guide.
        public let secretArn: String
        /// The name of the table that contains the document data.
        public let tableName: String

        public init(databaseHost: String, databaseName: String, databasePort: Int, secretArn: String, tableName: String) {
            self.databaseHost = databaseHost
            self.databaseName = databaseName
            self.databasePort = databasePort
            self.secretArn = secretArn
            self.tableName = tableName
        }

        public func validate(name: String) throws {
            try self.validate(self.databaseHost, name: "databaseHost", parent: name, max: 253)
            try self.validate(self.databaseHost, name: "databaseHost", parent: name, min: 1)
            try self.validate(self.databaseName, name: "databaseName", parent: name, max: 100)
            try self.validate(self.databaseName, name: "databaseName", parent: name, min: 1)
            try self.validate(self.databaseName, name: "databaseName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_]*$")
            try self.validate(self.databasePort, name: "databasePort", parent: name, max: 65535)
            try self.validate(self.databasePort, name: "databasePort", parent: name, min: 1)
            try self.validate(self.secretArn, name: "secretArn", parent: name, max: 1284)
            try self.validate(self.secretArn, name: "secretArn", parent: name, min: 1)
            try self.validate(self.secretArn, name: "secretArn", parent: name, pattern: "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}")
            try self.validate(self.tableName, name: "tableName", parent: name, max: 100)
            try self.validate(self.tableName, name: "tableName", parent: name, min: 1)
            try self.validate(self.tableName, name: "tableName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case databaseHost = "DatabaseHost"
            case databaseName = "DatabaseName"
            case databasePort = "DatabasePort"
            case secretArn = "SecretArn"
            case tableName = "TableName"
        }
    }

    public struct CreateDataSourceRequest: AWSEncodableShape {
        /// A token that you provide to identify the request to create a data source. Multiple calls to the CreateDataSource operation with the same client token will create only one data source.
        public let clientToken: String?
        /// The connector configuration information that is required to access the repository. You can't specify the Configuration parameter when the Type parameter is set to CUSTOM. If you do, you receive a ValidationException exception. The Configuration parameter is required for all other data sources.
        public let configuration: DataSourceConfiguration?
        /// A description for the data source.
        public let description: String?
        /// The identifier of the index that should be associated with this data source.
        public let indexId: String
        /// A unique name for the data source. A data source name can't be changed without deleting and recreating the data source.
        public let name: String
        /// The Amazon Resource Name (ARN) of a role with permission to access the data source. For more information, see IAM Roles for Amazon Kendra. You can't specify the RoleArn parameter when the Type parameter is set to CUSTOM. If you do, you receive a ValidationException exception. The RoleArn parameter is required for all other data sources.
        public let roleArn: String?
        /// Sets the frequency that Amazon Kendra will check the documents in your repository and update the index. If you don't set a schedule Amazon Kendra will not periodically update the index. You can call the StartDataSourceSyncJob operation to update the index. You can't specify the Schedule parameter when the Type parameter is set to CUSTOM. If you do, you receive a ValidationException exception.
        public let schedule: String?
        /// A list of key-value pairs that identify the data source. You can use the tags to identify and organize your resources and to control access to resources.
        public let tags: [Tag]?
        /// The type of repository that contains the data source.
        public let type: DataSourceType

        public init(clientToken: String? = CreateDataSourceRequest.idempotencyToken(), configuration: DataSourceConfiguration? = nil, description: String? = nil, indexId: String, name: String, roleArn: String? = nil, schedule: String? = nil, tags: [Tag]? = nil, type: DataSourceType) {
            self.clientToken = clientToken
            self.configuration = configuration
            self.description = description
            self.indexId = indexId
            self.name = name
            self.roleArn = roleArn
            self.schedule = schedule
            self.tags = tags
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 100)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.configuration?.validate(name: "\(name).configuration")
            try self.validate(self.description, name: "description", parent: name, max: 1000)
            try self.validate(self.description, name: "description", parent: name, min: 0)
            try self.validate(self.description, name: "description", parent: name, pattern: "^\\P{C}*$")
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
            try self.validate(self.name, name: "name", parent: name, max: 1000)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 1284)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 1)
            try self.validate(self.roleArn, name: "roleArn", parent: name, pattern: "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
            try self.validate(self.tags, name: "tags", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case clientToken = "ClientToken"
            case configuration = "Configuration"
            case description = "Description"
            case indexId = "IndexId"
            case name = "Name"
            case roleArn = "RoleArn"
            case schedule = "Schedule"
            case tags = "Tags"
            case type = "Type"
        }
    }

    public struct CreateDataSourceResponse: AWSDecodableShape {
        /// A unique identifier for the data source.
        public let id: String

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

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

    public struct CreateFaqRequest: AWSEncodableShape {
        /// A token that you provide to identify the request to create a FAQ. Multiple calls to the CreateFaqRequest operation with the same client token will create only one FAQ.
        public let clientToken: String?
        /// A description of the FAQ.
        public let description: String?
        /// The format of the input file. You can choose between a basic CSV format, a CSV format that includes customs attributes in a header, and a JSON format that includes custom attributes. The format must match the format of the file stored in the S3 bucket identified in the S3Path parameter. For more information, see Adding questions and answers.
        public let fileFormat: FaqFileFormat?
        /// The identifier of the index that contains the FAQ.
        public let indexId: String
        /// The name that should be associated with the FAQ.
        public let name: String
        /// The Amazon Resource Name (ARN) of a role with permission to access the S3 bucket that contains the FAQs. For more information, see IAM Roles for Amazon Kendra.
        public let roleArn: String
        /// The S3 location of the FAQ input data.
        public let s3Path: S3Path
        /// A list of key-value pairs that identify the FAQ. You can use the tags to identify and organize your resources and to control access to resources.
        public let tags: [Tag]?

        public init(clientToken: String? = CreateFaqRequest.idempotencyToken(), description: String? = nil, fileFormat: FaqFileFormat? = nil, indexId: String, name: String, roleArn: String, s3Path: S3Path, tags: [Tag]? = nil) {
            self.clientToken = clientToken
            self.description = description
            self.fileFormat = fileFormat
            self.indexId = indexId
            self.name = name
            self.roleArn = roleArn
            self.s3Path = s3Path
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 100)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.description, name: "description", parent: name, max: 1000)
            try self.validate(self.description, name: "description", parent: name, min: 0)
            try self.validate(self.description, name: "description", parent: name, pattern: "^\\P{C}*$")
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
            try self.validate(self.name, name: "name", parent: name, max: 100)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 1284)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 1)
            try self.validate(self.roleArn, name: "roleArn", parent: name, pattern: "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}")
            try self.s3Path.validate(name: "\(name).s3Path")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
            try self.validate(self.tags, name: "tags", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case clientToken = "ClientToken"
            case description = "Description"
            case fileFormat = "FileFormat"
            case indexId = "IndexId"
            case name = "Name"
            case roleArn = "RoleArn"
            case s3Path = "S3Path"
            case tags = "Tags"
        }
    }

    public struct CreateFaqResponse: AWSDecodableShape {
        /// The unique identifier of the FAQ.
        public let id: String?

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

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

    public struct CreateIndexRequest: AWSEncodableShape {
        /// A token that you provide to identify the request to create an index. Multiple calls to the CreateIndex operation with the same client token will create only one index.
        public let clientToken: String?
        /// A description for the index.
        public let description: String?
        /// The Amazon Kendra edition to use for the index. Choose DEVELOPER_EDITION for indexes intended for development, testing, or proof of concept. Use ENTERPRISE_EDITION for your production databases. Once you set the edition for an index, it can't be changed.  The Edition parameter is optional. If you don't supply a value, the default is ENTERPRISE_EDITION.
        public let edition: IndexEdition?
        /// The name for the new index.
        public let name: String
        /// An AWS Identity and Access Management (IAM) role that gives Amazon Kendra permissions to access your Amazon CloudWatch logs and metrics. This is also the role used when you use the BatchPutDocument operation to index documents from an Amazon S3 bucket.
        public let roleArn: String
        /// The identifier of the AWS KMS customer managed key (CMK) to use to encrypt data indexed by Amazon Kendra. Amazon Kendra doesn't support asymmetric CMKs.
        public let serverSideEncryptionConfiguration: ServerSideEncryptionConfiguration?
        /// A list of key-value pairs that identify the index. You can use the tags to identify and organize your resources and to control access to resources.
        public let tags: [Tag]?
        /// The user context policy.  ATTRIBUTE_FILTER  All indexed content is searchable and displayable for all users. If there is an access control list, it is ignored. You can filter on user and group attributes.   USER_TOKEN  Enables SSO and token-based user access control. All documents with no access control and all documents accessible to the user will be searchable and displayable.
        public let userContextPolicy: UserContextPolicy?
        /// The user token configuration.
        public let userTokenConfigurations: [UserTokenConfiguration]?

        public init(clientToken: String? = CreateIndexRequest.idempotencyToken(), description: String? = nil, edition: IndexEdition? = nil, name: String, roleArn: String, serverSideEncryptionConfiguration: ServerSideEncryptionConfiguration? = nil, tags: [Tag]? = nil, userContextPolicy: UserContextPolicy? = nil, userTokenConfigurations: [UserTokenConfiguration]? = nil) {
            self.clientToken = clientToken
            self.description = description
            self.edition = edition
            self.name = name
            self.roleArn = roleArn
            self.serverSideEncryptionConfiguration = serverSideEncryptionConfiguration
            self.tags = tags
            self.userContextPolicy = userContextPolicy
            self.userTokenConfigurations = userTokenConfigurations
        }

        public func validate(name: String) throws {
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 100)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.description, name: "description", parent: name, max: 1000)
            try self.validate(self.description, name: "description", parent: name, min: 0)
            try self.validate(self.description, name: "description", parent: name, pattern: "^\\P{C}*$")
            try self.validate(self.name, name: "name", parent: name, max: 1000)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 1284)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 1)
            try self.validate(self.roleArn, name: "roleArn", parent: name, pattern: "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}")
            try self.serverSideEncryptionConfiguration?.validate(name: "\(name).serverSideEncryptionConfiguration")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
            try self.validate(self.tags, name: "tags", parent: name, min: 0)
            try self.userTokenConfigurations?.forEach {
                try $0.validate(name: "\(name).userTokenConfigurations[]")
            }
            try self.validate(self.userTokenConfigurations, name: "userTokenConfigurations", parent: name, max: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case clientToken = "ClientToken"
            case description = "Description"
            case edition = "Edition"
            case name = "Name"
            case roleArn = "RoleArn"
            case serverSideEncryptionConfiguration = "ServerSideEncryptionConfiguration"
            case tags = "Tags"
            case userContextPolicy = "UserContextPolicy"
            case userTokenConfigurations = "UserTokenConfigurations"
        }
    }

    public struct CreateIndexResponse: AWSDecodableShape {
        /// The unique identifier of the index. Use this identifier when you query an index, set up a data source, or index a document.
        public let id: String?

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

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

    public struct CreateThesaurusRequest: AWSEncodableShape {
        /// A token that you provide to identify the request to create a thesaurus. Multiple calls to the CreateThesaurus operation with the same client token will create only one index.
        public let clientToken: String?
        /// The description for the new thesaurus.
        public let description: String?
        /// The unique identifier of the index for the new thesaurus.
        public let indexId: String
        /// The name for the new thesaurus.
        public let name: String
        /// An AWS Identity and Access Management (IAM) role that gives Amazon Kendra permissions to access thesaurus file specified in SourceS3Path.
        public let roleArn: String
        /// The thesaurus file Amazon S3 source path.
        public let sourceS3Path: S3Path
        /// A list of key-value pairs that identify the thesaurus. You can use the tags to identify and organize your resources and to control access to resources.
        public let tags: [Tag]?

        public init(clientToken: String? = CreateThesaurusRequest.idempotencyToken(), description: String? = nil, indexId: String, name: String, roleArn: String, sourceS3Path: S3Path, tags: [Tag]? = nil) {
            self.clientToken = clientToken
            self.description = description
            self.indexId = indexId
            self.name = name
            self.roleArn = roleArn
            self.sourceS3Path = sourceS3Path
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 100)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.description, name: "description", parent: name, max: 1000)
            try self.validate(self.description, name: "description", parent: name, min: 0)
            try self.validate(self.description, name: "description", parent: name, pattern: "^\\P{C}*$")
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
            try self.validate(self.name, name: "name", parent: name, max: 100)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 1284)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 1)
            try self.validate(self.roleArn, name: "roleArn", parent: name, pattern: "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}")
            try self.sourceS3Path.validate(name: "\(name).sourceS3Path")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
            try self.validate(self.tags, name: "tags", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case clientToken = "ClientToken"
            case description = "Description"
            case indexId = "IndexId"
            case name = "Name"
            case roleArn = "RoleArn"
            case sourceS3Path = "SourceS3Path"
            case tags = "Tags"
        }
    }

    public struct CreateThesaurusResponse: AWSDecodableShape {
        /// The unique identifier of the thesaurus.
        public let id: String?

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

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

    public struct DataSourceConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Provides configuration information for connecting to a Confluence data source.
        public let confluenceConfiguration: ConfluenceConfiguration?
        /// Provides information necessary to create a data source connector for a database.
        public let databaseConfiguration: DatabaseConfiguration?
        /// Provides configuration for data sources that connect to Google Drive.
        public let googleDriveConfiguration: GoogleDriveConfiguration?
        /// Provides configuration for data sources that connect to Microsoft OneDrive.
        public let oneDriveConfiguration: OneDriveConfiguration?
        /// Provides information to create a data source connector for a document repository in an Amazon S3 bucket.
        public let s3Configuration: S3DataSourceConfiguration?
        /// Provides configuration information for data sources that connect to a Salesforce site.
        public let salesforceConfiguration: SalesforceConfiguration?
        /// Provides configuration for data sources that connect to ServiceNow instances.
        public let serviceNowConfiguration: ServiceNowConfiguration?
        /// Provides information necessary to create a data source connector for a Microsoft SharePoint site.
        public let sharePointConfiguration: SharePointConfiguration?

        public init(confluenceConfiguration: ConfluenceConfiguration? = nil, databaseConfiguration: DatabaseConfiguration? = nil, googleDriveConfiguration: GoogleDriveConfiguration? = nil, oneDriveConfiguration: OneDriveConfiguration? = nil, s3Configuration: S3DataSourceConfiguration? = nil, salesforceConfiguration: SalesforceConfiguration? = nil, serviceNowConfiguration: ServiceNowConfiguration? = nil, sharePointConfiguration: SharePointConfiguration? = nil) {
            self.confluenceConfiguration = confluenceConfiguration
            self.databaseConfiguration = databaseConfiguration
            self.googleDriveConfiguration = googleDriveConfiguration
            self.oneDriveConfiguration = oneDriveConfiguration
            self.s3Configuration = s3Configuration
            self.salesforceConfiguration = salesforceConfiguration
            self.serviceNowConfiguration = serviceNowConfiguration
            self.sharePointConfiguration = sharePointConfiguration
        }

        public func validate(name: String) throws {
            try self.confluenceConfiguration?.validate(name: "\(name).confluenceConfiguration")
            try self.databaseConfiguration?.validate(name: "\(name).databaseConfiguration")
            try self.googleDriveConfiguration?.validate(name: "\(name).googleDriveConfiguration")
            try self.oneDriveConfiguration?.validate(name: "\(name).oneDriveConfiguration")
            try self.s3Configuration?.validate(name: "\(name).s3Configuration")
            try self.salesforceConfiguration?.validate(name: "\(name).salesforceConfiguration")
            try self.serviceNowConfiguration?.validate(name: "\(name).serviceNowConfiguration")
            try self.sharePointConfiguration?.validate(name: "\(name).sharePointConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case confluenceConfiguration = "ConfluenceConfiguration"
            case databaseConfiguration = "DatabaseConfiguration"
            case googleDriveConfiguration = "GoogleDriveConfiguration"
            case oneDriveConfiguration = "OneDriveConfiguration"
            case s3Configuration = "S3Configuration"
            case salesforceConfiguration = "SalesforceConfiguration"
            case serviceNowConfiguration = "ServiceNowConfiguration"
            case sharePointConfiguration = "SharePointConfiguration"
        }
    }

    public struct DataSourceSummary: AWSDecodableShape {
        /// The UNIX datetime that the data source was created.
        public let createdAt: Date?
        /// The unique identifier for the data source.
        public let id: String?
        /// The name of the data source.
        public let name: String?
        /// The status of the data source. When the status is ATIVE the data source is ready to use.
        public let status: DataSourceStatus?
        /// The type of the data source.
        public let type: DataSourceType?
        /// The UNIX datetime that the data source was lasted updated.
        public let updatedAt: Date?

        public init(createdAt: Date? = nil, id: String? = nil, name: String? = nil, status: DataSourceStatus? = nil, type: DataSourceType? = nil, updatedAt: Date? = nil) {
            self.createdAt = createdAt
            self.id = id
            self.name = name
            self.status = status
            self.type = type
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case createdAt = "CreatedAt"
            case id = "Id"
            case name = "Name"
            case status = "Status"
            case type = "Type"
            case updatedAt = "UpdatedAt"
        }
    }

    public struct DataSourceSyncJob: AWSDecodableShape {
        /// If the reason that the synchronization failed is due to an error with the underlying data source, this field contains a code that identifies the error.
        public let dataSourceErrorCode: String?
        /// The UNIX datetime that the synchronization job was completed.
        public let endTime: Date?
        /// If the Status field is set to FAILED, the ErrorCode field contains a the reason that the synchronization failed.
        public let errorCode: ErrorCode?
        /// If the Status field is set to ERROR, the ErrorMessage field contains a description of the error that caused the synchronization to fail.
        public let errorMessage: String?
        /// A unique identifier for the synchronization job.
        public let executionId: String?
        /// Maps a batch delete document request to a specific data source sync job. This is optional and should only be supplied when documents are deleted by a data source connector.
        public let metrics: DataSourceSyncJobMetrics?
        /// The UNIX datetime that the synchronization job was started.
        public let startTime: Date?
        /// The execution status of the synchronization job. When the Status field is set to SUCCEEDED, the synchronization job is done. If the status code is set to FAILED, the ErrorCode and ErrorMessage fields give you the reason for the failure.
        public let status: DataSourceSyncJobStatus?

        public init(dataSourceErrorCode: String? = nil, endTime: Date? = nil, errorCode: ErrorCode? = nil, errorMessage: String? = nil, executionId: String? = nil, metrics: DataSourceSyncJobMetrics? = nil, startTime: Date? = nil, status: DataSourceSyncJobStatus? = nil) {
            self.dataSourceErrorCode = dataSourceErrorCode
            self.endTime = endTime
            self.errorCode = errorCode
            self.errorMessage = errorMessage
            self.executionId = executionId
            self.metrics = metrics
            self.startTime = startTime
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case dataSourceErrorCode = "DataSourceErrorCode"
            case endTime = "EndTime"
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
            case executionId = "ExecutionId"
            case metrics = "Metrics"
            case startTime = "StartTime"
            case status = "Status"
        }
    }

    public struct DataSourceSyncJobMetricTarget: AWSEncodableShape {
        /// The ID of the data source that is running the sync job.
        public let dataSourceId: String
        /// The ID of the sync job that is running on the data source.
        public let dataSourceSyncJobId: String

        public init(dataSourceId: String, dataSourceSyncJobId: String) {
            self.dataSourceId = dataSourceId
            self.dataSourceSyncJobId = dataSourceSyncJobId
        }

        public func validate(name: String) throws {
            try self.validate(self.dataSourceId, name: "dataSourceId", parent: name, max: 100)
            try self.validate(self.dataSourceId, name: "dataSourceId", parent: name, min: 1)
            try self.validate(self.dataSourceId, name: "dataSourceId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.dataSourceSyncJobId, name: "dataSourceSyncJobId", parent: name, max: 100)
            try self.validate(self.dataSourceSyncJobId, name: "dataSourceSyncJobId", parent: name, min: 1)
            try self.validate(self.dataSourceSyncJobId, name: "dataSourceSyncJobId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
        }

        private enum CodingKeys: String, CodingKey {
            case dataSourceId = "DataSourceId"
            case dataSourceSyncJobId = "DataSourceSyncJobId"
        }
    }

    public struct DataSourceSyncJobMetrics: AWSDecodableShape {
        /// The number of documents added from the data source up to now in the data source sync.
        public let documentsAdded: String?
        /// The number of documents deleted from the data source up to now in the data source sync run.
        public let documentsDeleted: String?
        /// The number of documents that failed to sync from the data source up to now in the data source sync run.
        public let documentsFailed: String?
        /// The number of documents modified in the data source up to now in the data source sync run.
        public let documentsModified: String?
        /// The current number of documents crawled by the current sync job in the data source.
        public let documentsScanned: String?

        public init(documentsAdded: String? = nil, documentsDeleted: String? = nil, documentsFailed: String? = nil, documentsModified: String? = nil, documentsScanned: String? = nil) {
            self.documentsAdded = documentsAdded
            self.documentsDeleted = documentsDeleted
            self.documentsFailed = documentsFailed
            self.documentsModified = documentsModified
            self.documentsScanned = documentsScanned
        }

        private enum CodingKeys: String, CodingKey {
            case documentsAdded = "DocumentsAdded"
            case documentsDeleted = "DocumentsDeleted"
            case documentsFailed = "DocumentsFailed"
            case documentsModified = "DocumentsModified"
            case documentsScanned = "DocumentsScanned"
        }
    }

    public struct DataSourceToIndexFieldMapping: AWSEncodableShape & AWSDecodableShape {
        /// The name of the column or attribute in the data source.
        public let dataSourceFieldName: String
        /// The type of data stored in the column or attribute.
        public let dateFieldFormat: String?
        /// The name of the field in the index.
        public let indexFieldName: String

        public init(dataSourceFieldName: String, dateFieldFormat: String? = nil, indexFieldName: String) {
            self.dataSourceFieldName = dataSourceFieldName
            self.dateFieldFormat = dateFieldFormat
            self.indexFieldName = indexFieldName
        }

        public func validate(name: String) throws {
            try self.validate(self.dataSourceFieldName, name: "dataSourceFieldName", parent: name, max: 100)
            try self.validate(self.dataSourceFieldName, name: "dataSourceFieldName", parent: name, min: 1)
            try self.validate(self.dataSourceFieldName, name: "dataSourceFieldName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_.]*$")
            try self.validate(self.dateFieldFormat, name: "dateFieldFormat", parent: name, max: 40)
            try self.validate(self.dateFieldFormat, name: "dateFieldFormat", parent: name, min: 4)
            try self.validate(self.dateFieldFormat, name: "dateFieldFormat", parent: name, pattern: "^(?!\\s).*(?<!\\s)$")
            try self.validate(self.indexFieldName, name: "indexFieldName", parent: name, max: 30)
            try self.validate(self.indexFieldName, name: "indexFieldName", parent: name, min: 1)
            try self.validate(self.indexFieldName, name: "indexFieldName", parent: name, pattern: "^\\P{C}*$")
        }

        private enum CodingKeys: String, CodingKey {
            case dataSourceFieldName = "DataSourceFieldName"
            case dateFieldFormat = "DateFieldFormat"
            case indexFieldName = "IndexFieldName"
        }
    }

    public struct DataSourceVpcConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// A list of identifiers of security groups within your Amazon VPC. The security groups should enable Amazon Kendra to connect to the data source.
        public let securityGroupIds: [String]
        /// A list of identifiers for subnets within your Amazon VPC. The subnets should be able to connect to each other in the VPC, and they should have outgoing access to the Internet through a NAT device.
        public let subnetIds: [String]

        public init(securityGroupIds: [String], subnetIds: [String]) {
            self.securityGroupIds = securityGroupIds
            self.subnetIds = subnetIds
        }

        public func validate(name: String) throws {
            try self.securityGroupIds.forEach {
                try validate($0, name: "securityGroupIds[]", parent: name, max: 200)
                try validate($0, name: "securityGroupIds[]", parent: name, min: 1)
                try validate($0, name: "securityGroupIds[]", parent: name, pattern: "[-0-9a-zA-Z]+")
            }
            try self.validate(self.securityGroupIds, name: "securityGroupIds", parent: name, max: 10)
            try self.validate(self.securityGroupIds, name: "securityGroupIds", parent: name, min: 1)
            try self.subnetIds.forEach {
                try validate($0, name: "subnetIds[]", parent: name, max: 200)
                try validate($0, name: "subnetIds[]", parent: name, min: 1)
                try validate($0, name: "subnetIds[]", parent: name, pattern: "[\\-0-9a-zA-Z]+")
            }
            try self.validate(self.subnetIds, name: "subnetIds", parent: name, max: 6)
            try self.validate(self.subnetIds, name: "subnetIds", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case securityGroupIds = "SecurityGroupIds"
            case subnetIds = "SubnetIds"
        }
    }

    public struct DatabaseConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Information about the database column that provides information for user context filtering.
        public let aclConfiguration: AclConfiguration?
        /// Information about where the index should get the document information from the database.
        public let columnConfiguration: ColumnConfiguration
        /// The information necessary to connect to a database.
        public let connectionConfiguration: ConnectionConfiguration
        /// The type of database engine that runs the database.
        public let databaseEngineType: DatabaseEngineType
        /// Provides information about how Amazon Kendra uses quote marks around SQL identifiers when querying a database data source.
        public let sqlConfiguration: SqlConfiguration?
        public let vpcConfiguration: DataSourceVpcConfiguration?

        public init(aclConfiguration: AclConfiguration? = nil, columnConfiguration: ColumnConfiguration, connectionConfiguration: ConnectionConfiguration, databaseEngineType: DatabaseEngineType, sqlConfiguration: SqlConfiguration? = nil, vpcConfiguration: DataSourceVpcConfiguration? = nil) {
            self.aclConfiguration = aclConfiguration
            self.columnConfiguration = columnConfiguration
            self.connectionConfiguration = connectionConfiguration
            self.databaseEngineType = databaseEngineType
            self.sqlConfiguration = sqlConfiguration
            self.vpcConfiguration = vpcConfiguration
        }

        public func validate(name: String) throws {
            try self.aclConfiguration?.validate(name: "\(name).aclConfiguration")
            try self.columnConfiguration.validate(name: "\(name).columnConfiguration")
            try self.connectionConfiguration.validate(name: "\(name).connectionConfiguration")
            try self.vpcConfiguration?.validate(name: "\(name).vpcConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case aclConfiguration = "AclConfiguration"
            case columnConfiguration = "ColumnConfiguration"
            case connectionConfiguration = "ConnectionConfiguration"
            case databaseEngineType = "DatabaseEngineType"
            case sqlConfiguration = "SqlConfiguration"
            case vpcConfiguration = "VpcConfiguration"
        }
    }

    public struct DeleteDataSourceRequest: AWSEncodableShape {
        /// The unique identifier of the data source to delete.
        public let id: String
        /// The unique identifier of the index associated with the data source.
        public let indexId: String

        public init(id: String, indexId: String) {
            self.id = id
            self.indexId = indexId
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case indexId = "IndexId"
        }
    }

    public struct DeleteFaqRequest: AWSEncodableShape {
        /// The identifier of the FAQ to remove.
        public let id: String
        /// The index to remove the FAQ from.
        public let indexId: String

        public init(id: String, indexId: String) {
            self.id = id
            self.indexId = indexId
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case indexId = "IndexId"
        }
    }

    public struct DeleteIndexRequest: AWSEncodableShape {
        /// The identifier of the index to delete.
        public let id: String

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

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 36)
            try self.validate(self.id, name: "id", parent: name, min: 36)
            try self.validate(self.id, name: "id", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
        }

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

    public struct DeleteThesaurusRequest: AWSEncodableShape {
        /// The identifier of the thesaurus to delete.
        public let id: String
        /// The identifier of the index associated with the thesaurus to delete.
        public let indexId: String

        public init(id: String, indexId: String) {
            self.id = id
            self.indexId = indexId
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case indexId = "IndexId"
        }
    }

    public struct DescribeDataSourceRequest: AWSEncodableShape {
        /// The unique identifier of the data source to describe.
        public let id: String
        /// The identifier of the index that contains the data source.
        public let indexId: String

        public init(id: String, indexId: String) {
            self.id = id
            self.indexId = indexId
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case indexId = "IndexId"
        }
    }

    public struct DescribeDataSourceResponse: AWSDecodableShape {
        /// Information that describes where the data source is located and how the data source is configured. The specific information in the description depends on the data source provider.
        public let configuration: DataSourceConfiguration?
        /// The Unix timestamp of when the data source was created.
        public let createdAt: Date?
        /// The description of the data source.
        public let description: String?
        /// When the Status field value is FAILED, the ErrorMessage field contains a description of the error that caused the data source to fail.
        public let errorMessage: String?
        /// The identifier of the data source.
        public let id: String?
        /// The identifier of the index that contains the data source.
        public let indexId: String?
        /// The name that you gave the data source when it was created.
        public let name: String?
        /// The Amazon Resource Name (ARN) of the role that enables the data source to access its resources.
        public let roleArn: String?
        /// The schedule that Amazon Kendra will update the data source.
        public let schedule: String?
        /// The current status of the data source. When the status is ACTIVE the data source is ready to use. When the status is FAILED, the ErrorMessage field contains the reason that the data source failed.
        public let status: DataSourceStatus?
        /// The type of the data source.
        public let type: DataSourceType?
        /// The Unix timestamp of when the data source was last updated.
        public let updatedAt: Date?

        public init(configuration: DataSourceConfiguration? = nil, createdAt: Date? = nil, description: String? = nil, errorMessage: String? = nil, id: String? = nil, indexId: String? = nil, name: String? = nil, roleArn: String? = nil, schedule: String? = nil, status: DataSourceStatus? = nil, type: DataSourceType? = nil, updatedAt: Date? = nil) {
            self.configuration = configuration
            self.createdAt = createdAt
            self.description = description
            self.errorMessage = errorMessage
            self.id = id
            self.indexId = indexId
            self.name = name
            self.roleArn = roleArn
            self.schedule = schedule
            self.status = status
            self.type = type
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case configuration = "Configuration"
            case createdAt = "CreatedAt"
            case description = "Description"
            case errorMessage = "ErrorMessage"
            case id = "Id"
            case indexId = "IndexId"
            case name = "Name"
            case roleArn = "RoleArn"
            case schedule = "Schedule"
            case status = "Status"
            case type = "Type"
            case updatedAt = "UpdatedAt"
        }
    }

    public struct DescribeFaqRequest: AWSEncodableShape {
        /// The unique identifier of the FAQ.
        public let id: String
        /// The identifier of the index that contains the FAQ.
        public let indexId: String

        public init(id: String, indexId: String) {
            self.id = id
            self.indexId = indexId
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case indexId = "IndexId"
        }
    }

    public struct DescribeFaqResponse: AWSDecodableShape {
        /// The date and time that the FAQ was created.
        public let createdAt: Date?
        /// The description of the FAQ that you provided when it was created.
        public let description: String?
        /// If the Status field is FAILED, the ErrorMessage field contains the reason why the FAQ failed.
        public let errorMessage: String?
        /// The file format used by the input files for the FAQ.
        public let fileFormat: FaqFileFormat?
        /// The identifier of the FAQ.
        public let id: String?
        /// The identifier of the index that contains the FAQ.
        public let indexId: String?
        /// The name that you gave the FAQ when it was created.
        public let name: String?
        /// The Amazon Resource Name (ARN) of the role that provides access to the S3 bucket containing the input files for the FAQ.
        public let roleArn: String?
        public let s3Path: S3Path?
        /// The status of the FAQ. It is ready to use when the status is ACTIVE.
        public let status: FaqStatus?
        /// The date and time that the FAQ was last updated.
        public let updatedAt: Date?

        public init(createdAt: Date? = nil, description: String? = nil, errorMessage: String? = nil, fileFormat: FaqFileFormat? = nil, id: String? = nil, indexId: String? = nil, name: String? = nil, roleArn: String? = nil, s3Path: S3Path? = nil, status: FaqStatus? = nil, updatedAt: Date? = nil) {
            self.createdAt = createdAt
            self.description = description
            self.errorMessage = errorMessage
            self.fileFormat = fileFormat
            self.id = id
            self.indexId = indexId
            self.name = name
            self.roleArn = roleArn
            self.s3Path = s3Path
            self.status = status
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case createdAt = "CreatedAt"
            case description = "Description"
            case errorMessage = "ErrorMessage"
            case fileFormat = "FileFormat"
            case id = "Id"
            case indexId = "IndexId"
            case name = "Name"
            case roleArn = "RoleArn"
            case s3Path = "S3Path"
            case status = "Status"
            case updatedAt = "UpdatedAt"
        }
    }

    public struct DescribeIndexRequest: AWSEncodableShape {
        /// The name of the index to describe.
        public let id: String

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

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 36)
            try self.validate(self.id, name: "id", parent: name, min: 36)
            try self.validate(self.id, name: "id", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
        }

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

    public struct DescribeIndexResponse: AWSDecodableShape {
        /// For enterprise edtion indexes, you can choose to use additional capacity to meet the needs of your application. This contains the capacity units used for the index. A 0 for the query capacity or the storage capacity indicates that the index is using the default capacity for the index.
        public let capacityUnits: CapacityUnitsConfiguration?
        /// The Unix datetime that the index was created.
        public let createdAt: Date?
        /// The description of the index.
        public let description: String?
        /// Configuration settings for any metadata applied to the documents in the index.
        public let documentMetadataConfigurations: [DocumentMetadataConfiguration]?
        /// The Amazon Kendra edition used for the index. You decide the edition when you create the index.
        public let edition: IndexEdition?
        /// When th eStatus field value is FAILED, the ErrorMessage field contains a message that explains why.
        public let errorMessage: String?
        /// The name of the index.
        public let id: String?
        /// Provides information about the number of FAQ questions and answers and the number of text documents indexed.
        public let indexStatistics: IndexStatistics?
        /// The name of the index.
        public let name: String?
        /// The Amazon Resource Name (ARN) of the IAM role that gives Amazon Kendra permission to write to your Amazon Cloudwatch logs.
        public let roleArn: String?
        /// The identifier of the AWS KMS customer master key (CMK) used to encrypt your data. Amazon Kendra doesn't support asymmetric CMKs.
        public let serverSideEncryptionConfiguration: ServerSideEncryptionConfiguration?
        /// The current status of the index. When the value is ACTIVE, the index is ready for use. If the Status field value is FAILED, the ErrorMessage field contains a message that explains why.
        public let status: IndexStatus?
        /// The Unix datetime that the index was last updated.
        public let updatedAt: Date?
        /// The user context policy for the Amazon Kendra index.
        public let userContextPolicy: UserContextPolicy?
        /// The user token configuration for the Amazon Kendra index.
        public let userTokenConfigurations: [UserTokenConfiguration]?

        public init(capacityUnits: CapacityUnitsConfiguration? = nil, createdAt: Date? = nil, description: String? = nil, documentMetadataConfigurations: [DocumentMetadataConfiguration]? = nil, edition: IndexEdition? = nil, errorMessage: String? = nil, id: String? = nil, indexStatistics: IndexStatistics? = nil, name: String? = nil, roleArn: String? = nil, serverSideEncryptionConfiguration: ServerSideEncryptionConfiguration? = nil, status: IndexStatus? = nil, updatedAt: Date? = nil, userContextPolicy: UserContextPolicy? = nil, userTokenConfigurations: [UserTokenConfiguration]? = nil) {
            self.capacityUnits = capacityUnits
            self.createdAt = createdAt
            self.description = description
            self.documentMetadataConfigurations = documentMetadataConfigurations
            self.edition = edition
            self.errorMessage = errorMessage
            self.id = id
            self.indexStatistics = indexStatistics
            self.name = name
            self.roleArn = roleArn
            self.serverSideEncryptionConfiguration = serverSideEncryptionConfiguration
            self.status = status
            self.updatedAt = updatedAt
            self.userContextPolicy = userContextPolicy
            self.userTokenConfigurations = userTokenConfigurations
        }

        private enum CodingKeys: String, CodingKey {
            case capacityUnits = "CapacityUnits"
            case createdAt = "CreatedAt"
            case description = "Description"
            case documentMetadataConfigurations = "DocumentMetadataConfigurations"
            case edition = "Edition"
            case errorMessage = "ErrorMessage"
            case id = "Id"
            case indexStatistics = "IndexStatistics"
            case name = "Name"
            case roleArn = "RoleArn"
            case serverSideEncryptionConfiguration = "ServerSideEncryptionConfiguration"
            case status = "Status"
            case updatedAt = "UpdatedAt"
            case userContextPolicy = "UserContextPolicy"
            case userTokenConfigurations = "UserTokenConfigurations"
        }
    }

    public struct DescribeThesaurusRequest: AWSEncodableShape {
        /// The identifier of the thesaurus to describe.
        public let id: String
        /// The identifier of the index associated with the thesaurus to describe.
        public let indexId: String

        public init(id: String, indexId: String) {
            self.id = id
            self.indexId = indexId
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case indexId = "IndexId"
        }
    }

    public struct DescribeThesaurusResponse: AWSDecodableShape {
        /// The Unix datetime that the thesaurus was created.
        public let createdAt: Date?
        /// The thesaurus description.
        public let description: String?
        /// When the Status field value is FAILED, the ErrorMessage field provides more information.
        public let errorMessage: String?
        /// The size of the thesaurus file in bytes.
        public let fileSizeBytes: Int64?
        /// The identifier of the thesaurus.
        public let id: String?
        /// The identifier of the index associated with the thesaurus to describe.
        public let indexId: String?
        /// The thesaurus name.
        public let name: String?
        /// An AWS Identity and Access Management (IAM) role that gives Amazon Kendra permissions to access thesaurus file specified in SourceS3Path.
        public let roleArn: String?
        public let sourceS3Path: S3Path?
        /// The current status of the thesaurus. When the value is ACTIVE, queries are able to use the thesaurus. If the Status field value is FAILED, the ErrorMessage field provides more information.  If the status is ACTIVE_BUT_UPDATE_FAILED, it means that Amazon Kendra could not ingest the new thesaurus file. The old thesaurus file is still active.
        public let status: ThesaurusStatus?
        /// The number of synonym rules in the thesaurus file.
        public let synonymRuleCount: Int64?
        /// The number of unique terms in the thesaurus file. For example, the synonyms a,b,c and a=&gt;d, the term count would be 4.
        public let termCount: Int64?
        /// The Unix datetime that the thesaurus was last updated.
        public let updatedAt: Date?

        public init(createdAt: Date? = nil, description: String? = nil, errorMessage: String? = nil, fileSizeBytes: Int64? = nil, id: String? = nil, indexId: String? = nil, name: String? = nil, roleArn: String? = nil, sourceS3Path: S3Path? = nil, status: ThesaurusStatus? = nil, synonymRuleCount: Int64? = nil, termCount: Int64? = nil, updatedAt: Date? = nil) {
            self.createdAt = createdAt
            self.description = description
            self.errorMessage = errorMessage
            self.fileSizeBytes = fileSizeBytes
            self.id = id
            self.indexId = indexId
            self.name = name
            self.roleArn = roleArn
            self.sourceS3Path = sourceS3Path
            self.status = status
            self.synonymRuleCount = synonymRuleCount
            self.termCount = termCount
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case createdAt = "CreatedAt"
            case description = "Description"
            case errorMessage = "ErrorMessage"
            case fileSizeBytes = "FileSizeBytes"
            case id = "Id"
            case indexId = "IndexId"
            case name = "Name"
            case roleArn = "RoleArn"
            case sourceS3Path = "SourceS3Path"
            case status = "Status"
            case synonymRuleCount = "SynonymRuleCount"
            case termCount = "TermCount"
            case updatedAt = "UpdatedAt"
        }
    }

    public struct Document: AWSEncodableShape {
        /// Information to use for user context filtering.
        public let accessControlList: [Principal]?
        /// Custom attributes to apply to the document. Use the custom attributes to provide additional information for searching, to provide facets for refining searches, and to provide additional information in the query response.
        public let attributes: [DocumentAttribute]?
        /// The contents of the document.  Documents passed to the Blob parameter must be base64 encoded. Your code might not need to encode the document file bytes if you're using an AWS SDK to call Amazon Kendra operations. If you are calling the Amazon Kendra endpoint directly using REST, you must base64 encode the contents before sending.
        public let blob: Data?
        /// The file type of the document in the Blob field.
        public let contentType: ContentType?
        /// A unique identifier of the document in the index.
        public let id: String
        public let s3Path: S3Path?
        /// The title of the document.
        public let title: String?

        public init(accessControlList: [Principal]? = nil, attributes: [DocumentAttribute]? = nil, blob: Data? = nil, contentType: ContentType? = nil, id: String, s3Path: S3Path? = nil, title: String? = nil) {
            self.accessControlList = accessControlList
            self.attributes = attributes
            self.blob = blob
            self.contentType = contentType
            self.id = id
            self.s3Path = s3Path
            self.title = title
        }

        public func validate(name: String) throws {
            try self.accessControlList?.forEach {
                try $0.validate(name: "\(name).accessControlList[]")
            }
            try self.attributes?.forEach {
                try $0.validate(name: "\(name).attributes[]")
            }
            try self.validate(self.id, name: "id", parent: name, max: 2048)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.s3Path?.validate(name: "\(name).s3Path")
        }

        private enum CodingKeys: String, CodingKey {
            case accessControlList = "AccessControlList"
            case attributes = "Attributes"
            case blob = "Blob"
            case contentType = "ContentType"
            case id = "Id"
            case s3Path = "S3Path"
            case title = "Title"
        }
    }

    public struct DocumentAttribute: AWSEncodableShape & AWSDecodableShape {
        /// The identifier for the attribute.
        public let key: String
        /// The value of the attribute.
        public let value: DocumentAttributeValue

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

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 200)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.key, name: "key", parent: name, pattern: "[a-zA-Z0-9_][a-zA-Z0-9_-]*")
            try self.value.validate(name: "\(name).value")
        }

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

    public struct DocumentAttributeValue: AWSEncodableShape & AWSDecodableShape {
        /// A date expressed as an ISO 8601 string.
        public let dateValue: Date?
        /// A long integer value.
        public let longValue: Int64?
        /// A list of strings.
        public let stringListValue: [String]?
        /// A string, such as "department".
        public let stringValue: String?

        public init(dateValue: Date? = nil, longValue: Int64? = nil, stringListValue: [String]? = nil, stringValue: String? = nil) {
            self.dateValue = dateValue
            self.longValue = longValue
            self.stringListValue = stringListValue
            self.stringValue = stringValue
        }

        public func validate(name: String) throws {
            try self.stringListValue?.forEach {
                try validate($0, name: "stringListValue[]", parent: name, max: 2048)
                try validate($0, name: "stringListValue[]", parent: name, min: 1)
            }
            try self.validate(self.stringValue, name: "stringValue", parent: name, max: 2048)
            try self.validate(self.stringValue, name: "stringValue", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case dateValue = "DateValue"
            case longValue = "LongValue"
            case stringListValue = "StringListValue"
            case stringValue = "StringValue"
        }
    }

    public struct DocumentAttributeValueCountPair: AWSDecodableShape {
        /// The number of documents in the response that have the attribute value for the key.
        public let count: Int?
        /// The value of the attribute. For example, "HR."
        public let documentAttributeValue: DocumentAttributeValue?

        public init(count: Int? = nil, documentAttributeValue: DocumentAttributeValue? = nil) {
            self.count = count
            self.documentAttributeValue = documentAttributeValue
        }

        private enum CodingKeys: String, CodingKey {
            case count = "Count"
            case documentAttributeValue = "DocumentAttributeValue"
        }
    }

    public struct DocumentMetadataConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The name of the index field.
        public let name: String
        /// Provides manual tuning parameters to determine how the field affects the search results.
        public let relevance: Relevance?
        /// Provides information about how the field is used during a search.
        public let search: Search?
        /// The data type of the index field.
        public let type: DocumentAttributeValueType

        public init(name: String, relevance: Relevance? = nil, search: Search? = nil, type: DocumentAttributeValueType) {
            self.name = name
            self.relevance = relevance
            self.search = search
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 30)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.relevance?.validate(name: "\(name).relevance")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case relevance = "Relevance"
            case search = "Search"
            case type = "Type"
        }
    }

    public struct DocumentsMetadataConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// A prefix used to filter metadata configuration files in the AWS S3 bucket. The S3 bucket might contain multiple metadata files. Use S3Prefix to include only the desired metadata files.
        public let s3Prefix: String?

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

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

        private enum CodingKeys: String, CodingKey {
            case s3Prefix = "S3Prefix"
        }
    }

    public struct Facet: AWSEncodableShape {
        /// The unique key for the document attribute.
        public let documentAttributeKey: String?

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

        public func validate(name: String) throws {
            try self.validate(self.documentAttributeKey, name: "documentAttributeKey", parent: name, max: 200)
            try self.validate(self.documentAttributeKey, name: "documentAttributeKey", parent: name, min: 1)
            try self.validate(self.documentAttributeKey, name: "documentAttributeKey", parent: name, pattern: "[a-zA-Z0-9_][a-zA-Z0-9_-]*")
        }

        private enum CodingKeys: String, CodingKey {
            case documentAttributeKey = "DocumentAttributeKey"
        }
    }

    public struct FacetResult: AWSDecodableShape {
        /// The key for the facet values. This is the same as the DocumentAttributeKey provided in the query.
        public let documentAttributeKey: String?
        /// An array of key/value pairs, where the key is the value of the attribute and the count is the number of documents that share the key value.
        public let documentAttributeValueCountPairs: [DocumentAttributeValueCountPair]?
        /// The data type of the facet value. This is the same as the type defined for the index field when it was created.
        public let documentAttributeValueType: DocumentAttributeValueType?

        public init(documentAttributeKey: String? = nil, documentAttributeValueCountPairs: [DocumentAttributeValueCountPair]? = nil, documentAttributeValueType: DocumentAttributeValueType? = nil) {
            self.documentAttributeKey = documentAttributeKey
            self.documentAttributeValueCountPairs = documentAttributeValueCountPairs
            self.documentAttributeValueType = documentAttributeValueType
        }

        private enum CodingKeys: String, CodingKey {
            case documentAttributeKey = "DocumentAttributeKey"
            case documentAttributeValueCountPairs = "DocumentAttributeValueCountPairs"
            case documentAttributeValueType = "DocumentAttributeValueType"
        }
    }

    public struct FaqStatistics: AWSDecodableShape {
        /// The total number of FAQ questions and answers contained in the index.
        public let indexedQuestionAnswersCount: Int

        public init(indexedQuestionAnswersCount: Int) {
            self.indexedQuestionAnswersCount = indexedQuestionAnswersCount
        }

        private enum CodingKeys: String, CodingKey {
            case indexedQuestionAnswersCount = "IndexedQuestionAnswersCount"
        }
    }

    public struct FaqSummary: AWSDecodableShape {
        /// The UNIX datetime that the FAQ was added to the index.
        public let createdAt: Date?
        /// The file type used to create the FAQ.
        public let fileFormat: FaqFileFormat?
        /// The unique identifier of the FAQ.
        public let id: String?
        /// The name that you assigned the FAQ when you created or updated the FAQ.
        public let name: String?
        /// The current status of the FAQ. When the status is ACTIVE the FAQ is ready for use.
        public let status: FaqStatus?
        /// The UNIX datetime that the FAQ was last updated.
        public let updatedAt: Date?

        public init(createdAt: Date? = nil, fileFormat: FaqFileFormat? = nil, id: String? = nil, name: String? = nil, status: FaqStatus? = nil, updatedAt: Date? = nil) {
            self.createdAt = createdAt
            self.fileFormat = fileFormat
            self.id = id
            self.name = name
            self.status = status
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case createdAt = "CreatedAt"
            case fileFormat = "FileFormat"
            case id = "Id"
            case name = "Name"
            case status = "Status"
            case updatedAt = "UpdatedAt"
        }
    }

    public struct GoogleDriveConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// A list of MIME types to exclude from the index. All documents matching the specified MIME type are excluded.  For a list of MIME types, see Using a Google Workspace Drive data source.
        public let excludeMimeTypes: [String]?
        /// A list of identifiers or shared drives to exclude from the index. All files and folders stored on the shared drive are excluded.
        public let excludeSharedDrives: [String]?
        /// A list of email addresses of the users. Documents owned by these users are excluded from the index. Documents shared with excluded users are indexed unless they are excluded in another way.
        public let excludeUserAccounts: [String]?
        /// A list of regular expression patterns that apply to the path on Google Drive. Items that match the pattern are excluded from the index from both shared drives and users' My Drives. Items that don't match the pattern are included in the index. If an item matches both an exclusion pattern and an inclusion pattern, it is excluded from the index.
        public let exclusionPatterns: [String]?
        /// Defines mapping between a field in the Google Drive and a Amazon Kendra index field. If you are using the console, you can define index fields when creating the mapping. If you are using the API, you must first create the field using the UpdateIndex operation.
        public let fieldMappings: [DataSourceToIndexFieldMapping]?
        /// A list of regular expression patterns that apply to path on Google Drive. Items that match the pattern are included in the index from both shared drives and users' My Drives. Items that don't match the pattern are excluded from the index. If an item matches both an inclusion pattern and an exclusion pattern, it is excluded from the index.
        public let inclusionPatterns: [String]?
        /// The Amazon Resource Name (ARN) of a AWS Secrets Manager secret that contains the credentials required to connect to Google Drive. For more information, see Using a Google Workspace Drive data source.
        public let secretArn: String

        public init(excludeMimeTypes: [String]? = nil, excludeSharedDrives: [String]? = nil, excludeUserAccounts: [String]? = nil, exclusionPatterns: [String]? = nil, fieldMappings: [DataSourceToIndexFieldMapping]? = nil, inclusionPatterns: [String]? = nil, secretArn: String) {
            self.excludeMimeTypes = excludeMimeTypes
            self.excludeSharedDrives = excludeSharedDrives
            self.excludeUserAccounts = excludeUserAccounts
            self.exclusionPatterns = exclusionPatterns
            self.fieldMappings = fieldMappings
            self.inclusionPatterns = inclusionPatterns
            self.secretArn = secretArn
        }

        public func validate(name: String) throws {
            try self.excludeMimeTypes?.forEach {
                try validate($0, name: "excludeMimeTypes[]", parent: name, max: 256)
                try validate($0, name: "excludeMimeTypes[]", parent: name, min: 1)
                try validate($0, name: "excludeMimeTypes[]", parent: name, pattern: "^\\P{C}*$")
            }
            try self.validate(self.excludeMimeTypes, name: "excludeMimeTypes", parent: name, max: 30)
            try self.validate(self.excludeMimeTypes, name: "excludeMimeTypes", parent: name, min: 0)
            try self.excludeSharedDrives?.forEach {
                try validate($0, name: "excludeSharedDrives[]", parent: name, max: 256)
                try validate($0, name: "excludeSharedDrives[]", parent: name, min: 1)
                try validate($0, name: "excludeSharedDrives[]", parent: name, pattern: "^\\P{C}*$")
            }
            try self.validate(self.excludeSharedDrives, name: "excludeSharedDrives", parent: name, max: 100)
            try self.validate(self.excludeSharedDrives, name: "excludeSharedDrives", parent: name, min: 0)
            try self.excludeUserAccounts?.forEach {
                try validate($0, name: "excludeUserAccounts[]", parent: name, max: 256)
                try validate($0, name: "excludeUserAccounts[]", parent: name, min: 1)
                try validate($0, name: "excludeUserAccounts[]", parent: name, pattern: "^\\P{C}*$")
            }
            try self.validate(self.excludeUserAccounts, name: "excludeUserAccounts", parent: name, max: 100)
            try self.validate(self.excludeUserAccounts, name: "excludeUserAccounts", parent: name, min: 0)
            try self.exclusionPatterns?.forEach {
                try validate($0, name: "exclusionPatterns[]", parent: name, max: 150)
                try validate($0, name: "exclusionPatterns[]", parent: name, min: 1)
            }
            try self.validate(self.exclusionPatterns, name: "exclusionPatterns", parent: name, max: 100)
            try self.validate(self.exclusionPatterns, name: "exclusionPatterns", parent: name, min: 0)
            try self.fieldMappings?.forEach {
                try $0.validate(name: "\(name).fieldMappings[]")
            }
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, max: 100)
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, min: 1)
            try self.inclusionPatterns?.forEach {
                try validate($0, name: "inclusionPatterns[]", parent: name, max: 150)
                try validate($0, name: "inclusionPatterns[]", parent: name, min: 1)
            }
            try self.validate(self.inclusionPatterns, name: "inclusionPatterns", parent: name, max: 100)
            try self.validate(self.inclusionPatterns, name: "inclusionPatterns", parent: name, min: 0)
            try self.validate(self.secretArn, name: "secretArn", parent: name, max: 1284)
            try self.validate(self.secretArn, name: "secretArn", parent: name, min: 1)
            try self.validate(self.secretArn, name: "secretArn", parent: name, pattern: "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}")
        }

        private enum CodingKeys: String, CodingKey {
            case excludeMimeTypes = "ExcludeMimeTypes"
            case excludeSharedDrives = "ExcludeSharedDrives"
            case excludeUserAccounts = "ExcludeUserAccounts"
            case exclusionPatterns = "ExclusionPatterns"
            case fieldMappings = "FieldMappings"
            case inclusionPatterns = "InclusionPatterns"
            case secretArn = "SecretArn"
        }
    }

    public struct Highlight: AWSDecodableShape {
        /// The zero-based location in the response string where the highlight starts.
        public let beginOffset: Int
        /// The zero-based location in the response string where the highlight ends.
        public let endOffset: Int
        /// Indicates whether the response is the best response. True if this is the best response; otherwise, false.
        public let topAnswer: Bool?
        /// The highlight type.
        public let type: HighlightType?

        public init(beginOffset: Int, endOffset: Int, topAnswer: Bool? = nil, type: HighlightType? = nil) {
            self.beginOffset = beginOffset
            self.endOffset = endOffset
            self.topAnswer = topAnswer
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case beginOffset = "BeginOffset"
            case endOffset = "EndOffset"
            case topAnswer = "TopAnswer"
            case type = "Type"
        }
    }

    public struct IndexConfigurationSummary: AWSDecodableShape {
        /// The Unix timestamp when the index was created.
        public let createdAt: Date
        /// Indicates whether the index is a enterprise edition index or a developer edition index.
        public let edition: IndexEdition?
        /// A unique identifier for the index. Use this to identify the index when you are using operations such as Query, DescribeIndex, UpdateIndex, and DeleteIndex.
        public let id: String?
        /// The name of the index.
        public let name: String?
        /// The current status of the index. When the status is ACTIVE, the index is ready to search.
        public let status: IndexStatus
        /// The Unix timestamp when the index was last updated by the UpdateIndex operation.
        public let updatedAt: Date

        public init(createdAt: Date, edition: IndexEdition? = nil, id: String? = nil, name: String? = nil, status: IndexStatus, updatedAt: Date) {
            self.createdAt = createdAt
            self.edition = edition
            self.id = id
            self.name = name
            self.status = status
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case createdAt = "CreatedAt"
            case edition = "Edition"
            case id = "Id"
            case name = "Name"
            case status = "Status"
            case updatedAt = "UpdatedAt"
        }
    }

    public struct IndexStatistics: AWSDecodableShape {
        /// The number of question and answer topics in the index.
        public let faqStatistics: FaqStatistics
        /// The number of text documents indexed.
        public let textDocumentStatistics: TextDocumentStatistics

        public init(faqStatistics: FaqStatistics, textDocumentStatistics: TextDocumentStatistics) {
            self.faqStatistics = faqStatistics
            self.textDocumentStatistics = textDocumentStatistics
        }

        private enum CodingKeys: String, CodingKey {
            case faqStatistics = "FaqStatistics"
            case textDocumentStatistics = "TextDocumentStatistics"
        }
    }

    public struct JsonTokenTypeConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The group attribute field.
        public let groupAttributeField: String
        /// The user name attribute field.
        public let userNameAttributeField: String

        public init(groupAttributeField: String, userNameAttributeField: String) {
            self.groupAttributeField = groupAttributeField
            self.userNameAttributeField = userNameAttributeField
        }

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

        private enum CodingKeys: String, CodingKey {
            case groupAttributeField = "GroupAttributeField"
            case userNameAttributeField = "UserNameAttributeField"
        }
    }

    public struct JwtTokenTypeConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The regular expression that identifies the claim.
        public let claimRegex: String?
        /// The group attribute field.
        public let groupAttributeField: String?
        /// The issuer of the token.
        public let issuer: String?
        /// The location of the key.
        public let keyLocation: KeyLocation
        /// The Amazon Resource Name (arn) of the secret.
        public let secretManagerArn: String?
        /// The signing key URL.
        public let url: String?
        /// The user name attribute field.
        public let userNameAttributeField: String?

        public init(claimRegex: String? = nil, groupAttributeField: String? = nil, issuer: String? = nil, keyLocation: KeyLocation, secretManagerArn: String? = nil, url: String? = nil, userNameAttributeField: String? = nil) {
            self.claimRegex = claimRegex
            self.groupAttributeField = groupAttributeField
            self.issuer = issuer
            self.keyLocation = keyLocation
            self.secretManagerArn = secretManagerArn
            self.url = url
            self.userNameAttributeField = userNameAttributeField
        }

        public func validate(name: String) throws {
            try self.validate(self.claimRegex, name: "claimRegex", parent: name, max: 100)
            try self.validate(self.claimRegex, name: "claimRegex", parent: name, min: 1)
            try self.validate(self.claimRegex, name: "claimRegex", parent: name, pattern: "^\\P{C}*$")
            try self.validate(self.groupAttributeField, name: "groupAttributeField", parent: name, max: 100)
            try self.validate(self.groupAttributeField, name: "groupAttributeField", parent: name, min: 1)
            try self.validate(self.groupAttributeField, name: "groupAttributeField", parent: name, pattern: "^\\P{C}*$")
            try self.validate(self.issuer, name: "issuer", parent: name, max: 65)
            try self.validate(self.issuer, name: "issuer", parent: name, min: 1)
            try self.validate(self.issuer, name: "issuer", parent: name, pattern: "^\\P{C}*$")
            try self.validate(self.secretManagerArn, name: "secretManagerArn", parent: name, max: 1284)
            try self.validate(self.secretManagerArn, name: "secretManagerArn", parent: name, min: 1)
            try self.validate(self.secretManagerArn, name: "secretManagerArn", parent: name, pattern: "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}")
            try self.validate(self.url, name: "url", parent: name, max: 2048)
            try self.validate(self.url, name: "url", parent: name, min: 1)
            try self.validate(self.url, name: "url", parent: name, pattern: "^(https?|ftp|file):\\/\\/([^\\s]*)")
            try self.validate(self.userNameAttributeField, name: "userNameAttributeField", parent: name, max: 100)
            try self.validate(self.userNameAttributeField, name: "userNameAttributeField", parent: name, min: 1)
            try self.validate(self.userNameAttributeField, name: "userNameAttributeField", parent: name, pattern: "^\\P{C}*$")
        }

        private enum CodingKeys: String, CodingKey {
            case claimRegex = "ClaimRegex"
            case groupAttributeField = "GroupAttributeField"
            case issuer = "Issuer"
            case keyLocation = "KeyLocation"
            case secretManagerArn = "SecretManagerArn"
            case url = "URL"
            case userNameAttributeField = "UserNameAttributeField"
        }
    }

    public struct ListDataSourceSyncJobsRequest: AWSEncodableShape {
        /// The identifier of the data source.
        public let id: String
        /// The identifier of the index that contains the data source.
        public let indexId: String
        /// The maximum number of synchronization jobs to return in the response. If there are fewer results in the list, this response contains only the actual results.
        public let maxResults: Int?
        /// If the result of the previous request to GetDataSourceSyncJobHistory was truncated, include the NextToken to fetch the next set of jobs.
        public let nextToken: String?
        /// When specified, the synchronization jobs returned in the list are limited to jobs between the specified dates.
        public let startTimeFilter: TimeRange?
        /// When specified, only returns synchronization jobs with the Status field equal to the specified status.
        public let statusFilter: DataSourceSyncJobStatus?

        public init(id: String, indexId: String, maxResults: Int? = nil, nextToken: String? = nil, startTimeFilter: TimeRange? = nil, statusFilter: DataSourceSyncJobStatus? = nil) {
            self.id = id
            self.indexId = indexId
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.startTimeFilter = startTimeFilter
            self.statusFilter = statusFilter
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 10)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 800)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case indexId = "IndexId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case startTimeFilter = "StartTimeFilter"
            case statusFilter = "StatusFilter"
        }
    }

    public struct ListDataSourceSyncJobsResponse: AWSDecodableShape {
        /// A history of synchronization jobs for the data source.
        public let history: [DataSourceSyncJob]?
        /// The GetDataSourceSyncJobHistory operation returns a page of vocabularies at a time. The maximum size of the page is set by the MaxResults parameter. If there are more jobs in the list than the page size, Amazon Kendra returns the NextPage token. Include the token in the next request to the GetDataSourceSyncJobHistory operation to return in the next page of jobs.
        public let nextToken: String?

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

        private enum CodingKeys: String, CodingKey {
            case history = "History"
            case nextToken = "NextToken"
        }
    }

    public struct ListDataSourcesRequest: AWSEncodableShape {
        /// The identifier of the index that contains the data source.
        public let indexId: String
        /// The maximum number of data sources to return.
        public let maxResults: Int?
        /// If the previous response was incomplete (because there is more data to retrieve), Amazon Kendra returns a pagination token in the response. You can use this pagination token to retrieve the next set of data sources (DataSourceSummaryItems).
        public let nextToken: String?

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

        public func validate(name: String) throws {
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-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: 800)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

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

    public struct ListDataSourcesResponse: AWSDecodableShape {
        /// If the response is truncated, Amazon Kendra returns this token that you can use in the subsequent request to retrieve the next set of data sources.
        public let nextToken: String?
        /// An array of summary information for one or more data sources.
        public let summaryItems: [DataSourceSummary]?

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

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case summaryItems = "SummaryItems"
        }
    }

    public struct ListFaqsRequest: AWSEncodableShape {
        /// The index that contains the FAQ lists.
        public let indexId: String
        /// The maximum number of FAQs to return in the response. If there are fewer results in the list, this response contains only the actual results.
        public let maxResults: Int?
        /// If the result of the previous request to ListFaqs was truncated, include the NextToken to fetch the next set of FAQs.
        public let nextToken: String?

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

        public func validate(name: String) throws {
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-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: 800)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

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

    public struct ListFaqsResponse: AWSDecodableShape {
        /// information about the FAQs associated with the specified index.
        public let faqSummaryItems: [FaqSummary]?
        /// The ListFaqs operation returns a page of FAQs at a time. The maximum size of the page is set by the MaxResults parameter. If there are more jobs in the list than the page size, Amazon Kendra returns the NextPage token. Include the token in the next request to the ListFaqs operation to return the next page of FAQs.
        public let nextToken: String?

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

        private enum CodingKeys: String, CodingKey {
            case faqSummaryItems = "FaqSummaryItems"
            case nextToken = "NextToken"
        }
    }

    public struct ListIndicesRequest: AWSEncodableShape {
        /// The maximum number of data sources to return.
        public let maxResults: Int?
        /// If the previous response was incomplete (because there is more data to retrieve), Amazon Kendra returns a pagination token in the response. You can use this pagination token to retrieve the next set of indexes (DataSourceSummaryItems).
        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: 800)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

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

    public struct ListIndicesResponse: AWSDecodableShape {
        /// An array of summary information for one or more indexes.
        public let indexConfigurationSummaryItems: [IndexConfigurationSummary]?
        /// If the response is truncated, Amazon Kendra returns this token that you can use in the subsequent request to retrieve the next set of indexes.
        public let nextToken: String?

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

        private enum CodingKeys: String, CodingKey {
            case indexConfigurationSummaryItems = "IndexConfigurationSummaryItems"
            case nextToken = "NextToken"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the index, FAQ, or data source to get a list of tags for.
        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: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
        }

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

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// A list of tags associated with the index, FAQ, or data source.
        public let tags: [Tag]?

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

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

    public struct ListThesauriRequest: AWSEncodableShape {
        /// The identifier of the index associated with the thesaurus to list.
        public let indexId: String
        /// The maximum number of thesauri to return.
        public let maxResults: Int?
        /// If the previous response was incomplete (because there is more data to retrieve), Amazon Kendra returns a pagination token in the response. You can use this pagination token to retrieve the next set of thesauri (ThesaurusSummaryItems).
        public let nextToken: String?

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

        public func validate(name: String) throws {
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-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: 800)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

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

    public struct ListThesauriResponse: AWSDecodableShape {
        /// If the response is truncated, Amazon Kendra returns this token that you can use in the subsequent request to retrieve the next set of thesauri.
        public let nextToken: String?
        /// An array of summary information for one or more thesauruses.
        public let thesaurusSummaryItems: [ThesaurusSummary]?

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

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case thesaurusSummaryItems = "ThesaurusSummaryItems"
        }
    }

    public struct OneDriveConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// A Boolean value that specifies whether local groups are disabled (True) or enabled (False).
        public let disableLocalGroups: Bool?
        /// List of regular expressions applied to documents. Items that match the exclusion pattern are not indexed. If you provide both an inclusion pattern and an exclusion pattern, any item that matches the exclusion pattern isn't indexed.  The exclusion pattern is applied to the file name.
        public let exclusionPatterns: [String]?
        /// A list of DataSourceToIndexFieldMapping objects that map Microsoft OneDrive fields to custom fields in the Amazon Kendra index. You must first create the index fields before you map OneDrive fields.
        public let fieldMappings: [DataSourceToIndexFieldMapping]?
        /// A list of regular expression patterns. Documents that match the pattern are included in the index. Documents that don't match the pattern are excluded from the index. If a document matches both an inclusion pattern and an exclusion pattern, the document is not included in the index.  The exclusion pattern is applied to the file name.
        public let inclusionPatterns: [String]?
        /// A list of user accounts whose documents should be indexed.
        public let oneDriveUsers: OneDriveUsers
        /// The Amazon Resource Name (ARN) of an AWS Secrets Manager secret that contains the user name and password to connect to OneDrive. The user namd should be the application ID for the OneDrive application, and the password is the application key for the OneDrive application.
        public let secretArn: String
        /// The Azure Active Directory domain of the organization.
        public let tenantDomain: String

        public init(disableLocalGroups: Bool? = nil, exclusionPatterns: [String]? = nil, fieldMappings: [DataSourceToIndexFieldMapping]? = nil, inclusionPatterns: [String]? = nil, oneDriveUsers: OneDriveUsers, secretArn: String, tenantDomain: String) {
            self.disableLocalGroups = disableLocalGroups
            self.exclusionPatterns = exclusionPatterns
            self.fieldMappings = fieldMappings
            self.inclusionPatterns = inclusionPatterns
            self.oneDriveUsers = oneDriveUsers
            self.secretArn = secretArn
            self.tenantDomain = tenantDomain
        }

        public func validate(name: String) throws {
            try self.exclusionPatterns?.forEach {
                try validate($0, name: "exclusionPatterns[]", parent: name, max: 150)
                try validate($0, name: "exclusionPatterns[]", parent: name, min: 1)
            }
            try self.validate(self.exclusionPatterns, name: "exclusionPatterns", parent: name, max: 100)
            try self.validate(self.exclusionPatterns, name: "exclusionPatterns", parent: name, min: 0)
            try self.fieldMappings?.forEach {
                try $0.validate(name: "\(name).fieldMappings[]")
            }
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, max: 100)
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, min: 1)
            try self.inclusionPatterns?.forEach {
                try validate($0, name: "inclusionPatterns[]", parent: name, max: 150)
                try validate($0, name: "inclusionPatterns[]", parent: name, min: 1)
            }
            try self.validate(self.inclusionPatterns, name: "inclusionPatterns", parent: name, max: 100)
            try self.validate(self.inclusionPatterns, name: "inclusionPatterns", parent: name, min: 0)
            try self.oneDriveUsers.validate(name: "\(name).oneDriveUsers")
            try self.validate(self.secretArn, name: "secretArn", parent: name, max: 1284)
            try self.validate(self.secretArn, name: "secretArn", parent: name, min: 1)
            try self.validate(self.secretArn, name: "secretArn", parent: name, pattern: "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}")
            try self.validate(self.tenantDomain, name: "tenantDomain", parent: name, max: 256)
            try self.validate(self.tenantDomain, name: "tenantDomain", parent: name, min: 1)
            try self.validate(self.tenantDomain, name: "tenantDomain", parent: name, pattern: "^([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*\\.)+[a-z]{2,}$")
        }

        private enum CodingKeys: String, CodingKey {
            case disableLocalGroups = "DisableLocalGroups"
            case exclusionPatterns = "ExclusionPatterns"
            case fieldMappings = "FieldMappings"
            case inclusionPatterns = "InclusionPatterns"
            case oneDriveUsers = "OneDriveUsers"
            case secretArn = "SecretArn"
            case tenantDomain = "TenantDomain"
        }
    }

    public struct OneDriveUsers: AWSEncodableShape & AWSDecodableShape {
        /// A list of users whose documents should be indexed. Specify the user names in email format, for example, username@tenantdomain. If you need to index the documents of more than 100 users, use the OneDriveUserS3Path field to specify the location of a file containing a list of users.
        public let oneDriveUserList: [String]?
        /// The S3 bucket location of a file containing a list of users whose documents should be indexed.
        public let oneDriveUserS3Path: S3Path?

        public init(oneDriveUserList: [String]? = nil, oneDriveUserS3Path: S3Path? = nil) {
            self.oneDriveUserList = oneDriveUserList
            self.oneDriveUserS3Path = oneDriveUserS3Path
        }

        public func validate(name: String) throws {
            try self.oneDriveUserList?.forEach {
                try validate($0, name: "oneDriveUserList[]", parent: name, max: 256)
                try validate($0, name: "oneDriveUserList[]", parent: name, min: 1)
                try validate($0, name: "oneDriveUserList[]", parent: name, pattern: "^(?!\\s).+@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5})$")
            }
            try self.validate(self.oneDriveUserList, name: "oneDriveUserList", parent: name, max: 100)
            try self.validate(self.oneDriveUserList, name: "oneDriveUserList", parent: name, min: 1)
            try self.oneDriveUserS3Path?.validate(name: "\(name).oneDriveUserS3Path")
        }

        private enum CodingKeys: String, CodingKey {
            case oneDriveUserList = "OneDriveUserList"
            case oneDriveUserS3Path = "OneDriveUserS3Path"
        }
    }

    public struct Principal: AWSEncodableShape {
        /// Whether to allow or deny access to the principal.
        public let access: ReadAccessType
        /// The name of the user or group.
        public let name: String
        /// The type of principal.
        public let type: PrincipalType

        public init(access: ReadAccessType, name: String, type: PrincipalType) {
            self.access = access
            self.name = name
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 200)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^\\P{C}*$")
        }

        private enum CodingKeys: String, CodingKey {
            case access = "Access"
            case name = "Name"
            case type = "Type"
        }
    }

    public struct QueryRequest: AWSEncodableShape {
        /// Enables filtered searches based on document attributes. You can only provide one attribute filter; however, the AndAllFilters, NotFilter, and OrAllFilters parameters contain a list of other filters. The AttributeFilter parameter enables you to create a set of filtering rules that a document must satisfy to be included in the query results.
        public let attributeFilter: AttributeFilter?
        /// An array of documents attributes. Amazon Kendra returns a count for each attribute key specified. You can use this information to help narrow the search for your user.
        public let facets: [Facet]?
        /// The unique identifier of the index to search. The identifier is returned in the response from the operation.
        public let indexId: String
        /// Query results are returned in pages the size of the PageSize parameter. By default, Amazon Kendra returns the first page of results. Use this parameter to get result pages after the first one.
        public let pageNumber: Int?
        /// Sets the number of results that are returned in each page of results. The default page size is 10. The maximum number of results returned is 100. If you ask for more than 100 results, only 100 are returned.
        public let pageSize: Int?
        /// Sets the type of query. Only results for the specified query type are returned.
        public let queryResultTypeFilter: QueryResultType?
        /// The text to search for.
        public let queryText: String
        /// An array of document attributes to include in the response. No other document attributes are included in the response. By default all document attributes are included in the response.
        public let requestedDocumentAttributes: [String]?
        /// Provides information that determines how the results of the query are sorted. You can set the field that Amazon Kendra should sort the results on, and specify whether the results should be sorted in ascending or descending order. In the case of ties in sorting the results, the results are sorted by relevance. If you don't provide sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result.
        public let sortingConfiguration: SortingConfiguration?
        /// The user context token.
        public let userContext: UserContext?
        /// Provides an identifier for a specific user. The VisitorId should be a unique identifier, such as a GUID. Don't use personally identifiable information, such as the user's email address, as the VisitorId.
        public let visitorId: String?

        public init(attributeFilter: AttributeFilter? = nil, facets: [Facet]? = nil, indexId: String, pageNumber: Int? = nil, pageSize: Int? = nil, queryResultTypeFilter: QueryResultType? = nil, queryText: String, requestedDocumentAttributes: [String]? = nil, sortingConfiguration: SortingConfiguration? = nil, userContext: UserContext? = nil, visitorId: String? = nil) {
            self.attributeFilter = attributeFilter
            self.facets = facets
            self.indexId = indexId
            self.pageNumber = pageNumber
            self.pageSize = pageSize
            self.queryResultTypeFilter = queryResultTypeFilter
            self.queryText = queryText
            self.requestedDocumentAttributes = requestedDocumentAttributes
            self.sortingConfiguration = sortingConfiguration
            self.userContext = userContext
            self.visitorId = visitorId
        }

        public func validate(name: String) throws {
            try self.attributeFilter?.validate(name: "\(name).attributeFilter")
            try self.facets?.forEach {
                try $0.validate(name: "\(name).facets[]")
            }
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
            try self.validate(self.queryText, name: "queryText", parent: name, max: 1000)
            try self.validate(self.queryText, name: "queryText", parent: name, min: 1)
            try self.validate(self.queryText, name: "queryText", parent: name, pattern: "^\\P{C}*$")
            try self.requestedDocumentAttributes?.forEach {
                try validate($0, name: "requestedDocumentAttributes[]", parent: name, max: 200)
                try validate($0, name: "requestedDocumentAttributes[]", parent: name, min: 1)
                try validate($0, name: "requestedDocumentAttributes[]", parent: name, pattern: "[a-zA-Z0-9_][a-zA-Z0-9_-]*")
            }
            try self.validate(self.requestedDocumentAttributes, name: "requestedDocumentAttributes", parent: name, max: 100)
            try self.validate(self.requestedDocumentAttributes, name: "requestedDocumentAttributes", parent: name, min: 1)
            try self.sortingConfiguration?.validate(name: "\(name).sortingConfiguration")
            try self.userContext?.validate(name: "\(name).userContext")
            try self.validate(self.visitorId, name: "visitorId", parent: name, max: 256)
            try self.validate(self.visitorId, name: "visitorId", parent: name, min: 1)
            try self.validate(self.visitorId, name: "visitorId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
        }

        private enum CodingKeys: String, CodingKey {
            case attributeFilter = "AttributeFilter"
            case facets = "Facets"
            case indexId = "IndexId"
            case pageNumber = "PageNumber"
            case pageSize = "PageSize"
            case queryResultTypeFilter = "QueryResultTypeFilter"
            case queryText = "QueryText"
            case requestedDocumentAttributes = "RequestedDocumentAttributes"
            case sortingConfiguration = "SortingConfiguration"
            case userContext = "UserContext"
            case visitorId = "VisitorId"
        }
    }

    public struct QueryResult: AWSDecodableShape {
        /// Contains the facet results. A FacetResult contains the counts for each attribute key that was specified in the Facets input parameter.
        public let facetResults: [FacetResult]?
        /// The unique identifier for the search. You use QueryId to identify the search when using the feedback API.
        public let queryId: String?
        /// The results of the search.
        public let resultItems: [QueryResultItem]?
        /// The total number of items found by the search; however, you can only retrieve up to 100 items. For example, if the search found 192 items, you can only retrieve the first 100 of the items.
        public let totalNumberOfResults: Int?

        public init(facetResults: [FacetResult]? = nil, queryId: String? = nil, resultItems: [QueryResultItem]? = nil, totalNumberOfResults: Int? = nil) {
            self.facetResults = facetResults
            self.queryId = queryId
            self.resultItems = resultItems
            self.totalNumberOfResults = totalNumberOfResults
        }

        private enum CodingKeys: String, CodingKey {
            case facetResults = "FacetResults"
            case queryId = "QueryId"
            case resultItems = "ResultItems"
            case totalNumberOfResults = "TotalNumberOfResults"
        }
    }

    public struct QueryResultItem: AWSDecodableShape {
        /// One or more additional attributes associated with the query result.
        public let additionalAttributes: [AdditionalResultAttribute]?
        /// An array of document attributes for the document that the query result maps to. For example, the document author (Author) or the source URI (SourceUri) of the document.
        public let documentAttributes: [DocumentAttribute]?
        /// An extract of the text in the document. Contains information about highlighting the relevant terms in the excerpt.
        public let documentExcerpt: TextWithHighlights?
        /// The unique identifier for the document.
        public let documentId: String?
        /// The title of the document. Contains the text of the title and information for highlighting the relevant terms in the title.
        public let documentTitle: TextWithHighlights?
        /// The URI of the original location of the document.
        public let documentURI: String?
        /// A token that identifies a particular result from a particular query. Use this token to provide click-through feedback for the result. For more information, see  Submitting feedback .
        public let feedbackToken: String?
        /// The unique identifier for the query result.
        public let id: String?
        /// Indicates the confidence that Amazon Kendra has that a result matches the query that you provided. Each result is placed into a bin that indicates the confidence, VERY_HIGH, HIGH, MEDIUM and LOW. You can use the score to determine if a response meets the confidence needed for your application. The field is only set to LOW when the Type field is set to DOCUMENT and Amazon Kendra is not confident that the result matches the query.
        public let scoreAttributes: ScoreAttributes?
        /// The type of document.
        public let type: QueryResultType?

        public init(additionalAttributes: [AdditionalResultAttribute]? = nil, documentAttributes: [DocumentAttribute]? = nil, documentExcerpt: TextWithHighlights? = nil, documentId: String? = nil, documentTitle: TextWithHighlights? = nil, documentURI: String? = nil, feedbackToken: String? = nil, id: String? = nil, scoreAttributes: ScoreAttributes? = nil, type: QueryResultType? = nil) {
            self.additionalAttributes = additionalAttributes
            self.documentAttributes = documentAttributes
            self.documentExcerpt = documentExcerpt
            self.documentId = documentId
            self.documentTitle = documentTitle
            self.documentURI = documentURI
            self.feedbackToken = feedbackToken
            self.id = id
            self.scoreAttributes = scoreAttributes
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case additionalAttributes = "AdditionalAttributes"
            case documentAttributes = "DocumentAttributes"
            case documentExcerpt = "DocumentExcerpt"
            case documentId = "DocumentId"
            case documentTitle = "DocumentTitle"
            case documentURI = "DocumentURI"
            case feedbackToken = "FeedbackToken"
            case id = "Id"
            case scoreAttributes = "ScoreAttributes"
            case type = "Type"
        }
    }

    public struct Relevance: AWSEncodableShape & AWSDecodableShape {
        /// Specifies the time period that the boost applies to. For example, to make the boost apply to documents with the field value within the last month, you would use "2628000s". Once the field value is beyond the specified range, the effect of the boost drops off. The higher the importance, the faster the effect drops off. If you don't specify a value, the default is 3 months. The value of the field is a numeric string followed by the character "s", for example "86400s" for one day, or "604800s" for one week.  Only applies to DATE fields.
        public let duration: String?
        /// Indicates that this field determines how "fresh" a document is. For example, if document 1 was created on November 5, and document 2 was created on October 31, document 1 is "fresher" than document 2. You can only set the Freshness field on one DATE type field. Only applies to DATE fields.
        public let freshness: Bool?
        /// The relative importance of the field in the search. Larger numbers provide more of a boost than smaller numbers.
        public let importance: Int?
        /// Determines how values should be interpreted. When the RankOrder field is ASCENDING, higher numbers are better. For example, a document with a rating score of 10 is higher ranking than a document with a rating score of 1. When the RankOrder field is DESCENDING, lower numbers are better. For example, in a task tracking application, a priority 1 task is more important than a priority 5 task. Only applies to LONG and DOUBLE fields.
        public let rankOrder: Order?
        /// A list of values that should be given a different boost when they appear in the result list. For example, if you are boosting a field called "department," query terms that match the department field are boosted in the result. However, you can add entries from the department field to boost documents with those values higher.  For example, you can add entries to the map with names of departments. If you add "HR",5 and "Legal",3 those departments are given special attention when they appear in the metadata of a document. When those terms appear they are given the specified importance instead of the regular importance for the boost.
        public let valueImportanceMap: [String: Int]?

        public init(duration: String? = nil, freshness: Bool? = nil, importance: Int? = nil, rankOrder: Order? = nil, valueImportanceMap: [String: Int]? = nil) {
            self.duration = duration
            self.freshness = freshness
            self.importance = importance
            self.rankOrder = rankOrder
            self.valueImportanceMap = valueImportanceMap
        }

        public func validate(name: String) throws {
            try self.validate(self.duration, name: "duration", parent: name, max: 10)
            try self.validate(self.duration, name: "duration", parent: name, min: 1)
            try self.validate(self.duration, name: "duration", parent: name, pattern: "[0-9]+[s]")
            try self.validate(self.importance, name: "importance", parent: name, max: 10)
            try self.validate(self.importance, name: "importance", parent: name, min: 1)
            try self.valueImportanceMap?.forEach {
                try validate($0.key, name: "valueImportanceMap.key", parent: name, max: 50)
                try validate($0.key, name: "valueImportanceMap.key", parent: name, min: 1)
                try validate($0.value, name: "valueImportanceMap[\"\($0.key)\"]", parent: name, max: 10)
                try validate($0.value, name: "valueImportanceMap[\"\($0.key)\"]", parent: name, min: 1)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case duration = "Duration"
            case freshness = "Freshness"
            case importance = "Importance"
            case rankOrder = "RankOrder"
            case valueImportanceMap = "ValueImportanceMap"
        }
    }

    public struct RelevanceFeedback: AWSEncodableShape {
        /// Whether to document was relevant or not relevant to the search.
        public let relevanceValue: RelevanceType
        /// The unique identifier of the search result that the user provided relevance feedback for.
        public let resultId: String

        public init(relevanceValue: RelevanceType, resultId: String) {
            self.relevanceValue = relevanceValue
            self.resultId = resultId
        }

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

        private enum CodingKeys: String, CodingKey {
            case relevanceValue = "RelevanceValue"
            case resultId = "ResultId"
        }
    }

    public struct S3DataSourceConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Provides the path to the S3 bucket that contains the user context filtering files for the data source. For the format of the file, see Access control for S3 data sources.
        public let accessControlListConfiguration: AccessControlListConfiguration?
        /// The name of the bucket that contains the documents.
        public let bucketName: String
        public let documentsMetadataConfiguration: DocumentsMetadataConfiguration?
        /// A list of glob patterns for documents that should not be indexed. If a document that matches an inclusion prefix or inclusion pattern also matches an exclusion pattern, the document is not indexed. For more information about glob patterns, see glob (programming) in Wikipedia.
        public let exclusionPatterns: [String]?
        /// A list of glob patterns for documents that should be indexed. If a document that matches an inclusion pattern also matches an exclusion pattern, the document is not indexed. For more information about glob patterns, see glob (programming) in Wikipedia.
        public let inclusionPatterns: [String]?
        /// A list of S3 prefixes for the documents that should be included in the index.
        public let inclusionPrefixes: [String]?

        public init(accessControlListConfiguration: AccessControlListConfiguration? = nil, bucketName: String, documentsMetadataConfiguration: DocumentsMetadataConfiguration? = nil, exclusionPatterns: [String]? = nil, inclusionPatterns: [String]? = nil, inclusionPrefixes: [String]? = nil) {
            self.accessControlListConfiguration = accessControlListConfiguration
            self.bucketName = bucketName
            self.documentsMetadataConfiguration = documentsMetadataConfiguration
            self.exclusionPatterns = exclusionPatterns
            self.inclusionPatterns = inclusionPatterns
            self.inclusionPrefixes = inclusionPrefixes
        }

        public func validate(name: String) throws {
            try self.accessControlListConfiguration?.validate(name: "\(name).accessControlListConfiguration")
            try self.validate(self.bucketName, name: "bucketName", parent: name, max: 63)
            try self.validate(self.bucketName, name: "bucketName", parent: name, min: 3)
            try self.validate(self.bucketName, name: "bucketName", parent: name, pattern: "[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]")
            try self.documentsMetadataConfiguration?.validate(name: "\(name).documentsMetadataConfiguration")
            try self.exclusionPatterns?.forEach {
                try validate($0, name: "exclusionPatterns[]", parent: name, max: 150)
                try validate($0, name: "exclusionPatterns[]", parent: name, min: 1)
            }
            try self.validate(self.exclusionPatterns, name: "exclusionPatterns", parent: name, max: 100)
            try self.validate(self.exclusionPatterns, name: "exclusionPatterns", parent: name, min: 0)
            try self.inclusionPatterns?.forEach {
                try validate($0, name: "inclusionPatterns[]", parent: name, max: 150)
                try validate($0, name: "inclusionPatterns[]", parent: name, min: 1)
            }
            try self.validate(self.inclusionPatterns, name: "inclusionPatterns", parent: name, max: 100)
            try self.validate(self.inclusionPatterns, name: "inclusionPatterns", parent: name, min: 0)
            try self.inclusionPrefixes?.forEach {
                try validate($0, name: "inclusionPrefixes[]", parent: name, max: 150)
                try validate($0, name: "inclusionPrefixes[]", parent: name, min: 1)
            }
            try self.validate(self.inclusionPrefixes, name: "inclusionPrefixes", parent: name, max: 100)
            try self.validate(self.inclusionPrefixes, name: "inclusionPrefixes", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case accessControlListConfiguration = "AccessControlListConfiguration"
            case bucketName = "BucketName"
            case documentsMetadataConfiguration = "DocumentsMetadataConfiguration"
            case exclusionPatterns = "ExclusionPatterns"
            case inclusionPatterns = "InclusionPatterns"
            case inclusionPrefixes = "InclusionPrefixes"
        }
    }

    public struct S3Path: AWSEncodableShape & AWSDecodableShape {
        /// The name of the S3 bucket that contains the file.
        public let bucket: String
        /// The name of the file.
        public let key: String

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

        public func validate(name: String) throws {
            try self.validate(self.bucket, name: "bucket", parent: name, max: 63)
            try self.validate(self.bucket, name: "bucket", parent: name, min: 3)
            try self.validate(self.bucket, name: "bucket", parent: name, pattern: "[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]")
            try self.validate(self.key, name: "key", parent: name, max: 1024)
            try self.validate(self.key, name: "key", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case bucket = "Bucket"
            case key = "Key"
        }
    }

    public struct SalesforceChatterFeedConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The name of the column in the Salesforce FeedItem table that contains the content to index. Typically this is the Body column.
        public let documentDataFieldName: String
        /// The name of the column in the Salesforce FeedItem table that contains the title of the document. This is typically the Title collumn.
        public let documentTitleFieldName: String?
        /// Maps fields from a Salesforce chatter feed into Amazon Kendra index fields.
        public let fieldMappings: [DataSourceToIndexFieldMapping]?
        /// Filters the documents in the feed based on status of the user. When you specify ACTIVE_USERS only documents from users who have an active account are indexed. When you specify STANDARD_USER only documents for Salesforce standard users are documented. You can specify both.
        public let includeFilterTypes: [SalesforceChatterFeedIncludeFilterType]?

        public init(documentDataFieldName: String, documentTitleFieldName: String? = nil, fieldMappings: [DataSourceToIndexFieldMapping]? = nil, includeFilterTypes: [SalesforceChatterFeedIncludeFilterType]? = nil) {
            self.documentDataFieldName = documentDataFieldName
            self.documentTitleFieldName = documentTitleFieldName
            self.fieldMappings = fieldMappings
            self.includeFilterTypes = includeFilterTypes
        }

        public func validate(name: String) throws {
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, max: 100)
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, min: 1)
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_.]*$")
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, max: 100)
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, min: 1)
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_.]*$")
            try self.fieldMappings?.forEach {
                try $0.validate(name: "\(name).fieldMappings[]")
            }
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, max: 100)
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, min: 1)
            try self.validate(self.includeFilterTypes, name: "includeFilterTypes", parent: name, max: 2)
            try self.validate(self.includeFilterTypes, name: "includeFilterTypes", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case documentDataFieldName = "DocumentDataFieldName"
            case documentTitleFieldName = "DocumentTitleFieldName"
            case fieldMappings = "FieldMappings"
            case includeFilterTypes = "IncludeFilterTypes"
        }
    }

    public struct SalesforceConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Specifies configuration information for Salesforce chatter feeds.
        public let chatterFeedConfiguration: SalesforceChatterFeedConfiguration?
        /// Indicates whether Amazon Kendra should index attachments to Salesforce objects.
        public let crawlAttachments: Bool?
        /// A list of regular expression patterns. Documents that match the patterns are excluded from the index. Documents that don't match the patterns are included in the index. If a document matches both an exclusion pattern and an inclusion pattern, the document is not included in the index. The regex is applied to the name of the attached file.
        public let excludeAttachmentFilePatterns: [String]?
        /// A list of regular expression patterns. Documents that match the patterns are included in the index. Documents that don't match the patterns are excluded from the index. If a document matches both an inclusion pattern and an exclusion pattern, the document is not included in the index. The regex is applied to the name of the attached file.
        public let includeAttachmentFilePatterns: [String]?
        /// Specifies configuration information for the knowlege article types that Amazon Kendra indexes. Amazon Kendra indexes standard knowledge articles and the standard fields of knowledge articles, or the custom fields of custom knowledge articles, but not both.
        public let knowledgeArticleConfiguration: SalesforceKnowledgeArticleConfiguration?
        /// The Amazon Resource Name (ARN) of an AWS Secrets Manager secret that contains the key/value pairs required to connect to your Salesforce instance. The secret must contain a JSON structure with the following keys:   authenticationUrl - The OAUTH endpoint that Amazon Kendra connects to get an OAUTH token.    consumerKey - The application public key generated when you created your Salesforce application.   consumerSecret - The application private key generated when you created your Salesforce application.   password - The password associated with the user logging in to the Salesforce instance.   securityToken - The token associated with the user account logging in to the Salesforce instance.   username - The user name of the user logging in to the Salesforce instance.
        public let secretArn: String
        /// The instance URL for the Salesforce site that you want to index.
        public let serverUrl: String
        /// Provides configuration information for processing attachments to Salesforce standard objects.
        public let standardObjectAttachmentConfiguration: SalesforceStandardObjectAttachmentConfiguration?
        /// Specifies the Salesforce standard objects that Amazon Kendra indexes.
        public let standardObjectConfigurations: [SalesforceStandardObjectConfiguration]?

        public init(chatterFeedConfiguration: SalesforceChatterFeedConfiguration? = nil, crawlAttachments: Bool? = nil, excludeAttachmentFilePatterns: [String]? = nil, includeAttachmentFilePatterns: [String]? = nil, knowledgeArticleConfiguration: SalesforceKnowledgeArticleConfiguration? = nil, secretArn: String, serverUrl: String, standardObjectAttachmentConfiguration: SalesforceStandardObjectAttachmentConfiguration? = nil, standardObjectConfigurations: [SalesforceStandardObjectConfiguration]? = nil) {
            self.chatterFeedConfiguration = chatterFeedConfiguration
            self.crawlAttachments = crawlAttachments
            self.excludeAttachmentFilePatterns = excludeAttachmentFilePatterns
            self.includeAttachmentFilePatterns = includeAttachmentFilePatterns
            self.knowledgeArticleConfiguration = knowledgeArticleConfiguration
            self.secretArn = secretArn
            self.serverUrl = serverUrl
            self.standardObjectAttachmentConfiguration = standardObjectAttachmentConfiguration
            self.standardObjectConfigurations = standardObjectConfigurations
        }

        public func validate(name: String) throws {
            try self.chatterFeedConfiguration?.validate(name: "\(name).chatterFeedConfiguration")
            try self.excludeAttachmentFilePatterns?.forEach {
                try validate($0, name: "excludeAttachmentFilePatterns[]", parent: name, max: 150)
                try validate($0, name: "excludeAttachmentFilePatterns[]", parent: name, min: 1)
            }
            try self.validate(self.excludeAttachmentFilePatterns, name: "excludeAttachmentFilePatterns", parent: name, max: 100)
            try self.validate(self.excludeAttachmentFilePatterns, name: "excludeAttachmentFilePatterns", parent: name, min: 0)
            try self.includeAttachmentFilePatterns?.forEach {
                try validate($0, name: "includeAttachmentFilePatterns[]", parent: name, max: 150)
                try validate($0, name: "includeAttachmentFilePatterns[]", parent: name, min: 1)
            }
            try self.validate(self.includeAttachmentFilePatterns, name: "includeAttachmentFilePatterns", parent: name, max: 100)
            try self.validate(self.includeAttachmentFilePatterns, name: "includeAttachmentFilePatterns", parent: name, min: 0)
            try self.knowledgeArticleConfiguration?.validate(name: "\(name).knowledgeArticleConfiguration")
            try self.validate(self.secretArn, name: "secretArn", parent: name, max: 1284)
            try self.validate(self.secretArn, name: "secretArn", parent: name, min: 1)
            try self.validate(self.secretArn, name: "secretArn", parent: name, pattern: "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}")
            try self.validate(self.serverUrl, name: "serverUrl", parent: name, max: 2048)
            try self.validate(self.serverUrl, name: "serverUrl", parent: name, min: 1)
            try self.validate(self.serverUrl, name: "serverUrl", parent: name, pattern: "^(https?|ftp|file):\\/\\/([^\\s]*)")
            try self.standardObjectAttachmentConfiguration?.validate(name: "\(name).standardObjectAttachmentConfiguration")
            try self.standardObjectConfigurations?.forEach {
                try $0.validate(name: "\(name).standardObjectConfigurations[]")
            }
            try self.validate(self.standardObjectConfigurations, name: "standardObjectConfigurations", parent: name, max: 17)
            try self.validate(self.standardObjectConfigurations, name: "standardObjectConfigurations", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case chatterFeedConfiguration = "ChatterFeedConfiguration"
            case crawlAttachments = "CrawlAttachments"
            case excludeAttachmentFilePatterns = "ExcludeAttachmentFilePatterns"
            case includeAttachmentFilePatterns = "IncludeAttachmentFilePatterns"
            case knowledgeArticleConfiguration = "KnowledgeArticleConfiguration"
            case secretArn = "SecretArn"
            case serverUrl = "ServerUrl"
            case standardObjectAttachmentConfiguration = "StandardObjectAttachmentConfiguration"
            case standardObjectConfigurations = "StandardObjectConfigurations"
        }
    }

    public struct SalesforceCustomKnowledgeArticleTypeConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The name of the field in the custom knowledge article that contains the document data to index.
        public let documentDataFieldName: String
        /// The name of the field in the custom knowledge article that contains the document title.
        public let documentTitleFieldName: String?
        /// One or more objects that map fields in the custom knowledge article to fields in the Amazon Kendra index.
        public let fieldMappings: [DataSourceToIndexFieldMapping]?
        /// The name of the configuration.
        public let name: String

        public init(documentDataFieldName: String, documentTitleFieldName: String? = nil, fieldMappings: [DataSourceToIndexFieldMapping]? = nil, name: String) {
            self.documentDataFieldName = documentDataFieldName
            self.documentTitleFieldName = documentTitleFieldName
            self.fieldMappings = fieldMappings
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, max: 100)
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, min: 1)
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_.]*$")
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, max: 100)
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, min: 1)
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_.]*$")
            try self.fieldMappings?.forEach {
                try $0.validate(name: "\(name).fieldMappings[]")
            }
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, max: 100)
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 100)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case documentDataFieldName = "DocumentDataFieldName"
            case documentTitleFieldName = "DocumentTitleFieldName"
            case fieldMappings = "FieldMappings"
            case name = "Name"
        }
    }

    public struct SalesforceKnowledgeArticleConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Provides configuration information for custom Salesforce knowledge articles.
        public let customKnowledgeArticleTypeConfigurations: [SalesforceCustomKnowledgeArticleTypeConfiguration]?
        /// Specifies the document states that should be included when Amazon Kendra indexes knowledge articles. You must specify at least one state.
        public let includedStates: [SalesforceKnowledgeArticleState]
        /// Provides configuration information for standard Salesforce knowledge articles.
        public let standardKnowledgeArticleTypeConfiguration: SalesforceStandardKnowledgeArticleTypeConfiguration?

        public init(customKnowledgeArticleTypeConfigurations: [SalesforceCustomKnowledgeArticleTypeConfiguration]? = nil, includedStates: [SalesforceKnowledgeArticleState], standardKnowledgeArticleTypeConfiguration: SalesforceStandardKnowledgeArticleTypeConfiguration? = nil) {
            self.customKnowledgeArticleTypeConfigurations = customKnowledgeArticleTypeConfigurations
            self.includedStates = includedStates
            self.standardKnowledgeArticleTypeConfiguration = standardKnowledgeArticleTypeConfiguration
        }

        public func validate(name: String) throws {
            try self.customKnowledgeArticleTypeConfigurations?.forEach {
                try $0.validate(name: "\(name).customKnowledgeArticleTypeConfigurations[]")
            }
            try self.validate(self.customKnowledgeArticleTypeConfigurations, name: "customKnowledgeArticleTypeConfigurations", parent: name, max: 10)
            try self.validate(self.customKnowledgeArticleTypeConfigurations, name: "customKnowledgeArticleTypeConfigurations", parent: name, min: 1)
            try self.validate(self.includedStates, name: "includedStates", parent: name, max: 3)
            try self.validate(self.includedStates, name: "includedStates", parent: name, min: 1)
            try self.standardKnowledgeArticleTypeConfiguration?.validate(name: "\(name).standardKnowledgeArticleTypeConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case customKnowledgeArticleTypeConfigurations = "CustomKnowledgeArticleTypeConfigurations"
            case includedStates = "IncludedStates"
            case standardKnowledgeArticleTypeConfiguration = "StandardKnowledgeArticleTypeConfiguration"
        }
    }

    public struct SalesforceStandardKnowledgeArticleTypeConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The name of the field that contains the document data to index.
        public let documentDataFieldName: String
        /// The name of the field that contains the document title.
        public let documentTitleFieldName: String?
        /// One or more objects that map fields in the knowledge article to Amazon Kendra index fields. The index field must exist before you can map a Salesforce field to it.
        public let fieldMappings: [DataSourceToIndexFieldMapping]?

        public init(documentDataFieldName: String, documentTitleFieldName: String? = nil, fieldMappings: [DataSourceToIndexFieldMapping]? = nil) {
            self.documentDataFieldName = documentDataFieldName
            self.documentTitleFieldName = documentTitleFieldName
            self.fieldMappings = fieldMappings
        }

        public func validate(name: String) throws {
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, max: 100)
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, min: 1)
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_.]*$")
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, max: 100)
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, min: 1)
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_.]*$")
            try self.fieldMappings?.forEach {
                try $0.validate(name: "\(name).fieldMappings[]")
            }
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, max: 100)
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case documentDataFieldName = "DocumentDataFieldName"
            case documentTitleFieldName = "DocumentTitleFieldName"
            case fieldMappings = "FieldMappings"
        }
    }

    public struct SalesforceStandardObjectAttachmentConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The name of the field used for the document title.
        public let documentTitleFieldName: String?
        /// One or more objects that map fields in attachments to Amazon Kendra index fields.
        public let fieldMappings: [DataSourceToIndexFieldMapping]?

        public init(documentTitleFieldName: String? = nil, fieldMappings: [DataSourceToIndexFieldMapping]? = nil) {
            self.documentTitleFieldName = documentTitleFieldName
            self.fieldMappings = fieldMappings
        }

        public func validate(name: String) throws {
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, max: 100)
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, min: 1)
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_.]*$")
            try self.fieldMappings?.forEach {
                try $0.validate(name: "\(name).fieldMappings[]")
            }
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, max: 100)
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case documentTitleFieldName = "DocumentTitleFieldName"
            case fieldMappings = "FieldMappings"
        }
    }

    public struct SalesforceStandardObjectConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The name of the field in the standard object table that contains the document contents.
        public let documentDataFieldName: String
        /// The name of the field in the standard object table that contains the document titleB.
        public let documentTitleFieldName: String?
        /// One or more objects that map fields in the standard object to Amazon Kendra index fields. The index field must exist before you can map a Salesforce field to it.
        public let fieldMappings: [DataSourceToIndexFieldMapping]?
        /// The name of the standard object.
        public let name: SalesforceStandardObjectName

        public init(documentDataFieldName: String, documentTitleFieldName: String? = nil, fieldMappings: [DataSourceToIndexFieldMapping]? = nil, name: SalesforceStandardObjectName) {
            self.documentDataFieldName = documentDataFieldName
            self.documentTitleFieldName = documentTitleFieldName
            self.fieldMappings = fieldMappings
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, max: 100)
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, min: 1)
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_.]*$")
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, max: 100)
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, min: 1)
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_.]*$")
            try self.fieldMappings?.forEach {
                try $0.validate(name: "\(name).fieldMappings[]")
            }
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, max: 100)
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case documentDataFieldName = "DocumentDataFieldName"
            case documentTitleFieldName = "DocumentTitleFieldName"
            case fieldMappings = "FieldMappings"
            case name = "Name"
        }
    }

    public struct ScoreAttributes: AWSDecodableShape {
        /// A relative ranking for how well the response matches the query.
        public let scoreConfidence: ScoreConfidence?

        public init(scoreConfidence: ScoreConfidence? = nil) {
            self.scoreConfidence = scoreConfidence
        }

        private enum CodingKeys: String, CodingKey {
            case scoreConfidence = "ScoreConfidence"
        }
    }

    public struct Search: AWSEncodableShape & AWSDecodableShape {
        /// Determines whether the field is returned in the query response. The default is true.
        public let displayable: Bool?
        /// Indicates that the field can be used to create search facets, a count of results for each value in the field. The default is false .
        public let facetable: Bool?
        /// Determines whether the field is used in the search. If the Searchable field is true, you can use relevance tuning to manually tune how Amazon Kendra weights the field in the search. The default is true for string fields and false for number and date fields.
        public let searchable: Bool?
        /// Determines whether the field can be used to sort the results of a query. If you specify sorting on a field that does not have Sortable set to true, Amazon Kendra returns an exception. The default is false.
        public let sortable: Bool?

        public init(displayable: Bool? = nil, facetable: Bool? = nil, searchable: Bool? = nil, sortable: Bool? = nil) {
            self.displayable = displayable
            self.facetable = facetable
            self.searchable = searchable
            self.sortable = sortable
        }

        private enum CodingKeys: String, CodingKey {
            case displayable = "Displayable"
            case facetable = "Facetable"
            case searchable = "Searchable"
            case sortable = "Sortable"
        }
    }

    public struct ServerSideEncryptionConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The identifier of the AWS KMS customer master key (CMK). Amazon Kendra doesn't support asymmetric CMKs.
        public let kmsKeyId: String?

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

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

        private enum CodingKeys: String, CodingKey {
            case kmsKeyId = "KmsKeyId"
        }
    }

    public struct ServiceNowConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The ServiceNow instance that the data source connects to. The host endpoint should look like the following: {instance}.service-now.com.
        public let hostUrl: String
        /// Provides configuration information for crawling knowledge articles in the ServiceNow site.
        public let knowledgeArticleConfiguration: ServiceNowKnowledgeArticleConfiguration?
        /// The Amazon Resource Name (ARN) of the AWS Secret Manager secret that contains the user name and password required to connect to the ServiceNow instance.
        public let secretArn: String
        /// Provides configuration information for crawling service catalogs in the ServiceNow site.
        public let serviceCatalogConfiguration: ServiceNowServiceCatalogConfiguration?
        /// The identifier of the release that the ServiceNow host is running. If the host is not running the LONDON release, use OTHERS.
        public let serviceNowBuildVersion: ServiceNowBuildVersionType

        public init(hostUrl: String, knowledgeArticleConfiguration: ServiceNowKnowledgeArticleConfiguration? = nil, secretArn: String, serviceCatalogConfiguration: ServiceNowServiceCatalogConfiguration? = nil, serviceNowBuildVersion: ServiceNowBuildVersionType) {
            self.hostUrl = hostUrl
            self.knowledgeArticleConfiguration = knowledgeArticleConfiguration
            self.secretArn = secretArn
            self.serviceCatalogConfiguration = serviceCatalogConfiguration
            self.serviceNowBuildVersion = serviceNowBuildVersion
        }

        public func validate(name: String) throws {
            try self.validate(self.hostUrl, name: "hostUrl", parent: name, max: 2048)
            try self.validate(self.hostUrl, name: "hostUrl", parent: name, min: 1)
            try self.validate(self.hostUrl, name: "hostUrl", parent: name, pattern: "^(?!(^(https?|ftp|file):\\/\\/))[a-z0-9-]+(\\.service-now\\.com)$")
            try self.knowledgeArticleConfiguration?.validate(name: "\(name).knowledgeArticleConfiguration")
            try self.validate(self.secretArn, name: "secretArn", parent: name, max: 1284)
            try self.validate(self.secretArn, name: "secretArn", parent: name, min: 1)
            try self.validate(self.secretArn, name: "secretArn", parent: name, pattern: "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}")
            try self.serviceCatalogConfiguration?.validate(name: "\(name).serviceCatalogConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case hostUrl = "HostUrl"
            case knowledgeArticleConfiguration = "KnowledgeArticleConfiguration"
            case secretArn = "SecretArn"
            case serviceCatalogConfiguration = "ServiceCatalogConfiguration"
            case serviceNowBuildVersion = "ServiceNowBuildVersion"
        }
    }

    public struct ServiceNowKnowledgeArticleConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Indicates whether Amazon Kendra should index attachments to knowledge articles.
        public let crawlAttachments: Bool?
        /// The name of the ServiceNow field that is mapped to the index document contents field in the Amazon Kendra index.
        public let documentDataFieldName: String
        /// The name of the ServiceNow field that is mapped to the index document title field.
        public let documentTitleFieldName: String?
        /// List of regular expressions applied to knowledge articles. Items that don't match the inclusion pattern are not indexed. The regex is applied to the field specified in the PatternTargetField
        public let excludeAttachmentFilePatterns: [String]?
        /// Mapping between ServiceNow fields and Amazon Kendra index fields. You must create the index field before you map the field.
        public let fieldMappings: [DataSourceToIndexFieldMapping]?
        /// List of regular expressions applied to knowledge articles. Items that don't match the inclusion pattern are not indexed. The regex is applied to the field specified in the PatternTargetField.
        public let includeAttachmentFilePatterns: [String]?

        public init(crawlAttachments: Bool? = nil, documentDataFieldName: String, documentTitleFieldName: String? = nil, excludeAttachmentFilePatterns: [String]? = nil, fieldMappings: [DataSourceToIndexFieldMapping]? = nil, includeAttachmentFilePatterns: [String]? = nil) {
            self.crawlAttachments = crawlAttachments
            self.documentDataFieldName = documentDataFieldName
            self.documentTitleFieldName = documentTitleFieldName
            self.excludeAttachmentFilePatterns = excludeAttachmentFilePatterns
            self.fieldMappings = fieldMappings
            self.includeAttachmentFilePatterns = includeAttachmentFilePatterns
        }

        public func validate(name: String) throws {
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, max: 100)
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, min: 1)
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_.]*$")
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, max: 100)
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, min: 1)
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_.]*$")
            try self.excludeAttachmentFilePatterns?.forEach {
                try validate($0, name: "excludeAttachmentFilePatterns[]", parent: name, max: 150)
                try validate($0, name: "excludeAttachmentFilePatterns[]", parent: name, min: 1)
            }
            try self.validate(self.excludeAttachmentFilePatterns, name: "excludeAttachmentFilePatterns", parent: name, max: 100)
            try self.validate(self.excludeAttachmentFilePatterns, name: "excludeAttachmentFilePatterns", parent: name, min: 0)
            try self.fieldMappings?.forEach {
                try $0.validate(name: "\(name).fieldMappings[]")
            }
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, max: 100)
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, min: 1)
            try self.includeAttachmentFilePatterns?.forEach {
                try validate($0, name: "includeAttachmentFilePatterns[]", parent: name, max: 150)
                try validate($0, name: "includeAttachmentFilePatterns[]", parent: name, min: 1)
            }
            try self.validate(self.includeAttachmentFilePatterns, name: "includeAttachmentFilePatterns", parent: name, max: 100)
            try self.validate(self.includeAttachmentFilePatterns, name: "includeAttachmentFilePatterns", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case crawlAttachments = "CrawlAttachments"
            case documentDataFieldName = "DocumentDataFieldName"
            case documentTitleFieldName = "DocumentTitleFieldName"
            case excludeAttachmentFilePatterns = "ExcludeAttachmentFilePatterns"
            case fieldMappings = "FieldMappings"
            case includeAttachmentFilePatterns = "IncludeAttachmentFilePatterns"
        }
    }

    public struct ServiceNowServiceCatalogConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Indicates whether Amazon Kendra should crawl attachments to the service catalog items.
        public let crawlAttachments: Bool?
        /// The name of the ServiceNow field that is mapped to the index document contents field in the Amazon Kendra index.
        public let documentDataFieldName: String
        /// The name of the ServiceNow field that is mapped to the index document title field.
        public let documentTitleFieldName: String?
        /// Determines the types of file attachments that are excluded from the index.
        public let excludeAttachmentFilePatterns: [String]?
        /// Mapping between ServiceNow fields and Amazon Kendra index fields. You must create the index field before you map the field.
        public let fieldMappings: [DataSourceToIndexFieldMapping]?
        /// Determines the types of file attachments that are included in the index.
        public let includeAttachmentFilePatterns: [String]?

        public init(crawlAttachments: Bool? = nil, documentDataFieldName: String, documentTitleFieldName: String? = nil, excludeAttachmentFilePatterns: [String]? = nil, fieldMappings: [DataSourceToIndexFieldMapping]? = nil, includeAttachmentFilePatterns: [String]? = nil) {
            self.crawlAttachments = crawlAttachments
            self.documentDataFieldName = documentDataFieldName
            self.documentTitleFieldName = documentTitleFieldName
            self.excludeAttachmentFilePatterns = excludeAttachmentFilePatterns
            self.fieldMappings = fieldMappings
            self.includeAttachmentFilePatterns = includeAttachmentFilePatterns
        }

        public func validate(name: String) throws {
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, max: 100)
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, min: 1)
            try self.validate(self.documentDataFieldName, name: "documentDataFieldName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_.]*$")
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, max: 100)
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, min: 1)
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_.]*$")
            try self.excludeAttachmentFilePatterns?.forEach {
                try validate($0, name: "excludeAttachmentFilePatterns[]", parent: name, max: 150)
                try validate($0, name: "excludeAttachmentFilePatterns[]", parent: name, min: 1)
            }
            try self.validate(self.excludeAttachmentFilePatterns, name: "excludeAttachmentFilePatterns", parent: name, max: 100)
            try self.validate(self.excludeAttachmentFilePatterns, name: "excludeAttachmentFilePatterns", parent: name, min: 0)
            try self.fieldMappings?.forEach {
                try $0.validate(name: "\(name).fieldMappings[]")
            }
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, max: 100)
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, min: 1)
            try self.includeAttachmentFilePatterns?.forEach {
                try validate($0, name: "includeAttachmentFilePatterns[]", parent: name, max: 150)
                try validate($0, name: "includeAttachmentFilePatterns[]", parent: name, min: 1)
            }
            try self.validate(self.includeAttachmentFilePatterns, name: "includeAttachmentFilePatterns", parent: name, max: 100)
            try self.validate(self.includeAttachmentFilePatterns, name: "includeAttachmentFilePatterns", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case crawlAttachments = "CrawlAttachments"
            case documentDataFieldName = "DocumentDataFieldName"
            case documentTitleFieldName = "DocumentTitleFieldName"
            case excludeAttachmentFilePatterns = "ExcludeAttachmentFilePatterns"
            case fieldMappings = "FieldMappings"
            case includeAttachmentFilePatterns = "IncludeAttachmentFilePatterns"
        }
    }

    public struct SharePointConfiguration: AWSEncodableShape & AWSDecodableShape {
        ///  TRUE to include attachments to documents stored in your Microsoft SharePoint site in the index; otherwise, FALSE.
        public let crawlAttachments: Bool?
        /// A Boolean value that specifies whether local groups are disabled (True) or enabled (False).
        public let disableLocalGroups: Bool?
        /// The Microsoft SharePoint attribute field that contains the title of the document.
        public let documentTitleFieldName: String?
        /// A list of regular expression patterns. Documents that match the patterns are excluded from the index. Documents that don't match the patterns are included in the index. If a document matches both an exclusion pattern and an inclusion pattern, the document is not included in the index. The regex is applied to the display URL of the SharePoint document.
        public let exclusionPatterns: [String]?
        /// A list of DataSourceToIndexFieldMapping objects that map Microsoft SharePoint attributes to custom fields in the Amazon Kendra index. You must first create the index fields using the operation before you map SharePoint attributes. For more information, see Mapping Data Source Fields.
        public let fieldMappings: [DataSourceToIndexFieldMapping]?
        /// A list of regular expression patterns. Documents that match the patterns are included in the index. Documents that don't match the patterns are excluded from the index. If a document matches both an inclusion pattern and an exclusion pattern, the document is not included in the index. The regex is applied to the display URL of the SharePoint document.
        public let inclusionPatterns: [String]?
        /// The Amazon Resource Name (ARN) of credentials stored in AWS Secrets Manager. The credentials should be a user/password pair. For more information, see Using a Microsoft SharePoint Data Source. For more information about AWS Secrets Manager, see  What Is AWS Secrets Manager  in the AWS Secrets Manager user guide.
        public let secretArn: String
        /// The version of Microsoft SharePoint that you are using as a data source.
        public let sharePointVersion: SharePointVersion
        /// The URLs of the Microsoft SharePoint site that contains the documents that should be indexed.
        public let urls: [String]
        /// Set to TRUE to use the Microsoft SharePoint change log to determine the documents that need to be updated in the index. Depending on the size of the SharePoint change log, it may take longer for Amazon Kendra to use the change log than it takes it to determine the changed documents using the Amazon Kendra document crawler.
        public let useChangeLog: Bool?
        public let vpcConfiguration: DataSourceVpcConfiguration?

        public init(crawlAttachments: Bool? = nil, disableLocalGroups: Bool? = nil, documentTitleFieldName: String? = nil, exclusionPatterns: [String]? = nil, fieldMappings: [DataSourceToIndexFieldMapping]? = nil, inclusionPatterns: [String]? = nil, secretArn: String, sharePointVersion: SharePointVersion, urls: [String], useChangeLog: Bool? = nil, vpcConfiguration: DataSourceVpcConfiguration? = nil) {
            self.crawlAttachments = crawlAttachments
            self.disableLocalGroups = disableLocalGroups
            self.documentTitleFieldName = documentTitleFieldName
            self.exclusionPatterns = exclusionPatterns
            self.fieldMappings = fieldMappings
            self.inclusionPatterns = inclusionPatterns
            self.secretArn = secretArn
            self.sharePointVersion = sharePointVersion
            self.urls = urls
            self.useChangeLog = useChangeLog
            self.vpcConfiguration = vpcConfiguration
        }

        public func validate(name: String) throws {
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, max: 100)
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, min: 1)
            try self.validate(self.documentTitleFieldName, name: "documentTitleFieldName", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9_.]*$")
            try self.exclusionPatterns?.forEach {
                try validate($0, name: "exclusionPatterns[]", parent: name, max: 150)
                try validate($0, name: "exclusionPatterns[]", parent: name, min: 1)
            }
            try self.validate(self.exclusionPatterns, name: "exclusionPatterns", parent: name, max: 100)
            try self.validate(self.exclusionPatterns, name: "exclusionPatterns", parent: name, min: 0)
            try self.fieldMappings?.forEach {
                try $0.validate(name: "\(name).fieldMappings[]")
            }
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, max: 100)
            try self.validate(self.fieldMappings, name: "fieldMappings", parent: name, min: 1)
            try self.inclusionPatterns?.forEach {
                try validate($0, name: "inclusionPatterns[]", parent: name, max: 150)
                try validate($0, name: "inclusionPatterns[]", parent: name, min: 1)
            }
            try self.validate(self.inclusionPatterns, name: "inclusionPatterns", parent: name, max: 100)
            try self.validate(self.inclusionPatterns, name: "inclusionPatterns", parent: name, min: 0)
            try self.validate(self.secretArn, name: "secretArn", parent: name, max: 1284)
            try self.validate(self.secretArn, name: "secretArn", parent: name, min: 1)
            try self.validate(self.secretArn, name: "secretArn", parent: name, pattern: "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}")
            try self.urls.forEach {
                try validate($0, name: "urls[]", parent: name, max: 2048)
                try validate($0, name: "urls[]", parent: name, min: 1)
                try validate($0, name: "urls[]", parent: name, pattern: "^(https?|ftp|file):\\/\\/([^\\s]*)")
            }
            try self.validate(self.urls, name: "urls", parent: name, max: 100)
            try self.validate(self.urls, name: "urls", parent: name, min: 1)
            try self.vpcConfiguration?.validate(name: "\(name).vpcConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case crawlAttachments = "CrawlAttachments"
            case disableLocalGroups = "DisableLocalGroups"
            case documentTitleFieldName = "DocumentTitleFieldName"
            case exclusionPatterns = "ExclusionPatterns"
            case fieldMappings = "FieldMappings"
            case inclusionPatterns = "InclusionPatterns"
            case secretArn = "SecretArn"
            case sharePointVersion = "SharePointVersion"
            case urls = "Urls"
            case useChangeLog = "UseChangeLog"
            case vpcConfiguration = "VpcConfiguration"
        }
    }

    public struct SortingConfiguration: AWSEncodableShape {
        /// The name of the document attribute used to sort the response. You can use any field that has the Sortable flag set to true. You can also sort by any of the following built-in attributes:   _category   _created_at   _last_updated_at   _version   _view_count
        public let documentAttributeKey: String
        /// The order that the results should be returned in. In case of ties, the relevance assigned to the result by Amazon Kendra is used as the tie-breaker.
        public let sortOrder: SortOrder

        public init(documentAttributeKey: String, sortOrder: SortOrder) {
            self.documentAttributeKey = documentAttributeKey
            self.sortOrder = sortOrder
        }

        public func validate(name: String) throws {
            try self.validate(self.documentAttributeKey, name: "documentAttributeKey", parent: name, max: 200)
            try self.validate(self.documentAttributeKey, name: "documentAttributeKey", parent: name, min: 1)
            try self.validate(self.documentAttributeKey, name: "documentAttributeKey", parent: name, pattern: "[a-zA-Z0-9_][a-zA-Z0-9_-]*")
        }

        private enum CodingKeys: String, CodingKey {
            case documentAttributeKey = "DocumentAttributeKey"
            case sortOrder = "SortOrder"
        }
    }

    public struct SqlConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Determines whether Amazon Kendra encloses SQL identifiers for tables and column names in double quotes (") when making a database query. By default, Amazon Kendra passes SQL identifiers the way that they are entered into the data source configuration. It does not change the case of identifiers or enclose them in quotes. PostgreSQL internally converts uppercase characters to lower case characters in identifiers unless they are quoted. Choosing this option encloses identifiers in quotes so that PostgreSQL does not convert the character's case. For MySQL databases, you must enable the ansi_quotes option when you set this field to DOUBLE_QUOTES.
        public let queryIdentifiersEnclosingOption: QueryIdentifiersEnclosingOption?

        public init(queryIdentifiersEnclosingOption: QueryIdentifiersEnclosingOption? = nil) {
            self.queryIdentifiersEnclosingOption = queryIdentifiersEnclosingOption
        }

        private enum CodingKeys: String, CodingKey {
            case queryIdentifiersEnclosingOption = "QueryIdentifiersEnclosingOption"
        }
    }

    public struct StartDataSourceSyncJobRequest: AWSEncodableShape {
        /// The identifier of the data source to synchronize.
        public let id: String
        /// The identifier of the index that contains the data source.
        public let indexId: String

        public init(id: String, indexId: String) {
            self.id = id
            self.indexId = indexId
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case indexId = "IndexId"
        }
    }

    public struct StartDataSourceSyncJobResponse: AWSDecodableShape {
        /// Identifies a particular synchronization job.
        public let executionId: String?

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

        private enum CodingKeys: String, CodingKey {
            case executionId = "ExecutionId"
        }
    }

    public struct StopDataSourceSyncJobRequest: AWSEncodableShape {
        /// The identifier of the data source for which to stop the synchronization jobs.
        public let id: String
        /// The identifier of the index that contains the data source.
        public let indexId: String

        public init(id: String, indexId: String) {
            self.id = id
            self.indexId = indexId
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case indexId = "IndexId"
        }
    }

    public struct SubmitFeedbackRequest: AWSEncodableShape {
        /// Tells Amazon Kendra that a particular search result link was chosen by the user.
        public let clickFeedbackItems: [ClickFeedback]?
        /// The identifier of the index that was queried.
        public let indexId: String
        /// The identifier of the specific query for which you are submitting feedback. The query ID is returned in the response to the operation.
        public let queryId: String
        /// Provides Amazon Kendra with relevant or not relevant feedback for whether a particular item was relevant to the search.
        public let relevanceFeedbackItems: [RelevanceFeedback]?

        public init(clickFeedbackItems: [ClickFeedback]? = nil, indexId: String, queryId: String, relevanceFeedbackItems: [RelevanceFeedback]? = nil) {
            self.clickFeedbackItems = clickFeedbackItems
            self.indexId = indexId
            self.queryId = queryId
            self.relevanceFeedbackItems = relevanceFeedbackItems
        }

        public func validate(name: String) throws {
            try self.clickFeedbackItems?.forEach {
                try $0.validate(name: "\(name).clickFeedbackItems[]")
            }
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
            try self.validate(self.queryId, name: "queryId", parent: name, max: 36)
            try self.validate(self.queryId, name: "queryId", parent: name, min: 1)
            try self.validate(self.queryId, name: "queryId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
            try self.relevanceFeedbackItems?.forEach {
                try $0.validate(name: "\(name).relevanceFeedbackItems[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case clickFeedbackItems = "ClickFeedbackItems"
            case indexId = "IndexId"
            case queryId = "QueryId"
            case relevanceFeedbackItems = "RelevanceFeedbackItems"
        }
    }

    public struct Tag: AWSEncodableShape & AWSDecodableShape {
        /// The key for the tag. Keys are not case sensitive and must be unique for the index, FAQ, or data source.
        public let key: String
        /// The value associated with the tag. The value may be an empty string but it can't be null.
        public let value: String

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

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

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

    public struct TagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the index, FAQ, or data source to tag.
        public let resourceARN: String
        /// A list of tag keys to add to the index, FAQ, or data source. If a tag already exists, the existing value is replaced with the new value.
        public let tags: [Tag]

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

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

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

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

    public struct TextDocumentStatistics: AWSDecodableShape {
        /// The total size, in bytes, of the indexed documents.
        public let indexedTextBytes: Int64
        /// The number of text documents indexed.
        public let indexedTextDocumentsCount: Int

        public init(indexedTextBytes: Int64, indexedTextDocumentsCount: Int) {
            self.indexedTextBytes = indexedTextBytes
            self.indexedTextDocumentsCount = indexedTextDocumentsCount
        }

        private enum CodingKeys: String, CodingKey {
            case indexedTextBytes = "IndexedTextBytes"
            case indexedTextDocumentsCount = "IndexedTextDocumentsCount"
        }
    }

    public struct TextWithHighlights: AWSDecodableShape {
        /// The beginning and end of the text that should be highlighted.
        public let highlights: [Highlight]?
        /// The text to display to the user.
        public let text: String?

        public init(highlights: [Highlight]? = nil, text: String? = nil) {
            self.highlights = highlights
            self.text = text
        }

        private enum CodingKeys: String, CodingKey {
            case highlights = "Highlights"
            case text = "Text"
        }
    }

    public struct ThesaurusSummary: AWSDecodableShape {
        /// The Unix datetime that the thesaurus was created.
        public let createdAt: Date?
        /// The identifier of the thesaurus.
        public let id: String?
        /// The name of the thesaurus.
        public let name: String?
        /// The status of the thesaurus.
        public let status: ThesaurusStatus?
        /// The Unix datetime that the thesaurus was last updated.
        public let updatedAt: Date?

        public init(createdAt: Date? = nil, id: String? = nil, name: String? = nil, status: ThesaurusStatus? = nil, updatedAt: Date? = nil) {
            self.createdAt = createdAt
            self.id = id
            self.name = name
            self.status = status
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case createdAt = "CreatedAt"
            case id = "Id"
            case name = "Name"
            case status = "Status"
            case updatedAt = "UpdatedAt"
        }
    }

    public struct TimeRange: AWSEncodableShape {
        /// The UNIX datetime of the end of the time range.
        public let endTime: Date?
        /// The UNIX datetime of the beginning of the time range.
        public let startTime: Date?

        public init(endTime: Date? = nil, startTime: Date? = nil) {
            self.endTime = endTime
            self.startTime = startTime
        }

        private enum CodingKeys: String, CodingKey {
            case endTime = "EndTime"
            case startTime = "StartTime"
        }
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the index, FAQ, or data source to remove the tag from.
        public let resourceARN: String
        /// A list of tag keys to remove from the index, FAQ, or data source. If a tag key does not exist on the resource, it is ignored.
        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: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 200)
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, min: 0)
        }

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

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

    public struct UpdateDataSourceRequest: AWSEncodableShape {
        public let configuration: DataSourceConfiguration?
        /// The new description for the data source.
        public let description: String?
        /// The unique identifier of the data source to update.
        public let id: String
        /// The identifier of the index that contains the data source to update.
        public let indexId: String
        /// The name of the data source to update. The name of the data source can't be updated. To rename a data source you must delete the data source and re-create it.
        public let name: String?
        /// The Amazon Resource Name (ARN) of the new role to use when the data source is accessing resources on your behalf.
        public let roleArn: String?
        /// The new update schedule for the data source.
        public let schedule: String?

        public init(configuration: DataSourceConfiguration? = nil, description: String? = nil, id: String, indexId: String, name: String? = nil, roleArn: String? = nil, schedule: String? = nil) {
            self.configuration = configuration
            self.description = description
            self.id = id
            self.indexId = indexId
            self.name = name
            self.roleArn = roleArn
            self.schedule = schedule
        }

        public func validate(name: String) throws {
            try self.configuration?.validate(name: "\(name).configuration")
            try self.validate(self.description, name: "description", parent: name, max: 1000)
            try self.validate(self.description, name: "description", parent: name, min: 0)
            try self.validate(self.description, name: "description", parent: name, pattern: "^\\P{C}*$")
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
            try self.validate(self.name, name: "name", parent: name, max: 1000)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 1284)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 1)
            try self.validate(self.roleArn, name: "roleArn", parent: name, pattern: "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}")
        }

        private enum CodingKeys: String, CodingKey {
            case configuration = "Configuration"
            case description = "Description"
            case id = "Id"
            case indexId = "IndexId"
            case name = "Name"
            case roleArn = "RoleArn"
            case schedule = "Schedule"
        }
    }

    public struct UpdateIndexRequest: AWSEncodableShape {
        /// Sets the number of addtional storage and query capacity units that should be used by the index. You can change the capacity of the index up to 5 times per day. If you are using extra storage units, you can't reduce the storage capacity below that required to meet the storage needs for your index.
        public let capacityUnits: CapacityUnitsConfiguration?
        /// A new description for the index.
        public let description: String?
        /// The document metadata to update.
        public let documentMetadataConfigurationUpdates: [DocumentMetadataConfiguration]?
        /// The identifier of the index to update.
        public let id: String
        /// The name of the index to update.
        public let name: String?
        /// A new IAM role that gives Amazon Kendra permission to access your Amazon CloudWatch logs.
        public let roleArn: String?
        /// The user user token context policy.
        public let userContextPolicy: UserContextPolicy?
        /// The user token configuration.
        public let userTokenConfigurations: [UserTokenConfiguration]?

        public init(capacityUnits: CapacityUnitsConfiguration? = nil, description: String? = nil, documentMetadataConfigurationUpdates: [DocumentMetadataConfiguration]? = nil, id: String, name: String? = nil, roleArn: String? = nil, userContextPolicy: UserContextPolicy? = nil, userTokenConfigurations: [UserTokenConfiguration]? = nil) {
            self.capacityUnits = capacityUnits
            self.description = description
            self.documentMetadataConfigurationUpdates = documentMetadataConfigurationUpdates
            self.id = id
            self.name = name
            self.roleArn = roleArn
            self.userContextPolicy = userContextPolicy
            self.userTokenConfigurations = userTokenConfigurations
        }

        public func validate(name: String) throws {
            try self.capacityUnits?.validate(name: "\(name).capacityUnits")
            try self.validate(self.description, name: "description", parent: name, max: 1000)
            try self.validate(self.description, name: "description", parent: name, min: 0)
            try self.validate(self.description, name: "description", parent: name, pattern: "^\\P{C}*$")
            try self.documentMetadataConfigurationUpdates?.forEach {
                try $0.validate(name: "\(name).documentMetadataConfigurationUpdates[]")
            }
            try self.validate(self.documentMetadataConfigurationUpdates, name: "documentMetadataConfigurationUpdates", parent: name, max: 500)
            try self.validate(self.documentMetadataConfigurationUpdates, name: "documentMetadataConfigurationUpdates", parent: name, min: 0)
            try self.validate(self.id, name: "id", parent: name, max: 36)
            try self.validate(self.id, name: "id", parent: name, min: 36)
            try self.validate(self.id, name: "id", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
            try self.validate(self.name, name: "name", parent: name, max: 1000)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 1284)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 1)
            try self.validate(self.roleArn, name: "roleArn", parent: name, pattern: "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}")
            try self.userTokenConfigurations?.forEach {
                try $0.validate(name: "\(name).userTokenConfigurations[]")
            }
            try self.validate(self.userTokenConfigurations, name: "userTokenConfigurations", parent: name, max: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case capacityUnits = "CapacityUnits"
            case description = "Description"
            case documentMetadataConfigurationUpdates = "DocumentMetadataConfigurationUpdates"
            case id = "Id"
            case name = "Name"
            case roleArn = "RoleArn"
            case userContextPolicy = "UserContextPolicy"
            case userTokenConfigurations = "UserTokenConfigurations"
        }
    }

    public struct UpdateThesaurusRequest: AWSEncodableShape {
        /// The updated description of the thesaurus.
        public let description: String?
        /// The identifier of the thesaurus to update.
        public let id: String
        /// The identifier of the index associated with the thesaurus to update.
        public let indexId: String
        /// The updated name of the thesaurus.
        public let name: String?
        /// The updated role ARN of the thesaurus.
        public let roleArn: String?
        public let sourceS3Path: S3Path?

        public init(description: String? = nil, id: String, indexId: String, name: String? = nil, roleArn: String? = nil, sourceS3Path: S3Path? = nil) {
            self.description = description
            self.id = id
            self.indexId = indexId
            self.name = name
            self.roleArn = roleArn
            self.sourceS3Path = sourceS3Path
        }

        public func validate(name: String) throws {
            try self.validate(self.description, name: "description", parent: name, max: 1000)
            try self.validate(self.description, name: "description", parent: name, min: 0)
            try self.validate(self.description, name: "description", parent: name, pattern: "^\\P{C}*$")
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.indexId, name: "indexId", parent: name, max: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, min: 36)
            try self.validate(self.indexId, name: "indexId", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9-]*")
            try self.validate(self.name, name: "name", parent: name, max: 100)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[a-zA-Z0-9][a-zA-Z0-9_-]*")
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 1284)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 1)
            try self.validate(self.roleArn, name: "roleArn", parent: name, pattern: "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}")
            try self.sourceS3Path?.validate(name: "\(name).sourceS3Path")
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case id = "Id"
            case indexId = "IndexId"
            case name = "Name"
            case roleArn = "RoleArn"
            case sourceS3Path = "SourceS3Path"
        }
    }

    public struct UserContext: AWSEncodableShape {
        /// The user context token. It must be a JWT or a JSON token.
        public let token: String?

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

        public func validate(name: String) throws {
            try self.validate(self.token, name: "token", parent: name, max: 100_000)
            try self.validate(self.token, name: "token", parent: name, min: 1)
            try self.validate(self.token, name: "token", parent: name, pattern: "^\\P{C}*$")
        }

        private enum CodingKeys: String, CodingKey {
            case token = "Token"
        }
    }

    public struct UserTokenConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Information about the JSON token type configuration.
        public let jsonTokenTypeConfiguration: JsonTokenTypeConfiguration?
        /// Information about the JWT token type configuration.
        public let jwtTokenTypeConfiguration: JwtTokenTypeConfiguration?

        public init(jsonTokenTypeConfiguration: JsonTokenTypeConfiguration? = nil, jwtTokenTypeConfiguration: JwtTokenTypeConfiguration? = nil) {
            self.jsonTokenTypeConfiguration = jsonTokenTypeConfiguration
            self.jwtTokenTypeConfiguration = jwtTokenTypeConfiguration
        }

        public func validate(name: String) throws {
            try self.jsonTokenTypeConfiguration?.validate(name: "\(name).jsonTokenTypeConfiguration")
            try self.jwtTokenTypeConfiguration?.validate(name: "\(name).jwtTokenTypeConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case jsonTokenTypeConfiguration = "JsonTokenTypeConfiguration"
            case jwtTokenTypeConfiguration = "JwtTokenTypeConfiguration"
        }
    }
}
