ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.285.0

This commit is contained in:
speakeasybot
2024-05-08 18:15:36 +00:00
parent 1c0482d57f
commit 3d9c4e9182
24 changed files with 717 additions and 1611 deletions

View File

@@ -93,7 +93,6 @@ case .empty:
- ``Operations/GetLibrariesResponse``
- ``Operations/GetLibraryResponse``
- ``Operations/GetLibraryHubsResponse``
- ``Operations/GetLibraryItemsResponse``
- ``Operations/GetMetadataResponse``
- ``Operations/GetMetadataChildrenResponse``
- ``Operations/GetMyPlexAccountResponse``
@@ -233,17 +232,6 @@ case .empty:
- ``Operations/GetLibraryHubsResponseBody``
- ``Operations/GetLibraryHubsRole``
- ``Operations/GetLibraryHubsWriter``
- ``Operations/GetLibraryItemsCountry``
- ``Operations/GetLibraryItemsDirector``
- ``Operations/GetLibraryItemsGenre``
- ``Operations/GetLibraryItemsMedia``
- ``Operations/GetLibraryItemsMediaContainer``
- ``Operations/GetLibraryItemsMetadata``
- ``Operations/GetLibraryItemsPart``
- ``Operations/GetLibraryItemsRequest``
- ``Operations/GetLibraryItemsResponseBody``
- ``Operations/GetLibraryItemsRole``
- ``Operations/GetLibraryItemsWriter``
- ``Operations/GetMetadataCountry``
- ``Operations/GetMetadataDirector``
- ``Operations/GetMetadataErrors``
@@ -458,7 +446,6 @@ case .empty:
- ``Operations/StopTranscodeSessionRequest``
- ``Operations/StopTranscodeSessionResponseBody``
- ``Operations/Stream``
- ``Operations/Tag``
- ``Operations/TaskName``
- ``Operations/Tonight``
- ``Operations/TranscodeSession``

View File

@@ -55,15 +55,6 @@ class _LibraryAPI: LibraryAPI {
)
}
public func getLibraryItems(request: Operations.GetLibraryItemsRequest) async throws -> Response<Operations.GetLibraryItemsResponse> {
return try await client.makeRequest(
configureRequest: { configuration in
try configureGetLibraryItemsRequest(with: configuration, request: request)
},
handleResponse: handleGetLibraryItemsResponse
)
}
public func refreshLibrary(request: Operations.RefreshLibraryRequest) async throws -> Response<Operations.RefreshLibraryResponse> {
return try await client.makeRequest(
configureRequest: { configuration in
@@ -147,13 +138,6 @@ private func configureDeleteLibraryRequest(with configuration: URLRequestConfigu
configuration.telemetryHeader = .userAgent
}
private func configureGetLibraryItemsRequest(with configuration: URLRequestConfiguration, request: Operations.GetLibraryItemsRequest) throws {
configuration.path = "/library/sections/{sectionId}/{tag}"
configuration.method = .get
configuration.pathParameterSerializable = request
configuration.telemetryHeader = .userAgent
}
private func configureRefreshLibraryRequest(with configuration: URLRequestConfiguration, request: Operations.RefreshLibraryRequest) throws {
configuration.path = "/library/sections/{sectionId}/refresh"
configuration.method = .get
@@ -305,22 +289,6 @@ private func handleDeleteLibraryResponse(response: Client.APIResponse) throws ->
return .empty
}
private func handleGetLibraryItemsResponse(response: Client.APIResponse) throws -> Operations.GetLibraryItemsResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .object(try JSONDecoder().decode(Operations.GetLibraryItemsResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
}
return .empty
}
private func handleRefreshLibraryResponse(response: Client.APIResponse) throws -> Operations.RefreshLibraryResponse {
let httpResponse = response.httpResponse

View File

@@ -1,24 +0,0 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations.GetLibraryItemsRequest: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
switch format {
case .path:
return try serializePathParameterSerializable(self, with: format)
case .query, .header, .multipart, .form:
throw SerializationError.invalidSerializationParameter(type: "Operations.GetLibraryItemsRequest", format: format.formatDescription)
}
}
}
extension Operations.GetLibraryItemsRequest: PathParameterSerializable {
func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
return [
"sectionId": try sectionId.serialize(with: formatOverride ?? .path(explode: false)),
"tag": try tag.serialize(with: formatOverride ?? .path(explode: false)),
].compactMapValues { $0 }
}
}

View File

@@ -1,14 +0,0 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations.Tag: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return try rawValue.serialize(with: format)
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return [QueryParameter(key: [], serialized: try serialize(with: format))]
}
}

