mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-06 12:47:44 +00:00
283 lines
15 KiB
Swift
283 lines
15 KiB
Swift
// 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<Double?>(wrappedValue: addedAt)
|
|
self.allowSync = allowSync
|
|
self.art = art
|
|
self.contentRating = contentRating
|
|
self._duration = DecimalSerialized<Double?>(wrappedValue: duration)
|
|
self.grandparentArt = grandparentArt
|
|
self.grandparentGuid = grandparentGuid
|
|
self.grandparentKey = grandparentKey
|
|
self._grandparentRatingKey = DecimalSerialized<Double?>(wrappedValue: grandparentRatingKey)
|
|
self.grandparentTheme = grandparentTheme
|
|
self.grandparentThumb = grandparentThumb
|
|
self.grandparentTitle = grandparentTitle
|
|
self.guid = guid
|
|
self.guids = guids
|
|
self._index = DecimalSerialized<Double?>(wrappedValue: index)
|
|
self.key = key
|
|
self._lastViewedAt = DecimalSerialized<Double?>(wrappedValue: lastViewedAt)
|
|
self._librarySectionID = DecimalSerialized<Double?>(wrappedValue: librarySectionID)
|
|
self.librarySectionKey = librarySectionKey
|
|
self.librarySectionTitle = librarySectionTitle
|
|
self.librarySectionUUID = librarySectionUUID
|
|
self.media = media
|
|
self._originallyAvailableAt = DateTime<Date?>(wrappedValue: originallyAvailableAt)
|
|
self.parentGuid = parentGuid
|
|
self._parentIndex = DecimalSerialized<Double?>(wrappedValue: parentIndex)
|
|
self.parentKey = parentKey
|
|
self._parentRatingKey = DecimalSerialized<Double?>(wrappedValue: parentRatingKey)
|
|
self.parentThumb = parentThumb
|
|
self.parentTitle = parentTitle
|
|
self._ratingKey = DecimalSerialized<Double?>(wrappedValue: ratingKey)
|
|
self.summary = summary
|
|
self.thumb = thumb
|
|
self.title = title
|
|
self.type = type
|
|
self._updatedAt = DecimalSerialized<Double?>(wrappedValue: updatedAt)
|
|
self._year = DecimalSerialized<Double?>(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<Double?>.self, forKey: .addedAt) ?? DecimalSerialized<Double?>(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<Double?>.self, forKey: .duration) ?? DecimalSerialized<Double?>(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<Double?>.self, forKey: .grandparentRatingKey) ?? DecimalSerialized<Double?>(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<Double?>.self, forKey: .index) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self.key = try container.decodeIfPresent(String.self, forKey: .key)
|
|
self._lastViewedAt = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .lastViewedAt) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self._librarySectionID = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .librarySectionID) ?? DecimalSerialized<Double?>(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<Date?>.self, forKey: .originallyAvailableAt) ?? DateTime<Date?>(wrappedValue: nil)
|
|
self.parentGuid = try container.decodeIfPresent(String.self, forKey: .parentGuid)
|
|
self._parentIndex = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .parentIndex) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self.parentKey = try container.decodeIfPresent(String.self, forKey: .parentKey)
|
|
self._parentRatingKey = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .parentRatingKey) ?? DecimalSerialized<Double?>(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<Double?>.self, forKey: .ratingKey) ?? DecimalSerialized<Double?>(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<Double?>.self, forKey: .updatedAt) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self._year = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .year) ?? DecimalSerialized<Double?>(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<Double?> {
|
|
return _librarySectionID
|
|
}
|
|
var ratingKeyWrapper: DecimalSerialized<Double?> {
|
|
return _ratingKey
|
|
}
|
|
var parentRatingKeyWrapper: DecimalSerialized<Double?> {
|
|
return _parentRatingKey
|
|
}
|
|
var grandparentRatingKeyWrapper: DecimalSerialized<Double?> {
|
|
return _grandparentRatingKey
|
|
}
|
|
var indexWrapper: DecimalSerialized<Double?> {
|
|
return _index
|
|
}
|
|
var parentIndexWrapper: DecimalSerialized<Double?> {
|
|
return _parentIndex
|
|
}
|
|
var lastViewedAtWrapper: DecimalSerialized<Double?> {
|
|
return _lastViewedAt
|
|
}
|
|
var yearWrapper: DecimalSerialized<Double?> {
|
|
return _year
|
|
}
|
|
var durationWrapper: DecimalSerialized<Double?> {
|
|
return _duration
|
|
}
|
|
var originallyAvailableAtWrapper: DateTime<Date?> {
|
|
return _originallyAvailableAt
|
|
}
|
|
var addedAtWrapper: DecimalSerialized<Double?> {
|
|
return _addedAt
|
|
}
|
|
var updatedAtWrapper: DecimalSerialized<Double?> {
|
|
return _updatedAt
|
|
}
|
|
}
|