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

import Foundation
import AWSSDKSwiftCore

extension ComprehendMedical {
    //MARK: Enums

    public enum AttributeName: String, CustomStringConvertible, Codable {
        case sign = "SIGN"
        case symptom = "SYMPTOM"
        case diagnosis = "DIAGNOSIS"
        case negation = "NEGATION"
        public var description: String { return self.rawValue }
    }

    public enum EntitySubType: String, CustomStringConvertible, Codable {
        case name = "NAME"
        case dosage = "DOSAGE"
        case routeOrMode = "ROUTE_OR_MODE"
        case form = "FORM"
        case frequency = "FREQUENCY"
        case duration = "DURATION"
        case genericName = "GENERIC_NAME"
        case brandName = "BRAND_NAME"
        case strength = "STRENGTH"
        case rate = "RATE"
        case acuity = "ACUITY"
        case testName = "TEST_NAME"
        case testValue = "TEST_VALUE"
        case testUnits = "TEST_UNITS"
        case procedureName = "PROCEDURE_NAME"
        case treatmentName = "TREATMENT_NAME"
        case date = "DATE"
        case age = "AGE"
        case contactPoint = "CONTACT_POINT"
        case email = "EMAIL"
        case identifier = "IDENTIFIER"
        case url = "URL"
        case address = "ADDRESS"
        case profession = "PROFESSION"
        case systemOrganSite = "SYSTEM_ORGAN_SITE"
        case direction = "DIRECTION"
        case quality = "QUALITY"
        case quantity = "QUANTITY"
        case dxName = "DX_NAME"
        public var description: String { return self.rawValue }
    }

    public enum EntityType: String, CustomStringConvertible, Codable {
        case medication = "MEDICATION"
        case medicalCondition = "MEDICAL_CONDITION"
        case protectedHealthInformation = "PROTECTED_HEALTH_INFORMATION"
        case testTreatmentProcedure = "TEST_TREATMENT_PROCEDURE"
        case anatomy = "ANATOMY"
        public var description: String { return self.rawValue }
    }

    public enum ICD10CMAttributeType: String, CustomStringConvertible, Codable {
        case acuity = "ACUITY"
        case direction = "DIRECTION"
        case systemOrganSite = "SYSTEM_ORGAN_SITE"
        case quality = "QUALITY"
        case quantity = "QUANTITY"
        public var description: String { return self.rawValue }
    }

    public enum ICD10CMEntityCategory: String, CustomStringConvertible, Codable {
        case medicalCondition = "MEDICAL_CONDITION"
        public var description: String { return self.rawValue }
    }

    public enum ICD10CMEntityType: String, CustomStringConvertible, Codable {
        case dxName = "DX_NAME"
        public var description: String { return self.rawValue }
    }

    public enum ICD10CMTraitName: String, CustomStringConvertible, Codable {
        case negation = "NEGATION"
        case diagnosis = "DIAGNOSIS"
        case sign = "SIGN"
        case symptom = "SYMPTOM"
        public var description: String { return self.rawValue }
    }

    public enum JobStatus: String, CustomStringConvertible, Codable {
        case submitted = "SUBMITTED"
        case inProgress = "IN_PROGRESS"
        case completed = "COMPLETED"
        case partialSuccess = "PARTIAL_SUCCESS"
        case failed = "FAILED"
        case stopRequested = "STOP_REQUESTED"
        case stopped = "STOPPED"
        public var description: String { return self.rawValue }
    }

    public enum LanguageCode: String, CustomStringConvertible, Codable {
        case en = "en"
        public var description: String { return self.rawValue }
    }

    public enum RxNormAttributeType: String, CustomStringConvertible, Codable {
        case dosage = "DOSAGE"
        case duration = "DURATION"
        case form = "FORM"
        case frequency = "FREQUENCY"
        case rate = "RATE"
        case routeOrMode = "ROUTE_OR_MODE"
        case strength = "STRENGTH"
        public var description: String { return self.rawValue }
    }

    public enum RxNormEntityCategory: String, CustomStringConvertible, Codable {
        case medication = "MEDICATION"
        public var description: String { return self.rawValue }
    }

    public enum RxNormEntityType: String, CustomStringConvertible, Codable {
        case brandName = "BRAND_NAME"
        case genericName = "GENERIC_NAME"
        public var description: String { return self.rawValue }
    }

    public enum RxNormTraitName: String, CustomStringConvertible, Codable {
        case negation = "NEGATION"
        public var description: String { return self.rawValue }
    }

    //MARK: Shapes