View File

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

View File

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

View File

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

View File

@@ -1,107 +0,0 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetLibraryItemsMedia {
@DecimalSerialized
public private(set) var aspectRatio: Double?
public let audioChannels: Int?
public let audioCodec: String?
public let bitrate: Int?
public let container: String?
public let duration: Int?
public let height: Int?
public let id: Int?
public let part: [Operations.GetLibraryItemsPart]?
public let videoCodec: String?
public let videoFrameRate: String?
public let videoProfile: String?
public let videoResolution: String?
public let width: Int?
/// Creates an object with the specified parameters
///
///
public init(aspectRatio: Double? = nil, audioChannels: Int? = nil, audioCodec: String? = nil, bitrate: Int? = nil, container: String? = nil, duration: Int? = nil, height: Int? = nil, id: Int? = nil, part: [Operations.GetLibraryItemsPart]? = nil, videoCodec: String? = nil, videoFrameRate: String? = nil, videoProfile: String? = nil, videoResolution: String? = nil, width: Int? = nil) {
self._aspectRatio = DecimalSerialized<Double?>(wrappedValue: aspectRatio)
self.audioChannels = audioChannels
self.audioCodec = audioCodec
self.bitrate = bitrate
self.container = container
self.duration = duration
self.height = height
self.id = id
self.part = part
self.videoCodec = videoCodec
self.videoFrameRate = videoFrameRate
self.videoProfile = videoProfile
self.videoResolution = videoResolution
self.width = width
}
}
}
extension Operations.GetLibraryItemsMedia: Codable {
enum CodingKeys: String, CodingKey {
case aspectRatio
case audioChannels
case audioCodec
case bitrate
case container
case duration
case height
case id
case part = "Part"
case videoCodec
case videoFrameRate
case videoProfile
case videoResolution
case width
}
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self._aspectRatio = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .aspectRatio) ?? DecimalSerialized<Double?>(wrappedValue: nil)
self.audioChannels = try container.decodeIfPresent(Int.self, forKey: .audioChannels)
self.audioCodec = try container.decodeIfPresent(String.self, forKey: .audioCodec)
self.bitrate = try container.decodeIfPresent(Int.self, forKey: .bitrate)
self.container = try container.decodeIfPresent(String.self, forKey: .container)
self.duration = try container.decodeIfPresent(Int.self, forKey: .duration)
self.height = try container.decodeIfPresent(Int.self, forKey: .height)
self.id = try container.decodeIfPresent(Int.self, forKey: .id)
self.part = try container.decodeIfPresent([Operations.GetLibraryItemsPart].self, forKey: .part)
self.videoCodec = try container.decodeIfPresent(String.self, forKey: .videoCodec)
self.videoFrameRate = try container.decodeIfPresent(String.self, forKey: .videoFrameRate)
self.videoProfile = try container.decodeIfPresent(String.self, forKey: .videoProfile)
self.videoResolution = try container.decodeIfPresent(String.self, forKey: .videoResolution)
self.width = try container.decodeIfPresent(Int.self, forKey: .width)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
if self.aspectRatio != nil {
try container.encode(self._aspectRatio, forKey: .aspectRatio)
}
try container.encodeIfPresent(self.audioChannels, forKey: .audioChannels)
try container.encodeIfPresent(self.audioCodec, forKey: .audioCodec)
try container.encodeIfPresent(self.bitrate, forKey: .bitrate)
try container.encodeIfPresent(self.container, forKey: .container)
try container.encodeIfPresent(self.duration, forKey: .duration)
try container.encodeIfPresent(self.height, forKey: .height)
try container.encodeIfPresent(self.id, forKey: .id)
try container.encodeIfPresent(self.part, forKey: .part)
try container.encodeIfPresent(self.videoCodec, forKey: .videoCodec)
try container.encodeIfPresent(self.videoFrameRate, forKey: .videoFrameRate)
try container.encodeIfPresent(self.videoProfile, forKey: .videoProfile)
try container.encodeIfPresent(self.videoResolution, forKey: .videoResolution)
try container.encodeIfPresent(self.width, forKey: .width)
}
}
extension Operations.GetLibraryItemsMedia {
var aspectRatioWrapper: DecimalSerialized<Double?> {
return _aspectRatio
}
}

