mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-06 12:47:44 +00:00
255 lines
13 KiB
Swift
255 lines
13 KiB
Swift
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
|
|
import Foundation
|
|
|
|
extension Operations {
|
|
/// A model object
|
|
public struct GetSearchResultsMetadata {
|
|
@DecimalSerialized
|
|
public private(set) var addedAt: Double?
|
|
public let allowSync: Bool?
|
|
public let art: String?
|
|
@DecimalSerialized
|
|
public private(set) var audienceRating: Double?
|
|
public let audienceRatingImage: String?
|
|
public let chapterSource: String?
|
|
public let contentRating: String?
|
|
public let country: [Operations.GetSearchResultsCountry]?
|
|
public let director: [Operations.GetSearchResultsDirector]?
|
|
@DecimalSerialized
|
|
public private(set) var duration: Double?
|
|
public let genre: [Operations.GetSearchResultsGenre]?
|
|
public let guid: String?
|
|
public let key: String?
|
|
@DecimalSerialized
|
|
public private(set) var librarySectionID: Double?
|
|
public let librarySectionTitle: String?
|
|
public let librarySectionUUID: String?
|
|
public let media: [Operations.GetSearchResultsMedia]?
|
|
@DateTime
|
|
public private(set) var originallyAvailableAt: Date?
|
|
public let personal: Bool?
|
|
public let primaryExtraKey: String?
|
|
@DecimalSerialized
|
|
public private(set) var rating: Double?
|
|
public let ratingImage: String?
|
|
@DecimalSerialized
|
|
public private(set) var ratingKey: Double?
|
|
public let role: [Operations.GetSearchResultsRole]?
|
|
public let sourceTitle: String?
|
|
public let studio: String?
|
|
public let summary: String?
|
|
public let tagline: String?
|
|
public let thumb: String?
|
|
public let title: String?
|
|
public let type: String?
|
|
@DecimalSerialized
|
|
public private(set) var updatedAt: Double?
|
|
public let writer: [Operations.GetSearchResultsWriter]?
|
|
@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, audienceRating: Double? = nil, audienceRatingImage: String? = nil, chapterSource: String? = nil, contentRating: String? = nil, country: [Operations.GetSearchResultsCountry]? = nil, director: [Operations.GetSearchResultsDirector]? = nil, duration: Double? = nil, genre: [Operations.GetSearchResultsGenre]? = nil, guid: String? = nil, key: String? = nil, librarySectionID: Double? = nil, librarySectionTitle: String? = nil, librarySectionUUID: String? = nil, media: [Operations.GetSearchResultsMedia]? = nil, originallyAvailableAt: Date? = nil, personal: Bool? = nil, primaryExtraKey: String? = nil, rating: Double? = nil, ratingImage: String? = nil, ratingKey: Double? = nil, role: [Operations.GetSearchResultsRole]? = nil, sourceTitle: String? = nil, studio: String? = nil, summary: String? = nil, tagline: String? = nil, thumb: String? = nil, title: String? = nil, type: String? = nil, updatedAt: Double? = nil, writer: [Operations.GetSearchResultsWriter]? = nil, year: Double? = nil) {
|
|
self._addedAt = DecimalSerialized<Double?>(wrappedValue: addedAt)
|
|
self.allowSync = allowSync
|
|
self.art = art
|
|
self._audienceRating = DecimalSerialized<Double?>(wrappedValue: audienceRating)
|
|
self.audienceRatingImage = audienceRatingImage
|
|
self.chapterSource = chapterSource
|
|
self.contentRating = contentRating
|
|
self.country = country
|
|
self.director = director
|
|
self._duration = DecimalSerialized<Double?>(wrappedValue: duration)
|
|
self.genre = genre
|
|
self.guid = guid
|
|
self.key = key
|
|
self._librarySectionID = DecimalSerialized<Double?>(wrappedValue: librarySectionID)
|
|
self.librarySectionTitle = librarySectionTitle
|
|
self.librarySectionUUID = librarySectionUUID
|
|
self.media = media
|
|
self._originallyAvailableAt = DateTime<Date?>(wrappedValue: originallyAvailableAt)
|
|
self.personal = personal
|
|
self.primaryExtraKey = primaryExtraKey
|
|
self._rating = DecimalSerialized<Double?>(wrappedValue: rating)
|
|
self.ratingImage = ratingImage
|
|
self._ratingKey = DecimalSerialized<Double?>(wrappedValue: ratingKey)
|
|
self.role = role
|
|
self.sourceTitle = sourceTitle
|
|
self.studio = studio
|
|
self.summary = summary
|
|
self.tagline = tagline
|
|
self.thumb = thumb
|
|
self.title = title
|
|
self.type = type
|
|
self._updatedAt = DecimalSerialized<Double?>(wrappedValue: updatedAt)
|
|
self.writer = writer
|
|
self._year = DecimalSerialized<Double?>(wrappedValue: year)
|
|
}
|
|
}}
|
|
|
|
extension Operations.GetSearchResultsMetadata: Codable {
|
|
enum CodingKeys: String, CodingKey {
|
|
case addedAt
|
|
case allowSync
|
|
case art
|
|
case audienceRating
|
|
case audienceRatingImage
|
|
case chapterSource
|
|
case contentRating
|
|
case country = "Country"
|
|
case director = "Director"
|
|
case duration
|
|
case genre = "Genre"
|
|
case guid
|
|
case key
|
|
case librarySectionID
|
|
case librarySectionTitle
|
|
case librarySectionUUID
|
|
case media = "Media"
|
|
case originallyAvailableAt
|
|
case personal
|
|
case primaryExtraKey
|
|
case rating
|
|
case ratingImage
|
|
case ratingKey
|
|
case role = "Role"
|
|
case sourceTitle
|
|
case studio
|
|
case summary
|
|
case tagline
|
|
case thumb
|
|
case title
|
|
case type
|
|
case updatedAt
|
|
case writer = "Writer"
|
|
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._audienceRating = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .audienceRating) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self.audienceRatingImage = try container.decodeIfPresent(String.self, forKey: .audienceRatingImage)
|
|
self.chapterSource = try container.decodeIfPresent(String.self, forKey: .chapterSource)
|
|
self.contentRating = try container.decodeIfPresent(String.self, forKey: .contentRating)
|
|
self.country = try container.decodeIfPresent([Operations.GetSearchResultsCountry].self, forKey: .country)
|
|
self.director = try container.decodeIfPresent([Operations.GetSearchResultsDirector].self, forKey: .director)
|
|
self._duration = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .duration) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self.genre = try container.decodeIfPresent([Operations.GetSearchResultsGenre].self, forKey: .genre)
|
|
self.guid = try container.decodeIfPresent(String.self, forKey: .guid)
|
|
self.key = try container.decodeIfPresent(String.self, forKey: .key)
|
|
self._librarySectionID = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .librarySectionID) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self.librarySectionTitle = try container.decodeIfPresent(String.self, forKey: .librarySectionTitle)
|
|
self.librarySectionUUID = try container.decodeIfPresent(String.self, forKey: .librarySectionUUID)
|
|
self.media = try container.decodeIfPresent([Operations.GetSearchResultsMedia].self, forKey: .media)
|
|
self._originallyAvailableAt = try container.decodeIfPresent(DateTime<Date?>.self, forKey: .originallyAvailableAt) ?? DateTime<Date?>(wrappedValue: nil)
|
|
self.personal = try container.decodeIfPresent(Bool.self, forKey: .personal)
|
|
self.primaryExtraKey = try container.decodeIfPresent(String.self, forKey: .primaryExtraKey)
|
|
self._rating = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .rating) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self.ratingImage = try container.decodeIfPresent(String.self, forKey: .ratingImage)
|
|
self._ratingKey = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .ratingKey) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self.role = try container.decodeIfPresent([Operations.GetSearchResultsRole].self, forKey: .role)
|
|
self.sourceTitle = try container.decodeIfPresent(String.self, forKey: .sourceTitle)
|
|
self.studio = try container.decodeIfPresent(String.self, forKey: .studio)
|
|
self.summary = try container.decodeIfPresent(String.self, forKey: .summary)
|
|
self.tagline = try container.decodeIfPresent(String.self, forKey: .tagline)
|
|
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.writer = try container.decodeIfPresent([Operations.GetSearchResultsWriter].self, forKey: .writer)
|
|
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)
|
|
if self.audienceRating != nil {
|
|
try container.encode(self._audienceRating, forKey: .audienceRating)
|
|
}
|
|
try container.encodeIfPresent(self.audienceRatingImage, forKey: .audienceRatingImage)
|
|
try container.encodeIfPresent(self.chapterSource, forKey: .chapterSource)
|
|
try container.encodeIfPresent(self.contentRating, forKey: .contentRating)
|
|
try container.encodeIfPresent(self.country, forKey: .country)
|
|
try container.encodeIfPresent(self.director, forKey: .director)
|
|
if self.duration != nil {
|
|
try container.encode(self._duration, forKey: .duration)
|
|
}
|
|
try container.encodeIfPresent(self.genre, forKey: .genre)
|
|
try container.encodeIfPresent(self.guid, forKey: .guid)
|
|
try container.encodeIfPresent(self.key, forKey: .key)
|
|
if self.librarySectionID != nil {
|
|
try container.encode(self._librarySectionID, forKey: .librarySectionID)
|
|
}
|
|
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.personal, forKey: .personal)
|
|
try container.encodeIfPresent(self.primaryExtraKey, forKey: .primaryExtraKey)
|
|
if self.rating != nil {
|
|
try container.encode(self._rating, forKey: .rating)
|
|
}
|
|
try container.encodeIfPresent(self.ratingImage, forKey: .ratingImage)
|
|
if self.ratingKey != nil {
|
|
try container.encode(self._ratingKey, forKey: .ratingKey)
|
|
}
|
|
try container.encodeIfPresent(self.role, forKey: .role)
|
|
try container.encodeIfPresent(self.sourceTitle, forKey: .sourceTitle)
|
|
try container.encodeIfPresent(self.studio, forKey: .studio)
|
|
try container.encodeIfPresent(self.summary, forKey: .summary)
|
|
try container.encodeIfPresent(self.tagline, forKey: .tagline)
|
|
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)
|
|
}
|
|
try container.encodeIfPresent(self.writer, forKey: .writer)
|
|
if self.year != nil {
|
|
try container.encode(self._year, forKey: .year)
|
|
}
|
|
}
|
|
}
|
|
|
|
extension Operations.GetSearchResultsMetadata {
|
|
var librarySectionIDWrapper: DecimalSerialized<Double?> {
|
|
return _librarySectionID
|
|
}
|
|
var ratingKeyWrapper: DecimalSerialized<Double?> {
|
|
return _ratingKey
|
|
}
|
|
var ratingWrapper: DecimalSerialized<Double?> {
|
|
return _rating
|
|
}
|
|
var audienceRatingWrapper: DecimalSerialized<Double?> {
|
|
return _audienceRating
|
|
}
|
|
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
|
|
}
|
|
}
|