ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.308.1

This commit is contained in:
speakeasybot
2024-06-15 00:13:58 +00:00
parent 2e61d70eb2
commit 3c7871adc5
46 changed files with 2104 additions and 858 deletions

View File

@@ -3,34 +3,10 @@
import Foundation
extension Operations {
/// A model object
public struct Filter {
public let filter: String?
public let filterType: String?
public let key: String?
public let title: String?
public let type: String?
/// Creates an object with the specified parameters
///
///
public init(filter: String? = nil, filterType: String? = nil, key: String? = nil, title: String? = nil, type: String? = nil) {
self.filter = filter
self.filterType = filterType
self.key = key
self.title = title
self.type = type
}
/// Filter
public enum Filter: String, Codable, APIValue {
case all = "all"
case available = "available"
case released = "released"
}
}
extension Operations.Filter: Codable {
enum CodingKeys: String, CodingKey {
case filter
case filterType
case key
case title
case type
}
}

View File

@@ -0,0 +1,58 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetHomeDataErrors {
@DecimalSerialized
public private(set) var code: Double?
public let message: String?
@DecimalSerialized
public private(set) var status: Double?
/// Creates an object with the specified parameters
///
///
public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
self._code = DecimalSerialized<Double?>(wrappedValue: code)
self.message = message
self._status = DecimalSerialized<Double?>(wrappedValue: status)
}
}
}
extension Operations.GetHomeDataErrors: Codable {
enum CodingKeys: String, CodingKey {
case code
case message
case status
}
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self._code = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .code) ?? DecimalSerialized<Double?>(wrappedValue: nil)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
self._status = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .status) ?? DecimalSerialized<Double?>(wrappedValue: nil)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
if self.code != nil {
try container.encode(self._code, forKey: .code)
}
try container.encodeIfPresent(self.message, forKey: .message)
if self.status != nil {
try container.encode(self._status, forKey: .status)
}
}
}
extension Operations.GetHomeDataErrors {
var codeWrapper: DecimalSerialized<Double?> {
return _code
}
var statusWrapper: DecimalSerialized<Double?> {
return _status
}
}

View File

@@ -0,0 +1,24 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
public struct GetHomeDataPlexResponseBody {
public let errors: [Operations.GetHomeDataErrors]?
/// Creates an object with the specified parameters
///
///
public init(errors: [Operations.GetHomeDataErrors]? = nil) {
self.errors = errors
}
}
}
extension Operations.GetHomeDataPlexResponseBody: Codable {
enum CodingKeys: String, CodingKey {
case errors
}
}

View File

@@ -0,0 +1,34 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// A response model
public enum GetHomeDataResponse {
case empty
case twoHundredApplicationJsonObject(Operations.GetHomeDataResponseBody)
case fourHundredAndOneApplicationJsonObject(Operations.GetHomeDataPlexResponseBody)
var isEmpty: Bool {
if case .empty = self {
return true
} else {
return false
}
}
public func twoHundredApplicationJsonObject() throws -> Operations.GetHomeDataResponseBody {
guard case .twoHundredApplicationJsonObject(let value) = self else {
throw PlexswiftError.missingResponseData
}
return value
}
public func fourHundredAndOneApplicationJsonObject() throws -> Operations.GetHomeDataPlexResponseBody {
guard case .fourHundredAndOneApplicationJsonObject(let value) = self else {
throw PlexswiftError.missingResponseData
}
return value
}
}
}

View File

@@ -0,0 +1,73 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// Home Data
public struct GetHomeDataResponseBody {
public let guestEnabled: Bool?
@DecimalSerialized
public private(set) var guestUserID: Double?
public let guestUserUUID: String?
@DecimalSerialized
public private(set) var id: Double?
public let name: String?
public let subscription: Bool?
/// Creates an object with the specified parameters
///
///
public init(guestEnabled: Bool? = nil, guestUserID: Double? = nil, guestUserUUID: String? = nil, id: Double? = nil, name: String? = nil, subscription: Bool? = nil) {
self.guestEnabled = guestEnabled
self._guestUserID = DecimalSerialized<Double?>(wrappedValue: guestUserID)
self.guestUserUUID = guestUserUUID
self._id = DecimalSerialized<Double?>(wrappedValue: id)
self.name = name
self.subscription = subscription
}
}
}
extension Operations.GetHomeDataResponseBody: Codable {
enum CodingKeys: String, CodingKey {
case guestEnabled
case guestUserID
case guestUserUUID
case id
case name
case subscription
}
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.guestEnabled = try container.decodeIfPresent(Bool.self, forKey: .guestEnabled)
self._guestUserID = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .guestUserID) ?? DecimalSerialized<Double?>(wrappedValue: nil)
self.guestUserUUID = try container.decodeIfPresent(String.self, forKey: .guestUserUUID)
self._id = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .id) ?? DecimalSerialized<Double?>(wrappedValue: nil)
self.name = try container.decodeIfPresent(String.self, forKey: .name)
self.subscription = try container.decodeIfPresent(Bool.self, forKey: .subscription)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(self.guestEnabled, forKey: .guestEnabled)
if self.guestUserID != nil {
try container.encode(self._guestUserID, forKey: .guestUserID)
}
try container.encodeIfPresent(self.guestUserUUID, forKey: .guestUserUUID)
if self.id != nil {
try container.encode(self._id, forKey: .id)
}
try container.encodeIfPresent(self.name, forKey: .name)
try container.encodeIfPresent(self.subscription, forKey: .subscription)
}
}
extension Operations.GetHomeDataResponseBody {
var idWrapper: DecimalSerialized<Double?> {
return _id
}
var guestUserIDWrapper: DecimalSerialized<Double?> {
return _guestUserID
}
}

