// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. import Foundation extension Operations { /// A model object public struct GetOnDeckMetadata { @DecimalSerialized public private(set) var addedAt: Double? public let allowSync: Bool? public let art: String? public let contentRating: String? @DecimalSerialized public private(set) var duration: Double? public let grandparentArt: String? public let grandparentGuid: String? public let grandparentKey: String? @DecimalSerialized public private(set) var grandparentRatingKey: Double? public let grandparentTheme: String? public let grandparentThumb: String? public let grandparentTitle: String? public let guid: String? public let guids: [Operations.GetOnDeckGuids]? @DecimalSerialized public private(set) var index: Double? public let key: String? @DecimalSerialized public private(set) var lastViewedAt: Double? @DecimalSerialized public private(set) var librarySectionID: Double? public let librarySectionKey: String? public let librarySectionTitle: String? public let librarySectionUUID: String? public let media: [Operations.GetOnDeckMedia]? @DateTime public private(set) var originallyAvailableAt: Date? public let parentGuid: String? @DecimalSerialized public private(set) var parentIndex: Double? public let parentKey: String? @DecimalSerialized public private(set) var parentRatingKey: Double? public let parentThumb: String? public let parentTitle: String? @DecimalSerialized public private(set) var ratingKey: Double? public let summary: String? public let thumb: String? public let title: String? public let type: String? @DecimalSerialized public private(set) var updatedAt: Double? @DecimalSerialized public private(set) var year: Double? /// Creates an object with the specified parameters /// /// public init(addedAt: Double? = nil, allowSync: Bool? = nil, art: String? = nil, contentRating: String? = nil, duration: Double? = nil, grandparentArt: String? = nil, grandparentGuid: String? = nil, grandparentKey: String? = nil, grandparentRatingKey: Double? = nil, grandparentTheme: String? = nil, grandparentThumb: String? = nil, grandparentTitle: String? = nil, guid: String? = nil, guids: [Operations.GetOnDeckGuids]? = nil, index: Double? = nil, key: String? = nil, lastViewedAt: Double? = nil, librarySectionID: Double? = nil, librarySectionKey: String? = nil, librarySectionTitle: String? = nil, librarySectionUUID: String? = nil, media: [Operations.GetOnDeckMedia]? = nil, originallyAvailableAt: Date? = nil, parentGuid: String? = nil, parentIndex: Double? = nil, parentKey: String? = nil, parentRatingKey: Double? = nil, parentThumb: String? = nil, parentTitle: String? = nil, ratingKey: Double? = nil, summary: String? = nil, thumb: String? = nil, title: String? = nil, type: String? = nil, updatedAt: Double? = nil, year: Double? = nil) { self._addedAt = DecimalSerialized(wrappedValue: addedAt) self.allowSync = allowSync self.art = art self.contentRating = contentRating self._duration = DecimalSerialized(wrappedValue: duration) self.grandparentArt = grandparentArt self.grandparentGuid = grandparentGuid self.grandparentKey = grandparentKey self._grandparentRatingKey = DecimalSerialized(wrappedValue: grandparentRatingKey) self.grandparentTheme = grandparentTheme self.grandparentThumb = grandparentThumb self.grandparentTitle = grandparentTitle self.guid = guid self.guids = guids self._index = DecimalSerialized(wrappedValue: index) self.key = key self._lastViewedAt = DecimalSerialized(wrappedValue: lastViewedAt) self._librarySectionID = DecimalSerialized(wrappedValue: librarySectionID) self.librarySectionKey = librarySectionKey self.librarySectionTitle = librarySectionTitle self.librarySectionUUID = librarySectionUUID self.media = media self._originallyAvailableAt = DateTime(wrappedValue: originallyAvailableAt) self.parentGuid = parentGuid self._parentIndex = DecimalSerialized(wrappedValue: parentIndex) self.parentKey = parentKey self._parentRatingKey = DecimalSerialized(wrappedValue: parentRatingKey) self.parentThumb = parentThumb self.parentTitle = parentTitle self._ratingKey = DecimalSerialized(wrappedValue: ratingKey) self.summary = summary self.thumb = thumb self.title = title self.type = type self._updatedAt = DecimalSerialized(wrappedValue: updatedAt) self._year = DecimalSerialized(wrappedValue: year) } }} extension Operations.GetOnDeckMetadata: Codable { enum CodingKeys: String, CodingKey { case addedAt case allowSync case art case contentRating case duration case grandparentArt case grandparentGuid case grandparentKey case grandparentRatingKey case grandparentTheme case grandparentThumb case grandparentTitle case guid case guids = "Guid" case index case key case lastViewedAt case librarySectionID case librarySectionKey case librarySectionTitle case librarySectionUUID case media = "Media" case originallyAvailableAt case parentGuid case parentIndex case parentKey case parentRatingKey case parentThumb case parentTitle case ratingKey case summary case thumb case title case type case updatedAt case year } public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self._addedAt = try container.decodeIfPresent(DecimalSerialized.self, forKey: .addedAt) ?? DecimalSerialized(wrappedValue: nil) self.allowSync = try container.decodeIfPresent(Bool.self, forKey: .allowSync) self.art = try container.decodeIfPresent(String.self, forKey: .art) self.contentRating = try container.decodeIfPresent(String.self, forKey: .contentRating) self._duration = try container.decodeIfPresent(DecimalSerialized.self, forKey: .duration) ?? DecimalSerialized(wrappedValue: nil) self.grandparentArt = try container.decodeIfPresent(String.self, forKey: .grandparentArt) self.grandparentGuid = try container.decodeIfPresent(String.self, forKey: .grandparentGuid) self.grandparentKey = try container.decodeIfPresent(String.self, forKey: .grandparentKey) self._grandparentRatingKey = try container.decodeIfPresent(DecimalSerialized.self, forKey: .grandparentRatingKey) ?? DecimalSerialized(wrappedValue: nil) self.grandparentTheme = try container.decodeIfPresent(String.self, forKey: .grandparentTheme) self.grandparentThumb = try container.decodeIfPresent(String.self, forKey: .grandparentThumb) self.grandparentTitle = try container.decodeIfPresent(String.self, forKey: .grandparentTitle) self.guid = try container.decodeIfPresent(String.self, forKey: .guid) self.guids = try container.decodeIfPresent([Operations.GetOnDeckGuids].self, forKey: .guids) self._index = try container.decodeIfPresent(DecimalSerialized.self, forKey: .index) ?? DecimalSerialized(wrappedValue: nil) self.key = try container.decodeIfPresent(String.self, forKey: .key) self._lastViewedAt = try container.decodeIfPresent(DecimalSerialized.self, forKey: .lastViewedAt) ?? DecimalSerialized(wrappedValue: nil) self._librarySectionID = try container.decodeIfPresent(DecimalSerialized.self, forKey: .librarySectionID) ?? DecimalSerialized(wrappedValue: nil) self.librarySectionKey = try container.decodeIfPresent(String.self, forKey: .librarySectionKey) self.librarySectionTitle = try container.decodeIfPresent(String.self, forKey: .librarySectionTitle) self.librarySectionUUID = try container.decodeIfPresent(String.self, forKey: .librarySectionUUID) self.media = try container.decodeIfPresent([Operations.GetOnDeckMedia].self, forKey: .media) self._originallyAvailableAt = try container.decodeIfPresent(DateTime.self, forKey: .originallyAvailableAt) ?? DateTime(wrappedValue: nil) self.parentGuid = try container.decodeIfPresent(String.self, forKey: .parentGuid) self._parentIndex = try container.decodeIfPresent(DecimalSerialized.self, forKey: .parentIndex) ?? DecimalSerialized(wrappedValue: nil) self.parentKey = try container.decodeIfPresent(String.self, forKey: .parentKey) self._parentRatingKey = try container.decodeIfPresent(DecimalSerialized.self, forKey: .parentRatingKey) ?? DecimalSerialized(wrappedValue: nil) self.parentThumb = try container.decodeIfPresent(String.self, forKey: .parentThumb) self.parentTitle = try container.decodeIfPresent(String.self, forKey: .parentTitle) self._ratingKey = try container.decodeIfPresent(DecimalSerialized.self, forKey: .ratingKey) ?? DecimalSerialized(wrappedValue: nil) self.summary = try container.decodeIfPresent(String.self, forKey: .summary) self.thumb = try container.decodeIfPresent(String.self, forKey: .thumb) self.title = try container.decodeIfPresent(String.self, forKey: .title) self.type = try container.decodeIfPresent(String.self, forKey: .type) self._updatedAt = try container.decodeIfPresent(DecimalSerialized.self, forKey: .updatedAt) ?? DecimalSerialized(wrappedValue: nil) self._year = try container.decodeIfPresent(DecimalSerialized.self, forKey: .year) ?? DecimalSerialized(wrappedValue: nil) } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) if self.addedAt != nil { try container.encode(self._addedAt, forKey: .addedAt) } try container.encodeIfPresent(self.allowSync, forKey: .allowSync) try container.encodeIfPresent(self.art, forKey: .art) try container.encodeIfPresent(self.contentRating, forKey: .contentRating) if self.duration != nil { try container.encode(self._duration, forKey: .duration) } try container.encodeIfPresent(self.grandparentArt, forKey: .grandparentArt) try container.encodeIfPresent(self.grandparentGuid, forKey: .grandparentGuid) try container.encodeIfPresent(self.grandparentKey, forKey: .grandparentKey) if self.grandparentRatingKey != nil { try container.encode(self._grandparentRatingKey, forKey: .grandparentRatingKey) } try container.encodeIfPresent(self.grandparentTheme, forKey: .grandparentTheme) try container.encodeIfPresent(self.grandparentThumb, forKey: .grandparentThumb) try container.encodeIfPresent(self.grandparentTitle, forKey: .grandparentTitle) try container.encodeIfPresent(self.guid, forKey: .guid) try container.encodeIfPresent(self.guids, forKey: .guids) if self.index != nil { try container.encode(self._index, forKey: .index) } try container.encodeIfPresent(self.key, forKey: .key) if self.lastViewedAt != nil { try container.encode(self._lastViewedAt, forKey: .lastViewedAt) } if self.librarySectionID != nil { try container.encode(self._librarySectionID, forKey: .librarySectionID) } try container.encodeIfPresent(self.librarySectionKey, forKey: .librarySectionKey) try container.encodeIfPresent(self.librarySectionTitle, forKey: .librarySectionTitle) try container.encodeIfPresent(self.librarySectionUUID, forKey: .librarySectionUUID) try container.encodeIfPresent(self.media, forKey: .media) if self.originallyAvailableAt != nil { try container.encode(self._originallyAvailableAt, forKey: .originallyAvailableAt) } try container.encodeIfPresent(self.parentGuid, forKey: .parentGuid) if self.parentIndex != nil { try container.encode(self._parentIndex, forKey: .parentIndex) } try container.encodeIfPresent(self.parentKey, forKey: .parentKey) if self.parentRatingKey != nil { try container.encode(self._parentRatingKey, forKey: .parentRatingKey) } try container.encodeIfPresent(self.parentThumb, forKey: .parentThumb) try container.encodeIfPresent(self.parentTitle, forKey: .parentTitle) if self.ratingKey != nil { try container.encode(self._ratingKey, forKey: .ratingKey) } try container.encodeIfPresent(self.summary, forKey: .summary) try container.encodeIfPresent(self.thumb, forKey: .thumb) try container.encodeIfPresent(self.title, forKey: .title) try container.encodeIfPresent(self.type, forKey: .type) if self.updatedAt != nil { try container.encode(self._updatedAt, forKey: .updatedAt) } if self.year != nil { try container.encode(self._year, forKey: .year) } } } extension Operations.GetOnDeckMetadata { var librarySectionIDWrapper: DecimalSerialized { return _librarySectionID } var ratingKeyWrapper: DecimalSerialized { return _ratingKey } var parentRatingKeyWrapper: DecimalSerialized { return _parentRatingKey } var grandparentRatingKeyWrapper: DecimalSerialized { return _grandparentRatingKey } var indexWrapper: DecimalSerialized { return _index } var parentIndexWrapper: DecimalSerialized { return _parentIndex } var lastViewedAtWrapper: DecimalSerialized { return _lastViewedAt } var yearWrapper: DecimalSerialized { return _year } var durationWrapper: DecimalSerialized { return _duration } var originallyAvailableAtWrapper: DateTime { return _originallyAvailableAt } var addedAtWrapper: DecimalSerialized { return _addedAt } var updatedAtWrapper: DecimalSerialized { return _updatedAt } }