View File

@@ -1,69 +0,0 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetLibraryItemsMediaContainer {
public let allowSync: Bool?
public let art: String?
public let identifier: String?
public let librarySectionID: Int?
public let librarySectionTitle: String?
public let librarySectionUUID: String?
public let mediaTagPrefix: String?
public let mediaTagVersion: Int?
public let metadata: [Operations.GetLibraryItemsMetadata]?
public let mixedParents: Bool?
public let size: Int?
public let thumb: String?
public let title1: String?
public let title2: String?
public let viewGroup: String?
public let viewMode: Int?
/// Creates an object with the specified parameters
///
///
public init(allowSync: Bool? = nil, art: String? = nil, identifier: String? = nil, librarySectionID: Int? = nil, librarySectionTitle: String? = nil, librarySectionUUID: String? = nil, mediaTagPrefix: String? = nil, mediaTagVersion: Int? = nil, metadata: [Operations.GetLibraryItemsMetadata]? = nil, mixedParents: Bool? = nil, size: Int? = nil, thumb: String? = nil, title1: String? = nil, title2: String? = nil, viewGroup: String? = nil, viewMode: Int? = nil) {
self.allowSync = allowSync
self.art = art
self.identifier = identifier
self.librarySectionID = librarySectionID
self.librarySectionTitle = librarySectionTitle
self.librarySectionUUID = librarySectionUUID
self.mediaTagPrefix = mediaTagPrefix
self.mediaTagVersion = mediaTagVersion
self.metadata = metadata
self.mixedParents = mixedParents
self.size = size
self.thumb = thumb
self.title1 = title1
self.title2 = title2
self.viewGroup = viewGroup
self.viewMode = viewMode
}
}
}
extension Operations.GetLibraryItemsMediaContainer: Codable {
enum CodingKeys: String, CodingKey {
case allowSync
case art
case identifier
case librarySectionID
case librarySectionTitle
case librarySectionUUID
case mediaTagPrefix
case mediaTagVersion
case metadata = "Metadata"
case mixedParents
case size
case thumb
case title1
case title2
case viewGroup
case viewMode
}
}

View File