View File

@@ -0,0 +1,36 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetLibraryFilter {
public let filter: String?
public let filterType: String?
public let key: String?
public let title: String?
public let type: String?
/// Creates an object with the specified parameters
///
///
public init(filter: String? = nil, filterType: String? = nil, key: String? = nil, title: String? = nil, type: String? = nil) {
self.filter = filter
self.filterType = filterType
self.key = key
self.title = title
self.type = type
}
}
}
extension Operations.GetLibraryFilter: Codable {
enum CodingKeys: String, CodingKey {
case filter
case filterType
case key
case title
case type
}
}

View File

@@ -6,7 +6,7 @@ extension Operations {
/// A model object
public struct GetLibraryItemsRequest: APIValue {
/// the Id of the library to query
public let sectionId: Int
public let sectionId: AnyValue
/// A key representing a specific tag within the section.
public let tag: Operations.Tag
@@ -15,7 +15,7 @@ extension Operations {
/// - Parameter sectionId: the Id of the library to query
/// - Parameter tag: A key representing a specific tag within the section.
///
public init(sectionId: Int, tag: Operations.Tag) {
public init(sectionId: AnyValue, tag: Operations.Tag) {
self.sectionId = sectionId
self.tag = tag
}

View File

@@ -7,7 +7,7 @@ extension Operations {
public struct GetLibraryType {
public let active: Bool?
public let field: [Operations.Field]?
public let filter: [Operations.Filter]?
public let filter: [Operations.GetLibraryFilter]?
public let key: String?
public let sort: [Operations.Sort]?
public let title: String?
@@ -16,7 +16,7 @@ extension Operations {
/// Creates an object with the specified parameters
///
///
public init(active: Bool? = nil, field: [Operations.Field]? = nil, filter: [Operations.Filter]? = nil, key: String? = nil, sort: [Operations.Sort]? = nil, title: String? = nil, type: String? = nil) {
public init(active: Bool? = nil, field: [Operations.Field]? = nil, filter: [Operations.GetLibraryFilter]? = nil, key: String? = nil, sort: [Operations.Sort]? = nil, title: String? = nil, type: String? = nil) {
self.active = active
self.field = field
self.filter = filter

View File

@@ -5,6 +5,9 @@ import Foundation
extension Operations {
/// A model object
public struct GetPinRequest: APIValue {
/// Product name of the application shown in the list of devices
///
public let xPlexProduct: String
/// Determines the kind of code returned by the API call
/// Strong codes are used for Pin authentication flows
/// Non-Strong codes are used for `Plex.tv/link`
@@ -18,6 +21,8 @@ extension Operations {
/// Creates an object with the specified parameters
///
/// - Parameter xPlexProduct: Product name of the application shown in the list of devices
///
/// - Parameter strong: Determines the kind of code returned by the API call
/// Strong codes are used for Pin authentication flows
/// Non-Strong codes are used for `Plex.tv/link`
@@ -27,7 +32,8 @@ extension Operations {
/// (UUID, serial number, or other number unique per device)
///
///
public init(strong: Bool? = nil, xPlexClientIdentifier: String? = nil) {
public init(xPlexProduct: String, strong: Bool? = nil, xPlexClientIdentifier: String? = nil) {
self.xPlexProduct = xPlexProduct
self.strong = strong
self.xPlexClientIdentifier = xPlexClientIdentifier
}

View File

@@ -6,7 +6,7 @@ extension Operations {
/// A response model
public enum GetPinResponse {
case empty
case twoHundredApplicationJsonObject(Operations.GetPinResponseBody)
case twoHundredAndOneApplicationJsonObject(Operations.GetPinResponseBody)
case fourHundredApplicationJsonObject(Operations.GetPinPlexResponseBody)
var isEmpty: Bool {
@@ -17,8 +17,8 @@ extension Operations {
}
}
public func twoHundredApplicationJsonObject() throws -> Operations.GetPinResponseBody {
guard case .twoHundredApplicationJsonObject(let value) = self else {
public func twoHundredAndOneApplicationJsonObject() throws -> Operations.GetPinResponseBody {
guard case .twoHundredAndOneApplicationJsonObject(let value) = self else {
throw PlexswiftError.missingResponseData
}
return value

View File

@@ -10,7 +10,7 @@ extension Operations {
public let mediaTagPrefix: String?
@DecimalSerialized
public private(set) var mediaTagVersion: Double?
public let metadata: [Operations.Metadata]?
public let metadata: [Operations.GetRecentlyAddedMetadata]?
public let mixedParents: Bool?
@DecimalSerialized
public private(set) var size: Double?
@@ -18,7 +18,7 @@ extension Operations {
/// Creates an object with the specified parameters
///
///
public init(allowSync: Bool? = nil, identifier: String? = nil, mediaTagPrefix: String? = nil, mediaTagVersion: Double? = nil, metadata: [Operations.Metadata]? = nil, mixedParents: Bool? = nil, size: Double? = nil) {
public init(allowSync: Bool? = nil, identifier: String? = nil, mediaTagPrefix: String? = nil, mediaTagVersion: Double? = nil, metadata: [Operations.GetRecentlyAddedMetadata]? = nil, mixedParents: Bool? = nil, size: Double? = nil) {
self.allowSync = allowSync
self.identifier = identifier
self.mediaTagPrefix = mediaTagPrefix
@@ -47,7 +47,7 @@ extension Operations.GetRecentlyAddedMediaContainer: Codable {
self.identifier = try container.decodeIfPresent(String.self, forKey: .identifier)
self.mediaTagPrefix = try container.decodeIfPresent(String.self, forKey: .mediaTagPrefix)
self._mediaTagVersion = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .mediaTagVersion) ?? DecimalSerialized<Double?>(wrappedValue: nil)
self.metadata = try container.decodeIfPresent([Operations.Metadata].self, forKey: .metadata)
self.metadata = try container.decodeIfPresent([Operations.GetRecentlyAddedMetadata].self, forKey: .metadata)
self.mixedParents = try container.decodeIfPresent(Bool.self, forKey: .mixedParents)
self._size = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .size) ?? DecimalSerialized<Double?>(wrappedValue: nil)
}

View File

@@ -0,0 +1,245 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetRecentlyAddedMetadata {
@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.Country]?
public let director: [Operations.Director]?
@DecimalSerialized
public private(set) var duration: Double?
public let genre: [Operations.Genre]?
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.Media]?
@DateTime
public private(set) var originallyAvailableAt: Date?
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.Role]?
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.Writer]?
@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.Country]? = nil, director: [Operations.Director]? = nil, duration: Double? = nil, genre: [Operations.Genre]? = nil, guid: String? = nil, key: String? = nil, librarySectionID: Double? = nil, librarySectionTitle: String? = nil, librarySectionUUID: String? = nil, media: [Operations.Media]? = nil, originallyAvailableAt: Date? = nil, primaryExtraKey: String? = nil, rating: Double? = nil, ratingImage: String? = nil, ratingKey: Double? = nil, role: [Operations.Role]? = nil, studio: String? = nil, summary: String? = nil, tagline: String? = nil, thumb: String? = nil, title: String? = nil, type: String? = nil, updatedAt: Double? = nil, writer: [Operations.Writer]? = 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.primaryExtraKey = primaryExtraKey
self._rating = DecimalSerialized<Double?>(wrappedValue: rating)
self.ratingImage = ratingImage
self._ratingKey = DecimalSerialized<Double?>(wrappedValue: ratingKey)
self.role = role
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.GetRecentlyAddedMetadata: 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 primaryExtraKey
case rating
case ratingImage
case ratingKey
case role = "Role"
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.Country].self, forKey: .country)
self.director = try container.decodeIfPresent([Operations.Director].self, forKey: .director)
self._duration = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .duration) ?? DecimalSerialized<Double?>(wrappedValue: nil)
self.genre = try container.decodeIfPresent([Operations.Genre].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.Media].self, forKey: .media)
self._originallyAvailableAt = try container.decodeIfPresent(DateTime<Date?>.self, forKey: .originallyAvailableAt) ?? DateTime<Date?>(wrappedValue: nil)
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.Role].self, forKey: .role)
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.Writer].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.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.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.GetRecentlyAddedMetadata {
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
}
}

View File

@@ -0,0 +1,51 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetTokenLocation {
public let city: String?
public let code: String?
public let continentCode: String?
public let coordinates: String?
public let country: String?
public let europeanUnionMember: Bool?
public let inPrivacyRestrictedCountry: Bool?
public let postalCode: String?
public let subdivisions: String?
public let timeZone: String?
/// Creates an object with the specified parameters
///
///
public init(city: String? = nil, code: String? = nil, continentCode: String? = nil, coordinates: String? = nil, country: String? = nil, europeanUnionMember: Bool? = nil, inPrivacyRestrictedCountry: Bool? = nil, postalCode: String? = nil, subdivisions: String? = nil, timeZone: String? = nil) {
self.city = city
self.code = code
self.continentCode = continentCode
self.coordinates = coordinates
self.country = country
self.europeanUnionMember = europeanUnionMember
self.inPrivacyRestrictedCountry = inPrivacyRestrictedCountry
self.postalCode = postalCode
self.subdivisions = subdivisions
self.timeZone = timeZone
}
}
}
extension Operations.GetTokenLocation: Codable {
enum CodingKeys: String, CodingKey {
case city
case code
case continentCode = "continent_code"
case coordinates
case country
case europeanUnionMember = "european_union_member"
case inPrivacyRestrictedCountry = "in_privacy_restricted_country"
case postalCode = "postal_code"
case subdivisions
case timeZone = "time_zone"
}
}

View File

@@ -0,0 +1,24 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// X-Plex-Client-Identifier is missing
public struct GetTokenPlexResponseBody {
public let errors: [Operations.GetTokenErrors]?
/// Creates an object with the specified parameters
///
///
public init(errors: [Operations.GetTokenErrors]? = nil) {
self.errors = errors
}
}
}
extension Operations.GetTokenPlexResponseBody: Codable {
enum CodingKeys: String, CodingKey {
case errors
}
}

View File

@@ -6,7 +6,8 @@ extension Operations {
/// A response model
public enum GetTokenResponse {
case empty
case object(Operations.GetTokenResponseBody)
case twoHundredApplicationJsonObject(Operations.GetTokenResponseBody)
case fourHundredApplicationJsonObject(Operations.GetTokenPlexResponseBody)
var isEmpty: Bool {
if case .empty = self {
@@ -16,8 +17,15 @@ extension Operations {
}
}
public func object() throws -> Operations.GetTokenResponseBody {
guard case .object(let value) = self else {
public func twoHundredApplicationJsonObject() throws -> Operations.GetTokenResponseBody {
guard case .twoHundredApplicationJsonObject(let value) = self else {
throw PlexswiftError.missingResponseData
}
return value
}
public func fourHundredApplicationJsonObject() throws -> Operations.GetTokenPlexResponseBody {
guard case .fourHundredApplicationJsonObject(let value) = self else {
throw PlexswiftError.missingResponseData
}
return value

View File

@@ -3,22 +3,123 @@
import Foundation
extension Operations {
/// X-Plex-Client-Identifier is missing
/// Access Token
public struct GetTokenResponseBody {
public let errors: [Operations.GetTokenErrors]?
public let authToken: String?
public let clientIdentifier: String?
public let code: String?
@DateTime
public private(set) var createdAt: Date?
@DateTime
public private(set) var expiresAt: Date?
@DecimalSerialized
public private(set) var expiresIn: Double?
/// PinID for use with authentication
@DecimalSerialized
public private(set) var id: Double?
public let location: Operations.GetTokenLocation?
public let newRegistration: String?
public let product: String?
/// a link to a QR code hosted on plex.tv
/// The QR code redirects to the relevant `plex.tv/link` authentication page
/// Which then prompts the user for the 4 Digit Link Pin
///
public let qr: String?
public let trusted: Bool?
/// Creates an object with the specified parameters
///
/// - Parameter id: PinID for use with authentication
/// - Parameter qr: a link to a QR code hosted on plex.tv
/// The QR code redirects to the relevant `plex.tv/link` authentication page
/// Which then prompts the user for the 4 Digit Link Pin
///
///
public init(errors: [Operations.GetTokenErrors]? = nil) {
self.errors = errors
public init(authToken: String? = nil, clientIdentifier: String? = nil, code: String? = nil, createdAt: Date? = nil, expiresAt: Date? = nil, expiresIn: Double? = nil, id: Double? = nil, location: Operations.GetTokenLocation? = nil, newRegistration: String? = nil, product: String? = nil, qr: String? = nil, trusted: Bool? = nil) {
self.authToken = authToken
self.clientIdentifier = clientIdentifier
self.code = code
self._createdAt = DateTime<Date?>(wrappedValue: createdAt)
self._expiresAt = DateTime<Date?>(wrappedValue: expiresAt)
self._expiresIn = DecimalSerialized<Double?>(wrappedValue: expiresIn)
self._id = DecimalSerialized<Double?>(wrappedValue: id)
self.location = location
self.newRegistration = newRegistration
self.product = product
self.qr = qr
self.trusted = trusted
}
}
}
extension Operations.GetTokenResponseBody: Codable {
enum CodingKeys: String, CodingKey {
case errors
case authToken
case clientIdentifier
case code
case createdAt
case expiresAt
case expiresIn
case id
case location
case newRegistration
case product
case qr
case trusted
}
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.authToken = try container.decodeIfPresent(String.self, forKey: .authToken)
self.clientIdentifier = try container.decodeIfPresent(String.self, forKey: .clientIdentifier)
self.code = try container.decodeIfPresent(String.self, forKey: .code)
self._createdAt = try container.decodeIfPresent(DateTime<Date?>.self, forKey: .createdAt) ?? DateTime<Date?>(wrappedValue: nil)
self._expiresAt = try container.decodeIfPresent(DateTime<Date?>.self, forKey: .expiresAt) ?? DateTime<Date?>(wrappedValue: nil)
self._expiresIn = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .expiresIn) ?? DecimalSerialized<Double?>(wrappedValue: nil)
self._id = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .id) ?? DecimalSerialized<Double?>(wrappedValue: nil)
self.location = try container.decodeIfPresent(Operations.GetTokenLocation.self, forKey: .location)
self.newRegistration = try container.decodeIfPresent(String.self, forKey: .newRegistration)
self.product = try container.decodeIfPresent(String.self, forKey: .product)
self.qr = try container.decodeIfPresent(String.self, forKey: .qr)
self.trusted = try container.decodeIfPresent(Bool.self, forKey: .trusted)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(self.authToken, forKey: .authToken)
try container.encodeIfPresent(self.clientIdentifier, forKey: .clientIdentifier)
try container.encodeIfPresent(self.code, forKey: .code)
if self.createdAt != nil {
try container.encode(self._createdAt, forKey: .createdAt)
}
if self.expiresAt != nil {
try container.encode(self._expiresAt, forKey: .expiresAt)
}
if self.expiresIn != nil {
try container.encode(self._expiresIn, forKey: .expiresIn)
}
if self.id != nil {
try container.encode(self._id, forKey: .id)
}
try container.encodeIfPresent(self.location, forKey: .location)
try container.encodeIfPresent(self.newRegistration, forKey: .newRegistration)
try container.encodeIfPresent(self.product, forKey: .product)
try container.encodeIfPresent(self.qr, forKey: .qr)
try container.encodeIfPresent(self.trusted, forKey: .trusted)
}
}
extension Operations.GetTokenResponseBody {
var idWrapper: DecimalSerialized<Double?> {
return _id
}
var expiresInWrapper: DecimalSerialized<Double?> {
return _expiresIn
}
var createdAtWrapper: DateTime<Date?> {
return _createdAt
}
var expiresAtWrapper: DateTime<Date?> {
return _expiresAt
}
}

View File

@@ -0,0 +1,58 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetWatchlistErrors {
@DecimalSerialized
public private(set) var code: Double?
public let message: String?
@DecimalSerialized
public private(set) var status: Double?
/// Creates an object with the specified parameters
///
///
public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
self._code = DecimalSerialized<Double?>(wrappedValue: code)
self.message = message
self._status = DecimalSerialized<Double?>(wrappedValue: status)
}
}
}
extension Operations.GetWatchlistErrors: Codable {
enum CodingKeys: String, CodingKey {
case code
case message
case status
}
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self._code = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .code) ?? DecimalSerialized<Double?>(wrappedValue: nil)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
self._status = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .status) ?? DecimalSerialized<Double?>(wrappedValue: nil)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
if self.code != nil {
try container.encode(self._code, forKey: .code)
}
try container.encodeIfPresent(self.message, forKey: .message)
if self.status != nil {
try container.encode(self._status, forKey: .status)
}
}
}
extension Operations.GetWatchlistErrors {
var codeWrapper: DecimalSerialized<Double?> {
return _code
}
var statusWrapper: DecimalSerialized<Double?> {
return _status
}
}

View File

@@ -0,0 +1,75 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetWatchlistRequest: APIValue {
/// Filter
public let filter: Operations.Filter
/// User Token
public let xPlexToken: String
/// include collections in the results
///
public let includeCollections: Operations.IncludeCollections?
/// include external media in the results
///
public let includeExternalMedia: Operations.IncludeExternalMedia?
/// The type of library to filter. Can be "movie" or "show", or all if not present.
///
public let libtype: Operations.Libtype?
/// The number of items to return. If not specified, all items will be returned.
/// If the number of items exceeds the limit, the response will be paginated.
///
public let maxresults: Int?
/// In the format "field:dir". Available fields are "watchlistedAt" (Added At),
/// "titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating).
/// "dir" can be "asc" or "desc"
///
public let sort: String?
/// The number of items to return. If not specified, all items will be returned.
/// If the number of items exceeds the limit, the response will be paginated.
///
public let xPlexContainerSize: Int?
/// The index of the first item to return. If not specified, the first item will be returned.
/// If the number of items exceeds the limit, the response will be paginated.
///
public let xPlexContainerStart: Int?
/// Creates an object with the specified parameters
///
/// - Parameter filter: Filter
/// - Parameter xPlexToken: User Token
/// - Parameter includeCollections: include collections in the results
///
/// - Parameter includeExternalMedia: include external media in the results
///
/// - Parameter libtype: The type of library to filter. Can be "movie" or "show", or all if not present.
///
/// - Parameter maxresults: The number of items to return. If not specified, all items will be returned.
/// If the number of items exceeds the limit, the response will be paginated.
///
/// - Parameter sort: In the format "field:dir". Available fields are "watchlistedAt" (Added At),
/// "titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating).
/// "dir" can be "asc" or "desc"
///
/// - Parameter xPlexContainerSize: The number of items to return. If not specified, all items will be returned.
/// If the number of items exceeds the limit, the response will be paginated.
///
/// - Parameter xPlexContainerStart: The index of the first item to return. If not specified, the first item will be returned.
/// If the number of items exceeds the limit, the response will be paginated.
///
///
public init(filter: Operations.Filter, xPlexToken: String, includeCollections: Operations.IncludeCollections? = nil, includeExternalMedia: Operations.IncludeExternalMedia? = nil, libtype: Operations.Libtype? = nil, maxresults: Int? = nil, sort: String? = nil, xPlexContainerSize: Int? = nil, xPlexContainerStart: Int? = nil) {
self.filter = filter
self.xPlexToken = xPlexToken
self.includeCollections = includeCollections
self.includeExternalMedia = includeExternalMedia
self.libtype = libtype
self.maxresults = maxresults
self.sort = sort
self.xPlexContainerSize = xPlexContainerSize
self.xPlexContainerStart = xPlexContainerStart
}
}
}

View File

@@ -0,0 +1,34 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// A response model
public enum GetWatchlistResponse {
case empty
case twoHundredApplicationJsonObject(Operations.GetWatchlistResponseBody)
case fourHundredAndOneApplicationJsonObject(Operations.GetWatchlistWatchlistResponseBody)
var isEmpty: Bool {
if case .empty = self {
return true
} else {
return false
}
}
public func twoHundredApplicationJsonObject() throws -> Operations.GetWatchlistResponseBody {
guard case .twoHundredApplicationJsonObject(let value) = self else {
throw PlexswiftError.missingResponseData
}
return value
}
public func fourHundredAndOneApplicationJsonObject() throws -> Operations.GetWatchlistWatchlistResponseBody {
guard case .fourHundredAndOneApplicationJsonObject(let value) = self else {
throw PlexswiftError.missingResponseData
}
return value
}
}
}

View File

@@ -0,0 +1,42 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// Watchlist Data
public struct GetWatchlistResponseBody {
public let identifier: String?
public let librarySectionID: String?
public let librarySectionTitle: String?
public let metadata: [Operations.Metadata]?
public let offset: Int?
public let size: Int?
public let totalSize: Int?
/// Creates an object with the specified parameters
///
///
public init(identifier: String? = nil, librarySectionID: String? = nil, librarySectionTitle: String? = nil, metadata: [Operations.Metadata]? = nil, offset: Int? = nil, size: Int? = nil, totalSize: Int? = nil) {
self.identifier = identifier
self.librarySectionID = librarySectionID
self.librarySectionTitle = librarySectionTitle
self.metadata = metadata
self.offset = offset
self.size = size
self.totalSize = totalSize
}
}
}
extension Operations.GetWatchlistResponseBody: Codable {
enum CodingKeys: String, CodingKey {
case identifier
case librarySectionID
case librarySectionTitle
case metadata = "Metadata"
case offset
case size
case totalSize
}
}

View File

@@ -0,0 +1,24 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
public struct GetWatchlistWatchlistResponseBody {
public let errors: [Operations.GetWatchlistErrors]?
/// Creates an object with the specified parameters
///
///
public init(errors: [Operations.GetWatchlistErrors]? = nil) {
self.errors = errors
}
}
}
extension Operations.GetWatchlistWatchlistResponseBody: Codable {
enum CodingKeys: String, CodingKey {
case errors
}
}

View File

@@ -0,0 +1,30 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct Image {
public let alt: String?
public let type: String?
public let url: String?
/// Creates an object with the specified parameters
///
///
public init(alt: String? = nil, type: String? = nil, url: String? = nil) {
self.alt = alt
self.type = type
self.url = url
}
}
}
extension Operations.Image: Codable {
enum CodingKeys: String, CodingKey {
case alt
case type
case url
}
}

View File

@@ -0,0 +1,12 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// include collections in the results
///
public enum IncludeCollections: Int, Codable, APIValue {
case one = 1
case zero = 0
}
}

