// // TobaccoUseAndExposureSectionAllOf.swift // // Generated by openapi-generator // https://openapi-generator.tech // import Foundation #if canImport(AnyCodable) import AnyCodable #endif public struct TobaccoUseAndExposureSectionAllOf: Codable, Hashable { public enum TobaccoUser: String, Codable, CaseIterable { case active = "active" case never = "never" case formerBecausePregnancy = "former_because_pregnancy" case formerLongAgo = "former_long_ago" } public var exposureToEnvironmentalTobaccoSmoke: YesNoEnum? public var tobaccoUser: TobaccoUser? public var endDate: Date? public var smokeDuringPregnancy: YesNoEnum? public var referredToTobaccoCessationEducation: YesNoEnum? public init(exposureToEnvironmentalTobaccoSmoke: YesNoEnum? = nil, tobaccoUser: TobaccoUser? = nil, endDate: Date? = nil, smokeDuringPregnancy: YesNoEnum? = nil, referredToTobaccoCessationEducation: YesNoEnum? = nil) { self.exposureToEnvironmentalTobaccoSmoke = exposureToEnvironmentalTobaccoSmoke self.tobaccoUser = tobaccoUser self.endDate = endDate self.smokeDuringPregnancy = smokeDuringPregnancy self.referredToTobaccoCessationEducation = referredToTobaccoCessationEducation } public enum CodingKeys: String, CodingKey, CaseIterable { case exposureToEnvironmentalTobaccoSmoke case tobaccoUser case endDate case smokeDuringPregnancy case referredToTobaccoCessationEducation } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(exposureToEnvironmentalTobaccoSmoke, forKey: .exposureToEnvironmentalTobaccoSmoke) try container.encodeIfPresent(tobaccoUser, forKey: .tobaccoUser) try container.encodeIfPresent(endDate, forKey: .endDate) try container.encodeIfPresent(smokeDuringPregnancy, forKey: .smokeDuringPregnancy) try container.encodeIfPresent(referredToTobaccoCessationEducation, forKey: .referredToTobaccoCessationEducation) } }