@@ -1,334 +0,0 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetLibraryItemsMetadata {
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 childCount: Int?
public let contentRating: String?
public let country: [Operations.GetLibraryItemsCountry]?
public let director: [Operations.GetLibraryItemsDirector]?
public let duration: Int?
public let genre: [Operations.GetLibraryItemsGenre]?
public let grandparentArt: String?
public let grandparentGuid: String?
public let grandparentKey: String?
public let grandparentRatingKey: String?
public let grandparentTheme: String?
public let grandparentThumb: String?
public let grandparentTitle: String?
public let guid: String?
public let hasPremiumExtras: String?
public let hasPremiumPrimaryExtra: String?
public let index: Int?
public let key: String?
public let lastViewedAt: Int?
public let leafCount: Int?
public let media: [Operations.GetLibraryItemsMedia]?
@DateOnly
public private(set) var originallyAvailableAt: Date?
public let originalTitle: String?
public let parentGuid: String?
public let parentIndex: Int?
public let parentKey: String?
public let parentRatingKey: String?
public let parentStudio: String?
public let parentTheme: String?
public let parentThumb: String?
public let parentTitle: String?
public let parentYear: Int?
public let primaryExtraKey: String?
@DecimalSerialized
public private(set) var rating: Double?
public let ratingImage: String?
public let ratingKey: String?
public let role: [Operations.GetLibraryItemsRole]?
public let skipCount: Int?
public let studio: String?
public let summary: String?
public let tagline: String?
public let theme: String?
public let thumb: String?
public let title: String?
public let titleSort: String?
public let type: String?
public let updatedAt: Int?
public let viewCount: Int?
public let viewedLeafCount: Int?
public let viewOffset: Int?
public let writer: [Operations.GetLibraryItemsWriter]?
public let year: Int?
/// Creates an object with the specified parameters
///
///
public init(addedAt: Int? = nil, art: String? = nil, audienceRating: Double? = nil, audienceRatingImage: String? = nil, chapterSource: String? = nil, childCount: Int? = nil, contentRating: String? = nil, country: [Operations.GetLibraryItemsCountry]? = nil, director: [Operations.GetLibraryItemsDirector]? = nil, duration: Int? = nil, genre: [Operations.GetLibraryItemsGenre]? = nil, grandparentArt: String? = nil, grandparentGuid: String? = nil, grandparentKey: String? = nil, grandparentRatingKey: String? = nil, grandparentTheme: String? = nil, grandparentThumb: String? = nil, grandparentTitle: String? = nil, guid: String? = nil, hasPremiumExtras: String? = nil, hasPremiumPrimaryExtra: String? = nil, index: Int? = nil, key: String? = nil, lastViewedAt: Int? = nil, leafCount: Int? = nil, media: [Operations.GetLibraryItemsMedia]? = nil, originallyAvailableAt: Date? = nil, originalTitle: String? = nil, parentGuid: String? = nil, parentIndex: Int? = nil, parentKey: String? = nil, parentRatingKey: String? = nil, parentStudio: String? = nil, parentTheme: String? = nil, parentThumb: String? = nil, parentTitle: String? = nil, parentYear: Int? = nil, primaryExtraKey: String? = nil, rating: Double? = nil, ratingImage: String? = nil, ratingKey: String? = nil, role: [Operations.GetLibraryItemsRole]? = nil, skipCount: Int? = nil, studio: String? = nil, summary: String? = nil, tagline: String? = nil, theme: String? = nil, thumb: String? = nil, title: String? = nil, titleSort: String? = nil, type: String? = nil, updatedAt: Int? = nil, viewCount: Int? = nil, viewedLeafCount: Int? = nil, viewOffset: Int? = nil, writer: [Operations.GetLibraryItemsWriter]? = nil, year: Int? = nil) {
self.addedAt = addedAt
self.art = art
self._audienceRating = DecimalSerialized<Double?>(wrappedValue: audienceRating)
self.audienceRatingImage = audienceRatingImage
self.chapterSource = chapterSource
self.childCount = childCount
self.contentRating = contentRating
self.country = country
self.director = director
self.duration = duration
self.genre = genre
self.grandparentArt = grandparentArt
self.grandparentGuid = grandparentGuid
self.grandparentKey = grandparentKey
self.grandparentRatingKey = grandparentRatingKey
self.grandparentTheme = grandparentTheme
self.grandparentThumb = grandparentThumb
self.grandparentTitle = grandparentTitle
self.guid = guid
self.hasPremiumExtras = hasPremiumExtras
self.hasPremiumPrimaryExtra = hasPremiumPrimaryExtra
self.index = index
self.key = key
self.lastViewedAt = lastViewedAt
self.leafCount = leafCount
self.media = media
self._originallyAvailableAt = DateOnly<Date?>(wrappedValue: originallyAvailableAt)
self.originalTitle = originalTitle
self.parentGuid = parentGuid
self.parentIndex = parentIndex
self.parentKey = parentKey
self.parentRatingKey = parentRatingKey
self.parentStudio = parentStudio
self.parentTheme = parentTheme
self.parentThumb = parentThumb
self.parentTitle = parentTitle
self.parentYear = parentYear
self.primaryExtraKey = primaryExtraKey
self._rating = DecimalSerialized<Double?>(wrappedValue: rating)
self.ratingImage = ratingImage
self.ratingKey = ratingKey
self.role = role
self.skipCount = skipCount
self.studio = studio
self.summary = summary
self.tagline = tagline
self.theme = theme
self.thumb = thumb
self.title = title
self.titleSort = titleSort
self.type = type
self.updatedAt = updatedAt
self.viewCount = viewCount
self.viewedLeafCount = viewedLeafCount
self.viewOffset = viewOffset
self.writer = writer
self.year = year
}
}
}
extension Operations.GetLibraryItemsMetadata: Codable {
enum CodingKeys: String, CodingKey {
case addedAt
case art
case audienceRating
case audienceRatingImage
case chapterSource
case childCount
case contentRating
case country = "Country"
case director = "Director"
case duration
case genre = "Genre"
case grandparentArt
case grandparentGuid
case grandparentKey
case grandparentRatingKey
case grandparentTheme
case grandparentThumb
case grandparentTitle
case guid
case hasPremiumExtras
case hasPremiumPrimaryExtra
case index
case key
case lastViewedAt
case leafCount
case media = "Media"
case originallyAvailableAt
case originalTitle
case parentGuid
case parentIndex
case parentKey
case parentRatingKey
case parentStudio
case parentTheme
case parentThumb
case parentTitle
case parentYear
case primaryExtraKey
case rating
case ratingImage
case ratingKey
case role = "Role"
case skipCount
case studio
case summary
case tagline
case theme
case thumb
case title
case titleSort
case type
case updatedAt
case viewCount
case viewedLeafCount
case viewOffset
case writer = "Writer"
case year
}
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
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.childCount = try container.decodeIfPresent(Int.self, forKey: .childCount)
self.contentRating = try container.decodeIfPresent(String.self, forKey: .contentRating)
self.country = try container.decodeIfPresent([Operations.GetLibraryItemsCountry].self, forKey: .country)
self.director = try container.decodeIfPresent([Operations.GetLibraryItemsDirector].self, forKey: .director)
self.duration = try container.decodeIfPresent(Int.self, forKey: .duration)
self.genre = try container.decodeIfPresent([Operations.GetLibraryItemsGenre].self, forKey: .genre)
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(String.self, forKey: .grandparentRatingKey)
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.hasPremiumExtras = try container.decodeIfPresent(String.self, forKey: .hasPremiumExtras)
self.hasPremiumPrimaryExtra = try container.decodeIfPresent(String.self, forKey: .hasPremiumPrimaryExtra)
self.index = try container.decodeIfPresent(Int.self, forKey: .index)
self.key = try container.decodeIfPresent(String.self, forKey: .key)
self.lastViewedAt = try container.decodeIfPresent(Int.self, forKey: .lastViewedAt)
self.leafCount = try container.decodeIfPresent(Int.self, forKey: .leafCount)
self.media = try container.decodeIfPresent([Operations.GetLibraryItemsMedia].self, forKey: .media)
self._originallyAvailableAt = try container.decodeIfPresent(DateOnly<Date?>.self, forKey: .originallyAvailableAt) ?? DateOnly<Date?>(wrappedValue: nil)
self.originalTitle = try container.decodeIfPresent(String.self, forKey: .originalTitle)
self.parentGuid = try container.decodeIfPresent(String.self, forKey: .parentGuid)
self.parentIndex = try container.decodeIfPresent(Int.self, forKey: .parentIndex)
self.parentKey = try container.decodeIfPresent(String.self, forKey: .parentKey)
self.parentRatingKey = try container.decodeIfPresent(String.self, forKey: .parentRatingKey)
self.parentStudio = try container.decodeIfPresent(String.self, forKey: .parentStudio)
self.parentTheme = try container.decodeIfPresent(String.self, forKey: .parentTheme)
self.parentThumb = try container.decodeIfPresent(String.self, forKey: .parentThumb)
self.parentTitle = try container.decodeIfPresent(String.self, forKey: .parentTitle)
self.parentYear = try container.decodeIfPresent(Int.self, forKey: .parentYear)
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(String.self, forKey: .ratingKey)
self.role = try container.decodeIfPresent([Operations.GetLibraryItemsRole].self, forKey: .role)
self.skipCount = try container.decodeIfPresent(Int.self, forKey: .skipCount)
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.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.titleSort = try container.decodeIfPresent(String.self, forKey: .titleSort)
self.type = try container.decodeIfPresent(String.self, forKey: .type)
self.updatedAt = try container.decodeIfPresent(Int.self, forKey: .updatedAt)
self.viewCount = try container.decodeIfPresent(Int.self, forKey: .viewCount)
self.viewedLeafCount = try container.decodeIfPresent(Int.self, forKey: .viewedLeafCount)
self.viewOffset = try container.decodeIfPresent(Int.self, forKey: .viewOffset)
self.writer = try container.decodeIfPresent([Operations.GetLibraryItemsWriter].self, forKey: .writer)
self.year = try container.decodeIfPresent(Int.self, forKey: .year)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
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.childCount, forKey: .childCount)
try container.encodeIfPresent(self.contentRating, forKey: .contentRating)
try container.encodeIfPresent(self.country, forKey: .country)
try container.encodeIfPresent(self.director, forKey: .director)
try container.encodeIfPresent(self.duration, forKey: .duration)
try container.encodeIfPresent(self.genre, forKey: .genre)
try container.encodeIfPresent(self.grandparentArt, forKey: .grandparentArt)
try container.encodeIfPresent(self.grandparentGuid, forKey: .grandparentGuid)
try container.encodeIfPresent(self.grandparentKey, forKey: .grandparentKey)
try container.encodeIfPresent(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.hasPremiumExtras, forKey: .hasPremiumExtras)
try container.encodeIfPresent(self.hasPremiumPrimaryExtra, forKey: .hasPremiumPrimaryExtra)
try container.encodeIfPresent(self.index, forKey: .index)
try container.encodeIfPresent(self.key, forKey: .key)
try container.encodeIfPresent(self.lastViewedAt, forKey: .lastViewedAt)
try container.encodeIfPresent(self.leafCount, forKey: .leafCount)
try container.encodeIfPresent(self.media, forKey: .media)
if self.originallyAvailableAt != nil {
try container.encode(self._originallyAvailableAt, forKey: .originallyAvailableAt)
}
try container.encodeIfPresent(self.originalTitle, forKey: .originalTitle)
try container.encodeIfPresent(self.parentGuid, forKey: .parentGuid)
try container.encodeIfPresent(self.parentIndex, forKey: .parentIndex)
try container.encodeIfPresent(self.parentKey, forKey: .parentKey)
try container.encodeIfPresent(self.parentRatingKey, forKey: .parentRatingKey)
try container.encodeIfPresent(self.parentStudio, forKey: .parentStudio)
try container.encodeIfPresent(self.parentTheme, forKey: .parentTheme)
try container.encodeIfPresent(self.parentThumb, forKey: .parentThumb)
try container.encodeIfPresent(self.parentTitle, forKey: .parentTitle)
try container.encodeIfPresent(self.parentYear, forKey: .parentYear)
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)
try container.encodeIfPresent(self.ratingKey, forKey: .ratingKey)
try container.encodeIfPresent(self.role, forKey: .role)
try container.encodeIfPresent(self.skipCount, forKey: .skipCount)
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.theme, forKey: .theme)
try container.encodeIfPresent(self.thumb, forKey: .thumb)
try container.encodeIfPresent(self.title, forKey: .title)
try container.encodeIfPresent(self.titleSort, forKey: .titleSort)
try container.encodeIfPresent(self.type, forKey: .type)
try container.encodeIfPresent(self.updatedAt, forKey: .updatedAt)
try container.encodeIfPresent(self.viewCount, forKey: .viewCount)
try container.encodeIfPresent(self.viewedLeafCount, forKey: .viewedLeafCount)
try container.encodeIfPresent(self.viewOffset, forKey: .viewOffset)
try container.encodeIfPresent(self.writer, forKey: .writer)
try container.encodeIfPresent(self.year, forKey: .year)
}
}
extension Operations.GetLibraryItemsMetadata {
var ratingWrapper: DecimalSerialized<Double?> {
return _rating
}
var audienceRatingWrapper: DecimalSerialized<Double?> {
return _audienceRating
}
var originallyAvailableAtWrapper: DateOnly<Date?> {
return _originallyAvailableAt
}
}