View File

@@ -0,0 +1,12 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// include external media in the results
///
public enum IncludeExternalMedia: Int, Codable, APIValue {
case one = 1
case zero = 0
}
}

View File

@@ -0,0 +1,12 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// The type of library to filter. Can be "movie" or "show", or all if not present.
///
public enum Libtype: String, Codable, APIValue {
case movie = "movie"
case show = "show"
}
}

View File

@@ -12,15 +12,14 @@ extension Operations {
public let country: String?
public let europeanUnionMember: Bool?
public let inPrivacyRestrictedCountry: Bool?
@DecimalSerialized
public private(set) var postalCode: Double?
public let postalCode: String?
public let subdivisions: String?
public let timeZone: String?
/// Creates an object with the specified parameters
///
///
public init(city: String? = nil, code: String? = nil, continentCode: String? = nil, coordinates: String? = nil, country: String? = nil, europeanUnionMember: Bool? = nil, inPrivacyRestrictedCountry: Bool? = nil, postalCode: Double? = nil, subdivisions: String? = nil, timeZone: String? = nil) {
public init(city: String? = nil, code: String? = nil, continentCode: String? = nil, coordinates: String? = nil, country: String? = nil, europeanUnionMember: Bool? = nil, inPrivacyRestrictedCountry: Bool? = nil, postalCode: String? = nil, subdivisions: String? = nil, timeZone: String? = nil) {
self.city = city
self.code = code
self.continentCode = continentCode
@@ -28,7 +27,7 @@ extension Operations {
self.country = country
self.europeanUnionMember = europeanUnionMember
self.inPrivacyRestrictedCountry = inPrivacyRestrictedCountry
self._postalCode = DecimalSerialized<Double?>(wrappedValue: postalCode)
self.postalCode = postalCode
self.subdivisions = subdivisions
self.timeZone = timeZone
}
@@ -48,40 +47,5 @@ extension Operations.Location: Codable {
case subdivisions
case timeZone = "time_zone"
}
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.city = try container.decodeIfPresent(String.self, forKey: .city)
self.code = try container.decodeIfPresent(String.self, forKey: .code)
self.continentCode = try container.decodeIfPresent(String.self, forKey: .continentCode)
self.coordinates = try container.decodeIfPresent(String.self, forKey: .coordinates)
self.country = try container.decodeIfPresent(String.self, forKey: .country)
self.europeanUnionMember = try container.decodeIfPresent(Bool.self, forKey: .europeanUnionMember)
self.inPrivacyRestrictedCountry = try container.decodeIfPresent(Bool.self, forKey: .inPrivacyRestrictedCountry)
self._postalCode = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .postalCode) ?? DecimalSerialized<Double?>(wrappedValue: nil)
self.subdivisions = try container.decodeIfPresent(String.self, forKey: .subdivisions)
self.timeZone = try container.decodeIfPresent(String.self, forKey: .timeZone)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(self.city, forKey: .city)
try container.encodeIfPresent(self.code, forKey: .code)
try container.encodeIfPresent(self.continentCode, forKey: .continentCode)
try container.encodeIfPresent(self.coordinates, forKey: .coordinates)
try container.encodeIfPresent(self.country, forKey: .country)
try container.encodeIfPresent(self.europeanUnionMember, forKey: .europeanUnionMember)
try container.encodeIfPresent(self.inPrivacyRestrictedCountry, forKey: .inPrivacyRestrictedCountry)
if self.postalCode != nil {
try container.encode(self._postalCode, forKey: .postalCode)
}
try container.encodeIfPresent(self.subdivisions, forKey: .subdivisions)
try container.encodeIfPresent(self.timeZone, forKey: .timeZone)
}
}
extension Operations.Location {
var postalCodeWrapper: DecimalSerialized<Double?> {
return _postalCode
}
}