    public struct Attribute: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "BeginOffset", required: false, type: .integer), 
            AWSShapeMember(label: "EndOffset", required: false, type: .integer), 
            AWSShapeMember(label: "Id", required: false, type: .integer), 
            AWSShapeMember(label: "RelationshipScore", required: false, type: .float), 
            AWSShapeMember(label: "Score", required: false, type: .float), 
            AWSShapeMember(label: "Text", required: false, type: .string), 
            AWSShapeMember(label: "Traits", required: false, type: .list), 
            AWSShapeMember(label: "Type", required: false, type: .enum)
        ]

        ///  The 0-based character offset in the input text that shows where the attribute begins. The offset returns the UTF-8 code point in the string. 
        public let beginOffset: Int?
        ///  The 0-based character offset in the input text that shows where the attribute ends. The offset returns the UTF-8 code point in the string.
        public let endOffset: Int?
        ///  The numeric identifier for this attribute. This is a monotonically increasing id unique within this response rather than a global unique identifier. 
        public let id: Int?
        ///  The level of confidence that Amazon Comprehend Medical has that this attribute is correctly related to this entity. 
        public let relationshipScore: Float?
        ///  The level of confidence that Amazon Comprehend Medical has that the segment of text is correctly recognized as an attribute. 
        public let score: Float?
        ///  The segment of input text extracted as this attribute.
        public let text: String?
        ///  Contextual information for this attribute. 
        public let traits: [Trait]?
        ///  The type of attribute. 
        public let `type`: EntitySubType?

        public init(beginOffset: Int? = nil, endOffset: Int? = nil, id: Int? = nil, relationshipScore: Float? = nil, score: Float? = nil, text: String? = nil, traits: [Trait]? = nil, type: EntitySubType? = nil) {
            self.beginOffset = beginOffset
            self.endOffset = endOffset
            self.id = id
            self.relationshipScore = relationshipScore
            self.score = score
            self.text = text
            self.traits = traits
            self.`type` = `type`
        }

        private enum CodingKeys: String, CodingKey {
            case beginOffset = "BeginOffset"
            case endOffset = "EndOffset"
            case id = "Id"
            case relationshipScore = "RelationshipScore"
            case score = "Score"
            case text = "Text"
            case traits = "Traits"
            case `type` = "Type"
        }
    }

    public struct ComprehendMedicalAsyncJobFilter: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "JobName", required: false, type: .string), 
            AWSShapeMember(label: "JobStatus", required: false, type: .enum), 
            AWSShapeMember(label: "SubmitTimeAfter", required: false, type: .timestamp), 
            AWSShapeMember(label: "SubmitTimeBefore", required: false, type: .timestamp)
        ]

        /// Filters on the name of the job.
        public let jobName: String?
        /// Filters the list of jobs based on job status. Returns only jobs with the specified status.
        public let jobStatus: JobStatus?
        /// Filters the list of jobs based on the time that the job was submitted for processing. Returns only jobs submitted after the specified time. Jobs are returned in descending order, newest to oldest.
        public let submitTimeAfter: TimeStamp?
        /// Filters the list of jobs based on the time that the job was submitted for processing. Returns only jobs submitted before the specified time. Jobs are returned in ascending order, oldest to newest.
        public let submitTimeBefore: TimeStamp?

        public init(jobName: String? = nil, jobStatus: JobStatus? = nil, submitTimeAfter: TimeStamp? = nil, submitTimeBefore: TimeStamp? = nil) {
            self.jobName = jobName
            self.jobStatus = jobStatus
            self.submitTimeAfter = submitTimeAfter
            self.submitTimeBefore = submitTimeBefore
        }

        public func validate(name: String) throws {
            try validate(self.jobName, name:"jobName", parent: name, max: 256)
            try validate(self.jobName, name:"jobName", parent: name, min: 1)
            try validate(self.jobName, name:"jobName", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-%@]*)$")
        }

        private enum CodingKeys: String, CodingKey {
            case jobName = "JobName"
            case jobStatus = "JobStatus"
            case submitTimeAfter = "SubmitTimeAfter"
            case submitTimeBefore = "SubmitTimeBefore"
        }
    }

    public struct ComprehendMedicalAsyncJobProperties: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "DataAccessRoleArn", required: false, type: .string), 
            AWSShapeMember(label: "EndTime", required: false, type: .timestamp), 
            AWSShapeMember(label: "ExpirationTime", required: false, type: .timestamp), 
            AWSShapeMember(label: "InputDataConfig", required: false, type: .structure), 
            AWSShapeMember(label: "JobId", required: false, type: .string), 
            AWSShapeMember(label: "JobName", required: false, type: .string), 
            AWSShapeMember(label: "JobStatus", required: false, type: .enum), 
            AWSShapeMember(label: "KMSKey", required: false, type: .string), 
            AWSShapeMember(label: "LanguageCode", required: false, type: .enum), 
            AWSShapeMember(label: "ManifestFilePath", required: false, type: .string), 
            AWSShapeMember(label: "Message", required: false, type: .string), 
            AWSShapeMember(label: "ModelVersion", required: false, type: .string), 
            AWSShapeMember(label: "OutputDataConfig", required: false, type: .structure), 
            AWSShapeMember(label: "SubmitTime", required: false, type: .timestamp)
        ]

        /// The Amazon Resource Name (ARN) that gives Amazon Comprehend Medical read access to your input data.
        public let dataAccessRoleArn: String?
        /// The time that the detection job completed.
        public let endTime: TimeStamp?
        /// The date and time that job metadata is deleted from the server. Output files in your S3 bucket will not be deleted. After the metadata is deleted, the job will no longer appear in the results of the ListEntitiesDetectionV2Job or the ListPHIDetectionJobs operation.
        public let expirationTime: TimeStamp?
        /// The input data configuration that you supplied when you created the detection job.
        public let inputDataConfig: InputDataConfig?
        /// The identifier assigned to the detection job.
        public let jobId: String?
        /// The name that you assigned to the detection job.
        public let jobName: String?
        /// The current status of the detection job. If the status is FAILED, the Message field shows the reason for the failure.
        public let jobStatus: JobStatus?
        /// The AWS Key Management Service key, if any, used to encrypt the output files. 
        public let kMSKey: String?
        /// The language code of the input documents.
        public let languageCode: LanguageCode?
        /// The path to the file that describes the results of a batch job.
        public let manifestFilePath: String?
        /// A description of the status of a job.
        public let message: String?
        /// The version of the model used to analyze the documents. The version number looks like X.X.X. You can use this information to track the model used for a particular batch of documents.
        public let modelVersion: String?
        /// The output data configuration that you supplied when you created the detection job.
        public let outputDataConfig: OutputDataConfig?
        /// The time that the detection job was submitted for processing.
        public let submitTime: TimeStamp?

        public init(dataAccessRoleArn: String? = nil, endTime: TimeStamp? = nil, expirationTime: TimeStamp? = nil, inputDataConfig: InputDataConfig? = nil, jobId: String? = nil, jobName: String? = nil, jobStatus: JobStatus? = nil, kMSKey: String? = nil, languageCode: LanguageCode? = nil, manifestFilePath: String? = nil, message: String? = nil, modelVersion: String? = nil, outputDataConfig: OutputDataConfig? = nil, submitTime: TimeStamp? = nil) {
            self.dataAccessRoleArn = dataAccessRoleArn
            self.endTime = endTime
            self.expirationTime = expirationTime
            self.inputDataConfig = inputDataConfig
            self.jobId = jobId
            self.jobName = jobName
            self.jobStatus = jobStatus
            self.kMSKey = kMSKey
            self.languageCode = languageCode
            self.manifestFilePath = manifestFilePath
            self.message = message
            self.modelVersion = modelVersion
            self.outputDataConfig = outputDataConfig
            self.submitTime = submitTime
        }

        private enum CodingKeys: String, CodingKey {
            case dataAccessRoleArn = "DataAccessRoleArn"
            case endTime = "EndTime"
            case expirationTime = "ExpirationTime"
            case inputDataConfig = "InputDataConfig"
            case jobId = "JobId"
            case jobName = "JobName"
            case jobStatus = "JobStatus"
            case kMSKey = "KMSKey"
            case languageCode = "LanguageCode"
            case manifestFilePath = "ManifestFilePath"
            case message = "Message"
            case modelVersion = "ModelVersion"
            case outputDataConfig = "OutputDataConfig"
            case submitTime = "SubmitTime"
        }
    }

    public struct DescribeEntitiesDetectionV2JobRequest: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "JobId", required: true, type: .string)
        ]

        /// The identifier that Amazon Comprehend Medical generated for the job. The StartEntitiesDetectionV2Job operation returns this identifier in its response.
        public let jobId: String

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

        public func validate(name: String) throws {
            try validate(self.jobId, name:"jobId", parent: name, max: 32)
            try validate(self.jobId, name:"jobId", parent: name, min: 1)
            try validate(self.jobId, name:"jobId", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-%@]*)$")
        }

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
        }
    }

    public struct DescribeEntitiesDetectionV2JobResponse: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "ComprehendMedicalAsyncJobProperties", required: false, type: .structure)
        ]

        /// An object that contains the properties associated with a detection job.
        public let comprehendMedicalAsyncJobProperties: ComprehendMedicalAsyncJobProperties?

        public init(comprehendMedicalAsyncJobProperties: ComprehendMedicalAsyncJobProperties? = nil) {
            self.comprehendMedicalAsyncJobProperties = comprehendMedicalAsyncJobProperties
        }

        private enum CodingKeys: String, CodingKey {
            case comprehendMedicalAsyncJobProperties = "ComprehendMedicalAsyncJobProperties"
        }
    }

    public struct DescribePHIDetectionJobRequest: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "JobId", required: true, type: .string)
        ]

        /// The identifier that Amazon Comprehend Medical generated for the job. The StartPHIDetectionJob operation returns this identifier in its response.
        public let jobId: String

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

        public func validate(name: String) throws {
            try validate(self.jobId, name:"jobId", parent: name, max: 32)
            try validate(self.jobId, name:"jobId", parent: name, min: 1)
            try validate(self.jobId, name:"jobId", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-%@]*)$")
        }

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
        }
    }

    public struct DescribePHIDetectionJobResponse: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "ComprehendMedicalAsyncJobProperties", required: false, type: .structure)
        ]

        /// An object that contains the properties associated with a detection job.
        public let comprehendMedicalAsyncJobProperties: ComprehendMedicalAsyncJobProperties?

        public init(comprehendMedicalAsyncJobProperties: ComprehendMedicalAsyncJobProperties? = nil) {
            self.comprehendMedicalAsyncJobProperties = comprehendMedicalAsyncJobProperties
        }

        private enum CodingKeys: String, CodingKey {
            case comprehendMedicalAsyncJobProperties = "ComprehendMedicalAsyncJobProperties"
        }
    }

    public struct DetectEntitiesRequest: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Text", required: true, type: .string)
        ]

        ///  A UTF-8 text string containing the clinical content being examined for entities. Each string must contain fewer than 20,000 bytes of characters.
        public let text: String

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

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

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

    public struct DetectEntitiesResponse: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Entities", required: true, type: .list), 
            AWSShapeMember(label: "ModelVersion", required: true, type: .string), 
            AWSShapeMember(label: "PaginationToken", required: false, type: .string), 
            AWSShapeMember(label: "UnmappedAttributes", required: false, type: .list)
        ]

        ///  The collection of medical entities extracted from the input text and their associated information. For each entity, the response provides the entity text, the entity category, where the entity text begins and ends, and the level of confidence that Amazon Comprehend Medical has in the detection and analysis. Attributes and traits of the entity are also returned.
        public let entities: [Entity]
        /// The version of the model used to analyze the documents. The version number looks like X.X.X. You can use this information to track the model used for a particular batch of documents.
        public let modelVersion: String
        ///  If the result of the previous request to DetectEntities was truncated, include the PaginationToken to fetch the next page of entities.
        public let paginationToken: String?
        ///  Attributes extracted from the input text that we were unable to relate to an entity.
        public let unmappedAttributes: [UnmappedAttribute]?

        public init(entities: [Entity], modelVersion: String, paginationToken: String? = nil, unmappedAttributes: [UnmappedAttribute]? = nil) {
            self.entities = entities
            self.modelVersion = modelVersion
            self.paginationToken = paginationToken
            self.unmappedAttributes = unmappedAttributes
        }

        private enum CodingKeys: String, CodingKey {
            case entities = "Entities"
            case modelVersion = "ModelVersion"
            case paginationToken = "PaginationToken"
            case unmappedAttributes = "UnmappedAttributes"
        }
    }

    public struct DetectEntitiesV2Request: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Text", required: true, type: .string)
        ]

        /// A UTF-8 string containing the clinical content being examined for entities. Each string must contain fewer than 20,000 bytes of characters.
        public let text: String

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

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

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

    public struct DetectEntitiesV2Response: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Entities", required: true, type: .list), 
            AWSShapeMember(label: "ModelVersion", required: true, type: .string), 
            AWSShapeMember(label: "PaginationToken", required: false, type: .string), 
            AWSShapeMember(label: "UnmappedAttributes", required: false, type: .list)
        ]

        /// The collection of medical entities extracted from the input text and their associated information. For each entity, the response provides the entity text, the entity category, where the entity text begins and ends, and the level of confidence in the detection and analysis. Attributes and traits of the entity are also returned.
        public let entities: [Entity]
        /// The version of the model used to analyze the documents. The version number looks like X.X.X. You can use this information to track the model used for a particular batch of documents.
        public let modelVersion: String
        /// If the result to the DetectEntitiesV2 operation was truncated, include the PaginationToken to fetch the next page of entities.
        public let paginationToken: String?
        /// Attributes extracted from the input text that couldn't be related to an entity.
        public let unmappedAttributes: [UnmappedAttribute]?

        public init(entities: [Entity], modelVersion: String, paginationToken: String? = nil, unmappedAttributes: [UnmappedAttribute]? = nil) {
            self.entities = entities
            self.modelVersion = modelVersion
            self.paginationToken = paginationToken
            self.unmappedAttributes = unmappedAttributes
        }

        private enum CodingKeys: String, CodingKey {
            case entities = "Entities"
            case modelVersion = "ModelVersion"
            case paginationToken = "PaginationToken"
            case unmappedAttributes = "UnmappedAttributes"
        }
    }

    public struct DetectPHIRequest: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Text", required: true, type: .string)
        ]

        ///  A UTF-8 text string containing the clinical content being examined for PHI entities. Each string must contain fewer than 20,000 bytes of characters.
        public let text: String

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

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

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

    public struct DetectPHIResponse: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Entities", required: true, type: .list), 
            AWSShapeMember(label: "ModelVersion", required: true, type: .string), 
            AWSShapeMember(label: "PaginationToken", required: false, type: .string)
        ]

        ///  The collection of PHI entities extracted from the input text and their associated information. For each entity, the response provides the entity text, the entity category, where the entity text begins and ends, and the level of confidence that Amazon Comprehend Medical has in its detection. 
        public let entities: [Entity]
        /// The version of the model used to analyze the documents. The version number looks like X.X.X. You can use this information to track the model used for a particular batch of documents.
        public let modelVersion: String
        ///  If the result of the previous request to DetectPHI was truncated, include the PaginationToken to fetch the next page of PHI entities. 
        public let paginationToken: String?

        public init(entities: [Entity], modelVersion: String, paginationToken: String? = nil) {
            self.entities = entities
            self.modelVersion = modelVersion
            self.paginationToken = paginationToken
        }

        private enum CodingKeys: String, CodingKey {
            case entities = "Entities"
            case modelVersion = "ModelVersion"
            case paginationToken = "PaginationToken"
        }
    }

    public struct Entity: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Attributes", required: false, type: .list), 
            AWSShapeMember(label: "BeginOffset", required: false, type: .integer), 
            AWSShapeMember(label: "Category", required: false, type: .enum), 
            AWSShapeMember(label: "EndOffset", required: false, type: .integer), 
            AWSShapeMember(label: "Id", required: false, type: .integer), 
            AWSShapeMember(label: "Score", required: false, type: .float), 
            AWSShapeMember(label: "Text", required: false, type: .string), 
            AWSShapeMember(label: "Traits", required: false, type: .list), 
            AWSShapeMember(label: "Type", required: false, type: .enum)
        ]

        ///  The extracted attributes that relate to this entity.
        public let attributes: [Attribute]?
        ///  The 0-based character offset in the input text that shows where the entity begins. The offset returns the UTF-8 code point in the string. 
        public let beginOffset: Int?
        ///  The category of the entity.
        public let category: EntityType?
        ///  The 0-based character offset in the input text that shows where the entity ends. The offset returns the UTF-8 code point in the string. 
        public let endOffset: Int?
        ///  The numeric identifier for the entity. This is a monotonically increasing id unique within this response rather than a global unique identifier. 
        public let id: Int?
        /// The level of confidence that Amazon Comprehend Medical has in the accuracy of the detection.
        public let score: Float?
        ///  The segment of input text extracted as this entity.
        public let text: String?
        /// Contextual information for the entity.
        public let traits: [Trait]?
        ///  Describes the specific type of entity with category of entities.
        public let `type`: EntitySubType?

        public init(attributes: [Attribute]? = nil, beginOffset: Int? = nil, category: EntityType? = nil, endOffset: Int? = nil, id: Int? = nil, score: Float? = nil, text: String? = nil, traits: [Trait]? = nil, type: EntitySubType? = nil) {
            self.attributes = attributes
            self.beginOffset = beginOffset
            self.category = category
            self.endOffset = endOffset
            self.id = id
            self.score = score
            self.text = text
            self.traits = traits
            self.`type` = `type`
        }

        private enum CodingKeys: String, CodingKey {
            case attributes = "Attributes"
            case beginOffset = "BeginOffset"
            case category = "Category"
            case endOffset = "EndOffset"
            case id = "Id"
            case score = "Score"
            case text = "Text"
            case traits = "Traits"
            case `type` = "Type"
        }
    }

    public struct ICD10CMAttribute: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "BeginOffset", required: false, type: .integer), 
            AWSShapeMember(label: "EndOffset", required: false, type: .integer), 
            AWSShapeMember(label: "Id", required: false, type: .integer), 
            AWSShapeMember(label: "RelationshipScore", required: false, type: .float), 
            AWSShapeMember(label: "Score", required: false, type: .float), 
            AWSShapeMember(label: "Text", required: false, type: .string), 
            AWSShapeMember(label: "Traits", required: false, type: .list), 
            AWSShapeMember(label: "Type", required: false, type: .enum)
        ]

        /// The 0-based character offset in the input text that shows where the attribute begins. The offset returns the UTF-8 code point in the string.
        public let beginOffset: Int?
        /// The 0-based character offset in the input text that shows where the attribute ends. The offset returns the UTF-8 code point in the string.
        public let endOffset: Int?
        /// The numeric identifier for this attribute. This is a monotonically increasing id unique within this response rather than a global unique identifier.
        public let id: Int?
        /// The level of confidence that Amazon Comprehend Medical has that this attribute is correctly related to this entity.
        public let relationshipScore: Float?
        /// The level of confidence that Amazon Comprehend Medical has that the segment of text is correctly recognized as an attribute.
        public let score: Float?
        /// The segment of input text which contains the detected attribute.
        public let text: String?
        /// The contextual information for the attribute. The traits recognized by InferICD10CM are DIAGNOSIS, SIGN, SYMPTOM, and NEGATION.
        public let traits: [ICD10CMTrait]?
        /// The type of attribute. InferICD10CM detects entities of the type DX_NAME. 
        public let `type`: ICD10CMAttributeType?

        public init(beginOffset: Int? = nil, endOffset: Int? = nil, id: Int? = nil, relationshipScore: Float? = nil, score: Float? = nil, text: String? = nil, traits: [ICD10CMTrait]? = nil, type: ICD10CMAttributeType? = nil) {
            self.beginOffset = beginOffset
            self.endOffset = endOffset
            self.id = id
            self.relationshipScore = relationshipScore
            self.score = score
            self.text = text
            self.traits = traits
            self.`type` = `type`
        }

        private enum CodingKeys: String, CodingKey {
            case beginOffset = "BeginOffset"
            case endOffset = "EndOffset"
            case id = "Id"
            case relationshipScore = "RelationshipScore"
            case score = "Score"
            case text = "Text"
            case traits = "Traits"
            case `type` = "Type"
        }
    }

    public struct ICD10CMConcept: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Code", required: false, type: .string), 
            AWSShapeMember(label: "Description", required: false, type: .string), 
            AWSShapeMember(label: "Score", required: false, type: .float)
        ]

        /// The ICD-10-CM code that identifies the concept found in the knowledge base from the Centers for Disease Control.
        public let code: String?
        /// The long description of the ICD-10-CM code in the ontology.
        public let description: String?
        /// The level of confidence that Amazon Comprehend Medical has that the entity is accurately linked to an ICD-10-CM concept.
        public let score: Float?

        public init(code: String? = nil, description: String? = nil, score: Float? = nil) {
            self.code = code
            self.description = description
            self.score = score
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case description = "Description"
            case score = "Score"
        }
    }

    public struct ICD10CMEntity: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Attributes", required: false, type: .list), 
            AWSShapeMember(label: "BeginOffset", required: false, type: .integer), 
            AWSShapeMember(label: "Category", required: false, type: .enum), 
            AWSShapeMember(label: "EndOffset", required: false, type: .integer), 
            AWSShapeMember(label: "ICD10CMConcepts", required: false, type: .list), 
            AWSShapeMember(label: "Id", required: false, type: .integer), 
            AWSShapeMember(label: "Score", required: false, type: .float), 
            AWSShapeMember(label: "Text", required: false, type: .string), 
            AWSShapeMember(label: "Traits", required: false, type: .list), 
            AWSShapeMember(label: "Type", required: false, type: .enum)
        ]

        /// The detected attributes that relate to the entity. An extracted segment of the text that is an attribute of an entity, or otherwise related to an entity, such as the nature of a medical condition.
        public let attributes: [ICD10CMAttribute]?
        /// The 0-based character offset in the input text that shows where the entity begins. The offset returns the UTF-8 code point in the string.
        public let beginOffset: Int?
        ///  The category of the entity. InferICD10CM detects entities in the MEDICAL_CONDITION category. 
        public let category: ICD10CMEntityCategory?
        /// The 0-based character offset in the input text that shows where the entity ends. The offset returns the UTF-8 code point in the string.
        public let endOffset: Int?
        /// The ICD-10-CM concepts that the entity could refer to, along with a score indicating the likelihood of the match.
        public let iCD10CMConcepts: [ICD10CMConcept]?
        /// The numeric identifier for the entity. This is a monotonically increasing id unique within this response rather than a global unique identifier.
        public let id: Int?
        /// The level of confidence that Amazon Comprehend Medical has in the accuracy of the detection.
        public let score: Float?
        /// The segment of input text that is matched to the detected entity.
        public let text: String?
        /// Provides Contextual information for the entity. The traits recognized by InferICD10CM are DIAGNOSIS, SIGN, SYMPTOM, and NEGATION. 
        public let traits: [ICD10CMTrait]?
        /// Describes the specific type of entity with category of entities. InferICD10CM detects entities of the type DX_NAME.
        public let `type`: ICD10CMEntityType?

        public init(attributes: [ICD10CMAttribute]? = nil, beginOffset: Int? = nil, category: ICD10CMEntityCategory? = nil, endOffset: Int? = nil, iCD10CMConcepts: [ICD10CMConcept]? = nil, id: Int? = nil, score: Float? = nil, text: String? = nil, traits: [ICD10CMTrait]? = nil, type: ICD10CMEntityType? = nil) {
            self.attributes = attributes
            self.beginOffset = beginOffset
            self.category = category
            self.endOffset = endOffset
            self.iCD10CMConcepts = iCD10CMConcepts
            self.id = id
            self.score = score
            self.text = text
            self.traits = traits
            self.`type` = `type`
        }

        private enum CodingKeys: String, CodingKey {
            case attributes = "Attributes"
            case beginOffset = "BeginOffset"
            case category = "Category"
            case endOffset = "EndOffset"
            case iCD10CMConcepts = "ICD10CMConcepts"
            case id = "Id"
            case score = "Score"
            case text = "Text"
            case traits = "Traits"
            case `type` = "Type"
        }
    }

    public struct ICD10CMTrait: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Name", required: false, type: .enum), 
            AWSShapeMember(label: "Score", required: false, type: .float)
        ]

        /// Provides a name or contextual description about the trait.
        public let name: ICD10CMTraitName?
        /// The level of confidence that Amazon Comprehend Medical has that the segment of text is correctly recognized as a trait.
        public let score: Float?

        public init(name: ICD10CMTraitName? = nil, score: Float? = nil) {
            self.name = name
            self.score = score
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case score = "Score"
        }
    }

    public struct InferICD10CMRequest: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Text", required: true, type: .string)
        ]

        /// The input text used for analysis. The input for InferICD10CM is a string from 1 to 10000 characters.
        public let text: String

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

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

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

    public struct InferICD10CMResponse: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Entities", required: true, type: .list), 
            AWSShapeMember(label: "ModelVersion", required: false, type: .string), 
            AWSShapeMember(label: "PaginationToken", required: false, type: .string)
        ]

        /// The medical conditions detected in the text linked to ICD-10-CM concepts. If the action is successful, the service sends back an HTTP 200 response, as well as the entities detected.
        public let entities: [ICD10CMEntity]
        /// The version of the model used to analyze the documents, in the format n.n.n You can use this information to track the model used for a particular batch of documents.
        public let modelVersion: String?
        /// If the result of the previous request to InferICD10CM was truncated, include the PaginationToken to fetch the next page of medical condition entities. 
        public let paginationToken: String?

        public init(entities: [ICD10CMEntity], modelVersion: String? = nil, paginationToken: String? = nil) {
            self.entities = entities
            self.modelVersion = modelVersion
            self.paginationToken = paginationToken
        }

        private enum CodingKeys: String, CodingKey {
            case entities = "Entities"
            case modelVersion = "ModelVersion"
            case paginationToken = "PaginationToken"
        }
    }

    public struct InferRxNormRequest: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Text", required: true, type: .string)
        ]

        /// The input text used for analysis. The input for InferRxNorm is a string from 1 to 10000 characters.
        public let text: String

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

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

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

    public struct InferRxNormResponse: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Entities", required: true, type: .list), 
            AWSShapeMember(label: "ModelVersion", required: false, type: .string), 
            AWSShapeMember(label: "PaginationToken", required: false, type: .string)
        ]

        /// The medication entities detected in the text linked to RxNorm concepts. If the action is successful, the service sends back an HTTP 200 response, as well as the entities detected.
        public let entities: [RxNormEntity]
        /// The version of the model used to analyze the documents, in the format n.n.n You can use this information to track the model used for a particular batch of documents.
        public let modelVersion: String?
        /// If the result of the previous request to InferRxNorm was truncated, include the PaginationToken to fetch the next page of medication entities.
        public let paginationToken: String?

        public init(entities: [RxNormEntity], modelVersion: String? = nil, paginationToken: String? = nil) {
            self.entities = entities
            self.modelVersion = modelVersion
            self.paginationToken = paginationToken
        }

        private enum CodingKeys: String, CodingKey {
            case entities = "Entities"
            case modelVersion = "ModelVersion"
            case paginationToken = "PaginationToken"
        }
    }

    public struct InputDataConfig: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "S3Bucket", required: true, type: .string), 
            AWSShapeMember(label: "S3Key", required: false, type: .string)
        ]

        /// The URI of the S3 bucket that contains the input data. The bucket must be in the same region as the API endpoint that you are calling. Each file in the document collection must be less than 40 KB. You can store a maximum of 30 GB in the bucket.
        public let s3Bucket: String
        /// The path to the input data files in the S3 bucket.
        public let s3Key: String?

        public init(s3Bucket: String, s3Key: String? = nil) {
            self.s3Bucket = s3Bucket
            self.s3Key = s3Key
        }

        public func validate(name: String) throws {
            try validate(self.s3Bucket, name:"s3Bucket", parent: name, max: 63)
            try validate(self.s3Bucket, name:"s3Bucket", parent: name, min: 3)
            try validate(self.s3Bucket, name:"s3Bucket", parent: name, pattern: "^[0-9a-z\\.\\-_]*(?!\\.)$")
            try validate(self.s3Key, name:"s3Key", parent: name, max: 1024)
            try validate(self.s3Key, name:"s3Key", parent: name, pattern: ".*")
        }

        private enum CodingKeys: String, CodingKey {
            case s3Bucket = "S3Bucket"
            case s3Key = "S3Key"
        }
    }

    public struct ListEntitiesDetectionV2JobsRequest: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Filter", required: false, type: .structure), 
            AWSShapeMember(label: "MaxResults", required: false, type: .integer), 
            AWSShapeMember(label: "NextToken", required: false, type: .string)
        ]

        /// Filters the jobs that are returned. You can filter jobs based on their names, status, or the date and time that they were submitted. You can only set one filter at a time.
        public let filter: ComprehendMedicalAsyncJobFilter?
        /// The maximum number of results to return in each page. The default is 100.
        public let maxResults: Int?
        /// Identifies the next page of results to return.
        public let nextToken: String?

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

        public func validate(name: String) throws {
            try self.filter?.validate(name: "\(name).filter")
            try validate(self.maxResults, name:"maxResults", parent: name, max: 500)
            try validate(self.maxResults, name:"maxResults", parent: name, min: 1)
            try validate(self.nextToken, name:"nextToken", parent: name, min: 1)
        }

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

    public struct ListEntitiesDetectionV2JobsResponse: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "ComprehendMedicalAsyncJobPropertiesList", required: false, type: .list), 
            AWSShapeMember(label: "NextToken", required: false, type: .string)
        ]

        /// A list containing the properties of each job returned.
        public let comprehendMedicalAsyncJobPropertiesList: [ComprehendMedicalAsyncJobProperties]?
        /// Identifies the next page of results to return.
        public let nextToken: String?

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

        private enum CodingKeys: String, CodingKey {
            case comprehendMedicalAsyncJobPropertiesList = "ComprehendMedicalAsyncJobPropertiesList"
            case nextToken = "NextToken"
        }
    }

    public struct ListPHIDetectionJobsRequest: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Filter", required: false, type: .structure), 
            AWSShapeMember(label: "MaxResults", required: false, type: .integer), 
            AWSShapeMember(label: "NextToken", required: false, type: .string)
        ]

        /// Filters the jobs that are returned. You can filter jobs based on their names, status, or the date and time that they were submitted. You can only set one filter at a time.
        public let filter: ComprehendMedicalAsyncJobFilter?
        /// The maximum number of results to return in each page. The default is 100.
        public let maxResults: Int?
        /// Identifies the next page of results to return.
        public let nextToken: String?

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

        public func validate(name: String) throws {
            try self.filter?.validate(name: "\(name).filter")
            try validate(self.maxResults, name:"maxResults", parent: name, max: 500)
            try validate(self.maxResults, name:"maxResults", parent: name, min: 1)
            try validate(self.nextToken, name:"nextToken", parent: name, min: 1)
        }

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

    public struct ListPHIDetectionJobsResponse: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "ComprehendMedicalAsyncJobPropertiesList", required: false, type: .list), 
            AWSShapeMember(label: "NextToken", required: false, type: .string)
        ]

        /// A list containing the properties of each job returned.
        public let comprehendMedicalAsyncJobPropertiesList: [ComprehendMedicalAsyncJobProperties]?
        /// Identifies the next page of results to return.
        public let nextToken: String?

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

        private enum CodingKeys: String, CodingKey {
            case comprehendMedicalAsyncJobPropertiesList = "ComprehendMedicalAsyncJobPropertiesList"
            case nextToken = "NextToken"
        }
    }

    public struct OutputDataConfig: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "S3Bucket", required: true, type: .string), 
            AWSShapeMember(label: "S3Key", required: false, type: .string)
        ]

        /// When you use the OutputDataConfig object with asynchronous operations, you specify the Amazon S3 location where you want to write the output data. The URI must be in the same region as the API endpoint that you are calling. The location is used as the prefix for the actual location of the output.
        public let s3Bucket: String
        /// The path to the output data files in the S3 bucket. Amazon Comprehend Medical creates an output directory using the job ID so that the output from one job does not overwrite the output of another.
        public let s3Key: String?

        public init(s3Bucket: String, s3Key: String? = nil) {
            self.s3Bucket = s3Bucket
            self.s3Key = s3Key
        }

        public func validate(name: String) throws {
            try validate(self.s3Bucket, name:"s3Bucket", parent: name, max: 63)
            try validate(self.s3Bucket, name:"s3Bucket", parent: name, min: 3)
            try validate(self.s3Bucket, name:"s3Bucket", parent: name, pattern: "^[0-9a-z\\.\\-_]*(?!\\.)$")
            try validate(self.s3Key, name:"s3Key", parent: name, max: 1024)
            try validate(self.s3Key, name:"s3Key", parent: name, pattern: ".*")
        }

        private enum CodingKeys: String, CodingKey {
            case s3Bucket = "S3Bucket"
            case s3Key = "S3Key"
        }
    }

    public struct RxNormAttribute: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "BeginOffset", required: false, type: .integer), 
            AWSShapeMember(label: "EndOffset", required: false, type: .integer), 
            AWSShapeMember(label: "Id", required: false, type: .integer), 
            AWSShapeMember(label: "RelationshipScore", required: false, type: .float), 
            AWSShapeMember(label: "Score", required: false, type: .float), 
            AWSShapeMember(label: "Text", required: false, type: .string), 
            AWSShapeMember(label: "Traits", required: false, type: .list), 
            AWSShapeMember(label: "Type", required: false, type: .enum)
        ]

        /// The 0-based character offset in the input text that shows where the attribute begins. The offset returns the UTF-8 code point in the string.
        public let beginOffset: Int?
        /// The 0-based character offset in the input text that shows where the attribute ends. The offset returns the UTF-8 code point in the string.
        public let endOffset: Int?
        /// The numeric identifier for this attribute. This is a monotonically increasing id unique within this response rather than a global unique identifier.
        public let id: Int?
        /// The level of confidence that Amazon Comprehend Medical has that the attribute is accurately linked to an entity.
        public let relationshipScore: Float?
        /// The level of confidence that Comprehend Medical has that the segment of text is correctly recognized as an attribute.
        public let score: Float?
        /// The segment of input text which corresponds to the detected attribute.
        public let text: String?
        /// Contextual information for the attribute. InferRxNorm recognizes the trait NEGATION for attributes, i.e. that the patient is not taking a specific dose or form of a medication.
        public let traits: [RxNormTrait]?
        /// The type of attribute. The types of attributes recognized by InferRxNorm are BRAND_NAME and GENERIC_NAME.
        public let `type`: RxNormAttributeType?

        public init(beginOffset: Int? = nil, endOffset: Int? = nil, id: Int? = nil, relationshipScore: Float? = nil, score: Float? = nil, text: String? = nil, traits: [RxNormTrait]? = nil, type: RxNormAttributeType? = nil) {
            self.beginOffset = beginOffset
            self.endOffset = endOffset
            self.id = id
            self.relationshipScore = relationshipScore
            self.score = score
            self.text = text
            self.traits = traits
            self.`type` = `type`
        }

        private enum CodingKeys: String, CodingKey {
            case beginOffset = "BeginOffset"
            case endOffset = "EndOffset"
            case id = "Id"
            case relationshipScore = "RelationshipScore"
            case score = "Score"
            case text = "Text"
            case traits = "Traits"
            case `type` = "Type"
        }
    }

    public struct RxNormConcept: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Code", required: false, type: .string), 
            AWSShapeMember(label: "Description", required: false, type: .string), 
            AWSShapeMember(label: "Score", required: false, type: .float)
        ]

        /// RxNorm concept ID, also known as the RxCUI.
        public let code: String?
        /// The description of the RxNorm concept.
        public let description: String?
        /// The level of confidence that Amazon Comprehend Medical has that the entity is accurately linked to the reported RxNorm concept.
        public let score: Float?

        public init(code: String? = nil, description: String? = nil, score: Float? = nil) {
            self.code = code
            self.description = description
            self.score = score
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case description = "Description"
            case score = "Score"
        }
    }

    public struct RxNormEntity: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Attributes", required: false, type: .list), 
            AWSShapeMember(label: "BeginOffset", required: false, type: .integer), 
            AWSShapeMember(label: "Category", required: false, type: .enum), 
            AWSShapeMember(label: "EndOffset", required: false, type: .integer), 
            AWSShapeMember(label: "Id", required: false, type: .integer), 
            AWSShapeMember(label: "RxNormConcepts", required: false, type: .list), 
            AWSShapeMember(label: "Score", required: false, type: .float), 
            AWSShapeMember(label: "Text", required: false, type: .string), 
            AWSShapeMember(label: "Traits", required: false, type: .list), 
            AWSShapeMember(label: "Type", required: false, type: .enum)
        ]

        /// The extracted attributes that relate to the entity. The attributes recognized by InferRxNorm are DOSAGE, DURATION, FORM, FREQUENCY, RATE, ROUTE_OR_MODE, and STRENGTH.
        public let attributes: [RxNormAttribute]?
        /// The 0-based character offset in the input text that shows where the entity begins. The offset returns the UTF-8 code point in the string.
        public let beginOffset: Int?
        /// The category of the entity. The recognized categories are GENERIC or BRAND_NAME.
        public let category: RxNormEntityCategory?
        /// The 0-based character offset in the input text that shows where the entity ends. The offset returns the UTF-8 code point in the string.
        public let endOffset: Int?
        /// The numeric identifier for the entity. This is a monotonically increasing id unique within this response rather than a global unique identifier.
        public let id: Int?
        ///  The RxNorm concepts that the entity could refer to, along with a score indicating the likelihood of the match.
        public let rxNormConcepts: [RxNormConcept]?
        /// The level of confidence that Amazon Comprehend Medical has in the accuracy of the detected entity.
        public let score: Float?
        /// The segment of input text extracted from which the entity was detected.
        public let text: String?
        ///  Contextual information for the entity.
        public let traits: [RxNormTrait]?
        ///  Describes the specific type of entity. For InferRxNorm, the recognized entity type is MEDICATION.
        public let `type`: RxNormEntityType?

        public init(attributes: [RxNormAttribute]? = nil, beginOffset: Int? = nil, category: RxNormEntityCategory? = nil, endOffset: Int? = nil, id: Int? = nil, rxNormConcepts: [RxNormConcept]? = nil, score: Float? = nil, text: String? = nil, traits: [RxNormTrait]? = nil, type: RxNormEntityType? = nil) {
            self.attributes = attributes
            self.beginOffset = beginOffset
            self.category = category
            self.endOffset = endOffset
            self.id = id
            self.rxNormConcepts = rxNormConcepts
            self.score = score
            self.text = text
            self.traits = traits
            self.`type` = `type`
        }

        private enum CodingKeys: String, CodingKey {
            case attributes = "Attributes"
            case beginOffset = "BeginOffset"
            case category = "Category"
            case endOffset = "EndOffset"
            case id = "Id"
            case rxNormConcepts = "RxNormConcepts"
            case score = "Score"
            case text = "Text"
            case traits = "Traits"
            case `type` = "Type"
        }
    }

    public struct RxNormTrait: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Name", required: false, type: .enum), 
            AWSShapeMember(label: "Score", required: false, type: .float)
        ]

        /// Provides a name or contextual description about the trait.
        public let name: RxNormTraitName?
        /// The level of confidence that Amazon Comprehend Medical has in the accuracy of the detected trait.
        public let score: Float?

        public init(name: RxNormTraitName? = nil, score: Float? = nil) {
            self.name = name
            self.score = score
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case score = "Score"
        }
    }

    public struct StartEntitiesDetectionV2JobRequest: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "ClientRequestToken", required: false, type: .string), 
            AWSShapeMember(label: "DataAccessRoleArn", required: true, type: .string), 
            AWSShapeMember(label: "InputDataConfig", required: true, type: .structure), 
            AWSShapeMember(label: "JobName", required: false, type: .string), 
            AWSShapeMember(label: "KMSKey", required: false, type: .string), 
            AWSShapeMember(label: "LanguageCode", required: true, type: .enum), 
            AWSShapeMember(label: "OutputDataConfig", required: true, type: .structure)
        ]

        /// A unique identifier for the request. If you don't set the client request token, Amazon Comprehend Medical generates one.
        public let clientRequestToken: String?
        /// The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that grants Amazon Comprehend Medical read access to your input data. For more information, see  Role-Based Permissions Required for Asynchronous Operations.
        public let dataAccessRoleArn: String
        /// Specifies the format and location of the input data for the job.
        public let inputDataConfig: InputDataConfig
        /// The identifier of the job.
        public let jobName: String?
        /// An AWS Key Management Service key to encrypt your output files. If you do not specify a key, the files are written in plain text.
        public let kMSKey: String?
        /// The language of the input documents. All documents must be in the same language.
        public let languageCode: LanguageCode
        /// Specifies where to send the output files.
        public let outputDataConfig: OutputDataConfig

        public init(clientRequestToken: String? = StartEntitiesDetectionV2JobRequest.idempotencyToken(), dataAccessRoleArn: String, inputDataConfig: InputDataConfig, jobName: String? = nil, kMSKey: String? = nil, languageCode: LanguageCode, outputDataConfig: OutputDataConfig) {
            self.clientRequestToken = clientRequestToken
            self.dataAccessRoleArn = dataAccessRoleArn
            self.inputDataConfig = inputDataConfig
            self.jobName = jobName
            self.kMSKey = kMSKey
            self.languageCode = languageCode
            self.outputDataConfig = outputDataConfig
        }

        public func validate(name: String) throws {
            try validate(self.clientRequestToken, name:"clientRequestToken", parent: name, max: 64)
            try validate(self.clientRequestToken, name:"clientRequestToken", parent: name, min: 1)
            try validate(self.clientRequestToken, name:"clientRequestToken", parent: name, pattern: "^[a-zA-Z0-9-]+$")
            try validate(self.dataAccessRoleArn, name:"dataAccessRoleArn", parent: name, max: 2048)
            try validate(self.dataAccessRoleArn, name:"dataAccessRoleArn", parent: name, min: 20)
            try validate(self.dataAccessRoleArn, name:"dataAccessRoleArn", parent: name, pattern: "arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+")
            try self.inputDataConfig.validate(name: "\(name).inputDataConfig")
            try validate(self.jobName, name:"jobName", parent: name, max: 256)
            try validate(self.jobName, name:"jobName", parent: name, min: 1)
            try validate(self.jobName, name:"jobName", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-%@]*)$")
            try validate(self.kMSKey, name:"kMSKey", parent: name, max: 2048)
            try validate(self.kMSKey, name:"kMSKey", parent: name, min: 1)
            try validate(self.kMSKey, name:"kMSKey", parent: name, pattern: ".*")
            try self.outputDataConfig.validate(name: "\(name).outputDataConfig")
        }

        private enum CodingKeys: String, CodingKey {
            case clientRequestToken = "ClientRequestToken"
            case dataAccessRoleArn = "DataAccessRoleArn"
            case inputDataConfig = "InputDataConfig"
            case jobName = "JobName"
            case kMSKey = "KMSKey"
            case languageCode = "LanguageCode"
            case outputDataConfig = "OutputDataConfig"
        }
    }

    public struct StartEntitiesDetectionV2JobResponse: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "JobId", required: false, type: .string)
        ]

        /// The identifier generated for the job. To get the status of a job, use this identifier with the DescribeEntitiesDetectionV2Job operation.
        public let jobId: String?

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

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
        }
    }

    public struct StartPHIDetectionJobRequest: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "ClientRequestToken", required: false, type: .string), 
            AWSShapeMember(label: "DataAccessRoleArn", required: true, type: .string), 
            AWSShapeMember(label: "InputDataConfig", required: true, type: .structure), 
            AWSShapeMember(label: "JobName", required: false, type: .string), 
            AWSShapeMember(label: "KMSKey", required: false, type: .string), 
            AWSShapeMember(label: "LanguageCode", required: true, type: .enum), 
            AWSShapeMember(label: "OutputDataConfig", required: true, type: .structure)
        ]

        /// A unique identifier for the request. If you don't set the client request token, Amazon Comprehend Medical generates one.
        public let clientRequestToken: String?
        /// The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that grants Amazon Comprehend Medical read access to your input data. For more information, see  Role-Based Permissions Required for Asynchronous Operations.
        public let dataAccessRoleArn: String
        /// Specifies the format and location of the input data for the job.
        public let inputDataConfig: InputDataConfig
        /// The identifier of the job.
        public let jobName: String?
        /// An AWS Key Management Service key to encrypt your output files. If you do not specify a key, the files are written in plain text.
        public let kMSKey: String?
        /// The language of the input documents. All documents must be in the same language.
        public let languageCode: LanguageCode
        /// Specifies where to send the output files.
        public let outputDataConfig: OutputDataConfig

        public init(clientRequestToken: String? = StartPHIDetectionJobRequest.idempotencyToken(), dataAccessRoleArn: String, inputDataConfig: InputDataConfig, jobName: String? = nil, kMSKey: String? = nil, languageCode: LanguageCode, outputDataConfig: OutputDataConfig) {
            self.clientRequestToken = clientRequestToken
            self.dataAccessRoleArn = dataAccessRoleArn
            self.inputDataConfig = inputDataConfig
            self.jobName = jobName
            self.kMSKey = kMSKey
            self.languageCode = languageCode
            self.outputDataConfig = outputDataConfig
        }

        public func validate(name: String) throws {
            try validate(self.clientRequestToken, name:"clientRequestToken", parent: name, max: 64)
            try validate(self.clientRequestToken, name:"clientRequestToken", parent: name, min: 1)
            try validate(self.clientRequestToken, name:"clientRequestToken", parent: name, pattern: "^[a-zA-Z0-9-]+$")
            try validate(self.dataAccessRoleArn, name:"dataAccessRoleArn", parent: name, max: 2048)
            try validate(self.dataAccessRoleArn, name:"dataAccessRoleArn", parent: name, min: 20)
            try validate(self.dataAccessRoleArn, name:"dataAccessRoleArn", parent: name, pattern: "arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+")
            try self.inputDataConfig.validate(name: "\(name).inputDataConfig")
            try validate(self.jobName, name:"jobName", parent: name, max: 256)
            try validate(self.jobName, name:"jobName", parent: name, min: 1)
            try validate(self.jobName, name:"jobName", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-%@]*)$")
            try validate(self.kMSKey, name:"kMSKey", parent: name, max: 2048)
            try validate(self.kMSKey, name:"kMSKey", parent: name, min: 1)
            try validate(self.kMSKey, name:"kMSKey", parent: name, pattern: ".*")
            try self.outputDataConfig.validate(name: "\(name).outputDataConfig")
        }

        private enum CodingKeys: String, CodingKey {
            case clientRequestToken = "ClientRequestToken"
            case dataAccessRoleArn = "DataAccessRoleArn"
            case inputDataConfig = "InputDataConfig"
            case jobName = "JobName"
            case kMSKey = "KMSKey"
            case languageCode = "LanguageCode"
            case outputDataConfig = "OutputDataConfig"
        }
    }

    public struct StartPHIDetectionJobResponse: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "JobId", required: false, type: .string)
        ]

        /// The identifier generated for the job. To get the status of a job, use this identifier with the DescribePHIDetectionJob operation.
        public let jobId: String?

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

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
        }
    }

    public struct StopEntitiesDetectionV2JobRequest: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "JobId", required: true, type: .string)
        ]

        /// The identifier of the medical entities job to stop.
        public let jobId: String

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

        public func validate(name: String) throws {
            try validate(self.jobId, name:"jobId", parent: name, max: 32)
            try validate(self.jobId, name:"jobId", parent: name, min: 1)
            try validate(self.jobId, name:"jobId", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-%@]*)$")
        }

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
        }
    }

    public struct StopEntitiesDetectionV2JobResponse: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "JobId", required: false, type: .string)
        ]

        /// The identifier of the medical entities detection job that was stopped.
        public let jobId: String?

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

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
        }
    }

    public struct StopPHIDetectionJobRequest: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "JobId", required: true, type: .string)
        ]

        /// The identifier of the PHI detection job to stop.
        public let jobId: String

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

        public func validate(name: String) throws {
            try validate(self.jobId, name:"jobId", parent: name, max: 32)
            try validate(self.jobId, name:"jobId", parent: name, min: 1)
            try validate(self.jobId, name:"jobId", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-%@]*)$")
        }

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
        }
    }

    public struct StopPHIDetectionJobResponse: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "JobId", required: false, type: .string)
        ]

        /// The identifier of the PHI detection job that was stopped.
        public let jobId: String?

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

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
        }
    }

    public struct Trait: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Name", required: false, type: .enum), 
            AWSShapeMember(label: "Score", required: false, type: .float)
        ]

        ///  Provides a name or contextual description about the trait. 
        public let name: AttributeName?
        ///  The level of confidence that Amazon Comprehend Medical has in the accuracy of this trait.
        public let score: Float?

        public init(name: AttributeName? = nil, score: Float? = nil) {
            self.name = name
            self.score = score
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case score = "Score"
        }
    }

    public struct UnmappedAttribute: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "Attribute", required: false, type: .structure), 
            AWSShapeMember(label: "Type", required: false, type: .enum)
        ]

        ///  The specific attribute that has been extracted but not mapped to an entity. 
        public let attribute: Attribute?
        ///  The type of the attribute, could be one of the following values: "MEDICATION", "MEDICAL_CONDITION", "ANATOMY", "TEST_AND_TREATMENT_PROCEDURE" or "PROTECTED_HEALTH_INFORMATION". 
        public let `type`: EntityType?

        public init(attribute: Attribute? = nil, type: EntityType? = nil) {
            self.attribute = attribute
            self.`type` = `type`
        }

        private enum CodingKeys: String, CodingKey {
            case attribute = "Attribute"
            case `type` = "Type"
        }
    }
}