View File

@@ -1,42 +0,0 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetLibraryItemsPart {
public let container: String?
public let duration: Int?
public let file: String?
public let id: Int?
public let key: String?
public let size: Int?
public let videoProfile: String?
/// Creates an object with the specified parameters
///
///
public init(container: String? = nil, duration: Int? = nil, file: String? = nil, id: Int? = nil, key: String? = nil, size: Int? = nil, videoProfile: String? = nil) {
self.container = container
self.duration = duration
self.file = file
self.id = id
self.key = key
self.size = size
self.videoProfile = videoProfile
}
}
}
extension Operations.GetLibraryItemsPart: Codable {
enum CodingKeys: String, CodingKey {
case container
case duration
case file
case id
case key
case size
case videoProfile
}
}

View File

@@ -1,23 +0,0 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetLibraryItemsRequest: APIValue {
/// the Id of the library to query
public let sectionId: Int
/// A key representing a specific tag within the section.
public let tag: Operations.Tag
/// Creates an object with the specified parameters
///
/// - 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) {
self.sectionId = sectionId
self.tag = tag
}
}
}

View File

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

View File

@@ -1,24 +0,0 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// The contents of the library by section and tag
public struct GetLibraryItemsResponseBody {
public let mediaContainer: Operations.GetLibraryItemsMediaContainer?
/// Creates an object with the specified parameters
///
///
public init(mediaContainer: Operations.GetLibraryItemsMediaContainer? = nil) {
self.mediaContainer = mediaContainer
}
}
}
extension Operations.GetLibraryItemsResponseBody: Codable {
enum CodingKeys: String, CodingKey {
case mediaContainer = "MediaContainer"
}
}

View File

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

View File

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

View File

@@ -1,28 +0,0 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// A key representing a specific tag within the section.
public enum Tag: String, Codable, APIValue {
case all = "all"
case unwatched = "unwatched"
case newest = "newest"
case recentlyAdded = "recentlyAdded"
case recentlyViewed = "recentlyViewed"
case onDeck = "onDeck"
case collection = "collection"
case edition = "edition"
case genre = "genre"
case year = "year"
case decade = "decade"
case director = "director"
case actor = "actor"
case country = "country"
case contentRating = "contentRating"
case rating = "rating"
case resolution = "resolution"
case firstCharacter = "firstCharacter"
case folder = "folder"
}
}