View File

@@ -5,84 +5,84 @@ import Foundation
extension Operations {
/// A model object
public struct Metadata {
@DecimalSerialized
public private(set) var addedAt: Double?
public let allowSync: Bool?
public let addedAt: Int?
public let art: String?
@DecimalSerialized
public private(set) var audienceRating: Double?
public let audienceRatingImage: String?
public let chapterSource: String?
public let availabilityId: String?
public let banner: String?
public let childCount: Int?
public let contentRating: String?
public let country: [Operations.Country]?
public let director: [Operations.Director]?
@DecimalSerialized
public private(set) var duration: Double?
public let genre: [Operations.Genre]?
public let duration: Int?
public let expiresAt: Int?
public let guid: String?
public let image: [Operations.Image]?
public let imdbRatingCount: Int?
public let isContinuingSeries: Bool?
public let key: String?
@DecimalSerialized
public private(set) var librarySectionID: Double?
public let librarySectionTitle: String?
public let librarySectionUUID: String?
public let media: [Operations.Media]?
@DateTime
public let leafCount: Int?
@DateOnly
public private(set) var originallyAvailableAt: Date?
public let primaryExtraKey: String?
public let originalTitle: String?
public let playableKey: String?
public let publicPagesURL: String?
@DecimalSerialized
public private(set) var rating: Double?
public let ratingImage: String?
@DecimalSerialized
public private(set) var ratingKey: Double?
public let role: [Operations.Role]?
public let ratingKey: String?
public let skipChildren: Bool?
public let slug: String?
public let streamingMediaId: String?
public let studio: String?
public let summary: String?
public let subtype: String?
public let tagline: String?
public let theme: String?
public let thumb: String?
public let title: String?
public let type: String?
@DecimalSerialized
public private(set) var updatedAt: Double?
public let writer: [Operations.Writer]?
@DecimalSerialized
public private(set) var year: Double?
public let userState: Bool?
public let year: Int?
/// 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.Country]? = nil, director: [Operations.Director]? = nil, duration: Double? = nil, genre: [Operations.Genre]? = nil, guid: String? = nil, key: String? = nil, librarySectionID: Double? = nil, librarySectionTitle: String? = nil, librarySectionUUID: String? = nil, media: [Operations.Media]? = nil, originallyAvailableAt: Date? = nil, primaryExtraKey: String? = nil, rating: Double? = nil, ratingImage: String? = nil, ratingKey: Double? = nil, role: [Operations.Role]? = nil, studio: String? = nil, summary: String? = nil, tagline: String? = nil, thumb: String? = nil, title: String? = nil, type: String? = nil, updatedAt: Double? = nil, writer: [Operations.Writer]? = nil, year: Double? = nil) {
self._addedAt = DecimalSerialized<Double?>(wrappedValue: addedAt)
self.allowSync = allowSync
public init(addedAt: Int? = nil, art: String? = nil, audienceRating: Double? = nil, audienceRatingImage: String? = nil, availabilityId: String? = nil, banner: String? = nil, childCount: Int? = nil, contentRating: String? = nil, duration: Int? = nil, expiresAt: Int? = nil, guid: String? = nil, image: [Operations.Image]? = nil, imdbRatingCount: Int? = nil, isContinuingSeries: Bool? = nil, key: String? = nil, leafCount: Int? = nil, originallyAvailableAt: Date? = nil, originalTitle: String? = nil, playableKey: String? = nil, publicPagesURL: String? = nil, rating: Double? = nil, ratingImage: String? = nil, ratingKey: String? = nil, skipChildren: Bool? = nil, slug: String? = nil, streamingMediaId: String? = nil, studio: String? = nil, subtype: String? = nil, tagline: String? = nil, theme: String? = nil, thumb: String? = nil, title: String? = nil, type: String? = nil, userState: Bool? = nil, year: Int? = nil) {
self.addedAt = addedAt
self.art = art
self._audienceRating = DecimalSerialized<Double?>(wrappedValue: audienceRating)
self.audienceRatingImage = audienceRatingImage
self.chapterSource = chapterSource
self.availabilityId = availabilityId
self.banner = banner
self.childCount = childCount
self.contentRating = contentRating
self.country = country
self.director = director
self._duration = DecimalSerialized<Double?>(wrappedValue: duration)
self.genre = genre
self.duration = duration
self.expiresAt = expiresAt
self.guid = guid
self.image = image
self.imdbRatingCount = imdbRatingCount
self.isContinuingSeries = isContinuingSeries
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.primaryExtraKey = primaryExtraKey
self.leafCount = leafCount
self._originallyAvailableAt = DateOnly<Date?>(wrappedValue: originallyAvailableAt)
self.originalTitle = originalTitle
self.playableKey = playableKey
self.publicPagesURL = publicPagesURL
self._rating = DecimalSerialized<Double?>(wrappedValue: rating)
self.ratingImage = ratingImage
self._ratingKey = DecimalSerialized<Double?>(wrappedValue: ratingKey)
self.role = role
self.ratingKey = ratingKey
self.skipChildren = skipChildren
self.slug = slug
self.streamingMediaId = streamingMediaId
self.studio = studio
self.summary = summary
self.subtype = subtype
self.tagline = tagline
self.theme = theme
self.thumb = thumb
self.title = title
self.type = type
self._updatedAt = DecimalSerialized<Double?>(wrappedValue: updatedAt)
self.writer = writer
self._year = DecimalSerialized<Double?>(wrappedValue: year)
self.userState = userState
self.year = year
}
}
}
@@ -90,136 +90,130 @@ extension Operations {
extension Operations.Metadata: Codable {
enum CodingKeys: String, CodingKey {
case addedAt
case allowSync
case art
case audienceRating
case audienceRatingImage
case chapterSource
case availabilityId
case banner
case childCount
case contentRating
case country = "Country"
case director = "Director"
case duration
case genre = "Genre"
case expiresAt
case guid
case image = "Image"
case imdbRatingCount
case isContinuingSeries
case key
case librarySectionID
case librarySectionTitle
case librarySectionUUID
case media = "Media"
case leafCount
case originallyAvailableAt
case primaryExtraKey
case originalTitle
case playableKey
case publicPagesURL
case rating
case ratingImage
case ratingKey
case role = "Role"
case skipChildren
case slug
case streamingMediaId
case studio
case summary
case subtype
case tagline
case theme
case thumb
case title
case type
case updatedAt
case writer = "Writer"
case userState
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.addedAt = try container.decodeIfPresent(Int.self, forKey: .addedAt)
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.availabilityId = try container.decodeIfPresent(String.self, forKey: .availabilityId)
self.banner = try container.decodeIfPresent(String.self, forKey: .banner)
self.childCount = try container.decodeIfPresent(Int.self, forKey: .childCount)
self.contentRating = try container.decodeIfPresent(String.self, forKey: .contentRating)
self.country = try container.decodeIfPresent([Operations.Country].self, forKey: .country)
self.director = try container.decodeIfPresent([Operations.Director].self, forKey: .director)
self._duration = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .duration) ?? DecimalSerialized<Double?>(wrappedValue: nil)
self.genre = try container.decodeIfPresent([Operations.Genre].self, forKey: .genre)
self.duration = try container.decodeIfPresent(Int.self, forKey: .duration)
self.expiresAt = try container.decodeIfPresent(Int.self, forKey: .expiresAt)
self.guid = try container.decodeIfPresent(String.self, forKey: .guid)
self.image = try container.decodeIfPresent([Operations.Image].self, forKey: .image)
self.imdbRatingCount = try container.decodeIfPresent(Int.self, forKey: .imdbRatingCount)
self.isContinuingSeries = try container.decodeIfPresent(Bool.self, forKey: .isContinuingSeries)
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.Media].self, forKey: .media)
self._originallyAvailableAt = try container.decodeIfPresent(DateTime<Date?>.self, forKey: .originallyAvailableAt) ?? DateTime<Date?>(wrappedValue: nil)
self.primaryExtraKey = try container.decodeIfPresent(String.self, forKey: .primaryExtraKey)
self.leafCount = try container.decodeIfPresent(Int.self, forKey: .leafCount)
self._originallyAvailableAt = try container.decodeIfPresent(DateOnly<Date?>.self, forKey: .originallyAvailableAt) ?? DateOnly<Date?>(wrappedValue: nil)
self.originalTitle = try container.decodeIfPresent(String.self, forKey: .originalTitle)
self.playableKey = try container.decodeIfPresent(String.self, forKey: .playableKey)
self.publicPagesURL = try container.decodeIfPresent(String.self, forKey: .publicPagesURL)
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.Role].self, forKey: .role)
self.ratingKey = try container.decodeIfPresent(String.self, forKey: .ratingKey)
self.skipChildren = try container.decodeIfPresent(Bool.self, forKey: .skipChildren)
self.slug = try container.decodeIfPresent(String.self, forKey: .slug)
self.streamingMediaId = try container.decodeIfPresent(String.self, forKey: .streamingMediaId)
self.studio = try container.decodeIfPresent(String.self, forKey: .studio)
self.summary = try container.decodeIfPresent(String.self, forKey: .summary)
self.subtype = try container.decodeIfPresent(String.self, forKey: .subtype)
self.tagline = try container.decodeIfPresent(String.self, forKey: .tagline)
self.theme = try container.decodeIfPresent(String.self, forKey: .theme)
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.Writer].self, forKey: .writer)
self._year = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .year) ?? DecimalSerialized<Double?>(wrappedValue: nil)
self.userState = try container.decodeIfPresent(Bool.self, forKey: .userState)
self.year = try container.decodeIfPresent(Int.self, forKey: .year)
}
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.addedAt, forKey: .addedAt)
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.availabilityId, forKey: .availabilityId)
try container.encodeIfPresent(self.banner, forKey: .banner)
try container.encodeIfPresent(self.childCount, forKey: .childCount)
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.duration, forKey: .duration)
try container.encodeIfPresent(self.expiresAt, forKey: .expiresAt)
try container.encodeIfPresent(self.guid, forKey: .guid)
try container.encodeIfPresent(self.image, forKey: .image)
try container.encodeIfPresent(self.imdbRatingCount, forKey: .imdbRatingCount)
try container.encodeIfPresent(self.isContinuingSeries, forKey: .isContinuingSeries)
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)
try container.encodeIfPresent(self.leafCount, forKey: .leafCount)
if self.originallyAvailableAt != nil {
try container.encode(self._originallyAvailableAt, forKey: .originallyAvailableAt)
}
try container.encodeIfPresent(self.primaryExtraKey, forKey: .primaryExtraKey)
try container.encodeIfPresent(self.originalTitle, forKey: .originalTitle)
try container.encodeIfPresent(self.playableKey, forKey: .playableKey)
try container.encodeIfPresent(self.publicPagesURL, forKey: .publicPagesURL)
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.ratingKey, forKey: .ratingKey)
try container.encodeIfPresent(self.skipChildren, forKey: .skipChildren)
try container.encodeIfPresent(self.slug, forKey: .slug)
try container.encodeIfPresent(self.streamingMediaId, forKey: .streamingMediaId)
try container.encodeIfPresent(self.studio, forKey: .studio)
try container.encodeIfPresent(self.summary, forKey: .summary)
try container.encodeIfPresent(self.subtype, forKey: .subtype)
try container.encodeIfPresent(self.tagline, forKey: .tagline)
try container.encodeIfPresent(self.theme, forKey: .theme)
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)
}
try container.encodeIfPresent(self.userState, forKey: .userState)
try container.encodeIfPresent(self.year, forKey: .year)
}
}
extension Operations.Metadata {
var librarySectionIDWrapper: DecimalSerialized<Double?> {
return _librarySectionID
}
var ratingKeyWrapper: DecimalSerialized<Double?> {
return _ratingKey
var originallyAvailableAtWrapper: DateOnly<Date?> {
return _originallyAvailableAt
}
var ratingWrapper: DecimalSerialized<Double?> {
return _rating
@@ -227,19 +221,4 @@ extension Operations.Metadata {
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
}
}