// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. import Foundation extension Operations { /// A model object public struct Device { public let clientIdentifier: String? @DecimalSerialized public private(set) var createdAt: Double? @DecimalSerialized public private(set) var id: Double? public let name: String? public let platform: String? /// Creates an object with the specified parameters /// /// public init(clientIdentifier: String? = nil, createdAt: Double? = nil, id: Double? = nil, name: String? = nil, platform: String? = nil) { self.clientIdentifier = clientIdentifier self._createdAt = DecimalSerialized(wrappedValue: createdAt) self._id = DecimalSerialized(wrappedValue: id) self.name = name self.platform = platform } }} extension Operations.Device: Codable { enum CodingKeys: String, CodingKey { case clientIdentifier case createdAt case id case name case platform } public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.clientIdentifier = try container.decodeIfPresent(String.self, forKey: .clientIdentifier) self._createdAt = try container.decodeIfPresent(DecimalSerialized.self, forKey: .createdAt) ?? DecimalSerialized(wrappedValue: nil) self._id = try container.decodeIfPresent(DecimalSerialized.self, forKey: .id) ?? DecimalSerialized(wrappedValue: nil) self.name = try container.decodeIfPresent(String.self, forKey: .name) self.platform = try container.decodeIfPresent(String.self, forKey: .platform) } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(self.clientIdentifier, forKey: .clientIdentifier) if self.createdAt != nil { try container.encode(self._createdAt, forKey: .createdAt) } if self.id != nil { try container.encode(self._id, forKey: .id) } try container.encodeIfPresent(self.name, forKey: .name) try container.encodeIfPresent(self.platform, forKey: .platform) } } extension Operations.Device { var idWrapper: DecimalSerialized { return _id } var createdAtWrapper: DecimalSerialized { return _createdAt } }