ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.6

This commit is contained in:
speakeasybot
2025-02-11 00:09:23 +00:00
parent e6b7aa3eba
commit beb0de09ae
103 changed files with 3110 additions and 400 deletions

File diff suppressed because one or more lines are too long

View File

@@ -12,7 +12,7 @@ generation:
auth: auth:
oAuth2ClientCredentialsEnabled: true oAuth2ClientCredentialsEnabled: true
swift: swift:
version: 0.9.13 version: 0.10.1
author: LukeHagar author: LukeHagar
description: Swift Client SDK Generated by Speakeasy description: Swift Client SDK Generated by Speakeasy
imports: imports:

View File

@@ -9,8 +9,8 @@ sources:
- main - main
plexapi: plexapi:
sourceNamespace: plexapi sourceNamespace: plexapi
sourceRevisionDigest: sha256:49536684a97842ea7c069f909012b31a22a046d8277aee47b50a334494bf2c64 sourceRevisionDigest: sha256:0efb9039972533bf1190dfc1ffb377429a8e486b6299442e732f662c1ffbeca6
sourceBlobDigest: sha256:eac671ea32ce31e1e558839153f7effef39bb35b4e461c6e95661d0eaf4ce1c8 sourceBlobDigest: sha256:038d73166cc9db17f514d511cfe4365ea032f4ebcb247fa86b7aa1bba0e1ab46
tags: tags:
- latest - latest
- main - main
@@ -18,10 +18,10 @@ targets:
plexswift: plexswift:
source: plexapi source: plexapi
sourceNamespace: plexapi sourceNamespace: plexapi
sourceRevisionDigest: sha256:49536684a97842ea7c069f909012b31a22a046d8277aee47b50a334494bf2c64 sourceRevisionDigest: sha256:0efb9039972533bf1190dfc1ffb377429a8e486b6299442e732f662c1ffbeca6
sourceBlobDigest: sha256:eac671ea32ce31e1e558839153f7effef39bb35b4e461c6e95661d0eaf4ce1c8 sourceBlobDigest: sha256:038d73166cc9db17f514d511cfe4365ea032f4ebcb247fa86b7aa1bba0e1ab46
codeSamplesNamespace: code-samples-swift-plexswift codeSamplesNamespace: code-samples-swift-plexswift
codeSamplesRevisionDigest: sha256:cbda8e96fd8d266feec7c3938d440b67c9b5b6673392feec2cf5ac13b4bf98df codeSamplesRevisionDigest: sha256:8e0eb64da3cc17fa85414bd5ce0d4125c863a477b51f8fe9684d3221eb63ca6c
workflow: workflow:
workflowVersion: 1.0.0 workflowVersion: 1.0.0
speakeasyVersion: latest speakeasyVersion: latest

View File

@@ -62,7 +62,7 @@ You can add `plexswift` to your project directly in Xcode `(File > Add Packages.
```bash ```bash
dependencies: [ dependencies: [
.package(url: "https://github.com/LukeHagar/plexswift.git", .upToNextMajor(from: "0.9.13")) .package(url: "https://github.com/LukeHagar/plexswift.git", .upToNextMajor(from: "0.10.1"))
] ]
``` ```
<!-- End SDK Installation [installation] --> <!-- End SDK Installation [installation] -->
@@ -138,6 +138,7 @@ case .empty:
* [getLibraryDetails](docs/sdks/library/README.md#getlibrarydetails) - Get Library Details * [getLibraryDetails](docs/sdks/library/README.md#getlibrarydetails) - Get Library Details
* [deleteLibrary](docs/sdks/library/README.md#deletelibrary) - Delete Library Section * [deleteLibrary](docs/sdks/library/README.md#deletelibrary) - Delete Library Section
* [getLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items * [getLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items
* [getAllMediaLibrary](docs/sdks/library/README.md#getallmedialibrary) - Get all media of library
* [getRefreshLibraryMetadata](docs/sdks/library/README.md#getrefreshlibrarymetadata) - Refresh Metadata Of The Library * [getRefreshLibraryMetadata](docs/sdks/library/README.md#getrefreshlibrarymetadata) - Refresh Metadata Of The Library
* [getSearchLibrary](docs/sdks/library/README.md#getsearchlibrary) - Search Library * [getSearchLibrary](docs/sdks/library/README.md#getsearchlibrary) - Search Library
* [getGenresLibrary](docs/sdks/library/README.md#getgenreslibrary) - Get Genres of library media * [getGenresLibrary](docs/sdks/library/README.md#getgenreslibrary) - Get Genres of library media

View File

@@ -843,3 +843,13 @@ Based on:
- [swift v0.9.13] . - [swift v0.9.13] .
### Releases ### Releases
- [Swift Package Manager v0.9.13] https://github.com/LukeHagar/plexswift/releases/tag/v0.9.13 - . - [Swift Package Manager v0.9.13] https://github.com/LukeHagar/plexswift/releases/tag/v0.9.13 - .
## 2025-02-11 00:08:06
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.405.6 (2.428.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [swift v0.10.1] .
### Releases
- [Swift Package Manager v0.10.1] https://github.com/LukeHagar/plexswift/releases/tag/v0.10.1 - .

View File

@@ -120,6 +120,7 @@ case .empty:
- ``Operations/EnablePaperTrailBadRequest`` - ``Operations/EnablePaperTrailBadRequest``
- ``Operations/GetActorsLibraryBadRequest`` - ``Operations/GetActorsLibraryBadRequest``
- ``Operations/GetAllLibrariesBadRequest`` - ``Operations/GetAllLibrariesBadRequest``
- ``Operations/GetAllMediaLibraryBadRequest``
- ``Operations/GetBannerImageBadRequest`` - ``Operations/GetBannerImageBadRequest``
- ``Operations/GetCountriesLibraryBadRequest`` - ``Operations/GetCountriesLibraryBadRequest``
- ``Operations/GetGenresLibraryBadRequest`` - ``Operations/GetGenresLibraryBadRequest``
@@ -200,6 +201,7 @@ case .empty:
- ``Operations/EnablePaperTrailResponse`` - ``Operations/EnablePaperTrailResponse``
- ``Operations/GetActorsLibraryResponse`` - ``Operations/GetActorsLibraryResponse``
- ``Operations/GetAllLibrariesResponse`` - ``Operations/GetAllLibrariesResponse``
- ``Operations/GetAllMediaLibraryResponse``
- ``Operations/GetBannerImageResponse`` - ``Operations/GetBannerImageResponse``
- ``Operations/GetCountriesLibraryResponse`` - ``Operations/GetCountriesLibraryResponse``
- ``Operations/GetGenresLibraryResponse`` - ``Operations/GetGenresLibraryResponse``
@@ -271,6 +273,7 @@ case .empty:
- ``Operations/UploadPlaylistResponse`` - ``Operations/UploadPlaylistResponse``
### Other models ### Other models
- ``Operations/One``
- ``Operations/Account`` - ``Operations/Account``
- ``Operations/Action`` - ``Operations/Action``
- ``Operations/ActiveDirection`` - ``Operations/ActiveDirection``
@@ -365,6 +368,41 @@ case .empty:
- ``Operations/GetAllLibrariesMediaContainer`` - ``Operations/GetAllLibrariesMediaContainer``
- ``Operations/GetAllLibrariesResponseBody`` - ``Operations/GetAllLibrariesResponseBody``
- ``Operations/GetAllLibrariesUnauthorized`` - ``Operations/GetAllLibrariesUnauthorized``
- ``Operations/GetAllMediaLibrary1``
- ``Operations/GetAllMediaLibraryActiveDirection``
- ``Operations/GetAllMediaLibraryCollection``
- ``Operations/GetAllMediaLibraryCountry``
- ``Operations/GetAllMediaLibraryDefaultDirection``
- ``Operations/GetAllMediaLibraryDirector``
- ``Operations/GetAllMediaLibraryErrors``
- ``Operations/GetAllMediaLibraryField``
- ``Operations/GetAllMediaLibraryFieldType``
- ``Operations/GetAllMediaLibraryFilter``
- ``Operations/GetAllMediaLibraryGenre``
- ``Operations/GetAllMediaLibraryHasThumbnail``
- ``Operations/GetAllMediaLibraryImage``
- ``Operations/GetAllMediaLibraryLibraryErrors``
- ``Operations/GetAllMediaLibraryLibraryOptimizedForStreaming``
- ``Operations/GetAllMediaLibraryLibraryResponseType``
- ``Operations/GetAllMediaLibraryLibraryType``
- ``Operations/GetAllMediaLibraryMedia``
- ``Operations/GetAllMediaLibraryMediaContainer``
- ``Operations/GetAllMediaLibraryMeta``
- ``Operations/GetAllMediaLibraryMetadata``
- ``Operations/GetAllMediaLibraryOperator``
- ``Operations/GetAllMediaLibraryOptimizedForStreaming``
- ``Operations/GetAllMediaLibraryPart``
- ``Operations/GetAllMediaLibraryQueryParamIncludeMeta``
- ``Operations/GetAllMediaLibraryQueryParamType``
- ``Operations/GetAllMediaLibraryRequest``
- ``Operations/GetAllMediaLibraryResponseBody``
- ``Operations/GetAllMediaLibraryRole``
- ``Operations/GetAllMediaLibrarySort``
- ``Operations/GetAllMediaLibraryStream``
- ``Operations/GetAllMediaLibraryType``
- ``Operations/GetAllMediaLibraryUltraBlurColors``
- ``Operations/GetAllMediaLibraryUnauthorized``
- ``Operations/GetAllMediaLibraryWriter``
- ``Operations/GetBannerImageErrors`` - ``Operations/GetBannerImageErrors``
- ``Operations/GetBannerImageMediaErrors`` - ``Operations/GetBannerImageMediaErrors``
- ``Operations/GetBannerImageRequest`` - ``Operations/GetBannerImageRequest``
@@ -446,16 +484,22 @@ case .empty:
- ``Operations/GetLibraryItemsUltraBlurColors`` - ``Operations/GetLibraryItemsUltraBlurColors``
- ``Operations/GetLibraryItemsUnauthorized`` - ``Operations/GetLibraryItemsUnauthorized``
- ``Operations/GetLibraryItemsWriter`` - ``Operations/GetLibraryItemsWriter``
- ``Operations/GetMediaMetaData1``
- ``Operations/GetMediaMetaDataCountry`` - ``Operations/GetMediaMetaDataCountry``
- ``Operations/GetMediaMetaDataDirector`` - ``Operations/GetMediaMetaDataDirector``
- ``Operations/GetMediaMetaDataErrors`` - ``Operations/GetMediaMetaDataErrors``
- ``Operations/GetMediaMetaDataGenre`` - ``Operations/GetMediaMetaDataGenre``
- ``Operations/GetMediaMetaDataGuids``
- ``Operations/GetMediaMetaDataHasThumbnail``
- ``Operations/GetMediaMetaDataImage`` - ``Operations/GetMediaMetaDataImage``
- ``Operations/GetMediaMetaDataLibrary1``
- ``Operations/GetMediaMetaDataLibraryErrors`` - ``Operations/GetMediaMetaDataLibraryErrors``
- ``Operations/GetMediaMetaDataLibraryOptimizedForStreaming``
- ``Operations/GetMediaMetaDataLocation`` - ``Operations/GetMediaMetaDataLocation``
- ``Operations/GetMediaMetaDataMedia`` - ``Operations/GetMediaMetaDataMedia``
- ``Operations/GetMediaMetaDataMediaContainer`` - ``Operations/GetMediaMetaDataMediaContainer``
- ``Operations/GetMediaMetaDataMetadata`` - ``Operations/GetMediaMetaDataMetadata``
- ``Operations/GetMediaMetaDataOptimizedForStreaming``
- ``Operations/GetMediaMetaDataPart`` - ``Operations/GetMediaMetaDataPart``
- ``Operations/GetMediaMetaDataRequest`` - ``Operations/GetMediaMetaDataRequest``
- ``Operations/GetMediaMetaDataResponseBody`` - ``Operations/GetMediaMetaDataResponseBody``
@@ -526,6 +570,8 @@ case .empty:
- ``Operations/GetSearchAllLibrariesMetaDataRating`` - ``Operations/GetSearchAllLibrariesMetaDataRating``
- ``Operations/GetSearchAllLibrariesOptimizedForStreaming`` - ``Operations/GetSearchAllLibrariesOptimizedForStreaming``
- ``Operations/GetSearchAllLibrariesPart`` - ``Operations/GetSearchAllLibrariesPart``
- ``Operations/GetSearchAllLibrariesQueryParamIncludeCollections``
- ``Operations/GetSearchAllLibrariesQueryParamIncludeExternalMedia``
- ``Operations/GetSearchAllLibrariesRequest`` - ``Operations/GetSearchAllLibrariesRequest``
- ``Operations/GetSearchAllLibrariesResponseBody`` - ``Operations/GetSearchAllLibrariesResponseBody``
- ``Operations/GetSearchAllLibrariesRole`` - ``Operations/GetSearchAllLibrariesRole``
@@ -804,6 +850,7 @@ case .empty:
- ``Operations/Home`` - ``Operations/Home``
- ``Operations/Hub`` - ``Operations/Hub``
- ``Operations/Image`` - ``Operations/Image``
- ``Operations/IncludeAdvanced``
- ``Operations/IncludeCollections`` - ``Operations/IncludeCollections``
- ``Operations/IncludeDetails`` - ``Operations/IncludeDetails``
- ``Operations/IncludeExternalMedia`` - ``Operations/IncludeExternalMedia``
@@ -890,11 +937,12 @@ case .empty:
- ``Operations/QueryParamForce`` - ``Operations/QueryParamForce``
- ``Operations/QueryParamIncludeCollections`` - ``Operations/QueryParamIncludeCollections``
- ``Operations/QueryParamIncludeExternalMedia`` - ``Operations/QueryParamIncludeExternalMedia``
- ``Operations/QueryParamIncludeGuids``
- ``Operations/QueryParamIncludeMeta`` - ``Operations/QueryParamIncludeMeta``
- ``Operations/QueryParamOnlyTransient`` - ``Operations/QueryParamOnlyTransient``
- ``Operations/QueryParamSmart`` - ``Operations/QueryParamSmart``
- ``Operations/QueryParamType`` - ``Operations/QueryParamType``
- ``Operations/Rating`` - ``Operations/Ratings``
- ``Operations/Release`` - ``Operations/Release``
- ``Operations/ResponseBody`` - ``Operations/ResponseBody``
- ``Operations/Restricted`` - ``Operations/Restricted``

View File

@@ -64,6 +64,15 @@ class _LibraryAPI: LibraryAPI {
) )
} }
public func getAllMediaLibrary(request: Operations.GetAllMediaLibraryRequest) async throws -> Response<Operations.GetAllMediaLibraryResponse> {
return try await client.makeRequest(
configureRequest: { configuration in
try configureGetAllMediaLibraryRequest(with: configuration, request: request)
},
handleResponse: handleGetAllMediaLibraryResponse
)
}
public func getRefreshLibraryMetadata(request: Operations.GetRefreshLibraryMetadataRequest) async throws -> Response<Operations.GetRefreshLibraryMetadataResponse> { public func getRefreshLibraryMetadata(request: Operations.GetRefreshLibraryMetadataRequest) async throws -> Response<Operations.GetRefreshLibraryMetadataResponse> {
return try await client.makeRequest( return try await client.makeRequest(
configureRequest: { configuration in configureRequest: { configuration in
@@ -201,6 +210,14 @@ private func configureGetLibraryItemsRequest(with configuration: URLRequestConfi
configuration.telemetryHeader = .userAgent configuration.telemetryHeader = .userAgent
} }
private func configureGetAllMediaLibraryRequest(with configuration: URLRequestConfiguration, request: Operations.GetAllMediaLibraryRequest) throws {
configuration.path = "/library/sections/{sectionKey}/all"
configuration.method = .get
configuration.pathParameterSerializable = request
configuration.queryParameterSerializable = request
configuration.telemetryHeader = .userAgent
}
private func configureGetRefreshLibraryMetadataRequest(with configuration: URLRequestConfiguration, request: Operations.GetRefreshLibraryMetadataRequest) throws { private func configureGetRefreshLibraryMetadataRequest(with configuration: URLRequestConfiguration, request: Operations.GetRefreshLibraryMetadataRequest) throws {
configuration.path = "/library/sections/{sectionKey}/refresh" configuration.path = "/library/sections/{sectionKey}/refresh"
configuration.method = .get configuration.method = .get
@@ -460,6 +477,40 @@ private func handleGetLibraryItemsResponse(response: Client.APIResponse) throws
return .empty return .empty
} }
private func handleGetAllMediaLibraryResponse(response: Client.APIResponse) throws -> Operations.GetAllMediaLibraryResponse {
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.GetAllMediaLibraryResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetAllMediaLibraryBadRequest.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 401 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .unauthorized(try JSONDecoder().decode(Operations.GetAllMediaLibraryUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 404 {
return .empty
}
return .empty
}
private func handleGetRefreshLibraryMetadataResponse(response: Client.APIResponse) throws -> Operations.GetRefreshLibraryMetadataResponse { private func handleGetRefreshLibraryMetadataResponse(response: Client.APIResponse) throws -> Operations.GetRefreshLibraryMetadataResponse {
let httpResponse = response.httpResponse let httpResponse = response.httpResponse

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetAllMediaLibrary1: 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

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetAllMediaLibraryActiveDirection: 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

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetAllMediaLibraryDefaultDirection: 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

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetAllMediaLibraryHasThumbnail: 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

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetAllMediaLibraryLibraryOptimizedForStreaming: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return ""
}
}

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetAllMediaLibraryLibraryResponseType: 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

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetAllMediaLibraryLibraryType: 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

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetAllMediaLibraryOptimizedForStreaming: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return ""
}
}

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetAllMediaLibraryQueryParamIncludeMeta: 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

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetAllMediaLibraryQueryParamType: 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

@@ -0,0 +1,44 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetAllMediaLibraryRequest: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
switch format {
case .path:
return try serializePathParameterSerializable(self, with: format)
case .query:
return try serializeQueryParameterSerializable(self, with: format)
case .header, .multipart, .form:
throw SerializationError.invalidSerializationParameter(type: "Operations.GetAllMediaLibraryRequest", format: format.formatDescription)
}
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return try serializedQueryParameters(with: nil, formatOverride: format)
}
}
extension Operations.GetAllMediaLibraryRequest: PathParameterSerializable {
func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
return [
"sectionKey": try sectionKey.serialize(with: formatOverride ?? .path(explode: false)),
].compactMapValues { $0 }
}
}
extension Operations.GetAllMediaLibraryRequest: QueryParameterSerializable {
func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
let builder = QueryParameterBuilder()
try builder.addQueryParameters(from: type, named: "type", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: includeAdvanced, named: "includeAdvanced", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: includeCollections, named: "includeCollections", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: includeExternalMedia, named: "includeExternalMedia", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: includeGuids, named: "includeGuids", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: includeMeta, named: "includeMeta", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: xPlexContainerSize, named: "X-Plex-Container-Size", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: xPlexContainerStart, named: "X-Plex-Container-Start", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
return builder.build()
}
}

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetMediaMetaData1: 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

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetMediaMetaDataHasThumbnail: 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

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetMediaMetaDataLibrary1: 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

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetMediaMetaDataLibraryOptimizedForStreaming: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return ""
}
}

View File

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetMediaMetaDataOptimizedForStreaming: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return ""
}
}

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetSearchAllLibrariesQueryParamIncludeCollections: 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

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetSearchAllLibrariesQueryParamIncludeExternalMedia: 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

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.IncludeAdvanced: 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

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.One: 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

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.QueryParamIncludeGuids: 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

@@ -17,8 +17,8 @@ extension Operations {
public let mediaTagVersion: Int public let mediaTagVersion: Int
/// Specifies whether caching is disabled. /// Specifies whether caching is disabled.
public let nocache: Bool public let nocache: Bool
@DecimalSerialized /// Number of media items returned in this response.
public private(set) var size: Double public let size: Int
/// URL for the thumbnail image of the media container. /// URL for the thumbnail image of the media container.
public let thumb: String public let thumb: String
/// The primary title of the media container. /// The primary title of the media container.
@@ -40,6 +40,7 @@ extension Operations {
/// - Parameter mediaTagPrefix: The prefix used for media tag resource paths. /// - Parameter mediaTagPrefix: The prefix used for media tag resource paths.
/// - Parameter mediaTagVersion: The version number for media tags. /// - Parameter mediaTagVersion: The version number for media tags.
/// - Parameter nocache: Specifies whether caching is disabled. /// - Parameter nocache: Specifies whether caching is disabled.
/// - Parameter size: Number of media items returned in this response.
/// - Parameter thumb: URL for the thumbnail image of the media container. /// - Parameter thumb: URL for the thumbnail image of the media container.
/// - Parameter title1: The primary title of the media container. /// - Parameter title1: The primary title of the media container.
/// - Parameter title2: The secondary title of the media container. /// - Parameter title2: The secondary title of the media container.
@@ -47,14 +48,14 @@ extension Operations {
/// - Parameter viewMode: Identifier for the view mode. /// - Parameter viewMode: Identifier for the view mode.
/// - Parameter directory: An array of actor entries for media items. /// - Parameter directory: An array of actor entries for media items.
/// ///
public init(allowSync: Bool, art: String, identifier: String, mediaTagPrefix: String, mediaTagVersion: Int, nocache: Bool, size: Double, thumb: String, title1: String, title2: String, viewGroup: String, viewMode: String, directory: [Operations.GetActorsLibraryDirectory]? = nil) { public init(allowSync: Bool, art: String, identifier: String, mediaTagPrefix: String, mediaTagVersion: Int, nocache: Bool, size: Int, thumb: String, title1: String, title2: String, viewGroup: String, viewMode: String, directory: [Operations.GetActorsLibraryDirectory]? = nil) {
self.allowSync = allowSync self.allowSync = allowSync
self.art = art self.art = art
self.identifier = identifier self.identifier = identifier
self.mediaTagPrefix = mediaTagPrefix self.mediaTagPrefix = mediaTagPrefix
self.mediaTagVersion = mediaTagVersion self.mediaTagVersion = mediaTagVersion
self.nocache = nocache self.nocache = nocache
self._size = DecimalSerialized<Double>(wrappedValue: size) self.size = size
self.thumb = thumb self.thumb = thumb
self.title1 = title1 self.title1 = title1
self.title2 = title2 self.title2 = title2
@@ -80,44 +81,5 @@ extension Operations.GetActorsLibraryMediaContainer: Codable {
case viewMode case viewMode
case directory = "Directory" case directory = "Directory"
} }
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.allowSync = try container.decode(Bool.self, forKey: .allowSync)
self.art = try container.decode(String.self, forKey: .art)
self.identifier = try container.decode(String.self, forKey: .identifier)
self.mediaTagPrefix = try container.decode(String.self, forKey: .mediaTagPrefix)
self.mediaTagVersion = try container.decode(Int.self, forKey: .mediaTagVersion)
self.nocache = try container.decode(Bool.self, forKey: .nocache)
self._size = try container.decode(DecimalSerialized<Double>.self, forKey: .size)
self.thumb = try container.decode(String.self, forKey: .thumb)
self.title1 = try container.decode(String.self, forKey: .title1)
self.title2 = try container.decode(String.self, forKey: .title2)
self.viewGroup = try container.decode(String.self, forKey: .viewGroup)
self.viewMode = try container.decode(String.self, forKey: .viewMode)
self.directory = try container.decodeIfPresent([Operations.GetActorsLibraryDirectory].self, forKey: .directory)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self.allowSync, forKey: .allowSync)
try container.encode(self.art, forKey: .art)
try container.encode(self.identifier, forKey: .identifier)
try container.encode(self.mediaTagPrefix, forKey: .mediaTagPrefix)
try container.encode(self.mediaTagVersion, forKey: .mediaTagVersion)
try container.encode(self.nocache, forKey: .nocache)
try container.encode(self._size, forKey: .size)
try container.encode(self.thumb, forKey: .thumb)
try container.encode(self.title1, forKey: .title1)
try container.encode(self.title2, forKey: .title2)
try container.encode(self.viewGroup, forKey: .viewGroup)
try container.encode(self.viewMode, forKey: .viewMode)
try container.encodeIfPresent(self.directory, forKey: .directory)
}
} }
extension Operations.GetActorsLibraryMediaContainer {
var sizeWrapper: DecimalSerialized<Double> {
return _size
}
}

View File

@@ -0,0 +1,9 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
public enum GetAllMediaLibrary1: Int, Codable, APIValue {
case zero = 0
case one = 1
}}

View File

@@ -0,0 +1,11 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// The direction of the sort. Can be either `asc` or `desc`.
///
public enum GetAllMediaLibraryActiveDirection: String, Codable, APIValue {
case ascending = "asc"
case descending = "desc"
}}

View File

@@ -0,0 +1,23 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Bad Request - A parameter was not specified, or was specified incorrectly.
public struct GetAllMediaLibraryBadRequest {
public let errors: [Operations.GetAllMediaLibraryErrors]?
/// Creates a request model with the specified parameters
///
///
public init(errors: [Operations.GetAllMediaLibraryErrors]? = nil) {
self.errors = errors
}
}}
extension Operations.GetAllMediaLibraryBadRequest: Codable {
enum CodingKeys: String, CodingKey {
case errors
}
}

View File

@@ -0,0 +1,25 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibraryCollection {
/// The user-made collection this media item belongs to
public let tag: String
/// Creates an object with the specified parameters
///
/// - Parameter tag: The user-made collection this media item belongs to
///
public init(tag: String) {
self.tag = tag
}
}}
extension Operations.GetAllMediaLibraryCollection: Codable {
enum CodingKeys: String, CodingKey {
case tag
}
}

View File

@@ -0,0 +1,25 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibraryCountry {
/// The country of origin of this media item
public let tag: String
/// Creates an object with the specified parameters
///
/// - Parameter tag: The country of origin of this media item
///
public init(tag: String) {
self.tag = tag
}
}}
extension Operations.GetAllMediaLibraryCountry: Codable {
enum CodingKeys: String, CodingKey {
case tag
}
}

View File

@@ -0,0 +1,11 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// The direction of the sort. Can be either `asc` or `desc`.
///
public enum GetAllMediaLibraryDefaultDirection: String, Codable, APIValue {
case ascending = "asc"
case descending = "desc"
}}

View File

@@ -0,0 +1,25 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibraryDirector {
/// The role of Director
public let tag: String
/// Creates an object with the specified parameters
///
/// - Parameter tag: The role of Director
///
public init(tag: String) {
self.tag = tag
}
}}
extension Operations.GetAllMediaLibraryDirector: Codable {
enum CodingKeys: String, CodingKey {
case tag
}
}

View File

@@ -0,0 +1,29 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibraryErrors {
public let code: Int?
public let message: String?
public let status: Int?
/// Creates an object with the specified parameters
///
///
public init(code: Int? = nil, message: String? = nil, status: Int? = nil) {
self.code = code
self.message = message
self.status = status
}
}}
extension Operations.GetAllMediaLibraryErrors: Codable {
enum CodingKeys: String, CodingKey {
case code
case message
case status
}
}

View File

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

View File

@@ -0,0 +1,26 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibraryFieldType {
public let `operator`: [Operations.GetAllMediaLibraryOperator]
public let type: String
/// Creates an object with the specified parameters
///
///
public init(`operator`: [Operations.GetAllMediaLibraryOperator], type: String) {
self.`operator` = `operator`
self.type = type
}
}}
extension Operations.GetAllMediaLibraryFieldType: Codable {
enum CodingKeys: String, CodingKey {
case `operator` = "Operator"
case type
}
}

View File

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

View File

@@ -0,0 +1,25 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibraryGenre {
/// The country of origin of this media item
public let tag: String
/// Creates an object with the specified parameters
///
/// - Parameter tag: The country of origin of this media item
///
public init(tag: String) {
self.tag = tag
}
}}
extension Operations.GetAllMediaLibraryGenre: Codable {
enum CodingKeys: String, CodingKey {
case tag
}
}

View File

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Indicates if the part has a thumbnail.
public enum GetAllMediaLibraryHasThumbnail: String, Codable, APIValue {
case `false` = "0"
case `true` = "1"
}}

View File

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

View File

@@ -0,0 +1,29 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibraryLibraryErrors {
public let code: Int?
public let message: String?
public let status: Int?
/// Creates an object with the specified parameters
///
///
public init(code: Int? = nil, message: String? = nil, status: Int? = nil) {
self.code = code
self.message = message
self.status = status
}
}}
extension Operations.GetAllMediaLibraryLibraryErrors: Codable {
enum CodingKeys: String, CodingKey {
case code
case message
case status
}
}

View File

@@ -0,0 +1,32 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
public enum GetAllMediaLibraryLibraryOptimizedForStreaming {
case getAllMediaLibrary1(Operations.GetAllMediaLibrary1)
case bool(Bool)
}}
extension Operations.GetAllMediaLibraryLibraryOptimizedForStreaming: Codable {
public init(from decoder: Decoder) throws {
if let value = try? Operations.GetAllMediaLibrary1(from: decoder) {
self = .getAllMediaLibrary1(value)
} else if let value = try? Bool(from: decoder) {
self = .bool(value)
} else {
throw PlexswiftError.failedToHandleResponse(.failedToDecodeResponse)
}
}
public func encode(to encoder: Encoder) throws {
switch self {
case .getAllMediaLibrary1(let value):
try value.encode(to: encoder)
case .bool(let value):
try value.encode(to: encoder)
}
}
}

View File

@@ -0,0 +1,11 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
public enum GetAllMediaLibraryLibraryResponseType: String, Codable, APIValue {
case coverPoster = "coverPoster"
case background = "background"
case snapshot = "snapshot"
case clearLogo = "clearLogo"
}}

View File

@@ -0,0 +1,15 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// The type of media content
///
public enum GetAllMediaLibraryLibraryType: String, Codable, APIValue {
case movie = "movie"
case tvShow = "show"
case season = "season"
case episode = "episode"
case artist = "artist"
case album = "album"
}}

View File

@@ -0,0 +1,167 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibraryMedia {
/// Indicates whether voice activity is detected.
public let hasVoiceActivity: Bool
/// Unique media identifier.
public let id: Int
/// An array of parts for this media item.
public let part: [Operations.GetAllMediaLibraryPart]
/// Aspect ratio of the video.
@DecimalSerialized
public private(set) var aspectRatio: Double?
/// Number of audio channels.
public let audioChannels: Int?
/// Audio codec used.
public let audioCodec: String?
/// The audio profile used for the media (e.g., DTS, Dolby Digital, etc.).
public let audioProfile: String?
/// Bitrate in bits per second.
public let bitrate: Int?
/// File container type.
public let container: String?
public let displayOffset: Int?
/// Duration of the media in milliseconds.
public let duration: Int?
public let has64bitOffsets: Bool?
/// Video height in pixels.
public let height: Int?
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
public let optimizedForStreaming: Operations.GetAllMediaLibraryOptimizedForStreaming?
/// Video codec used.
public let videoCodec: String?
/// Frame rate of the video. Values found include NTSC, PAL, 24p
///
public let videoFrameRate: String?
/// Video profile (e.g., main 10).
public let videoProfile: String?
/// Video resolution (e.g., 4k).
public let videoResolution: String?
/// Video width in pixels.
public let width: Int?
/// Creates an object with the specified parameters
///
/// - Parameter hasVoiceActivity: Indicates whether voice activity is detected.
/// - Parameter id: Unique media identifier.
/// - Parameter part: An array of parts for this media item.
/// - Parameter aspectRatio: Aspect ratio of the video.
/// - Parameter audioChannels: Number of audio channels.
/// - Parameter audioCodec: Audio codec used.
/// - Parameter audioProfile: The audio profile used for the media (e.g., DTS, Dolby Digital, etc.).
/// - Parameter bitrate: Bitrate in bits per second.
/// - Parameter container: File container type.
/// - Parameter duration: Duration of the media in milliseconds.
/// - Parameter height: Video height in pixels.
/// - Parameter optimizedForStreaming: Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
/// - Parameter videoCodec: Video codec used.
/// - Parameter videoFrameRate: Frame rate of the video. Values found include NTSC, PAL, 24p
///
/// - Parameter videoProfile: Video profile (e.g., main 10).
/// - Parameter videoResolution: Video resolution (e.g., 4k).
/// - Parameter width: Video width in pixels.
///
public init(hasVoiceActivity: Bool, id: Int, part: [Operations.GetAllMediaLibraryPart], aspectRatio: Double? = nil, audioChannels: Int? = nil, audioCodec: String? = nil, audioProfile: String? = nil, bitrate: Int? = nil, container: String? = nil, displayOffset: Int? = nil, duration: Int? = nil, has64bitOffsets: Bool? = nil, height: Int? = nil, optimizedForStreaming: Operations.GetAllMediaLibraryOptimizedForStreaming? = nil, videoCodec: String? = nil, videoFrameRate: String? = nil, videoProfile: String? = nil, videoResolution: String? = nil, width: Int? = nil) {
self.hasVoiceActivity = hasVoiceActivity
self.id = id
self.part = part
self._aspectRatio = DecimalSerialized<Double?>(wrappedValue: aspectRatio)
self.audioChannels = audioChannels
self.audioCodec = audioCodec
self.audioProfile = audioProfile
self.bitrate = bitrate
self.container = container
self.displayOffset = displayOffset
self.duration = duration
self.has64bitOffsets = has64bitOffsets
self.height = height
self.optimizedForStreaming = optimizedForStreaming
self.videoCodec = videoCodec
self.videoFrameRate = videoFrameRate
self.videoProfile = videoProfile
self.videoResolution = videoResolution
self.width = width
}
}}
extension Operations.GetAllMediaLibraryMedia: Codable {
enum CodingKeys: String, CodingKey {
case hasVoiceActivity
case id
case part = "Part"
case aspectRatio
case audioChannels
case audioCodec
case audioProfile
case bitrate
case container
case displayOffset
case duration
case has64bitOffsets
case height
case optimizedForStreaming
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.hasVoiceActivity = try container.decode(Bool.self, forKey: .hasVoiceActivity)
self.id = try container.decode(Int.self, forKey: .id)
self.part = try container.decode([Operations.GetAllMediaLibraryPart].self, forKey: .part)
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.audioProfile = try container.decodeIfPresent(String.self, forKey: .audioProfile)
self.bitrate = try container.decodeIfPresent(Int.self, forKey: .bitrate)
self.container = try container.decodeIfPresent(String.self, forKey: .container)
self.displayOffset = try container.decodeIfPresent(Int.self, forKey: .displayOffset)
self.duration = try container.decodeIfPresent(Int.self, forKey: .duration)
self.has64bitOffsets = try container.decodeIfPresent(Bool.self, forKey: .has64bitOffsets)
self.height = try container.decodeIfPresent(Int.self, forKey: .height)
self.optimizedForStreaming = try container.decodeIfPresent(Operations.GetAllMediaLibraryOptimizedForStreaming.self, forKey: .optimizedForStreaming)
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)
try container.encode(self.hasVoiceActivity, forKey: .hasVoiceActivity)
try container.encode(self.id, forKey: .id)
try container.encode(self.part, forKey: .part)
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.audioProfile, forKey: .audioProfile)
try container.encodeIfPresent(self.bitrate, forKey: .bitrate)
try container.encodeIfPresent(self.container, forKey: .container)
try container.encodeIfPresent(self.displayOffset, forKey: .displayOffset)
try container.encodeIfPresent(self.duration, forKey: .duration)
try container.encodeIfPresent(self.has64bitOffsets, forKey: .has64bitOffsets)
try container.encodeIfPresent(self.height, forKey: .height)
try container.encodeIfPresent(self.optimizedForStreaming, forKey: .optimizedForStreaming)
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.GetAllMediaLibraryMedia {
var aspectRatioWrapper: DecimalSerialized<Double?> {
return _aspectRatio
}
}

View File

@@ -0,0 +1,117 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibraryMediaContainer {
/// Indicates whether syncing is allowed.
public let allowSync: Bool
/// URL for the background artwork of the media container.
public let art: String
/// The content type or mode.
public let content: String
/// An plugin identifier for the media container.
public let identifier: String
/// The unique identifier for the library section.
public let librarySectionID: Int
/// The title of the library section.
public let librarySectionTitle: String
/// The prefix used for media tag resource paths.
public let mediaTagPrefix: String
/// The version number for media tags.
public let mediaTagVersion: Int
/// Specifies whether caching is disabled.
public let nocache: Bool
/// Offset value for pagination.
public let offset: Int
/// Number of media items returned in this response.
public let size: Int
/// URL for the thumbnail image of the media container.
public let thumb: String
/// The primary title of the media container.
public let title1: String
/// The secondary title of the media container.
public let title2: String
/// Total number of media items in the library.
public let totalSize: Int
/// Identifier for the view group layout.
public let viewGroup: String
/// The universally unique identifier for the library section.
public let librarySectionUUID: String?
/// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
///
public let meta: Operations.GetAllMediaLibraryMeta?
/// An array of metadata items.
public let metadata: [Operations.GetAllMediaLibraryMetadata]?
/// Creates an object with the specified parameters
///
/// - Parameter allowSync: Indicates whether syncing is allowed.
/// - Parameter art: URL for the background artwork of the media container.
/// - Parameter content: The content type or mode.
/// - Parameter identifier: An plugin identifier for the media container.
/// - Parameter librarySectionID: The unique identifier for the library section.
/// - Parameter librarySectionTitle: The title of the library section.
/// - Parameter mediaTagPrefix: The prefix used for media tag resource paths.
/// - Parameter mediaTagVersion: The version number for media tags.
/// - Parameter nocache: Specifies whether caching is disabled.
/// - Parameter offset: Offset value for pagination.
/// - Parameter size: Number of media items returned in this response.
/// - Parameter thumb: URL for the thumbnail image of the media container.
/// - Parameter title1: The primary title of the media container.
/// - Parameter title2: The secondary title of the media container.
/// - Parameter totalSize: Total number of media items in the library.
/// - Parameter viewGroup: Identifier for the view group layout.
/// - Parameter librarySectionUUID: The universally unique identifier for the library section.
/// - Parameter meta: The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
///
/// - Parameter metadata: An array of metadata items.
///
public init(allowSync: Bool, art: String, content: String, identifier: String, librarySectionID: Int, librarySectionTitle: String, mediaTagPrefix: String, mediaTagVersion: Int, nocache: Bool, offset: Int, size: Int, thumb: String, title1: String, title2: String, totalSize: Int, viewGroup: String, librarySectionUUID: String? = nil, meta: Operations.GetAllMediaLibraryMeta? = nil, metadata: [Operations.GetAllMediaLibraryMetadata]? = nil) {
self.allowSync = allowSync
self.art = art
self.content = content
self.identifier = identifier
self.librarySectionID = librarySectionID
self.librarySectionTitle = librarySectionTitle
self.mediaTagPrefix = mediaTagPrefix
self.mediaTagVersion = mediaTagVersion
self.nocache = nocache
self.offset = offset
self.size = size
self.thumb = thumb
self.title1 = title1
self.title2 = title2
self.totalSize = totalSize
self.viewGroup = viewGroup
self.librarySectionUUID = librarySectionUUID
self.meta = meta
self.metadata = metadata
}
}}
extension Operations.GetAllMediaLibraryMediaContainer: Codable {
enum CodingKeys: String, CodingKey {
case allowSync
case art
case content
case identifier
case librarySectionID
case librarySectionTitle
case mediaTagPrefix
case mediaTagVersion
case nocache
case offset
case size
case thumb
case title1
case title2
case totalSize
case viewGroup
case librarySectionUUID
case meta = "Meta"
case metadata = "Metadata"
}
}

View File

@@ -0,0 +1,27 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
///
public struct GetAllMediaLibraryMeta {
public let fieldType: [Operations.GetAllMediaLibraryFieldType]?
public let type: [Operations.GetAllMediaLibraryType]?
/// Creates an object with the specified parameters
///
///
public init(fieldType: [Operations.GetAllMediaLibraryFieldType]? = nil, type: [Operations.GetAllMediaLibraryType]? = nil) {
self.fieldType = fieldType
self.type = type
}
}}
extension Operations.GetAllMediaLibraryMeta: Codable {
enum CodingKeys: String, CodingKey {
case fieldType = "FieldType"
case type = "Type"
}
}

View File

@@ -0,0 +1,473 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Unknown
///
public struct GetAllMediaLibraryMetadata {
public let addedAt: Int
/// The art image URL for the media item.
public let art: String
/// The audience rating for the media item.
@DecimalSerialized
public private(set) var audienceRating: Double
/// The number of child items associated with this media item.
public let childCount: Int
/// The duration of the media item in milliseconds.
public let duration: Int
/// The globally unique identifier for the media item.
public let guid: String
/// The index position of the media item.
public let index: Int
/// The unique key for the media item.
public let key: String
/// The original release date of the media item.
@DateOnly
public private(set) var originallyAvailableAt: Date
/// The critic rating for the media item.
@DecimalSerialized
public private(set) var rating: Double
/// The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API.
public let ratingKey: String
/// The total number of seasons (for TV shows).
public let seasonCount: Int
/// A URLfriendly version of the media title.
public let slug: String
/// A synopsis of the media item.
public let summary: String
/// A brief tagline for the media item.
public let tagline: String
/// The theme URL for the media item.
public let theme: String
/// The thumbnail image URL for the media item.
public let thumb: String
/// The title of the media item.
public let title: String
/// The sort title used for ordering media items.
public let titleSort: String
public let type: Operations.GetAllMediaLibraryLibraryType
/// The release year of the media item.
public let year: Int
/// The URL for the audience rating image.
public let audienceRatingImage: String?
/// The source from which chapter data is derived.
public let chapterSource: String?
public let collection: [Operations.GetAllMediaLibraryCollection]?
/// The content rating for the media item.
public let contentRating: String?
public let country: [Operations.GetAllMediaLibraryCountry]?
/// The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available).
public let createdAtAccuracy: String?
/// The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC.
public let createdAtTZOffset: String?
public let director: [Operations.GetAllMediaLibraryDirector]?
public let genre: [Operations.GetAllMediaLibraryGenre]?
/// The art URL for the grandparent media item.
public let grandparentArt: String?
/// The GUID of the grandparent media item.
public let grandparentGuid: String?
/// The key of the grandparent media item.
public let grandparentKey: String?
/// The rating key of the grandparent media item.
public let grandparentRatingKey: String?
/// The slug for the grandparent media item.
public let grandparentSlug: String?
/// The theme URL for the grandparent media item.
public let grandparentTheme: String?
/// The thumbnail URL for the grandparent media item.
public let grandparentThumb: String?
/// The title of the grandparent media item.
public let grandparentTitle: String?
public let guids: [Operations.Guids]?
public let image: [Operations.GetAllMediaLibraryImage]?
/// The Unix timestamp representing the last time the item was rated.
public let lastRatedAt: Int?
/// Unix timestamp for when the media item was last viewed.
public let lastViewedAt: Int?
/// The number of leaf items (end nodes) under this media item.
public let leafCount: Int?
public let media: [Operations.GetAllMediaLibraryMedia]?
/// The original title of the media item (if different).
public let originalTitle: String?
/// The GUID of the parent media item.
public let parentGuid: String?
/// The index position of the parent media item.
public let parentIndex: Int?
/// The key of the parent media item.
public let parentKey: String?
/// The rating key of the parent media item.
public let parentRatingKey: String?
/// The thumbnail URL for the parent media item.
public let parentThumb: String?
/// The title of the parent media item.
public let parentTitle: String?
/// The primary extra key associated with this media item.
public let primaryExtraKey: String?
/// The URL for the rating image.
public let ratingImage: String?
public let role: [Operations.GetAllMediaLibraryRole]?
/// The number of times this media item has been skipped.
public let skipCount: Int?
/// The studio that produced the media item.
public let studio: String?
/// A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip.
public let subtype: String?
public let ultraBlurColors: Operations.GetAllMediaLibraryUltraBlurColors?
/// Unix epoch datetime in seconds
public let updatedAt: Int?
/// The rating provided by a user for the item. This value is expressed as a decimal number.
@DecimalSerialized
public private(set) var userRating: Double?
/// The number of times this media item has been viewed.
public let viewCount: Int?
/// The number of leaf items that have been viewed.
public let viewedLeafCount: Int?
/// The current playback offset (in milliseconds).
public let viewOffset: Int?
public let writer: [Operations.GetAllMediaLibraryWriter]?
/// Creates an object with the specified parameters
///
/// - Parameter art: The art image URL for the media item.
/// - Parameter audienceRating: The audience rating for the media item.
/// - Parameter childCount: The number of child items associated with this media item.
/// - Parameter duration: The duration of the media item in milliseconds.
/// - Parameter guid: The globally unique identifier for the media item.
/// - Parameter index: The index position of the media item.
/// - Parameter key: The unique key for the media item.
/// - Parameter originallyAvailableAt: The original release date of the media item.
/// - Parameter rating: The critic rating for the media item.
/// - Parameter ratingKey: The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API.
/// - Parameter seasonCount: The total number of seasons (for TV shows).
/// - Parameter slug: A URLfriendly version of the media title.
/// - Parameter summary: A synopsis of the media item.
/// - Parameter tagline: A brief tagline for the media item.
/// - Parameter theme: The theme URL for the media item.
/// - Parameter thumb: The thumbnail image URL for the media item.
/// - Parameter title: The title of the media item.
/// - Parameter titleSort: The sort title used for ordering media items.
/// - Parameter year: The release year of the media item.
/// - Parameter audienceRatingImage: The URL for the audience rating image.
/// - Parameter chapterSource: The source from which chapter data is derived.
/// - Parameter contentRating: The content rating for the media item.
/// - Parameter createdAtAccuracy: The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available).
/// - Parameter createdAtTZOffset: The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC.
/// - Parameter grandparentArt: The art URL for the grandparent media item.
/// - Parameter grandparentGuid: The GUID of the grandparent media item.
/// - Parameter grandparentKey: The key of the grandparent media item.
/// - Parameter grandparentRatingKey: The rating key of the grandparent media item.
/// - Parameter grandparentSlug: The slug for the grandparent media item.
/// - Parameter grandparentTheme: The theme URL for the grandparent media item.
/// - Parameter grandparentThumb: The thumbnail URL for the grandparent media item.
/// - Parameter grandparentTitle: The title of the grandparent media item.
/// - Parameter lastRatedAt: The Unix timestamp representing the last time the item was rated.
/// - Parameter lastViewedAt: Unix timestamp for when the media item was last viewed.
/// - Parameter leafCount: The number of leaf items (end nodes) under this media item.
/// - Parameter originalTitle: The original title of the media item (if different).
/// - Parameter parentGuid: The GUID of the parent media item.
/// - Parameter parentIndex: The index position of the parent media item.
/// - Parameter parentKey: The key of the parent media item.
/// - Parameter parentRatingKey: The rating key of the parent media item.
/// - Parameter parentThumb: The thumbnail URL for the parent media item.
/// - Parameter parentTitle: The title of the parent media item.
/// - Parameter primaryExtraKey: The primary extra key associated with this media item.
/// - Parameter ratingImage: The URL for the rating image.
/// - Parameter skipCount: The number of times this media item has been skipped.
/// - Parameter studio: The studio that produced the media item.
/// - Parameter subtype: A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip.
/// - Parameter updatedAt: Unix epoch datetime in seconds
/// - Parameter userRating: The rating provided by a user for the item. This value is expressed as a decimal number.
/// - Parameter viewCount: The number of times this media item has been viewed.
/// - Parameter viewedLeafCount: The number of leaf items that have been viewed.
/// - Parameter viewOffset: The current playback offset (in milliseconds).
///
public init(addedAt: Int, art: String, audienceRating: Double, childCount: Int, duration: Int, guid: String, index: Int, key: String, originallyAvailableAt: Date, rating: Double, ratingKey: String, seasonCount: Int, slug: String, summary: String, tagline: String, theme: String, thumb: String, title: String, titleSort: String, type: Operations.GetAllMediaLibraryLibraryType, year: Int, audienceRatingImage: String? = nil, chapterSource: String? = nil, collection: [Operations.GetAllMediaLibraryCollection]? = nil, contentRating: String? = nil, country: [Operations.GetAllMediaLibraryCountry]? = nil, createdAtAccuracy: String? = nil, createdAtTZOffset: String? = nil, director: [Operations.GetAllMediaLibraryDirector]? = nil, genre: [Operations.GetAllMediaLibraryGenre]? = nil, grandparentArt: String? = nil, grandparentGuid: String? = nil, grandparentKey: String? = nil, grandparentRatingKey: String? = nil, grandparentSlug: String? = nil, grandparentTheme: String? = nil, grandparentThumb: String? = nil, grandparentTitle: String? = nil, guids: [Operations.Guids]? = nil, image: [Operations.GetAllMediaLibraryImage]? = nil, lastRatedAt: Int? = nil, lastViewedAt: Int? = nil, leafCount: Int? = nil, media: [Operations.GetAllMediaLibraryMedia]? = nil, originalTitle: String? = nil, parentGuid: String? = nil, parentIndex: Int? = nil, parentKey: String? = nil, parentRatingKey: String? = nil, parentThumb: String? = nil, parentTitle: String? = nil, primaryExtraKey: String? = nil, ratingImage: String? = nil, role: [Operations.GetAllMediaLibraryRole]? = nil, skipCount: Int? = nil, studio: String? = nil, subtype: String? = nil, ultraBlurColors: Operations.GetAllMediaLibraryUltraBlurColors? = nil, updatedAt: Int? = nil, userRating: Double? = nil, viewCount: Int? = nil, viewedLeafCount: Int? = nil, viewOffset: Int? = nil, writer: [Operations.GetAllMediaLibraryWriter]? = nil) {
self.addedAt = addedAt
self.art = art
self._audienceRating = DecimalSerialized<Double>(wrappedValue: audienceRating)
self.childCount = childCount
self.duration = duration
self.guid = guid
self.index = index
self.key = key
self._originallyAvailableAt = DateOnly<Date>(wrappedValue: originallyAvailableAt)
self._rating = DecimalSerialized<Double>(wrappedValue: rating)
self.ratingKey = ratingKey
self.seasonCount = seasonCount
self.slug = slug
self.summary = summary
self.tagline = tagline
self.theme = theme
self.thumb = thumb
self.title = title
self.titleSort = titleSort
self.type = type
self.year = year
self.audienceRatingImage = audienceRatingImage
self.chapterSource = chapterSource
self.collection = collection
self.contentRating = contentRating
self.country = country
self.createdAtAccuracy = createdAtAccuracy
self.createdAtTZOffset = createdAtTZOffset
self.director = director
self.genre = genre
self.grandparentArt = grandparentArt
self.grandparentGuid = grandparentGuid
self.grandparentKey = grandparentKey
self.grandparentRatingKey = grandparentRatingKey
self.grandparentSlug = grandparentSlug
self.grandparentTheme = grandparentTheme
self.grandparentThumb = grandparentThumb
self.grandparentTitle = grandparentTitle
self.guids = guids
self.image = image
self.lastRatedAt = lastRatedAt
self.lastViewedAt = lastViewedAt
self.leafCount = leafCount
self.media = media
self.originalTitle = originalTitle
self.parentGuid = parentGuid
self.parentIndex = parentIndex
self.parentKey = parentKey
self.parentRatingKey = parentRatingKey
self.parentThumb = parentThumb
self.parentTitle = parentTitle
self.primaryExtraKey = primaryExtraKey
self.ratingImage = ratingImage
self.role = role
self.skipCount = skipCount
self.studio = studio
self.subtype = subtype
self.ultraBlurColors = ultraBlurColors
self.updatedAt = updatedAt
self._userRating = DecimalSerialized<Double?>(wrappedValue: userRating)
self.viewCount = viewCount
self.viewedLeafCount = viewedLeafCount
self.viewOffset = viewOffset
self.writer = writer
}
}}
extension Operations.GetAllMediaLibraryMetadata: Codable {
enum CodingKeys: String, CodingKey {
case addedAt
case art
case audienceRating
case childCount
case duration
case guid
case index
case key
case originallyAvailableAt
case rating
case ratingKey
case seasonCount
case slug
case summary
case tagline
case theme
case thumb
case title
case titleSort
case type
case year
case audienceRatingImage
case chapterSource
case collection = "Collection"
case contentRating
case country = "Country"
case createdAtAccuracy
case createdAtTZOffset
case director = "Director"
case genre = "Genre"
case grandparentArt
case grandparentGuid
case grandparentKey
case grandparentRatingKey
case grandparentSlug
case grandparentTheme
case grandparentThumb
case grandparentTitle
case guids = "Guid"
case image = "Image"
case lastRatedAt
case lastViewedAt
case leafCount
case media = "Media"
case originalTitle
case parentGuid
case parentIndex
case parentKey
case parentRatingKey
case parentThumb
case parentTitle
case primaryExtraKey
case ratingImage
case role = "Role"
case skipCount
case studio
case subtype
case ultraBlurColors = "UltraBlurColors"
case updatedAt
case userRating
case viewCount
case viewedLeafCount
case viewOffset
case writer = "Writer"
}
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.addedAt = try container.decode(Int.self, forKey: .addedAt)
self.art = try container.decode(String.self, forKey: .art)
self._audienceRating = try container.decode(DecimalSerialized<Double>.self, forKey: .audienceRating)
self.childCount = try container.decode(Int.self, forKey: .childCount)
self.duration = try container.decode(Int.self, forKey: .duration)
self.guid = try container.decode(String.self, forKey: .guid)
self.index = try container.decode(Int.self, forKey: .index)
self.key = try container.decode(String.self, forKey: .key)
self._originallyAvailableAt = try container.decode(DateOnly<Date>.self, forKey: .originallyAvailableAt)
self._rating = try container.decode(DecimalSerialized<Double>.self, forKey: .rating)
self.ratingKey = try container.decode(String.self, forKey: .ratingKey)
self.seasonCount = try container.decode(Int.self, forKey: .seasonCount)
self.slug = try container.decode(String.self, forKey: .slug)
self.summary = try container.decode(String.self, forKey: .summary)
self.tagline = try container.decode(String.self, forKey: .tagline)
self.theme = try container.decode(String.self, forKey: .theme)
self.thumb = try container.decode(String.self, forKey: .thumb)
self.title = try container.decode(String.self, forKey: .title)
self.titleSort = try container.decode(String.self, forKey: .titleSort)
self.type = try container.decode(Operations.GetAllMediaLibraryLibraryType.self, forKey: .type)
self.year = try container.decode(Int.self, forKey: .year)
self.audienceRatingImage = try container.decodeIfPresent(String.self, forKey: .audienceRatingImage)
self.chapterSource = try container.decodeIfPresent(String.self, forKey: .chapterSource)
self.collection = try container.decodeIfPresent([Operations.GetAllMediaLibraryCollection].self, forKey: .collection)
self.contentRating = try container.decodeIfPresent(String.self, forKey: .contentRating)
self.country = try container.decodeIfPresent([Operations.GetAllMediaLibraryCountry].self, forKey: .country)
self.createdAtAccuracy = try container.decodeIfPresent(String.self, forKey: .createdAtAccuracy)
self.createdAtTZOffset = try container.decodeIfPresent(String.self, forKey: .createdAtTZOffset)
self.director = try container.decodeIfPresent([Operations.GetAllMediaLibraryDirector].self, forKey: .director)
self.genre = try container.decodeIfPresent([Operations.GetAllMediaLibraryGenre].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.grandparentSlug = try container.decodeIfPresent(String.self, forKey: .grandparentSlug)
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.guids = try container.decodeIfPresent([Operations.Guids].self, forKey: .guids)
self.image = try container.decodeIfPresent([Operations.GetAllMediaLibraryImage].self, forKey: .image)
self.lastRatedAt = try container.decodeIfPresent(Int.self, forKey: .lastRatedAt)
self.lastViewedAt = try container.decodeIfPresent(Int.self, forKey: .lastViewedAt)
self.leafCount = try container.decodeIfPresent(Int.self, forKey: .leafCount)
self.media = try container.decodeIfPresent([Operations.GetAllMediaLibraryMedia].self, forKey: .media)
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.parentThumb = try container.decodeIfPresent(String.self, forKey: .parentThumb)
self.parentTitle = try container.decodeIfPresent(String.self, forKey: .parentTitle)
self.primaryExtraKey = try container.decodeIfPresent(String.self, forKey: .primaryExtraKey)
self.ratingImage = try container.decodeIfPresent(String.self, forKey: .ratingImage)
self.role = try container.decodeIfPresent([Operations.GetAllMediaLibraryRole].self, forKey: .role)
self.skipCount = try container.decodeIfPresent(Int.self, forKey: .skipCount)
self.studio = try container.decodeIfPresent(String.self, forKey: .studio)
self.subtype = try container.decodeIfPresent(String.self, forKey: .subtype)
self.ultraBlurColors = try container.decodeIfPresent(Operations.GetAllMediaLibraryUltraBlurColors.self, forKey: .ultraBlurColors)
self.updatedAt = try container.decodeIfPresent(Int.self, forKey: .updatedAt)
self._userRating = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .userRating) ?? DecimalSerialized<Double?>(wrappedValue: nil)
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.GetAllMediaLibraryWriter].self, forKey: .writer)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self.addedAt, forKey: .addedAt)
try container.encode(self.art, forKey: .art)
try container.encode(self._audienceRating, forKey: .audienceRating)
try container.encode(self.childCount, forKey: .childCount)
try container.encode(self.duration, forKey: .duration)
try container.encode(self.guid, forKey: .guid)
try container.encode(self.index, forKey: .index)
try container.encode(self.key, forKey: .key)
try container.encode(self._originallyAvailableAt, forKey: .originallyAvailableAt)
try container.encode(self._rating, forKey: .rating)
try container.encode(self.ratingKey, forKey: .ratingKey)
try container.encode(self.seasonCount, forKey: .seasonCount)
try container.encode(self.slug, forKey: .slug)
try container.encode(self.summary, forKey: .summary)
try container.encode(self.tagline, forKey: .tagline)
try container.encode(self.theme, forKey: .theme)
try container.encode(self.thumb, forKey: .thumb)
try container.encode(self.title, forKey: .title)
try container.encode(self.titleSort, forKey: .titleSort)
try container.encode(self.type, forKey: .type)
try container.encode(self.year, forKey: .year)
try container.encodeIfPresent(self.audienceRatingImage, forKey: .audienceRatingImage)
try container.encodeIfPresent(self.chapterSource, forKey: .chapterSource)
try container.encodeIfPresent(self.collection, forKey: .collection)
try container.encodeIfPresent(self.contentRating, forKey: .contentRating)
try container.encodeIfPresent(self.country, forKey: .country)
try container.encodeIfPresent(self.createdAtAccuracy, forKey: .createdAtAccuracy)
try container.encodeIfPresent(self.createdAtTZOffset, forKey: .createdAtTZOffset)
try container.encodeIfPresent(self.director, forKey: .director)
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.grandparentSlug, forKey: .grandparentSlug)
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.guids, forKey: .guids)
try container.encodeIfPresent(self.image, forKey: .image)
try container.encodeIfPresent(self.lastRatedAt, forKey: .lastRatedAt)
try container.encodeIfPresent(self.lastViewedAt, forKey: .lastViewedAt)
try container.encodeIfPresent(self.leafCount, forKey: .leafCount)
try container.encodeIfPresent(self.media, forKey: .media)
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.parentThumb, forKey: .parentThumb)
try container.encodeIfPresent(self.parentTitle, forKey: .parentTitle)
try container.encodeIfPresent(self.primaryExtraKey, forKey: .primaryExtraKey)
try container.encodeIfPresent(self.ratingImage, forKey: .ratingImage)
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.subtype, forKey: .subtype)
try container.encodeIfPresent(self.ultraBlurColors, forKey: .ultraBlurColors)
try container.encodeIfPresent(self.updatedAt, forKey: .updatedAt)
if self.userRating != nil {
try container.encode(self._userRating, forKey: .userRating)
}
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)
}
}
extension Operations.GetAllMediaLibraryMetadata {
var ratingWrapper: DecimalSerialized<Double> {
return _rating
}
var audienceRatingWrapper: DecimalSerialized<Double> {
return _audienceRating
}
var originallyAvailableAtWrapper: DateOnly<Date> {
return _originallyAvailableAt
}
var userRatingWrapper: DecimalSerialized<Double?> {
return _userRating
}
}

View File

@@ -0,0 +1,26 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibraryOperator {
public let key: String
public let title: String
/// Creates an object with the specified parameters
///
///
public init(key: String, title: String) {
self.key = key
self.title = title
}
}}
extension Operations.GetAllMediaLibraryOperator: Codable {
enum CodingKeys: String, CodingKey {
case key
case title
}
}

View File

@@ -0,0 +1,32 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
public enum GetAllMediaLibraryOptimizedForStreaming {
case one(Operations.One)
case bool(Bool)
}}
extension Operations.GetAllMediaLibraryOptimizedForStreaming: Codable {
public init(from decoder: Decoder) throws {
if let value = try? Operations.One(from: decoder) {
self = .one(value)
} else if let value = try? Bool(from: decoder) {
self = .bool(value)
} else {
throw PlexswiftError.failedToHandleResponse(.failedToDecodeResponse)
}
}
public func encode(to encoder: Encoder) throws {
switch self {
case .one(let value):
try value.encode(to: encoder)
case .bool(let value):
try value.encode(to: encoder)
}
}
}

View File

@@ -0,0 +1,92 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibraryPart {
/// File path for the part.
public let file: String
/// Unique part identifier.
public let id: Int
/// Key to access this part.
public let key: String
/// File size in bytes.
public let size: Int
/// Indicates if the part is accessible.
public let accessible: Bool?
/// The audio profile used for the media (e.g., DTS, Dolby Digital, etc.).
public let audioProfile: String?
/// Container format of the part.
public let container: String?
/// Duration of the part in milliseconds.
public let duration: Int?
/// Indicates if the part exists.
public let exists: Bool?
public let has64bitOffsets: Bool?
public let hasThumbnail: Operations.GetAllMediaLibraryHasThumbnail?
public let indexes: String?
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
public let optimizedForStreaming: Operations.GetAllMediaLibraryLibraryOptimizedForStreaming?
public let packetLength: Int?
/// An array of streams for this part.
public let stream: [Operations.GetAllMediaLibraryStream]?
/// Video profile for the part.
public let videoProfile: String?
/// Creates an object with the specified parameters
///
/// - Parameter file: File path for the part.
/// - Parameter id: Unique part identifier.
/// - Parameter key: Key to access this part.
/// - Parameter size: File size in bytes.
/// - Parameter accessible: Indicates if the part is accessible.
/// - Parameter audioProfile: The audio profile used for the media (e.g., DTS, Dolby Digital, etc.).
/// - Parameter container: Container format of the part.
/// - Parameter duration: Duration of the part in milliseconds.
/// - Parameter exists: Indicates if the part exists.
/// - Parameter optimizedForStreaming: Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
/// - Parameter stream: An array of streams for this part.
/// - Parameter videoProfile: Video profile for the part.
///
public init(file: String, id: Int, key: String, size: Int, accessible: Bool? = nil, audioProfile: String? = nil, container: String? = nil, duration: Int? = nil, exists: Bool? = nil, has64bitOffsets: Bool? = nil, hasThumbnail: Operations.GetAllMediaLibraryHasThumbnail? = nil, indexes: String? = nil, optimizedForStreaming: Operations.GetAllMediaLibraryLibraryOptimizedForStreaming? = nil, packetLength: Int? = nil, stream: [Operations.GetAllMediaLibraryStream]? = nil, videoProfile: String? = nil) {
self.file = file
self.id = id
self.key = key
self.size = size
self.accessible = accessible
self.audioProfile = audioProfile
self.container = container
self.duration = duration
self.exists = exists
self.has64bitOffsets = has64bitOffsets
self.hasThumbnail = hasThumbnail
self.indexes = indexes
self.optimizedForStreaming = optimizedForStreaming
self.packetLength = packetLength
self.stream = stream
self.videoProfile = videoProfile
}
}}
extension Operations.GetAllMediaLibraryPart: Codable {
enum CodingKeys: String, CodingKey {
case file
case id
case key
case size
case accessible
case audioProfile
case container
case duration
case exists
case has64bitOffsets
case hasThumbnail
case indexes
case optimizedForStreaming
case packetLength
case stream = "Stream"
case videoProfile
}
}

View File

@@ -0,0 +1,11 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Adds the Meta object to the response
///
public enum GetAllMediaLibraryQueryParamIncludeMeta: Int, Codable, APIValue {
case disable = 0
case enable = 1
}}

View File

@@ -0,0 +1,21 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// The type of media to retrieve or filter by.
/// 1 = movie
/// 2 = show
/// 3 = season
/// 4 = episode
/// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
///
public enum GetAllMediaLibraryQueryParamType: Int, Codable, APIValue {
case movie = 1
case tvShow = 2
case season = 3
case episode = 4
case audio = 8
case album = 9
case track = 10
}}

View File

@@ -0,0 +1,76 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibraryRequest: APIValue {
/// The unique key of the Plex library.
/// Note: This is unique in the context of the Plex server.
///
public let sectionKey: Int
/// The type of media to retrieve or filter by.
/// 1 = movie
/// 2 = show
/// 3 = season
/// 4 = episode
/// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
///
public let type: Operations.GetAllMediaLibraryQueryParamType
public let includeAdvanced: Operations.IncludeAdvanced?
public let includeCollections: Operations.QueryParamIncludeCollections?
public let includeExternalMedia: Operations.QueryParamIncludeExternalMedia?
/// Adds the Guid object to the response
///
public let includeGuids: Operations.QueryParamIncludeGuids?
/// Adds the Meta object to the response
///
public let includeMeta: Operations.GetAllMediaLibraryQueryParamIncludeMeta?
/// 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.
/// By default this is 50
///
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.
/// By default this is 0
///
public let xPlexContainerStart: Int?
/// Creates an object with the specified parameters
///
/// - Parameter sectionKey: The unique key of the Plex library.
/// Note: This is unique in the context of the Plex server.
///
/// - Parameter type: The type of media to retrieve or filter by.
/// 1 = movie
/// 2 = show
/// 3 = season
/// 4 = episode
/// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
///
/// - Parameter includeGuids: Adds the Guid object to the response
///
/// - Parameter includeMeta: Adds the Meta object to the response
///
/// - 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.
/// By default this is 50
///
/// - 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.
/// By default this is 0
///
///
public init(sectionKey: Int, type: Operations.GetAllMediaLibraryQueryParamType, includeAdvanced: Operations.IncludeAdvanced? = nil, includeCollections: Operations.QueryParamIncludeCollections? = nil, includeExternalMedia: Operations.QueryParamIncludeExternalMedia? = nil, includeGuids: Operations.QueryParamIncludeGuids? = nil, includeMeta: Operations.GetAllMediaLibraryQueryParamIncludeMeta? = nil, xPlexContainerSize: Int? = nil, xPlexContainerStart: Int? = nil) {
self.sectionKey = sectionKey
self.type = type
self.includeAdvanced = includeAdvanced
self.includeCollections = includeCollections
self.includeExternalMedia = includeExternalMedia
self.includeGuids = includeGuids
self.includeMeta = includeMeta
self.xPlexContainerSize = xPlexContainerSize
self.xPlexContainerStart = xPlexContainerStart
}
}}

View File

@@ -0,0 +1,41 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A response model
public enum GetAllMediaLibraryResponse {
case empty
case badRequest(Operations.GetAllMediaLibraryBadRequest)
case object(Operations.GetAllMediaLibraryResponseBody)
case unauthorized(Operations.GetAllMediaLibraryUnauthorized)
var isEmpty: Bool {
if case .empty = self {
return true
} else {
return false
}
}
public func badRequest() throws -> Operations.GetAllMediaLibraryBadRequest {
guard case .badRequest(let value) = self else {
throw PlexswiftError.missingResponseData
}
return value
}
public func object() throws -> Operations.GetAllMediaLibraryResponseBody {
guard case .object(let value) = self else {
throw PlexswiftError.missingResponseData
}
return value
}
public func unauthorized() throws -> Operations.GetAllMediaLibraryUnauthorized {
guard case .unauthorized(let value) = self else {
throw PlexswiftError.missingResponseData
}
return value
}
}}

View File

@@ -0,0 +1,23 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Successful response containing media container data.
public struct GetAllMediaLibraryResponseBody {
public let mediaContainer: Operations.GetAllMediaLibraryMediaContainer?
/// Creates an object with the specified parameters
///
///
public init(mediaContainer: Operations.GetAllMediaLibraryMediaContainer? = nil) {
self.mediaContainer = mediaContainer
}
}}
extension Operations.GetAllMediaLibraryResponseBody: Codable {
enum CodingKeys: String, CodingKey {
case mediaContainer = "MediaContainer"
}
}

View File

@@ -0,0 +1,25 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibraryRole {
/// The name of the actor for this role
public let tag: String
/// Creates an object with the specified parameters
///
/// - Parameter tag: The name of the actor for this role
///
public init(tag: String) {
self.tag = tag
}
}}
extension Operations.GetAllMediaLibraryRole: Codable {
enum CodingKeys: String, CodingKey {
case tag
}
}

View File

@@ -0,0 +1,52 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibrarySort {
/// The direction of the sort. Can be either `asc` or `desc`.
///
public let defaultDirection: Operations.GetAllMediaLibraryDefaultDirection
public let key: String
public let title: String
public let active: Bool?
/// The direction of the sort. Can be either `asc` or `desc`.
///
public let activeDirection: Operations.GetAllMediaLibraryActiveDirection?
public let `default`: String?
public let descKey: String?
public let firstCharacterKey: String?
/// Creates an object with the specified parameters
///
/// - Parameter defaultDirection: The direction of the sort. Can be either `asc` or `desc`.
///
/// - Parameter activeDirection: The direction of the sort. Can be either `asc` or `desc`.
///
///
public init(defaultDirection: Operations.GetAllMediaLibraryDefaultDirection, key: String, title: String, active: Bool? = nil, activeDirection: Operations.GetAllMediaLibraryActiveDirection? = nil, `default`: String? = nil, descKey: String? = nil, firstCharacterKey: String? = nil) {
self.defaultDirection = defaultDirection
self.key = key
self.title = title
self.active = active
self.activeDirection = activeDirection
self.`default` = `default`
self.descKey = descKey
self.firstCharacterKey = firstCharacterKey
}
}}
extension Operations.GetAllMediaLibrarySort: Codable {
enum CodingKeys: String, CodingKey {
case defaultDirection
case key
case title
case active
case activeDirection
case `default` = "default"
case descKey
case firstCharacterKey
}
}

View File

@@ -0,0 +1,359 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibraryStream {
/// Codec used by the stream.
public let codec: String
/// Display title for the stream.
public let displayTitle: String
/// Extended display title for the stream.
public let extendedDisplayTitle: String
/// Unique stream identifier.
public let id: Int
/// Index of the stream.
public let index: Int
/// Language of the stream.
public let language: String
/// ISO language code.
public let languageCode: String
/// Language tag (e.g., en).
public let languageTag: String
/// Stream type (1=video, 2=audio, 3=subtitle).
public let streamType: Int
/// Audio channel layout.
public let audioChannelLayout: String?
/// Bit depth of the video stream.
public let bitDepth: Int?
/// Bitrate of the stream.
public let bitrate: Int?
/// Indicates if the stream can auto-sync.
public let canAutoSync: Bool?
/// Number of audio channels (for audio streams).
public let channels: Int?
/// Chroma sample location.
public let chromaLocation: String?
/// Chroma subsampling format.
public let chromaSubsampling: String?
/// Coded video height.
public let codedHeight: Int?
/// Coded video width.
public let codedWidth: Int?
/// Color primaries used.
public let colorPrimaries: String?
/// Color range (e.g., tv).
public let colorRange: String?
/// Color space.
public let colorSpace: String?
/// Color transfer characteristics.
public let colorTrc: String?
/// Indicates if this stream is default.
public let `default`: Bool?
/// Dolby Vision BL compatibility ID.
public let doviblCompatID: Int?
/// Indicates if Dolby Vision BL is present.
public let doviblPresent: Bool?
/// Indicates if Dolby Vision EL is present.
public let dovielPresent: Bool?
/// Dolby Vision level.
public let doviLevel: Int?
/// Indicates if Dolby Vision is present.
public let doviPresent: Bool?
/// Dolby Vision profile.
public let doviProfile: Int?
/// Indicates if Dolby Vision RPU is present.
public let dovirpuPresent: Bool?
/// Dolby Vision version.
public let doviVersion: String?
/// Indicates if the stream is a dub.
public let dub: Bool?
public let forced: Bool?
/// Frame rate of the stream.
@DecimalSerialized
public private(set) var frameRate: Double?
public let hasScalingMatrix: Bool?
/// Indicates whether header compression is enabled.
public let headerCompression: Bool?
/// Indicates if the stream is for the hearing impaired.
public let hearingImpaired: Bool?
/// Height of the video stream.
public let height: Int?
/// Video level.
public let level: Int?
/// Indicates if this is the original stream.
public let original: Bool?
/// Video profile.
public let profile: String?
/// Number of reference frames.
public let refFrames: Int?
/// Sampling rate for the audio stream.
public let samplingRate: Int?
public let scanType: String?
/// Indicates if this stream is selected (applicable for audio streams).
public let selected: Bool?
/// Optional title for the stream (e.g., language variant).
public let title: String?
/// Width of the video stream.
public let width: Int?
/// Creates an object with the specified parameters
///
/// - Parameter codec: Codec used by the stream.
/// - Parameter displayTitle: Display title for the stream.
/// - Parameter extendedDisplayTitle: Extended display title for the stream.
/// - Parameter id: Unique stream identifier.
/// - Parameter index: Index of the stream.
/// - Parameter language: Language of the stream.
/// - Parameter languageCode: ISO language code.
/// - Parameter languageTag: Language tag (e.g., en).
/// - Parameter streamType: Stream type (1=video, 2=audio, 3=subtitle).
/// - Parameter audioChannelLayout: Audio channel layout.
/// - Parameter bitDepth: Bit depth of the video stream.
/// - Parameter bitrate: Bitrate of the stream.
/// - Parameter canAutoSync: Indicates if the stream can auto-sync.
/// - Parameter channels: Number of audio channels (for audio streams).
/// - Parameter chromaLocation: Chroma sample location.
/// - Parameter chromaSubsampling: Chroma subsampling format.
/// - Parameter codedHeight: Coded video height.
/// - Parameter codedWidth: Coded video width.
/// - Parameter colorPrimaries: Color primaries used.
/// - Parameter colorRange: Color range (e.g., tv).
/// - Parameter colorSpace: Color space.
/// - Parameter colorTrc: Color transfer characteristics.
/// - Parameter `default`: Indicates if this stream is default.
/// - Parameter doviblCompatID: Dolby Vision BL compatibility ID.
/// - Parameter doviblPresent: Indicates if Dolby Vision BL is present.
/// - Parameter dovielPresent: Indicates if Dolby Vision EL is present.
/// - Parameter doviLevel: Dolby Vision level.
/// - Parameter doviPresent: Indicates if Dolby Vision is present.
/// - Parameter doviProfile: Dolby Vision profile.
/// - Parameter dovirpuPresent: Indicates if Dolby Vision RPU is present.
/// - Parameter doviVersion: Dolby Vision version.
/// - Parameter dub: Indicates if the stream is a dub.
/// - Parameter frameRate: Frame rate of the stream.
/// - Parameter headerCompression: Indicates whether header compression is enabled.
/// - Parameter hearingImpaired: Indicates if the stream is for the hearing impaired.
/// - Parameter height: Height of the video stream.
/// - Parameter level: Video level.
/// - Parameter original: Indicates if this is the original stream.
/// - Parameter profile: Video profile.
/// - Parameter refFrames: Number of reference frames.
/// - Parameter samplingRate: Sampling rate for the audio stream.
/// - Parameter selected: Indicates if this stream is selected (applicable for audio streams).
/// - Parameter title: Optional title for the stream (e.g., language variant).
/// - Parameter width: Width of the video stream.
///
public init(codec: String, displayTitle: String, extendedDisplayTitle: String, id: Int, index: Int, language: String, languageCode: String, languageTag: String, streamType: Int, audioChannelLayout: String? = nil, bitDepth: Int? = nil, bitrate: Int? = nil, canAutoSync: Bool? = nil, channels: Int? = nil, chromaLocation: String? = nil, chromaSubsampling: String? = nil, codedHeight: Int? = nil, codedWidth: Int? = nil, colorPrimaries: String? = nil, colorRange: String? = nil, colorSpace: String? = nil, colorTrc: String? = nil, `default`: Bool? = nil, doviblCompatID: Int? = nil, doviblPresent: Bool? = nil, dovielPresent: Bool? = nil, doviLevel: Int? = nil, doviPresent: Bool? = nil, doviProfile: Int? = nil, dovirpuPresent: Bool? = nil, doviVersion: String? = nil, dub: Bool? = nil, forced: Bool? = nil, frameRate: Double? = nil, hasScalingMatrix: Bool? = nil, headerCompression: Bool? = nil, hearingImpaired: Bool? = nil, height: Int? = nil, level: Int? = nil, original: Bool? = nil, profile: String? = nil, refFrames: Int? = nil, samplingRate: Int? = nil, scanType: String? = nil, selected: Bool? = nil, title: String? = nil, width: Int? = nil) {
self.codec = codec
self.displayTitle = displayTitle
self.extendedDisplayTitle = extendedDisplayTitle
self.id = id
self.index = index
self.language = language
self.languageCode = languageCode
self.languageTag = languageTag
self.streamType = streamType
self.audioChannelLayout = audioChannelLayout
self.bitDepth = bitDepth
self.bitrate = bitrate
self.canAutoSync = canAutoSync
self.channels = channels
self.chromaLocation = chromaLocation
self.chromaSubsampling = chromaSubsampling
self.codedHeight = codedHeight
self.codedWidth = codedWidth
self.colorPrimaries = colorPrimaries
self.colorRange = colorRange
self.colorSpace = colorSpace
self.colorTrc = colorTrc
self.`default` = `default`
self.doviblCompatID = doviblCompatID
self.doviblPresent = doviblPresent
self.dovielPresent = dovielPresent
self.doviLevel = doviLevel
self.doviPresent = doviPresent
self.doviProfile = doviProfile
self.dovirpuPresent = dovirpuPresent
self.doviVersion = doviVersion
self.dub = dub
self.forced = forced
self._frameRate = DecimalSerialized<Double?>(wrappedValue: frameRate)
self.hasScalingMatrix = hasScalingMatrix
self.headerCompression = headerCompression
self.hearingImpaired = hearingImpaired
self.height = height
self.level = level
self.original = original
self.profile = profile
self.refFrames = refFrames
self.samplingRate = samplingRate
self.scanType = scanType
self.selected = selected
self.title = title
self.width = width
}
}}
extension Operations.GetAllMediaLibraryStream: Codable {
enum CodingKeys: String, CodingKey {
case codec
case displayTitle
case extendedDisplayTitle
case id
case index
case language
case languageCode
case languageTag
case streamType
case audioChannelLayout
case bitDepth
case bitrate
case canAutoSync
case channels
case chromaLocation
case chromaSubsampling
case codedHeight
case codedWidth
case colorPrimaries
case colorRange
case colorSpace
case colorTrc
case `default` = "default"
case doviblCompatID = "DOVIBLCompatID"
case doviblPresent = "DOVIBLPresent"
case dovielPresent = "DOVIELPresent"
case doviLevel = "DOVILevel"
case doviPresent = "DOVIPresent"
case doviProfile = "DOVIProfile"
case dovirpuPresent = "DOVIRPUPresent"
case doviVersion = "DOVIVersion"
case dub
case forced
case frameRate
case hasScalingMatrix
case headerCompression
case hearingImpaired
case height
case level
case original
case profile
case refFrames
case samplingRate
case scanType
case selected
case title
case width
}
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.codec = try container.decode(String.self, forKey: .codec)
self.displayTitle = try container.decode(String.self, forKey: .displayTitle)
self.extendedDisplayTitle = try container.decode(String.self, forKey: .extendedDisplayTitle)
self.id = try container.decode(Int.self, forKey: .id)
self.index = try container.decode(Int.self, forKey: .index)
self.language = try container.decode(String.self, forKey: .language)
self.languageCode = try container.decode(String.self, forKey: .languageCode)
self.languageTag = try container.decode(String.self, forKey: .languageTag)
self.streamType = try container.decode(Int.self, forKey: .streamType)
self.audioChannelLayout = try container.decodeIfPresent(String.self, forKey: .audioChannelLayout)
self.bitDepth = try container.decodeIfPresent(Int.self, forKey: .bitDepth)
self.bitrate = try container.decodeIfPresent(Int.self, forKey: .bitrate)
self.canAutoSync = try container.decodeIfPresent(Bool.self, forKey: .canAutoSync)
self.channels = try container.decodeIfPresent(Int.self, forKey: .channels)
self.chromaLocation = try container.decodeIfPresent(String.self, forKey: .chromaLocation)
self.chromaSubsampling = try container.decodeIfPresent(String.self, forKey: .chromaSubsampling)
self.codedHeight = try container.decodeIfPresent(Int.self, forKey: .codedHeight)
self.codedWidth = try container.decodeIfPresent(Int.self, forKey: .codedWidth)
self.colorPrimaries = try container.decodeIfPresent(String.self, forKey: .colorPrimaries)
self.colorRange = try container.decodeIfPresent(String.self, forKey: .colorRange)
self.colorSpace = try container.decodeIfPresent(String.self, forKey: .colorSpace)
self.colorTrc = try container.decodeIfPresent(String.self, forKey: .colorTrc)
self.`default` = try container.decodeIfPresent(Bool.self, forKey: .`default`)
self.doviblCompatID = try container.decodeIfPresent(Int.self, forKey: .doviblCompatID)
self.doviblPresent = try container.decodeIfPresent(Bool.self, forKey: .doviblPresent)
self.dovielPresent = try container.decodeIfPresent(Bool.self, forKey: .dovielPresent)
self.doviLevel = try container.decodeIfPresent(Int.self, forKey: .doviLevel)
self.doviPresent = try container.decodeIfPresent(Bool.self, forKey: .doviPresent)
self.doviProfile = try container.decodeIfPresent(Int.self, forKey: .doviProfile)
self.dovirpuPresent = try container.decodeIfPresent(Bool.self, forKey: .dovirpuPresent)
self.doviVersion = try container.decodeIfPresent(String.self, forKey: .doviVersion)
self.dub = try container.decodeIfPresent(Bool.self, forKey: .dub)
self.forced = try container.decodeIfPresent(Bool.self, forKey: .forced)
self._frameRate = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .frameRate) ?? DecimalSerialized<Double?>(wrappedValue: nil)
self.hasScalingMatrix = try container.decodeIfPresent(Bool.self, forKey: .hasScalingMatrix)
self.headerCompression = try container.decodeIfPresent(Bool.self, forKey: .headerCompression)
self.hearingImpaired = try container.decodeIfPresent(Bool.self, forKey: .hearingImpaired)
self.height = try container.decodeIfPresent(Int.self, forKey: .height)
self.level = try container.decodeIfPresent(Int.self, forKey: .level)
self.original = try container.decodeIfPresent(Bool.self, forKey: .original)
self.profile = try container.decodeIfPresent(String.self, forKey: .profile)
self.refFrames = try container.decodeIfPresent(Int.self, forKey: .refFrames)
self.samplingRate = try container.decodeIfPresent(Int.self, forKey: .samplingRate)
self.scanType = try container.decodeIfPresent(String.self, forKey: .scanType)
self.selected = try container.decodeIfPresent(Bool.self, forKey: .selected)
self.title = try container.decodeIfPresent(String.self, forKey: .title)
self.width = try container.decodeIfPresent(Int.self, forKey: .width)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self.codec, forKey: .codec)
try container.encode(self.displayTitle, forKey: .displayTitle)
try container.encode(self.extendedDisplayTitle, forKey: .extendedDisplayTitle)
try container.encode(self.id, forKey: .id)
try container.encode(self.index, forKey: .index)
try container.encode(self.language, forKey: .language)
try container.encode(self.languageCode, forKey: .languageCode)
try container.encode(self.languageTag, forKey: .languageTag)
try container.encode(self.streamType, forKey: .streamType)
try container.encodeIfPresent(self.audioChannelLayout, forKey: .audioChannelLayout)
try container.encodeIfPresent(self.bitDepth, forKey: .bitDepth)
try container.encodeIfPresent(self.bitrate, forKey: .bitrate)
try container.encodeIfPresent(self.canAutoSync, forKey: .canAutoSync)
try container.encodeIfPresent(self.channels, forKey: .channels)
try container.encodeIfPresent(self.chromaLocation, forKey: .chromaLocation)
try container.encodeIfPresent(self.chromaSubsampling, forKey: .chromaSubsampling)
try container.encodeIfPresent(self.codedHeight, forKey: .codedHeight)
try container.encodeIfPresent(self.codedWidth, forKey: .codedWidth)
try container.encodeIfPresent(self.colorPrimaries, forKey: .colorPrimaries)
try container.encodeIfPresent(self.colorRange, forKey: .colorRange)
try container.encodeIfPresent(self.colorSpace, forKey: .colorSpace)
try container.encodeIfPresent(self.colorTrc, forKey: .colorTrc)
try container.encodeIfPresent(self.`default`, forKey: .`default`)
try container.encodeIfPresent(self.doviblCompatID, forKey: .doviblCompatID)
try container.encodeIfPresent(self.doviblPresent, forKey: .doviblPresent)
try container.encodeIfPresent(self.dovielPresent, forKey: .dovielPresent)
try container.encodeIfPresent(self.doviLevel, forKey: .doviLevel)
try container.encodeIfPresent(self.doviPresent, forKey: .doviPresent)
try container.encodeIfPresent(self.doviProfile, forKey: .doviProfile)
try container.encodeIfPresent(self.dovirpuPresent, forKey: .dovirpuPresent)
try container.encodeIfPresent(self.doviVersion, forKey: .doviVersion)
try container.encodeIfPresent(self.dub, forKey: .dub)
try container.encodeIfPresent(self.forced, forKey: .forced)
if self.frameRate != nil {
try container.encode(self._frameRate, forKey: .frameRate)
}
try container.encodeIfPresent(self.hasScalingMatrix, forKey: .hasScalingMatrix)
try container.encodeIfPresent(self.headerCompression, forKey: .headerCompression)
try container.encodeIfPresent(self.hearingImpaired, forKey: .hearingImpaired)
try container.encodeIfPresent(self.height, forKey: .height)
try container.encodeIfPresent(self.level, forKey: .level)
try container.encodeIfPresent(self.original, forKey: .original)
try container.encodeIfPresent(self.profile, forKey: .profile)
try container.encodeIfPresent(self.refFrames, forKey: .refFrames)
try container.encodeIfPresent(self.samplingRate, forKey: .samplingRate)
try container.encodeIfPresent(self.scanType, forKey: .scanType)
try container.encodeIfPresent(self.selected, forKey: .selected)
try container.encodeIfPresent(self.title, forKey: .title)
try container.encodeIfPresent(self.width, forKey: .width)
}
}
extension Operations.GetAllMediaLibraryStream {
var frameRateWrapper: DecimalSerialized<Double?> {
return _frameRate
}
}

View File

@@ -0,0 +1,44 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibraryType {
public let active: Bool
public let key: String
public let title: String
public let type: String
public let field: [Operations.GetAllMediaLibraryField]?
public let filter: [Operations.GetAllMediaLibraryFilter]?
public let sort: [Operations.GetAllMediaLibrarySort]?
public let subtype: String?
/// Creates an object with the specified parameters
///
///
public init(active: Bool, key: String, title: String, type: String, field: [Operations.GetAllMediaLibraryField]? = nil, filter: [Operations.GetAllMediaLibraryFilter]? = nil, sort: [Operations.GetAllMediaLibrarySort]? = nil, subtype: String? = nil) {
self.active = active
self.key = key
self.title = title
self.type = type
self.field = field
self.filter = filter
self.sort = sort
self.subtype = subtype
}
}}
extension Operations.GetAllMediaLibraryType: Codable {
enum CodingKeys: String, CodingKey {
case active
case key
case title
case type
case field = "Field"
case filter = "Filter"
case sort = "Sort"
case subtype
}
}

View File

@@ -0,0 +1,32 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibraryUltraBlurColors {
public let bottomLeft: String
public let bottomRight: String
public let topLeft: String
public let topRight: String
/// Creates an object with the specified parameters
///
///
public init(bottomLeft: String, bottomRight: String, topLeft: String, topRight: String) {
self.bottomLeft = bottomLeft
self.bottomRight = bottomRight
self.topLeft = topLeft
self.topRight = topRight
}
}}
extension Operations.GetAllMediaLibraryUltraBlurColors: Codable {
enum CodingKeys: String, CodingKey {
case bottomLeft
case bottomRight
case topLeft
case topRight
}
}

View File

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

View File

@@ -0,0 +1,25 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetAllMediaLibraryWriter {
/// The role of Writer
public let tag: String
/// Creates an object with the specified parameters
///
/// - Parameter tag: The role of Writer
///
public init(tag: String) {
self.tag = tag
}
}}
extension Operations.GetAllMediaLibraryWriter: Codable {
enum CodingKeys: String, CodingKey {
case tag
}
}

View File

@@ -5,27 +5,48 @@ import Foundation
extension Operations { extension Operations {
/// A model object /// A model object
public struct GetCountriesLibraryMediaContainer { public struct GetCountriesLibraryMediaContainer {
/// Indicates whether syncing is allowed.
public let allowSync: Bool public let allowSync: Bool
/// URL for the background artwork of the media container.
public let art: String public let art: String
/// The content type or mode.
public let content: String public let content: String
/// An plugin identifier for the media container.
public let identifier: String public let identifier: String
/// The prefix used for media tag resource paths.
public let mediaTagPrefix: String public let mediaTagPrefix: String
/// The version number for media tags.
public let mediaTagVersion: Int public let mediaTagVersion: Int
/// Specifies whether caching is disabled.
public let nocache: Bool public let nocache: Bool
@DecimalSerialized /// Number of media items returned in this response.
public private(set) var size: Double public let size: Int
/// URL for the thumbnail image of the media container.
public let thumb: String public let thumb: String
/// The primary title of the media container.
public let title1: String public let title1: String
/// The secondary title of the media container.
public let title2: String public let title2: String
/// Identifier for the view group layout.
public let viewGroup: String public let viewGroup: String
public let directory: [Operations.GetCountriesLibraryDirectory]? public let directory: [Operations.GetCountriesLibraryDirectory]?
public let offset: Int?
public let totalSize: Int?
/// Creates an object with the specified parameters /// Creates an object with the specified parameters
/// ///
/// - Parameter allowSync: Indicates whether syncing is allowed.
/// - Parameter art: URL for the background artwork of the media container.
/// - Parameter content: The content type or mode.
/// - Parameter identifier: An plugin identifier for the media container.
/// - Parameter mediaTagPrefix: The prefix used for media tag resource paths.
/// - Parameter mediaTagVersion: The version number for media tags.
/// - Parameter nocache: Specifies whether caching is disabled.
/// - Parameter size: Number of media items returned in this response.
/// - Parameter thumb: URL for the thumbnail image of the media container.
/// - Parameter title1: The primary title of the media container.
/// - Parameter title2: The secondary title of the media container.
/// - Parameter viewGroup: Identifier for the view group layout.
/// ///
public init(allowSync: Bool, art: String, content: String, identifier: String, mediaTagPrefix: String, mediaTagVersion: Int, nocache: Bool, size: Double, thumb: String, title1: String, title2: String, viewGroup: String, directory: [Operations.GetCountriesLibraryDirectory]? = nil, offset: Int? = nil, totalSize: Int? = nil) { public init(allowSync: Bool, art: String, content: String, identifier: String, mediaTagPrefix: String, mediaTagVersion: Int, nocache: Bool, size: Int, thumb: String, title1: String, title2: String, viewGroup: String, directory: [Operations.GetCountriesLibraryDirectory]? = nil) {
self.allowSync = allowSync self.allowSync = allowSync
self.art = art self.art = art
self.content = content self.content = content
@@ -33,14 +54,12 @@ extension Operations {
self.mediaTagPrefix = mediaTagPrefix self.mediaTagPrefix = mediaTagPrefix
self.mediaTagVersion = mediaTagVersion self.mediaTagVersion = mediaTagVersion
self.nocache = nocache self.nocache = nocache
self._size = DecimalSerialized<Double>(wrappedValue: size) self.size = size
self.thumb = thumb self.thumb = thumb
self.title1 = title1 self.title1 = title1
self.title2 = title2 self.title2 = title2
self.viewGroup = viewGroup self.viewGroup = viewGroup
self.directory = directory self.directory = directory
self.offset = offset
self.totalSize = totalSize
} }
}} }}
@@ -59,51 +78,6 @@ extension Operations.GetCountriesLibraryMediaContainer: Codable {
case title2 case title2
case viewGroup case viewGroup
case directory = "Directory" case directory = "Directory"
case offset
case totalSize
}
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.allowSync = try container.decode(Bool.self, forKey: .allowSync)
self.art = try container.decode(String.self, forKey: .art)
self.content = try container.decode(String.self, forKey: .content)
self.identifier = try container.decode(String.self, forKey: .identifier)
self.mediaTagPrefix = try container.decode(String.self, forKey: .mediaTagPrefix)
self.mediaTagVersion = try container.decode(Int.self, forKey: .mediaTagVersion)
self.nocache = try container.decode(Bool.self, forKey: .nocache)
self._size = try container.decode(DecimalSerialized<Double>.self, forKey: .size)
self.thumb = try container.decode(String.self, forKey: .thumb)
self.title1 = try container.decode(String.self, forKey: .title1)
self.title2 = try container.decode(String.self, forKey: .title2)
self.viewGroup = try container.decode(String.self, forKey: .viewGroup)
self.directory = try container.decodeIfPresent([Operations.GetCountriesLibraryDirectory].self, forKey: .directory)
self.offset = try container.decodeIfPresent(Int.self, forKey: .offset)
self.totalSize = try container.decodeIfPresent(Int.self, forKey: .totalSize)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self.allowSync, forKey: .allowSync)
try container.encode(self.art, forKey: .art)
try container.encode(self.content, forKey: .content)
try container.encode(self.identifier, forKey: .identifier)
try container.encode(self.mediaTagPrefix, forKey: .mediaTagPrefix)
try container.encode(self.mediaTagVersion, forKey: .mediaTagVersion)
try container.encode(self.nocache, forKey: .nocache)
try container.encode(self._size, forKey: .size)
try container.encode(self.thumb, forKey: .thumb)
try container.encode(self.title1, forKey: .title1)
try container.encode(self.title2, forKey: .title2)
try container.encode(self.viewGroup, forKey: .viewGroup)
try container.encodeIfPresent(self.directory, forKey: .directory)
try container.encodeIfPresent(self.offset, forKey: .offset)
try container.encodeIfPresent(self.totalSize, forKey: .totalSize)
} }
} }
extension Operations.GetCountriesLibraryMediaContainer {
var sizeWrapper: DecimalSerialized<Double> {
return _size
}
}

View File

@@ -5,27 +5,48 @@ import Foundation
extension Operations { extension Operations {
/// A model object /// A model object
public struct GetGenresLibraryMediaContainer { public struct GetGenresLibraryMediaContainer {
/// Indicates whether syncing is allowed.
public let allowSync: Bool public let allowSync: Bool
/// URL for the background artwork of the media container.
public let art: String public let art: String
/// The content type or mode.
public let content: String public let content: String
/// An plugin identifier for the media container.
public let identifier: String public let identifier: String
/// The prefix used for media tag resource paths.
public let mediaTagPrefix: String public let mediaTagPrefix: String
/// The version number for media tags.
public let mediaTagVersion: Int public let mediaTagVersion: Int
/// Specifies whether caching is disabled.
public let nocache: Bool public let nocache: Bool
@DecimalSerialized /// Number of media items returned in this response.
public private(set) var size: Double public let size: Int
/// URL for the thumbnail image of the media container.
public let thumb: String public let thumb: String
/// The primary title of the media container.
public let title1: String public let title1: String
/// The secondary title of the media container.
public let title2: String public let title2: String
/// Identifier for the view group layout.
public let viewGroup: String public let viewGroup: String
public let directory: [Operations.GetGenresLibraryDirectory]? public let directory: [Operations.GetGenresLibraryDirectory]?
public let offset: Int?
public let totalSize: Int?
/// Creates an object with the specified parameters /// Creates an object with the specified parameters
/// ///
/// - Parameter allowSync: Indicates whether syncing is allowed.
/// - Parameter art: URL for the background artwork of the media container.
/// - Parameter content: The content type or mode.
/// - Parameter identifier: An plugin identifier for the media container.
/// - Parameter mediaTagPrefix: The prefix used for media tag resource paths.
/// - Parameter mediaTagVersion: The version number for media tags.
/// - Parameter nocache: Specifies whether caching is disabled.
/// - Parameter size: Number of media items returned in this response.
/// - Parameter thumb: URL for the thumbnail image of the media container.
/// - Parameter title1: The primary title of the media container.
/// - Parameter title2: The secondary title of the media container.
/// - Parameter viewGroup: Identifier for the view group layout.
/// ///
public init(allowSync: Bool, art: String, content: String, identifier: String, mediaTagPrefix: String, mediaTagVersion: Int, nocache: Bool, size: Double, thumb: String, title1: String, title2: String, viewGroup: String, directory: [Operations.GetGenresLibraryDirectory]? = nil, offset: Int? = nil, totalSize: Int? = nil) { public init(allowSync: Bool, art: String, content: String, identifier: String, mediaTagPrefix: String, mediaTagVersion: Int, nocache: Bool, size: Int, thumb: String, title1: String, title2: String, viewGroup: String, directory: [Operations.GetGenresLibraryDirectory]? = nil) {
self.allowSync = allowSync self.allowSync = allowSync
self.art = art self.art = art
self.content = content self.content = content
@@ -33,14 +54,12 @@ extension Operations {
self.mediaTagPrefix = mediaTagPrefix self.mediaTagPrefix = mediaTagPrefix
self.mediaTagVersion = mediaTagVersion self.mediaTagVersion = mediaTagVersion
self.nocache = nocache self.nocache = nocache
self._size = DecimalSerialized<Double>(wrappedValue: size) self.size = size
self.thumb = thumb self.thumb = thumb
self.title1 = title1 self.title1 = title1
self.title2 = title2 self.title2 = title2
self.viewGroup = viewGroup self.viewGroup = viewGroup
self.directory = directory self.directory = directory
self.offset = offset
self.totalSize = totalSize
} }
}} }}
@@ -59,51 +78,6 @@ extension Operations.GetGenresLibraryMediaContainer: Codable {
case title2 case title2
case viewGroup case viewGroup
case directory = "Directory" case directory = "Directory"
case offset
case totalSize
}
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.allowSync = try container.decode(Bool.self, forKey: .allowSync)
self.art = try container.decode(String.self, forKey: .art)
self.content = try container.decode(String.self, forKey: .content)
self.identifier = try container.decode(String.self, forKey: .identifier)
self.mediaTagPrefix = try container.decode(String.self, forKey: .mediaTagPrefix)
self.mediaTagVersion = try container.decode(Int.self, forKey: .mediaTagVersion)
self.nocache = try container.decode(Bool.self, forKey: .nocache)
self._size = try container.decode(DecimalSerialized<Double>.self, forKey: .size)
self.thumb = try container.decode(String.self, forKey: .thumb)
self.title1 = try container.decode(String.self, forKey: .title1)
self.title2 = try container.decode(String.self, forKey: .title2)
self.viewGroup = try container.decode(String.self, forKey: .viewGroup)
self.directory = try container.decodeIfPresent([Operations.GetGenresLibraryDirectory].self, forKey: .directory)
self.offset = try container.decodeIfPresent(Int.self, forKey: .offset)
self.totalSize = try container.decodeIfPresent(Int.self, forKey: .totalSize)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self.allowSync, forKey: .allowSync)
try container.encode(self.art, forKey: .art)
try container.encode(self.content, forKey: .content)
try container.encode(self.identifier, forKey: .identifier)
try container.encode(self.mediaTagPrefix, forKey: .mediaTagPrefix)
try container.encode(self.mediaTagVersion, forKey: .mediaTagVersion)
try container.encode(self.nocache, forKey: .nocache)
try container.encode(self._size, forKey: .size)
try container.encode(self.thumb, forKey: .thumb)
try container.encode(self.title1, forKey: .title1)
try container.encode(self.title2, forKey: .title2)
try container.encode(self.viewGroup, forKey: .viewGroup)
try container.encodeIfPresent(self.directory, forKey: .directory)
try container.encodeIfPresent(self.offset, forKey: .offset)
try container.encodeIfPresent(self.totalSize, forKey: .totalSize)
} }
} }
extension Operations.GetGenresLibraryMediaContainer {
var sizeWrapper: DecimalSerialized<Double> {
return _size
}
}

View File

@@ -10,16 +10,18 @@ extension Operations {
public let key: String public let key: String
public let title: String public let title: String
public let type: String public let type: String
public let advanced: Bool?
/// Creates an object with the specified parameters /// Creates an object with the specified parameters
/// ///
/// ///
public init(filter: String, filterType: String, key: String, title: String, type: String) { public init(filter: String, filterType: String, key: String, title: String, type: String, advanced: Bool? = nil) {
self.filter = filter self.filter = filter
self.filterType = filterType self.filterType = filterType
self.key = key self.key = key
self.title = title self.title = title
self.type = type self.type = type
self.advanced = advanced
} }
}} }}
@@ -30,6 +32,7 @@ extension Operations.GetLibraryItemsFilter: Codable {
case key case key
case title case title
case type case type
case advanced
} }
} }

View File

@@ -10,4 +10,6 @@ extension Operations {
case tvShow = "show" case tvShow = "show"
case season = "season" case season = "season"
case episode = "episode" case episode = "episode"
case artist = "artist"
case album = "album"
}} }}

View File

@@ -12,11 +12,12 @@ extension Operations {
public let field: [Operations.GetLibraryItemsField]? public let field: [Operations.GetLibraryItemsField]?
public let filter: [Operations.GetLibraryItemsFilter]? public let filter: [Operations.GetLibraryItemsFilter]?
public let sort: [Operations.GetLibraryItemsSort]? public let sort: [Operations.GetLibraryItemsSort]?
public let subtype: String?
/// Creates an object with the specified parameters /// Creates an object with the specified parameters
/// ///
/// ///
public init(active: Bool, key: String, title: String, type: String, field: [Operations.GetLibraryItemsField]? = nil, filter: [Operations.GetLibraryItemsFilter]? = nil, sort: [Operations.GetLibraryItemsSort]? = nil) { public init(active: Bool, key: String, title: String, type: String, field: [Operations.GetLibraryItemsField]? = nil, filter: [Operations.GetLibraryItemsFilter]? = nil, sort: [Operations.GetLibraryItemsSort]? = nil, subtype: String? = nil) {
self.active = active self.active = active
self.key = key self.key = key
self.title = title self.title = title
@@ -24,6 +25,7 @@ extension Operations {
self.field = field self.field = field
self.filter = filter self.filter = filter
self.sort = sort self.sort = sort
self.subtype = subtype
} }
}} }}
@@ -36,6 +38,7 @@ extension Operations.GetLibraryItemsType: Codable {
case field = "Field" case field = "Field"
case filter = "Filter" case filter = "Filter"
case sort = "Sort" case sort = "Sort"
case subtype
} }
} }

View File

@@ -0,0 +1,9 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
public enum GetMediaMetaData1: Int, Codable, APIValue {
case zero = 0
case one = 1
}}

View File

@@ -0,0 +1,25 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetMediaMetaDataGuids {
/// The GUID value.
public let id: String
/// Creates an object with the specified parameters
///
/// - Parameter id: The GUID value.
///
public init(id: String) {
self.id = id
}
}}
extension Operations.GetMediaMetaDataGuids: Codable {
enum CodingKeys: String, CodingKey {
case id
}
}

View File

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Indicates if the part has a thumbnail.
public enum GetMediaMetaDataHasThumbnail: String, Codable, APIValue {
case `false` = "0"
case `true` = "1"
}}

View File

@@ -0,0 +1,9 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
public enum GetMediaMetaDataLibrary1: Int, Codable, APIValue {
case zero = 0
case one = 1
}}

View File

@@ -0,0 +1,32 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
public enum GetMediaMetaDataLibraryOptimizedForStreaming {
case getMediaMetaDataLibrary1(Operations.GetMediaMetaDataLibrary1)
case bool(Bool)
}}
extension Operations.GetMediaMetaDataLibraryOptimizedForStreaming: Codable {
public init(from decoder: Decoder) throws {
if let value = try? Operations.GetMediaMetaDataLibrary1(from: decoder) {
self = .getMediaMetaDataLibrary1(value)
} else if let value = try? Bool(from: decoder) {
self = .bool(value)
} else {
throw PlexswiftError.failedToHandleResponse(.failedToDecodeResponse)
}
}
public func encode(to encoder: Encoder) throws {
switch self {
case .getMediaMetaDataLibrary1(let value):
try value.encode(to: encoder)
case .bool(let value):
try value.encode(to: encoder)
}
}
}

View File

@@ -5,67 +5,81 @@ import Foundation
extension Operations { extension Operations {
/// A model object /// A model object
public struct GetMediaMetaDataMedia { public struct GetMediaMetaDataMedia {
/// Aspect ratio of the video.
@DecimalSerialized
public private(set) var aspectRatio: Double
/// Number of audio channels.
public let audioChannels: Int
/// Audio codec used.
public let audioCodec: String
/// Bitrate in bits per second.
public let bitrate: Int
/// File container type.
public let container: String
/// Duration of the media in milliseconds.
public let duration: Int
/// Indicates whether voice activity is detected. /// Indicates whether voice activity is detected.
public let hasVoiceActivity: Bool public let hasVoiceActivity: Bool
/// Video height in pixels.
public let height: Int
/// Unique media identifier. /// Unique media identifier.
public let id: Int public let id: Int
/// An array of parts for this media item. /// An array of parts for this media item.
public let part: [Operations.GetMediaMetaDataPart] public let part: [Operations.GetMediaMetaDataPart]
/// Aspect ratio of the video.
@DecimalSerialized
public private(set) var aspectRatio: Double?
/// Number of audio channels.
public let audioChannels: Int?
/// Audio codec used.
public let audioCodec: String?
/// The audio profile used for the media (e.g., DTS, Dolby Digital, etc.).
public let audioProfile: String?
/// Bitrate in bits per second.
public let bitrate: Int?
/// File container type.
public let container: String?
public let displayOffset: Int?
/// Duration of the media in milliseconds.
public let duration: Int?
public let has64bitOffsets: Bool?
/// Video height in pixels.
public let height: Int?
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
public let optimizedForStreaming: Operations.GetMediaMetaDataOptimizedForStreaming?
/// Video codec used. /// Video codec used.
public let videoCodec: String public let videoCodec: String?
/// Frame rate of the video (e.g., 24p). /// Frame rate of the video. Values found include NTSC, PAL, 24p
public let videoFrameRate: String ///
public let videoFrameRate: String?
/// Video profile (e.g., main 10). /// Video profile (e.g., main 10).
public let videoProfile: String public let videoProfile: String?
/// Video resolution (e.g., 4k). /// Video resolution (e.g., 4k).
public let videoResolution: String public let videoResolution: String?
/// Video width in pixels. /// Video width in pixels.
public let width: Int public let width: Int?
/// Creates an object with the specified parameters /// Creates an object with the specified parameters
/// ///
/// - Parameter hasVoiceActivity: Indicates whether voice activity is detected.
/// - Parameter id: Unique media identifier.
/// - Parameter part: An array of parts for this media item.
/// - Parameter aspectRatio: Aspect ratio of the video. /// - Parameter aspectRatio: Aspect ratio of the video.
/// - Parameter audioChannels: Number of audio channels. /// - Parameter audioChannels: Number of audio channels.
/// - Parameter audioCodec: Audio codec used. /// - Parameter audioCodec: Audio codec used.
/// - Parameter audioProfile: The audio profile used for the media (e.g., DTS, Dolby Digital, etc.).
/// - Parameter bitrate: Bitrate in bits per second. /// - Parameter bitrate: Bitrate in bits per second.
/// - Parameter container: File container type. /// - Parameter container: File container type.
/// - Parameter duration: Duration of the media in milliseconds. /// - Parameter duration: Duration of the media in milliseconds.
/// - Parameter hasVoiceActivity: Indicates whether voice activity is detected.
/// - Parameter height: Video height in pixels. /// - Parameter height: Video height in pixels.
/// - Parameter id: Unique media identifier. /// - Parameter optimizedForStreaming: Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
/// - Parameter part: An array of parts for this media item.
/// - Parameter videoCodec: Video codec used. /// - Parameter videoCodec: Video codec used.
/// - Parameter videoFrameRate: Frame rate of the video (e.g., 24p). /// - Parameter videoFrameRate: Frame rate of the video. Values found include NTSC, PAL, 24p
///
/// - Parameter videoProfile: Video profile (e.g., main 10). /// - Parameter videoProfile: Video profile (e.g., main 10).
/// - Parameter videoResolution: Video resolution (e.g., 4k). /// - Parameter videoResolution: Video resolution (e.g., 4k).
/// - Parameter width: Video width in pixels. /// - Parameter width: Video width in pixels.
/// ///
public init(aspectRatio: Double, audioChannels: Int, audioCodec: String, bitrate: Int, container: String, duration: Int, hasVoiceActivity: Bool, height: Int, id: Int, part: [Operations.GetMediaMetaDataPart], videoCodec: String, videoFrameRate: String, videoProfile: String, videoResolution: String, width: Int) { public init(hasVoiceActivity: Bool, id: Int, part: [Operations.GetMediaMetaDataPart], aspectRatio: Double? = nil, audioChannels: Int? = nil, audioCodec: String? = nil, audioProfile: String? = nil, bitrate: Int? = nil, container: String? = nil, displayOffset: Int? = nil, duration: Int? = nil, has64bitOffsets: Bool? = nil, height: Int? = nil, optimizedForStreaming: Operations.GetMediaMetaDataOptimizedForStreaming? = 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.hasVoiceActivity = hasVoiceActivity self.hasVoiceActivity = hasVoiceActivity
self.height = height
self.id = id self.id = id
self.part = part self.part = part
self._aspectRatio = DecimalSerialized<Double?>(wrappedValue: aspectRatio)
self.audioChannels = audioChannels
self.audioCodec = audioCodec
self.audioProfile = audioProfile
self.bitrate = bitrate
self.container = container
self.displayOffset = displayOffset
self.duration = duration
self.has64bitOffsets = has64bitOffsets
self.height = height
self.optimizedForStreaming = optimizedForStreaming
self.videoCodec = videoCodec self.videoCodec = videoCodec
self.videoFrameRate = videoFrameRate self.videoFrameRate = videoFrameRate
self.videoProfile = videoProfile self.videoProfile = videoProfile
@@ -76,16 +90,20 @@ extension Operations {
extension Operations.GetMediaMetaDataMedia: Codable { extension Operations.GetMediaMetaDataMedia: Codable {
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case hasVoiceActivity
case id
case part = "Part"
case aspectRatio case aspectRatio
case audioChannels case audioChannels
case audioCodec case audioCodec
case audioProfile
case bitrate case bitrate
case container case container
case displayOffset
case duration case duration
case hasVoiceActivity case has64bitOffsets
case height case height
case id case optimizedForStreaming
case part = "Part"
case videoCodec case videoCodec
case videoFrameRate case videoFrameRate
case videoProfile case videoProfile
@@ -95,45 +113,55 @@ extension Operations.GetMediaMetaDataMedia: Codable {
public init(from decoder: Decoder) throws { public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self) let container = try decoder.container(keyedBy: CodingKeys.self)
self._aspectRatio = try container.decode(DecimalSerialized<Double>.self, forKey: .aspectRatio)
self.audioChannels = try container.decode(Int.self, forKey: .audioChannels)
self.audioCodec = try container.decode(String.self, forKey: .audioCodec)
self.bitrate = try container.decode(Int.self, forKey: .bitrate)
self.container = try container.decode(String.self, forKey: .container)
self.duration = try container.decode(Int.self, forKey: .duration)
self.hasVoiceActivity = try container.decode(Bool.self, forKey: .hasVoiceActivity) self.hasVoiceActivity = try container.decode(Bool.self, forKey: .hasVoiceActivity)
self.height = try container.decode(Int.self, forKey: .height)
self.id = try container.decode(Int.self, forKey: .id) self.id = try container.decode(Int.self, forKey: .id)
self.part = try container.decode([Operations.GetMediaMetaDataPart].self, forKey: .part) self.part = try container.decode([Operations.GetMediaMetaDataPart].self, forKey: .part)
self.videoCodec = try container.decode(String.self, forKey: .videoCodec) self._aspectRatio = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .aspectRatio) ?? DecimalSerialized<Double?>(wrappedValue: nil)
self.videoFrameRate = try container.decode(String.self, forKey: .videoFrameRate) self.audioChannels = try container.decodeIfPresent(Int.self, forKey: .audioChannels)
self.videoProfile = try container.decode(String.self, forKey: .videoProfile) self.audioCodec = try container.decodeIfPresent(String.self, forKey: .audioCodec)
self.videoResolution = try container.decode(String.self, forKey: .videoResolution) self.audioProfile = try container.decodeIfPresent(String.self, forKey: .audioProfile)
self.width = try container.decode(Int.self, forKey: .width) self.bitrate = try container.decodeIfPresent(Int.self, forKey: .bitrate)
self.container = try container.decodeIfPresent(String.self, forKey: .container)
self.displayOffset = try container.decodeIfPresent(Int.self, forKey: .displayOffset)
self.duration = try container.decodeIfPresent(Int.self, forKey: .duration)
self.has64bitOffsets = try container.decodeIfPresent(Bool.self, forKey: .has64bitOffsets)
self.height = try container.decodeIfPresent(Int.self, forKey: .height)
self.optimizedForStreaming = try container.decodeIfPresent(Operations.GetMediaMetaDataOptimizedForStreaming.self, forKey: .optimizedForStreaming)
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 { public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self) var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self._aspectRatio, forKey: .aspectRatio)
try container.encode(self.audioChannels, forKey: .audioChannels)
try container.encode(self.audioCodec, forKey: .audioCodec)
try container.encode(self.bitrate, forKey: .bitrate)
try container.encode(self.container, forKey: .container)
try container.encode(self.duration, forKey: .duration)
try container.encode(self.hasVoiceActivity, forKey: .hasVoiceActivity) try container.encode(self.hasVoiceActivity, forKey: .hasVoiceActivity)
try container.encode(self.height, forKey: .height)
try container.encode(self.id, forKey: .id) try container.encode(self.id, forKey: .id)
try container.encode(self.part, forKey: .part) try container.encode(self.part, forKey: .part)
try container.encode(self.videoCodec, forKey: .videoCodec) if self.aspectRatio != nil {
try container.encode(self.videoFrameRate, forKey: .videoFrameRate) try container.encode(self._aspectRatio, forKey: .aspectRatio)
try container.encode(self.videoProfile, forKey: .videoProfile) }
try container.encode(self.videoResolution, forKey: .videoResolution) try container.encodeIfPresent(self.audioChannels, forKey: .audioChannels)
try container.encode(self.width, forKey: .width) try container.encodeIfPresent(self.audioCodec, forKey: .audioCodec)
try container.encodeIfPresent(self.audioProfile, forKey: .audioProfile)
try container.encodeIfPresent(self.bitrate, forKey: .bitrate)
try container.encodeIfPresent(self.container, forKey: .container)
try container.encodeIfPresent(self.displayOffset, forKey: .displayOffset)
try container.encodeIfPresent(self.duration, forKey: .duration)
try container.encodeIfPresent(self.has64bitOffsets, forKey: .has64bitOffsets)
try container.encodeIfPresent(self.height, forKey: .height)
try container.encodeIfPresent(self.optimizedForStreaming, forKey: .optimizedForStreaming)
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.GetMediaMetaDataMedia { extension Operations.GetMediaMetaDataMedia {
var aspectRatioWrapper: DecimalSerialized<Double> { var aspectRatioWrapper: DecimalSerialized<Double?> {
return _aspectRatio return _aspectRatio
} }
} }

View File

@@ -19,8 +19,8 @@ extension Operations {
public let mediaTagVersion: Int public let mediaTagVersion: Int
/// An array of metadata items. /// An array of metadata items.
public let metadata: [Operations.GetMediaMetaDataMetadata] public let metadata: [Operations.GetMediaMetaDataMetadata]
@DecimalSerialized /// Number of media items returned in this response.
public private(set) var size: Double public let size: Int
/// The universally unique identifier for the library section. /// The universally unique identifier for the library section.
public let librarySectionUUID: String? public let librarySectionUUID: String?
@@ -33,9 +33,10 @@ extension Operations {
/// - Parameter mediaTagPrefix: The prefix used for media tag resource paths. /// - Parameter mediaTagPrefix: The prefix used for media tag resource paths.
/// - Parameter mediaTagVersion: The version number for media tags. /// - Parameter mediaTagVersion: The version number for media tags.
/// - Parameter metadata: An array of metadata items. /// - Parameter metadata: An array of metadata items.
/// - Parameter size: Number of media items returned in this response.
/// - Parameter librarySectionUUID: The universally unique identifier for the library section. /// - Parameter librarySectionUUID: The universally unique identifier for the library section.
/// ///
public init(allowSync: Bool, identifier: String, librarySectionID: Int, librarySectionTitle: String, mediaTagPrefix: String, mediaTagVersion: Int, metadata: [Operations.GetMediaMetaDataMetadata], size: Double, librarySectionUUID: String? = nil) { public init(allowSync: Bool, identifier: String, librarySectionID: Int, librarySectionTitle: String, mediaTagPrefix: String, mediaTagVersion: Int, metadata: [Operations.GetMediaMetaDataMetadata], size: Int, librarySectionUUID: String? = nil) {
self.allowSync = allowSync self.allowSync = allowSync
self.identifier = identifier self.identifier = identifier
self.librarySectionID = librarySectionID self.librarySectionID = librarySectionID
@@ -43,7 +44,7 @@ extension Operations {
self.mediaTagPrefix = mediaTagPrefix self.mediaTagPrefix = mediaTagPrefix
self.mediaTagVersion = mediaTagVersion self.mediaTagVersion = mediaTagVersion
self.metadata = metadata self.metadata = metadata
self._size = DecimalSerialized<Double>(wrappedValue: size) self.size = size
self.librarySectionUUID = librarySectionUUID self.librarySectionUUID = librarySectionUUID
} }
}} }}
@@ -60,36 +61,5 @@ extension Operations.GetMediaMetaDataMediaContainer: Codable {
case size case size
case librarySectionUUID case librarySectionUUID
} }
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.allowSync = try container.decode(Bool.self, forKey: .allowSync)
self.identifier = try container.decode(String.self, forKey: .identifier)
self.librarySectionID = try container.decode(Int.self, forKey: .librarySectionID)
self.librarySectionTitle = try container.decode(String.self, forKey: .librarySectionTitle)
self.mediaTagPrefix = try container.decode(String.self, forKey: .mediaTagPrefix)
self.mediaTagVersion = try container.decode(Int.self, forKey: .mediaTagVersion)
self.metadata = try container.decode([Operations.GetMediaMetaDataMetadata].self, forKey: .metadata)
self._size = try container.decode(DecimalSerialized<Double>.self, forKey: .size)
self.librarySectionUUID = try container.decodeIfPresent(String.self, forKey: .librarySectionUUID)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self.allowSync, forKey: .allowSync)
try container.encode(self.identifier, forKey: .identifier)
try container.encode(self.librarySectionID, forKey: .librarySectionID)
try container.encode(self.librarySectionTitle, forKey: .librarySectionTitle)
try container.encode(self.mediaTagPrefix, forKey: .mediaTagPrefix)
try container.encode(self.mediaTagVersion, forKey: .mediaTagVersion)
try container.encode(self.metadata, forKey: .metadata)
try container.encode(self._size, forKey: .size)
try container.encodeIfPresent(self.librarySectionUUID, forKey: .librarySectionUUID)
}
} }
extension Operations.GetMediaMetaDataMediaContainer {
var sizeWrapper: DecimalSerialized<Double> {
return _size
}
}

View File

@@ -5,23 +5,13 @@ import Foundation
extension Operations { extension Operations {
/// A model object /// A model object
public struct GetMediaMetaDataMetadata { public struct GetMediaMetaDataMetadata {
/// Unix timestamp when the item was added.
public let addedAt: Int public let addedAt: Int
/// URL of the art image. /// URL of the art image.
public let art: String public let art: String
/// The audience rating for the content.
@DecimalSerialized
public private(set) var audienceRating: Double
/// The URL for the audience rating image.
public let audienceRatingImage: String
/// The content rating (e.g., TV-MA).
public let contentRating: String
/// Duration of the content in milliseconds. /// Duration of the content in milliseconds.
public let duration: Int public let duration: Int
/// The globally unique identifier for the item. /// The globally unique identifier for the item.
public let guid: String public let guid: String
/// An array of GUID objects.
public let guids: [Operations.Guids]
/// An array of image objects. /// An array of image objects.
public let image: [Operations.GetMediaMetaDataImage] public let image: [Operations.GetMediaMetaDataImage]
/// The API key to access metadata details. /// The API key to access metadata details.
@@ -32,11 +22,6 @@ extension Operations {
public let librarySectionKey: String public let librarySectionKey: String
/// The title of the library section. /// The title of the library section.
public let librarySectionTitle: String public let librarySectionTitle: String
/// The original release date.
@DateOnly
public private(set) var originallyAvailableAt: Date
/// An array of rating objects.
public let rating: [Operations.Rating]
/// The rating key of the metadata item. /// The rating key of the metadata item.
public let ratingKey: String public let ratingKey: String
/// A summary of the content. /// A summary of the content.
@@ -48,13 +33,19 @@ extension Operations {
/// The type of content (e.g., show, movie). /// The type of content (e.g., show, movie).
public let type: String public let type: String
public let ultraBlurColors: Operations.GetMediaMetaDataUltraBlurColors public let ultraBlurColors: Operations.GetMediaMetaDataUltraBlurColors
/// Unix timestamp when the item was last updated.
public let updatedAt: Int public let updatedAt: Int
/// The release year. /// The release year.
public let year: Int public let year: Int
/// The audience rating for the content.
@DecimalSerialized
public private(set) var audienceRating: Double?
/// The URL for the audience rating image.
public let audienceRatingImage: String?
public let chapterSource: String? public let chapterSource: String?
/// The number of child items. /// The number of child items.
public let childCount: Int? public let childCount: Int?
/// The content rating (e.g., TV-MA).
public let contentRating: String?
/// An array of country tags. /// An array of country tags.
public let country: [Operations.GetMediaMetaDataCountry]? public let country: [Operations.GetMediaMetaDataCountry]?
/// An array of Director roles. /// An array of Director roles.
@@ -75,6 +66,8 @@ extension Operations {
public let grandparentThumb: String? public let grandparentThumb: String?
/// The title of the grandparent entity (typically the show's title). /// The title of the grandparent entity (typically the show's title).
public let grandparentTitle: String? public let grandparentTitle: String?
/// An array of GUID objects.
public let guids: [Operations.GetMediaMetaDataGuids]?
/// The index or order of the item. /// The index or order of the item.
public let index: Int? public let index: Int?
/// Unix timestamp of when the item was last viewed. /// Unix timestamp of when the item was last viewed.
@@ -84,6 +77,9 @@ extension Operations {
/// An array of location objects. /// An array of location objects.
public let location: [Operations.GetMediaMetaDataLocation]? public let location: [Operations.GetMediaMetaDataLocation]?
public let media: [Operations.GetMediaMetaDataMedia]? public let media: [Operations.GetMediaMetaDataMedia]?
/// The original release date.
@DateOnly
public private(set) var originallyAvailableAt: Date?
/// The original title of the content. /// The original title of the content.
public let originalTitle: String? public let originalTitle: String?
/// A GUID identifying the parent entity (e.g., season) for the item. /// A GUID identifying the parent entity (e.g., season) for the item.
@@ -101,6 +97,13 @@ extension Operations {
public let primaryExtraKey: String? public let primaryExtraKey: String?
/// An array of Writer roles. /// An array of Writer roles.
public let producer: [Operations.Producer]? public let producer: [Operations.Producer]?
/// The general rating
@DecimalSerialized
public private(set) var rating: Double?
/// The URL or identifier for the rating image (e.g., Rotten Tomatoes rating image).
public let ratingImage: String?
/// An array of rating objects.
public let ratings: [Operations.Ratings]?
/// An array of Actor roles. /// An array of Actor roles.
public let role: [Operations.GetMediaMetaDataRole]? public let role: [Operations.GetMediaMetaDataRole]?
/// An array of similar content objects. /// An array of similar content objects.
@@ -124,29 +127,24 @@ extension Operations {
/// Creates an object with the specified parameters /// Creates an object with the specified parameters
/// ///
/// - Parameter addedAt: Unix timestamp when the item was added.
/// - Parameter art: URL of the art image. /// - Parameter art: URL of the art image.
/// - Parameter audienceRating: The audience rating for the content.
/// - Parameter audienceRatingImage: The URL for the audience rating image.
/// - Parameter contentRating: The content rating (e.g., TV-MA).
/// - Parameter duration: Duration of the content in milliseconds. /// - Parameter duration: Duration of the content in milliseconds.
/// - Parameter guid: The globally unique identifier for the item. /// - Parameter guid: The globally unique identifier for the item.
/// - Parameter guids: An array of GUID objects.
/// - Parameter image: An array of image objects. /// - Parameter image: An array of image objects.
/// - Parameter key: The API key to access metadata details. /// - Parameter key: The API key to access metadata details.
/// - Parameter librarySectionID: The ID of the library section. /// - Parameter librarySectionID: The ID of the library section.
/// - Parameter librarySectionKey: The key of the library section. /// - Parameter librarySectionKey: The key of the library section.
/// - Parameter librarySectionTitle: The title of the library section. /// - Parameter librarySectionTitle: The title of the library section.
/// - Parameter originallyAvailableAt: The original release date.
/// - Parameter rating: An array of rating objects.
/// - Parameter ratingKey: The rating key of the metadata item. /// - Parameter ratingKey: The rating key of the metadata item.
/// - Parameter summary: A summary of the content. /// - Parameter summary: A summary of the content.
/// - Parameter thumb: URL of the thumbnail image. /// - Parameter thumb: URL of the thumbnail image.
/// - Parameter title: The title of the content. /// - Parameter title: The title of the content.
/// - Parameter type: The type of content (e.g., show, movie). /// - Parameter type: The type of content (e.g., show, movie).
/// - Parameter updatedAt: Unix timestamp when the item was last updated.
/// - Parameter year: The release year. /// - Parameter year: The release year.
/// - Parameter audienceRating: The audience rating for the content.
/// - Parameter audienceRatingImage: The URL for the audience rating image.
/// - Parameter childCount: The number of child items. /// - Parameter childCount: The number of child items.
/// - Parameter contentRating: The content rating (e.g., TV-MA).
/// - Parameter country: An array of country tags. /// - Parameter country: An array of country tags.
/// - Parameter director: An array of Director roles. /// - Parameter director: An array of Director roles.
/// - Parameter genre: An array of genre tags. /// - Parameter genre: An array of genre tags.
@@ -157,10 +155,12 @@ extension Operations {
/// - Parameter grandparentSlug: A URL-friendly identifier (slug) for the grandparent entity. /// - Parameter grandparentSlug: A URL-friendly identifier (slug) for the grandparent entity.
/// - Parameter grandparentThumb: The URL of the grandparent's thumbnail image. /// - Parameter grandparentThumb: The URL of the grandparent's thumbnail image.
/// - Parameter grandparentTitle: The title of the grandparent entity (typically the show's title). /// - Parameter grandparentTitle: The title of the grandparent entity (typically the show's title).
/// - Parameter guids: An array of GUID objects.
/// - Parameter index: The index or order of the item. /// - Parameter index: The index or order of the item.
/// - Parameter lastViewedAt: Unix timestamp of when the item was last viewed. /// - Parameter lastViewedAt: Unix timestamp of when the item was last viewed.
/// - Parameter leafCount: The total number of episodes (or leaves). /// - Parameter leafCount: The total number of episodes (or leaves).
/// - Parameter location: An array of location objects. /// - Parameter location: An array of location objects.
/// - Parameter originallyAvailableAt: The original release date.
/// - Parameter originalTitle: The original title of the content. /// - Parameter originalTitle: The original title of the content.
/// - Parameter parentGuid: A GUID identifying the parent entity (e.g., season) for the item. /// - Parameter parentGuid: A GUID identifying the parent entity (e.g., season) for the item.
/// - Parameter parentIndex: The index number of the parent entity, which could indicate its order or position. /// - Parameter parentIndex: The index number of the parent entity, which could indicate its order or position.
@@ -169,6 +169,9 @@ extension Operations {
/// - Parameter parentThumb: The URL of the parent's thumbnail image. /// - Parameter parentThumb: The URL of the parent's thumbnail image.
/// - Parameter parentTitle: The title of the parent entity (typically the season's title). /// - Parameter parentTitle: The title of the parent entity (typically the season's title).
/// - Parameter producer: An array of Writer roles. /// - Parameter producer: An array of Writer roles.
/// - Parameter rating: The general rating
/// - Parameter ratingImage: The URL or identifier for the rating image (e.g., Rotten Tomatoes rating image).
/// - Parameter ratings: An array of rating objects.
/// - Parameter role: An array of Actor roles. /// - Parameter role: An array of Actor roles.
/// - Parameter similar: An array of similar content objects. /// - Parameter similar: An array of similar content objects.
/// - Parameter skipCount: The number of times the item has been skipped. /// - Parameter skipCount: The number of times the item has been skipped.
@@ -180,22 +183,16 @@ extension Operations {
/// - Parameter viewedLeafCount: The number of episodes that have been viewed. /// - Parameter viewedLeafCount: The number of episodes that have been viewed.
/// - Parameter writer: An array of Writer roles. /// - Parameter writer: An array of Writer roles.
/// ///
public init(addedAt: Int, art: String, audienceRating: Double, audienceRatingImage: String, contentRating: String, duration: Int, guid: String, guids: [Operations.Guids], image: [Operations.GetMediaMetaDataImage], key: String, librarySectionID: Int, librarySectionKey: String, librarySectionTitle: String, originallyAvailableAt: Date, rating: [Operations.Rating], ratingKey: String, summary: String, thumb: String, title: String, type: String, ultraBlurColors: Operations.GetMediaMetaDataUltraBlurColors, updatedAt: Int, year: Int, chapterSource: String? = nil, childCount: Int? = nil, country: [Operations.GetMediaMetaDataCountry]? = nil, director: [Operations.GetMediaMetaDataDirector]? = nil, genre: [Operations.GetMediaMetaDataGenre]? = nil, grandparentArt: String? = nil, grandparentGuid: String? = nil, grandparentKey: String? = nil, grandparentRatingKey: String? = nil, grandparentSlug: String? = nil, grandparentThumb: String? = nil, grandparentTitle: String? = nil, index: Int? = nil, lastViewedAt: Int? = nil, leafCount: Int? = nil, location: [Operations.GetMediaMetaDataLocation]? = nil, media: [Operations.GetMediaMetaDataMedia]? = nil, originalTitle: String? = nil, parentGuid: String? = nil, parentIndex: Int? = nil, parentKey: String? = nil, parentRatingKey: String? = nil, parentThumb: String? = nil, parentTitle: String? = nil, primaryExtraKey: String? = nil, producer: [Operations.Producer]? = nil, role: [Operations.GetMediaMetaDataRole]? = nil, similar: [Operations.Similar]? = nil, skipCount: Int? = nil, slug: String? = nil, studio: String? = nil, tagline: String? = nil, theme: String? = nil, viewCount: Int? = nil, viewedLeafCount: Int? = nil, writer: [Operations.GetMediaMetaDataWriter]? = nil) { public init(addedAt: Int, art: String, duration: Int, guid: String, image: [Operations.GetMediaMetaDataImage], key: String, librarySectionID: Int, librarySectionKey: String, librarySectionTitle: String, ratingKey: String, summary: String, thumb: String, title: String, type: String, ultraBlurColors: Operations.GetMediaMetaDataUltraBlurColors, updatedAt: Int, year: Int, audienceRating: Double? = nil, audienceRatingImage: String? = nil, chapterSource: String? = nil, childCount: Int? = nil, contentRating: String? = nil, country: [Operations.GetMediaMetaDataCountry]? = nil, director: [Operations.GetMediaMetaDataDirector]? = nil, genre: [Operations.GetMediaMetaDataGenre]? = nil, grandparentArt: String? = nil, grandparentGuid: String? = nil, grandparentKey: String? = nil, grandparentRatingKey: String? = nil, grandparentSlug: String? = nil, grandparentThumb: String? = nil, grandparentTitle: String? = nil, guids: [Operations.GetMediaMetaDataGuids]? = nil, index: Int? = nil, lastViewedAt: Int? = nil, leafCount: Int? = nil, location: [Operations.GetMediaMetaDataLocation]? = nil, media: [Operations.GetMediaMetaDataMedia]? = nil, originallyAvailableAt: Date? = nil, originalTitle: String? = nil, parentGuid: String? = nil, parentIndex: Int? = nil, parentKey: String? = nil, parentRatingKey: String? = nil, parentThumb: String? = nil, parentTitle: String? = nil, primaryExtraKey: String? = nil, producer: [Operations.Producer]? = nil, rating: Double? = nil, ratingImage: String? = nil, ratings: [Operations.Ratings]? = nil, role: [Operations.GetMediaMetaDataRole]? = nil, similar: [Operations.Similar]? = nil, skipCount: Int? = nil, slug: String? = nil, studio: String? = nil, tagline: String? = nil, theme: String? = nil, viewCount: Int? = nil, viewedLeafCount: Int? = nil, writer: [Operations.GetMediaMetaDataWriter]? = nil) {
self.addedAt = addedAt self.addedAt = addedAt
self.art = art self.art = art
self._audienceRating = DecimalSerialized<Double>(wrappedValue: audienceRating)
self.audienceRatingImage = audienceRatingImage
self.contentRating = contentRating
self.duration = duration self.duration = duration
self.guid = guid self.guid = guid
self.guids = guids
self.image = image self.image = image
self.key = key self.key = key
self.librarySectionID = librarySectionID self.librarySectionID = librarySectionID
self.librarySectionKey = librarySectionKey self.librarySectionKey = librarySectionKey
self.librarySectionTitle = librarySectionTitle self.librarySectionTitle = librarySectionTitle
self._originallyAvailableAt = DateOnly<Date>(wrappedValue: originallyAvailableAt)
self.rating = rating
self.ratingKey = ratingKey self.ratingKey = ratingKey
self.summary = summary self.summary = summary
self.thumb = thumb self.thumb = thumb
@@ -204,8 +201,11 @@ extension Operations {
self.ultraBlurColors = ultraBlurColors self.ultraBlurColors = ultraBlurColors
self.updatedAt = updatedAt self.updatedAt = updatedAt
self.year = year self.year = year
self._audienceRating = DecimalSerialized<Double?>(wrappedValue: audienceRating)
self.audienceRatingImage = audienceRatingImage
self.chapterSource = chapterSource self.chapterSource = chapterSource
self.childCount = childCount self.childCount = childCount
self.contentRating = contentRating
self.country = country self.country = country
self.director = director self.director = director
self.genre = genre self.genre = genre
@@ -216,11 +216,13 @@ extension Operations {
self.grandparentSlug = grandparentSlug self.grandparentSlug = grandparentSlug
self.grandparentThumb = grandparentThumb self.grandparentThumb = grandparentThumb
self.grandparentTitle = grandparentTitle self.grandparentTitle = grandparentTitle
self.guids = guids
self.index = index self.index = index
self.lastViewedAt = lastViewedAt self.lastViewedAt = lastViewedAt
self.leafCount = leafCount self.leafCount = leafCount
self.location = location self.location = location
self.media = media self.media = media
self._originallyAvailableAt = DateOnly<Date?>(wrappedValue: originallyAvailableAt)
self.originalTitle = originalTitle self.originalTitle = originalTitle
self.parentGuid = parentGuid self.parentGuid = parentGuid
self.parentIndex = parentIndex self.parentIndex = parentIndex
@@ -230,6 +232,9 @@ extension Operations {
self.parentTitle = parentTitle self.parentTitle = parentTitle
self.primaryExtraKey = primaryExtraKey self.primaryExtraKey = primaryExtraKey
self.producer = producer self.producer = producer
self._rating = DecimalSerialized<Double?>(wrappedValue: rating)
self.ratingImage = ratingImage
self.ratings = ratings
self.role = role self.role = role
self.similar = similar self.similar = similar
self.skipCount = skipCount self.skipCount = skipCount
@@ -247,19 +252,13 @@ extension Operations.GetMediaMetaDataMetadata: Codable {
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case addedAt case addedAt
case art case art
case audienceRating
case audienceRatingImage
case contentRating
case duration case duration
case guid case guid
case guids = "Guid"
case image = "Image" case image = "Image"
case key case key
case librarySectionID case librarySectionID
case librarySectionKey case librarySectionKey
case librarySectionTitle case librarySectionTitle
case originallyAvailableAt
case rating = "Rating"
case ratingKey case ratingKey
case summary case summary
case thumb case thumb
@@ -268,8 +267,11 @@ extension Operations.GetMediaMetaDataMetadata: Codable {
case ultraBlurColors = "UltraBlurColors" case ultraBlurColors = "UltraBlurColors"
case updatedAt case updatedAt
case year case year
case audienceRating
case audienceRatingImage
case chapterSource case chapterSource
case childCount case childCount
case contentRating
case country = "Country" case country = "Country"
case director = "Director" case director = "Director"
case genre = "Genre" case genre = "Genre"
@@ -280,11 +282,13 @@ extension Operations.GetMediaMetaDataMetadata: Codable {
case grandparentSlug case grandparentSlug
case grandparentThumb case grandparentThumb
case grandparentTitle case grandparentTitle
case guids = "Guid"
case index case index
case lastViewedAt case lastViewedAt
case leafCount case leafCount
case location = "Location" case location = "Location"
case media = "Media" case media = "Media"
case originallyAvailableAt
case originalTitle case originalTitle
case parentGuid case parentGuid
case parentIndex case parentIndex
@@ -294,6 +298,9 @@ extension Operations.GetMediaMetaDataMetadata: Codable {
case parentTitle case parentTitle
case primaryExtraKey case primaryExtraKey
case producer = "Producer" case producer = "Producer"
case rating
case ratingImage
case ratings = "Rating"
case role = "Role" case role = "Role"
case similar = "Similar" case similar = "Similar"
case skipCount case skipCount
@@ -310,19 +317,13 @@ extension Operations.GetMediaMetaDataMetadata: Codable {
let container = try decoder.container(keyedBy: CodingKeys.self) let container = try decoder.container(keyedBy: CodingKeys.self)
self.addedAt = try container.decode(Int.self, forKey: .addedAt) self.addedAt = try container.decode(Int.self, forKey: .addedAt)
self.art = try container.decode(String.self, forKey: .art) self.art = try container.decode(String.self, forKey: .art)
self._audienceRating = try container.decode(DecimalSerialized<Double>.self, forKey: .audienceRating)
self.audienceRatingImage = try container.decode(String.self, forKey: .audienceRatingImage)
self.contentRating = try container.decode(String.self, forKey: .contentRating)
self.duration = try container.decode(Int.self, forKey: .duration) self.duration = try container.decode(Int.self, forKey: .duration)
self.guid = try container.decode(String.self, forKey: .guid) self.guid = try container.decode(String.self, forKey: .guid)
self.guids = try container.decode([Operations.Guids].self, forKey: .guids)
self.image = try container.decode([Operations.GetMediaMetaDataImage].self, forKey: .image) self.image = try container.decode([Operations.GetMediaMetaDataImage].self, forKey: .image)
self.key = try container.decode(String.self, forKey: .key) self.key = try container.decode(String.self, forKey: .key)
self.librarySectionID = try container.decode(Int.self, forKey: .librarySectionID) self.librarySectionID = try container.decode(Int.self, forKey: .librarySectionID)
self.librarySectionKey = try container.decode(String.self, forKey: .librarySectionKey) self.librarySectionKey = try container.decode(String.self, forKey: .librarySectionKey)
self.librarySectionTitle = try container.decode(String.self, forKey: .librarySectionTitle) self.librarySectionTitle = try container.decode(String.self, forKey: .librarySectionTitle)
self._originallyAvailableAt = try container.decode(DateOnly<Date>.self, forKey: .originallyAvailableAt)
self.rating = try container.decode([Operations.Rating].self, forKey: .rating)
self.ratingKey = try container.decode(String.self, forKey: .ratingKey) self.ratingKey = try container.decode(String.self, forKey: .ratingKey)
self.summary = try container.decode(String.self, forKey: .summary) self.summary = try container.decode(String.self, forKey: .summary)
self.thumb = try container.decode(String.self, forKey: .thumb) self.thumb = try container.decode(String.self, forKey: .thumb)
@@ -331,8 +332,11 @@ extension Operations.GetMediaMetaDataMetadata: Codable {
self.ultraBlurColors = try container.decode(Operations.GetMediaMetaDataUltraBlurColors.self, forKey: .ultraBlurColors) self.ultraBlurColors = try container.decode(Operations.GetMediaMetaDataUltraBlurColors.self, forKey: .ultraBlurColors)
self.updatedAt = try container.decode(Int.self, forKey: .updatedAt) self.updatedAt = try container.decode(Int.self, forKey: .updatedAt)
self.year = try container.decode(Int.self, forKey: .year) self.year = try container.decode(Int.self, forKey: .year)
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.chapterSource = try container.decodeIfPresent(String.self, forKey: .chapterSource)
self.childCount = try container.decodeIfPresent(Int.self, forKey: .childCount) self.childCount = try container.decodeIfPresent(Int.self, forKey: .childCount)
self.contentRating = try container.decodeIfPresent(String.self, forKey: .contentRating)
self.country = try container.decodeIfPresent([Operations.GetMediaMetaDataCountry].self, forKey: .country) self.country = try container.decodeIfPresent([Operations.GetMediaMetaDataCountry].self, forKey: .country)
self.director = try container.decodeIfPresent([Operations.GetMediaMetaDataDirector].self, forKey: .director) self.director = try container.decodeIfPresent([Operations.GetMediaMetaDataDirector].self, forKey: .director)
self.genre = try container.decodeIfPresent([Operations.GetMediaMetaDataGenre].self, forKey: .genre) self.genre = try container.decodeIfPresent([Operations.GetMediaMetaDataGenre].self, forKey: .genre)
@@ -343,11 +347,13 @@ extension Operations.GetMediaMetaDataMetadata: Codable {
self.grandparentSlug = try container.decodeIfPresent(String.self, forKey: .grandparentSlug) self.grandparentSlug = try container.decodeIfPresent(String.self, forKey: .grandparentSlug)
self.grandparentThumb = try container.decodeIfPresent(String.self, forKey: .grandparentThumb) self.grandparentThumb = try container.decodeIfPresent(String.self, forKey: .grandparentThumb)
self.grandparentTitle = try container.decodeIfPresent(String.self, forKey: .grandparentTitle) self.grandparentTitle = try container.decodeIfPresent(String.self, forKey: .grandparentTitle)
self.guids = try container.decodeIfPresent([Operations.GetMediaMetaDataGuids].self, forKey: .guids)
self.index = try container.decodeIfPresent(Int.self, forKey: .index) self.index = try container.decodeIfPresent(Int.self, forKey: .index)
self.lastViewedAt = try container.decodeIfPresent(Int.self, forKey: .lastViewedAt) self.lastViewedAt = try container.decodeIfPresent(Int.self, forKey: .lastViewedAt)
self.leafCount = try container.decodeIfPresent(Int.self, forKey: .leafCount) self.leafCount = try container.decodeIfPresent(Int.self, forKey: .leafCount)
self.location = try container.decodeIfPresent([Operations.GetMediaMetaDataLocation].self, forKey: .location) self.location = try container.decodeIfPresent([Operations.GetMediaMetaDataLocation].self, forKey: .location)
self.media = try container.decodeIfPresent([Operations.GetMediaMetaDataMedia].self, forKey: .media) self.media = try container.decodeIfPresent([Operations.GetMediaMetaDataMedia].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.originalTitle = try container.decodeIfPresent(String.self, forKey: .originalTitle)
self.parentGuid = try container.decodeIfPresent(String.self, forKey: .parentGuid) self.parentGuid = try container.decodeIfPresent(String.self, forKey: .parentGuid)
self.parentIndex = try container.decodeIfPresent(Int.self, forKey: .parentIndex) self.parentIndex = try container.decodeIfPresent(Int.self, forKey: .parentIndex)
@@ -357,6 +363,9 @@ extension Operations.GetMediaMetaDataMetadata: Codable {
self.parentTitle = try container.decodeIfPresent(String.self, forKey: .parentTitle) self.parentTitle = try container.decodeIfPresent(String.self, forKey: .parentTitle)
self.primaryExtraKey = try container.decodeIfPresent(String.self, forKey: .primaryExtraKey) self.primaryExtraKey = try container.decodeIfPresent(String.self, forKey: .primaryExtraKey)
self.producer = try container.decodeIfPresent([Operations.Producer].self, forKey: .producer) self.producer = try container.decodeIfPresent([Operations.Producer].self, forKey: .producer)
self._rating = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .rating) ?? DecimalSerialized<Double?>(wrappedValue: nil)
self.ratingImage = try container.decodeIfPresent(String.self, forKey: .ratingImage)
self.ratings = try container.decodeIfPresent([Operations.Ratings].self, forKey: .ratings)
self.role = try container.decodeIfPresent([Operations.GetMediaMetaDataRole].self, forKey: .role) self.role = try container.decodeIfPresent([Operations.GetMediaMetaDataRole].self, forKey: .role)
self.similar = try container.decodeIfPresent([Operations.Similar].self, forKey: .similar) self.similar = try container.decodeIfPresent([Operations.Similar].self, forKey: .similar)
self.skipCount = try container.decodeIfPresent(Int.self, forKey: .skipCount) self.skipCount = try container.decodeIfPresent(Int.self, forKey: .skipCount)
@@ -373,19 +382,13 @@ extension Operations.GetMediaMetaDataMetadata: Codable {
var container = encoder.container(keyedBy: CodingKeys.self) var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self.addedAt, forKey: .addedAt) try container.encode(self.addedAt, forKey: .addedAt)
try container.encode(self.art, forKey: .art) try container.encode(self.art, forKey: .art)
try container.encode(self._audienceRating, forKey: .audienceRating)
try container.encode(self.audienceRatingImage, forKey: .audienceRatingImage)
try container.encode(self.contentRating, forKey: .contentRating)
try container.encode(self.duration, forKey: .duration) try container.encode(self.duration, forKey: .duration)
try container.encode(self.guid, forKey: .guid) try container.encode(self.guid, forKey: .guid)
try container.encode(self.guids, forKey: .guids)
try container.encode(self.image, forKey: .image) try container.encode(self.image, forKey: .image)
try container.encode(self.key, forKey: .key) try container.encode(self.key, forKey: .key)
try container.encode(self.librarySectionID, forKey: .librarySectionID) try container.encode(self.librarySectionID, forKey: .librarySectionID)
try container.encode(self.librarySectionKey, forKey: .librarySectionKey) try container.encode(self.librarySectionKey, forKey: .librarySectionKey)
try container.encode(self.librarySectionTitle, forKey: .librarySectionTitle) try container.encode(self.librarySectionTitle, forKey: .librarySectionTitle)
try container.encode(self._originallyAvailableAt, forKey: .originallyAvailableAt)
try container.encode(self.rating, forKey: .rating)
try container.encode(self.ratingKey, forKey: .ratingKey) try container.encode(self.ratingKey, forKey: .ratingKey)
try container.encode(self.summary, forKey: .summary) try container.encode(self.summary, forKey: .summary)
try container.encode(self.thumb, forKey: .thumb) try container.encode(self.thumb, forKey: .thumb)
@@ -394,8 +397,13 @@ extension Operations.GetMediaMetaDataMetadata: Codable {
try container.encode(self.ultraBlurColors, forKey: .ultraBlurColors) try container.encode(self.ultraBlurColors, forKey: .ultraBlurColors)
try container.encode(self.updatedAt, forKey: .updatedAt) try container.encode(self.updatedAt, forKey: .updatedAt)
try container.encode(self.year, forKey: .year) try container.encode(self.year, forKey: .year)
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.chapterSource, forKey: .chapterSource)
try container.encodeIfPresent(self.childCount, forKey: .childCount) 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.country, forKey: .country)
try container.encodeIfPresent(self.director, forKey: .director) try container.encodeIfPresent(self.director, forKey: .director)
try container.encodeIfPresent(self.genre, forKey: .genre) try container.encodeIfPresent(self.genre, forKey: .genre)
@@ -406,11 +414,15 @@ extension Operations.GetMediaMetaDataMetadata: Codable {
try container.encodeIfPresent(self.grandparentSlug, forKey: .grandparentSlug) try container.encodeIfPresent(self.grandparentSlug, forKey: .grandparentSlug)
try container.encodeIfPresent(self.grandparentThumb, forKey: .grandparentThumb) try container.encodeIfPresent(self.grandparentThumb, forKey: .grandparentThumb)
try container.encodeIfPresent(self.grandparentTitle, forKey: .grandparentTitle) try container.encodeIfPresent(self.grandparentTitle, forKey: .grandparentTitle)
try container.encodeIfPresent(self.guids, forKey: .guids)
try container.encodeIfPresent(self.index, forKey: .index) try container.encodeIfPresent(self.index, forKey: .index)
try container.encodeIfPresent(self.lastViewedAt, forKey: .lastViewedAt) try container.encodeIfPresent(self.lastViewedAt, forKey: .lastViewedAt)
try container.encodeIfPresent(self.leafCount, forKey: .leafCount) try container.encodeIfPresent(self.leafCount, forKey: .leafCount)
try container.encodeIfPresent(self.location, forKey: .location) try container.encodeIfPresent(self.location, forKey: .location)
try container.encodeIfPresent(self.media, forKey: .media) 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.originalTitle, forKey: .originalTitle)
try container.encodeIfPresent(self.parentGuid, forKey: .parentGuid) try container.encodeIfPresent(self.parentGuid, forKey: .parentGuid)
try container.encodeIfPresent(self.parentIndex, forKey: .parentIndex) try container.encodeIfPresent(self.parentIndex, forKey: .parentIndex)
@@ -420,6 +432,11 @@ extension Operations.GetMediaMetaDataMetadata: Codable {
try container.encodeIfPresent(self.parentTitle, forKey: .parentTitle) try container.encodeIfPresent(self.parentTitle, forKey: .parentTitle)
try container.encodeIfPresent(self.primaryExtraKey, forKey: .primaryExtraKey) try container.encodeIfPresent(self.primaryExtraKey, forKey: .primaryExtraKey)
try container.encodeIfPresent(self.producer, forKey: .producer) try container.encodeIfPresent(self.producer, forKey: .producer)
if self.rating != nil {
try container.encode(self._rating, forKey: .rating)
}
try container.encodeIfPresent(self.ratingImage, forKey: .ratingImage)
try container.encodeIfPresent(self.ratings, forKey: .ratings)
try container.encodeIfPresent(self.role, forKey: .role) try container.encodeIfPresent(self.role, forKey: .role)
try container.encodeIfPresent(self.similar, forKey: .similar) try container.encodeIfPresent(self.similar, forKey: .similar)
try container.encodeIfPresent(self.skipCount, forKey: .skipCount) try container.encodeIfPresent(self.skipCount, forKey: .skipCount)
@@ -434,10 +451,13 @@ extension Operations.GetMediaMetaDataMetadata: Codable {
} }
extension Operations.GetMediaMetaDataMetadata { extension Operations.GetMediaMetaDataMetadata {
var audienceRatingWrapper: DecimalSerialized<Double> { var audienceRatingWrapper: DecimalSerialized<Double?> {
return _audienceRating return _audienceRating
} }
var originallyAvailableAtWrapper: DateOnly<Date> { var ratingWrapper: DecimalSerialized<Double?> {
return _rating
}
var originallyAvailableAtWrapper: DateOnly<Date?> {
return _originallyAvailableAt return _originallyAvailableAt
} }
} }

View File

@@ -0,0 +1,32 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
public enum GetMediaMetaDataOptimizedForStreaming {
case getMediaMetaData1(Operations.GetMediaMetaData1)
case bool(Bool)
}}
extension Operations.GetMediaMetaDataOptimizedForStreaming: Codable {
public init(from decoder: Decoder) throws {
if let value = try? Operations.GetMediaMetaData1(from: decoder) {
self = .getMediaMetaData1(value)
} else if let value = try? Bool(from: decoder) {
self = .bool(value)
} else {
throw PlexswiftError.failedToHandleResponse(.failedToDecodeResponse)
}
}
public func encode(to encoder: Encoder) throws {
switch self {
case .getMediaMetaData1(let value):
try value.encode(to: encoder)
case .bool(let value):
try value.encode(to: encoder)
}
}
}

View File

@@ -5,10 +5,6 @@ import Foundation
extension Operations { extension Operations {
/// A model object /// A model object
public struct GetMediaMetaDataPart { public struct GetMediaMetaDataPart {
/// Container format of the part.
public let container: String
/// Duration of the part in milliseconds.
public let duration: Int
/// File path for the part. /// File path for the part.
public let file: String public let file: String
/// Unique part identifier. /// Unique part identifier.
@@ -17,57 +13,80 @@ extension Operations {
public let key: String public let key: String
/// File size in bytes. /// File size in bytes.
public let size: Int public let size: Int
/// An array of streams for this part.
public let stream: [Operations.GetMediaMetaDataStream]
/// Video profile for the part.
public let videoProfile: String
/// Indicates if the part is accessible. /// Indicates if the part is accessible.
public let accessible: Bool? public let accessible: Bool?
/// The audio profile used for the media (e.g., DTS, Dolby Digital, etc.).
public let audioProfile: String?
/// Container format of the part.
public let container: String?
/// Duration of the part in milliseconds.
public let duration: Int?
/// Indicates if the part exists. /// Indicates if the part exists.
public let exists: Bool? public let exists: Bool?
public let has64bitOffsets: Bool?
public let hasThumbnail: Operations.GetMediaMetaDataHasThumbnail?
public let indexes: String? public let indexes: String?
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
public let optimizedForStreaming: Operations.GetMediaMetaDataLibraryOptimizedForStreaming?
public let packetLength: Int?
/// An array of streams for this part.
public let stream: [Operations.GetMediaMetaDataStream]?
/// Video profile for the part.
public let videoProfile: String?
/// Creates an object with the specified parameters /// Creates an object with the specified parameters
/// ///
/// - Parameter container: Container format of the part.
/// - Parameter duration: Duration of the part in milliseconds.
/// - Parameter file: File path for the part. /// - Parameter file: File path for the part.
/// - Parameter id: Unique part identifier. /// - Parameter id: Unique part identifier.
/// - Parameter key: Key to access this part. /// - Parameter key: Key to access this part.
/// - Parameter size: File size in bytes. /// - Parameter size: File size in bytes.
/// - Parameter accessible: Indicates if the part is accessible.
/// - Parameter audioProfile: The audio profile used for the media (e.g., DTS, Dolby Digital, etc.).
/// - Parameter container: Container format of the part.
/// - Parameter duration: Duration of the part in milliseconds.
/// - Parameter exists: Indicates if the part exists.
/// - Parameter optimizedForStreaming: Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
/// - Parameter stream: An array of streams for this part. /// - Parameter stream: An array of streams for this part.
/// - Parameter videoProfile: Video profile for the part. /// - Parameter videoProfile: Video profile for the part.
/// - Parameter accessible: Indicates if the part is accessible.
/// - Parameter exists: Indicates if the part exists.
/// ///
public init(container: String, duration: Int, file: String, id: Int, key: String, size: Int, stream: [Operations.GetMediaMetaDataStream], videoProfile: String, accessible: Bool? = nil, exists: Bool? = nil, indexes: String? = nil) { public init(file: String, id: Int, key: String, size: Int, accessible: Bool? = nil, audioProfile: String? = nil, container: String? = nil, duration: Int? = nil, exists: Bool? = nil, has64bitOffsets: Bool? = nil, hasThumbnail: Operations.GetMediaMetaDataHasThumbnail? = nil, indexes: String? = nil, optimizedForStreaming: Operations.GetMediaMetaDataLibraryOptimizedForStreaming? = nil, packetLength: Int? = nil, stream: [Operations.GetMediaMetaDataStream]? = nil, videoProfile: String? = nil) {
self.container = container
self.duration = duration
self.file = file self.file = file
self.id = id self.id = id
self.key = key self.key = key
self.size = size self.size = size
self.accessible = accessible
self.audioProfile = audioProfile
self.container = container
self.duration = duration
self.exists = exists
self.has64bitOffsets = has64bitOffsets
self.hasThumbnail = hasThumbnail
self.indexes = indexes
self.optimizedForStreaming = optimizedForStreaming
self.packetLength = packetLength
self.stream = stream self.stream = stream
self.videoProfile = videoProfile self.videoProfile = videoProfile
self.accessible = accessible
self.exists = exists
self.indexes = indexes
} }
}} }}
extension Operations.GetMediaMetaDataPart: Codable { extension Operations.GetMediaMetaDataPart: Codable {
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case container
case duration
case file case file
case id case id
case key case key
case size case size
case accessible
case audioProfile
case container
case duration
case exists
case has64bitOffsets
case hasThumbnail
case indexes
case optimizedForStreaming
case packetLength
case stream = "Stream" case stream = "Stream"
case videoProfile case videoProfile
case accessible
case exists
case indexes
} }
} }

View File

@@ -5,8 +5,6 @@ import Foundation
extension Operations { extension Operations {
/// A model object /// A model object
public struct GetMediaMetaDataStream { public struct GetMediaMetaDataStream {
/// Bitrate of the stream.
public let bitrate: Int
/// Codec used by the stream. /// Codec used by the stream.
public let codec: String public let codec: String
/// Display title for the stream. /// Display title for the stream.
@@ -29,6 +27,8 @@ extension Operations {
public let audioChannelLayout: String? public let audioChannelLayout: String?
/// Bit depth of the video stream. /// Bit depth of the video stream.
public let bitDepth: Int? public let bitDepth: Int?
/// Bitrate of the stream.
public let bitrate: Int?
/// Indicates if the stream can auto-sync. /// Indicates if the stream can auto-sync.
public let canAutoSync: Bool? public let canAutoSync: Bool?
/// Number of audio channels (for audio streams). /// Number of audio channels (for audio streams).
@@ -74,6 +74,8 @@ extension Operations {
@DecimalSerialized @DecimalSerialized
public private(set) var frameRate: Double? public private(set) var frameRate: Double?
public let hasScalingMatrix: Bool? public let hasScalingMatrix: Bool?
/// Indicates whether header compression is enabled.
public let headerCompression: Bool?
/// Indicates if the stream is for the hearing impaired. /// Indicates if the stream is for the hearing impaired.
public let hearingImpaired: Bool? public let hearingImpaired: Bool?
/// Height of the video stream. /// Height of the video stream.
@@ -98,7 +100,6 @@ extension Operations {
/// Creates an object with the specified parameters /// Creates an object with the specified parameters
/// ///
/// - Parameter bitrate: Bitrate of the stream.
/// - Parameter codec: Codec used by the stream. /// - Parameter codec: Codec used by the stream.
/// - Parameter displayTitle: Display title for the stream. /// - Parameter displayTitle: Display title for the stream.
/// - Parameter extendedDisplayTitle: Extended display title for the stream. /// - Parameter extendedDisplayTitle: Extended display title for the stream.
@@ -110,6 +111,7 @@ extension Operations {
/// - Parameter streamType: Stream type (1=video, 2=audio, 3=subtitle). /// - Parameter streamType: Stream type (1=video, 2=audio, 3=subtitle).
/// - Parameter audioChannelLayout: Audio channel layout. /// - Parameter audioChannelLayout: Audio channel layout.
/// - Parameter bitDepth: Bit depth of the video stream. /// - Parameter bitDepth: Bit depth of the video stream.
/// - Parameter bitrate: Bitrate of the stream.
/// - Parameter canAutoSync: Indicates if the stream can auto-sync. /// - Parameter canAutoSync: Indicates if the stream can auto-sync.
/// - Parameter channels: Number of audio channels (for audio streams). /// - Parameter channels: Number of audio channels (for audio streams).
/// - Parameter chromaLocation: Chroma sample location. /// - Parameter chromaLocation: Chroma sample location.
@@ -131,6 +133,7 @@ extension Operations {
/// - Parameter doviVersion: Dolby Vision version. /// - Parameter doviVersion: Dolby Vision version.
/// - Parameter dub: Indicates if the stream is a dub. /// - Parameter dub: Indicates if the stream is a dub.
/// - Parameter frameRate: Frame rate of the stream. /// - Parameter frameRate: Frame rate of the stream.
/// - Parameter headerCompression: Indicates whether header compression is enabled.
/// - Parameter hearingImpaired: Indicates if the stream is for the hearing impaired. /// - Parameter hearingImpaired: Indicates if the stream is for the hearing impaired.
/// - Parameter height: Height of the video stream. /// - Parameter height: Height of the video stream.
/// - Parameter level: Video level. /// - Parameter level: Video level.
@@ -142,8 +145,7 @@ extension Operations {
/// - Parameter title: Optional title for the stream (e.g., language variant). /// - Parameter title: Optional title for the stream (e.g., language variant).
/// - Parameter width: Width of the video stream. /// - Parameter width: Width of the video stream.
/// ///
public init(bitrate: Int, codec: String, displayTitle: String, extendedDisplayTitle: String, id: Int, index: Int, language: String, languageCode: String, languageTag: String, streamType: Int, audioChannelLayout: String? = nil, bitDepth: Int? = nil, canAutoSync: Bool? = nil, channels: Int? = nil, chromaLocation: String? = nil, chromaSubsampling: String? = nil, codedHeight: Int? = nil, codedWidth: Int? = nil, colorPrimaries: String? = nil, colorRange: String? = nil, colorSpace: String? = nil, colorTrc: String? = nil, `default`: Bool? = nil, doviblCompatID: Int? = nil, doviblPresent: Bool? = nil, dovielPresent: Bool? = nil, doviLevel: Int? = nil, doviPresent: Bool? = nil, doviProfile: Int? = nil, dovirpuPresent: Bool? = nil, doviVersion: String? = nil, dub: Bool? = nil, forced: Bool? = nil, frameRate: Double? = nil, hasScalingMatrix: Bool? = nil, hearingImpaired: Bool? = nil, height: Int? = nil, level: Int? = nil, original: Bool? = nil, profile: String? = nil, refFrames: Int? = nil, samplingRate: Int? = nil, scanType: String? = nil, selected: Bool? = nil, title: String? = nil, width: Int? = nil) { public init(codec: String, displayTitle: String, extendedDisplayTitle: String, id: Int, index: Int, language: String, languageCode: String, languageTag: String, streamType: Int, audioChannelLayout: String? = nil, bitDepth: Int? = nil, bitrate: Int? = nil, canAutoSync: Bool? = nil, channels: Int? = nil, chromaLocation: String? = nil, chromaSubsampling: String? = nil, codedHeight: Int? = nil, codedWidth: Int? = nil, colorPrimaries: String? = nil, colorRange: String? = nil, colorSpace: String? = nil, colorTrc: String? = nil, `default`: Bool? = nil, doviblCompatID: Int? = nil, doviblPresent: Bool? = nil, dovielPresent: Bool? = nil, doviLevel: Int? = nil, doviPresent: Bool? = nil, doviProfile: Int? = nil, dovirpuPresent: Bool? = nil, doviVersion: String? = nil, dub: Bool? = nil, forced: Bool? = nil, frameRate: Double? = nil, hasScalingMatrix: Bool? = nil, headerCompression: Bool? = nil, hearingImpaired: Bool? = nil, height: Int? = nil, level: Int? = nil, original: Bool? = nil, profile: String? = nil, refFrames: Int? = nil, samplingRate: Int? = nil, scanType: String? = nil, selected: Bool? = nil, title: String? = nil, width: Int? = nil) {
self.bitrate = bitrate
self.codec = codec self.codec = codec
self.displayTitle = displayTitle self.displayTitle = displayTitle
self.extendedDisplayTitle = extendedDisplayTitle self.extendedDisplayTitle = extendedDisplayTitle
@@ -155,6 +157,7 @@ extension Operations {
self.streamType = streamType self.streamType = streamType
self.audioChannelLayout = audioChannelLayout self.audioChannelLayout = audioChannelLayout
self.bitDepth = bitDepth self.bitDepth = bitDepth
self.bitrate = bitrate
self.canAutoSync = canAutoSync self.canAutoSync = canAutoSync
self.channels = channels self.channels = channels
self.chromaLocation = chromaLocation self.chromaLocation = chromaLocation
@@ -178,6 +181,7 @@ extension Operations {
self.forced = forced self.forced = forced
self._frameRate = DecimalSerialized<Double?>(wrappedValue: frameRate) self._frameRate = DecimalSerialized<Double?>(wrappedValue: frameRate)
self.hasScalingMatrix = hasScalingMatrix self.hasScalingMatrix = hasScalingMatrix
self.headerCompression = headerCompression
self.hearingImpaired = hearingImpaired self.hearingImpaired = hearingImpaired
self.height = height self.height = height
self.level = level self.level = level
@@ -194,7 +198,6 @@ extension Operations {
extension Operations.GetMediaMetaDataStream: Codable { extension Operations.GetMediaMetaDataStream: Codable {
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case bitrate
case codec case codec
case displayTitle case displayTitle
case extendedDisplayTitle case extendedDisplayTitle
@@ -206,6 +209,7 @@ extension Operations.GetMediaMetaDataStream: Codable {
case streamType case streamType
case audioChannelLayout case audioChannelLayout
case bitDepth case bitDepth
case bitrate
case canAutoSync case canAutoSync
case channels case channels
case chromaLocation case chromaLocation
@@ -229,6 +233,7 @@ extension Operations.GetMediaMetaDataStream: Codable {
case forced case forced
case frameRate case frameRate
case hasScalingMatrix case hasScalingMatrix
case headerCompression
case hearingImpaired case hearingImpaired
case height case height
case level case level
@@ -244,7 +249,6 @@ extension Operations.GetMediaMetaDataStream: Codable {
public init(from decoder: Decoder) throws { public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self) let container = try decoder.container(keyedBy: CodingKeys.self)
self.bitrate = try container.decode(Int.self, forKey: .bitrate)
self.codec = try container.decode(String.self, forKey: .codec) self.codec = try container.decode(String.self, forKey: .codec)
self.displayTitle = try container.decode(String.self, forKey: .displayTitle) self.displayTitle = try container.decode(String.self, forKey: .displayTitle)
self.extendedDisplayTitle = try container.decode(String.self, forKey: .extendedDisplayTitle) self.extendedDisplayTitle = try container.decode(String.self, forKey: .extendedDisplayTitle)
@@ -256,6 +260,7 @@ extension Operations.GetMediaMetaDataStream: Codable {
self.streamType = try container.decode(Int.self, forKey: .streamType) self.streamType = try container.decode(Int.self, forKey: .streamType)
self.audioChannelLayout = try container.decodeIfPresent(String.self, forKey: .audioChannelLayout) self.audioChannelLayout = try container.decodeIfPresent(String.self, forKey: .audioChannelLayout)
self.bitDepth = try container.decodeIfPresent(Int.self, forKey: .bitDepth) self.bitDepth = try container.decodeIfPresent(Int.self, forKey: .bitDepth)
self.bitrate = try container.decodeIfPresent(Int.self, forKey: .bitrate)
self.canAutoSync = try container.decodeIfPresent(Bool.self, forKey: .canAutoSync) self.canAutoSync = try container.decodeIfPresent(Bool.self, forKey: .canAutoSync)
self.channels = try container.decodeIfPresent(Int.self, forKey: .channels) self.channels = try container.decodeIfPresent(Int.self, forKey: .channels)
self.chromaLocation = try container.decodeIfPresent(String.self, forKey: .chromaLocation) self.chromaLocation = try container.decodeIfPresent(String.self, forKey: .chromaLocation)
@@ -279,6 +284,7 @@ extension Operations.GetMediaMetaDataStream: Codable {
self.forced = try container.decodeIfPresent(Bool.self, forKey: .forced) self.forced = try container.decodeIfPresent(Bool.self, forKey: .forced)
self._frameRate = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .frameRate) ?? DecimalSerialized<Double?>(wrappedValue: nil) self._frameRate = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .frameRate) ?? DecimalSerialized<Double?>(wrappedValue: nil)
self.hasScalingMatrix = try container.decodeIfPresent(Bool.self, forKey: .hasScalingMatrix) self.hasScalingMatrix = try container.decodeIfPresent(Bool.self, forKey: .hasScalingMatrix)
self.headerCompression = try container.decodeIfPresent(Bool.self, forKey: .headerCompression)
self.hearingImpaired = try container.decodeIfPresent(Bool.self, forKey: .hearingImpaired) self.hearingImpaired = try container.decodeIfPresent(Bool.self, forKey: .hearingImpaired)
self.height = try container.decodeIfPresent(Int.self, forKey: .height) self.height = try container.decodeIfPresent(Int.self, forKey: .height)
self.level = try container.decodeIfPresent(Int.self, forKey: .level) self.level = try container.decodeIfPresent(Int.self, forKey: .level)
@@ -294,7 +300,6 @@ extension Operations.GetMediaMetaDataStream: Codable {
public func encode(to encoder: Encoder) throws { public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self) var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self.bitrate, forKey: .bitrate)
try container.encode(self.codec, forKey: .codec) try container.encode(self.codec, forKey: .codec)
try container.encode(self.displayTitle, forKey: .displayTitle) try container.encode(self.displayTitle, forKey: .displayTitle)
try container.encode(self.extendedDisplayTitle, forKey: .extendedDisplayTitle) try container.encode(self.extendedDisplayTitle, forKey: .extendedDisplayTitle)
@@ -306,6 +311,7 @@ extension Operations.GetMediaMetaDataStream: Codable {
try container.encode(self.streamType, forKey: .streamType) try container.encode(self.streamType, forKey: .streamType)
try container.encodeIfPresent(self.audioChannelLayout, forKey: .audioChannelLayout) try container.encodeIfPresent(self.audioChannelLayout, forKey: .audioChannelLayout)
try container.encodeIfPresent(self.bitDepth, forKey: .bitDepth) try container.encodeIfPresent(self.bitDepth, forKey: .bitDepth)
try container.encodeIfPresent(self.bitrate, forKey: .bitrate)
try container.encodeIfPresent(self.canAutoSync, forKey: .canAutoSync) try container.encodeIfPresent(self.canAutoSync, forKey: .canAutoSync)
try container.encodeIfPresent(self.channels, forKey: .channels) try container.encodeIfPresent(self.channels, forKey: .channels)
try container.encodeIfPresent(self.chromaLocation, forKey: .chromaLocation) try container.encodeIfPresent(self.chromaLocation, forKey: .chromaLocation)
@@ -331,6 +337,7 @@ extension Operations.GetMediaMetaDataStream: Codable {
try container.encode(self._frameRate, forKey: .frameRate) try container.encode(self._frameRate, forKey: .frameRate)
} }
try container.encodeIfPresent(self.hasScalingMatrix, forKey: .hasScalingMatrix) try container.encodeIfPresent(self.hasScalingMatrix, forKey: .hasScalingMatrix)
try container.encodeIfPresent(self.headerCompression, forKey: .headerCompression)
try container.encodeIfPresent(self.hearingImpaired, forKey: .hearingImpaired) try container.encodeIfPresent(self.hearingImpaired, forKey: .hearingImpaired)
try container.encodeIfPresent(self.height, forKey: .height) try container.encodeIfPresent(self.height, forKey: .height)
try container.encodeIfPresent(self.level, forKey: .level) try container.encodeIfPresent(self.level, forKey: .level)

View File

@@ -10,16 +10,18 @@ extension Operations {
public let key: String public let key: String
public let title: String public let title: String
public let type: String public let type: String
public let advanced: Bool?
/// Creates an object with the specified parameters /// Creates an object with the specified parameters
/// ///
/// ///
public init(filter: String, filterType: String, key: String, title: String, type: String) { public init(filter: String, filterType: String, key: String, title: String, type: String, advanced: Bool? = nil) {
self.filter = filter self.filter = filter
self.filterType = filterType self.filterType = filterType
self.key = key self.key = key
self.title = title self.title = title
self.type = type self.type = type
self.advanced = advanced
} }
}} }}
@@ -30,6 +32,7 @@ extension Operations.GetRecentlyAddedFilter: Codable {
case key case key
case title case title
case type case type
case advanced
} }
} }

View File

@@ -10,4 +10,6 @@ extension Operations {
case tvShow = "show" case tvShow = "show"
case season = "season" case season = "season"
case episode = "episode" case episode = "episode"
case artist = "artist"
case album = "album"
}} }}

View File

@@ -10,16 +10,18 @@ extension Operations {
public let key: String public let key: String
public let title: String public let title: String
public let type: String public let type: String
public let advanced: Bool?
/// Creates an object with the specified parameters /// Creates an object with the specified parameters
/// ///
/// ///
public init(filter: String, filterType: String, key: String, title: String, type: String) { public init(filter: String, filterType: String, key: String, title: String, type: String, advanced: Bool? = nil) {
self.filter = filter self.filter = filter
self.filterType = filterType self.filterType = filterType
self.key = key self.key = key
self.title = title self.title = title
self.type = type self.type = type
self.advanced = advanced
} }
}} }}
@@ -30,6 +32,7 @@ extension Operations.GetRecentlyAddedLibraryFilter: Codable {
case key case key
case title case title
case type case type
case advanced
} }
} }

View File

@@ -12,11 +12,12 @@ extension Operations {
public let field: [Operations.Field]? public let field: [Operations.Field]?
public let filter: [Operations.GetRecentlyAddedLibraryFilter]? public let filter: [Operations.GetRecentlyAddedLibraryFilter]?
public let sort: [Operations.Sort]? public let sort: [Operations.Sort]?
public let subtype: String?
/// Creates an object with the specified parameters /// Creates an object with the specified parameters
/// ///
/// ///
public init(active: Bool, key: String, title: String, type: String, field: [Operations.Field]? = nil, filter: [Operations.GetRecentlyAddedLibraryFilter]? = nil, sort: [Operations.Sort]? = nil) { public init(active: Bool, key: String, title: String, type: String, field: [Operations.Field]? = nil, filter: [Operations.GetRecentlyAddedLibraryFilter]? = nil, sort: [Operations.Sort]? = nil, subtype: String? = nil) {
self.active = active self.active = active
self.key = key self.key = key
self.title = title self.title = title
@@ -24,6 +25,7 @@ extension Operations {
self.field = field self.field = field
self.filter = filter self.filter = filter
self.sort = sort self.sort = sort
self.subtype = subtype
} }
}} }}
@@ -36,6 +38,7 @@ extension Operations.GetRecentlyAddedLibraryType: Codable {
case field = "Field" case field = "Field"
case filter = "Filter" case filter = "Filter"
case sort = "Sort" case sort = "Sort"
case subtype
} }
} }

View File

@@ -5,8 +5,7 @@ import Foundation
extension Operations { extension Operations {
/// A model object /// A model object
public struct GetRecentlyAddedMediaContainer { public struct GetRecentlyAddedMediaContainer {
@DecimalSerialized public let size: Int
public private(set) var size: Double
public let allowSync: Bool? public let allowSync: Bool?
public let identifier: String? public let identifier: String?
/// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. /// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
@@ -21,8 +20,8 @@ extension Operations {
/// - Parameter meta: The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. /// - Parameter meta: The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
/// ///
/// ///
public init(size: Double, allowSync: Bool? = nil, identifier: String? = nil, meta: Operations.Meta? = nil, metadata: [Operations.GetRecentlyAddedMetadata]? = nil, offset: Int? = nil, totalSize: Int? = nil) { public init(size: Int, allowSync: Bool? = nil, identifier: String? = nil, meta: Operations.Meta? = nil, metadata: [Operations.GetRecentlyAddedMetadata]? = nil, offset: Int? = nil, totalSize: Int? = nil) {
self._size = DecimalSerialized<Double>(wrappedValue: size) self.size = size
self.allowSync = allowSync self.allowSync = allowSync
self.identifier = identifier self.identifier = identifier
self.meta = meta self.meta = meta
@@ -42,32 +41,5 @@ extension Operations.GetRecentlyAddedMediaContainer: Codable {
case offset case offset
case totalSize case totalSize
} }
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self._size = try container.decode(DecimalSerialized<Double>.self, forKey: .size)
self.allowSync = try container.decodeIfPresent(Bool.self, forKey: .allowSync)
self.identifier = try container.decodeIfPresent(String.self, forKey: .identifier)
self.meta = try container.decodeIfPresent(Operations.Meta.self, forKey: .meta)
self.metadata = try container.decodeIfPresent([Operations.GetRecentlyAddedMetadata].self, forKey: .metadata)
self.offset = try container.decodeIfPresent(Int.self, forKey: .offset)
self.totalSize = try container.decodeIfPresent(Int.self, forKey: .totalSize)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self._size, forKey: .size)
try container.encodeIfPresent(self.allowSync, forKey: .allowSync)
try container.encodeIfPresent(self.identifier, forKey: .identifier)
try container.encodeIfPresent(self.meta, forKey: .meta)
try container.encodeIfPresent(self.metadata, forKey: .metadata)
try container.encodeIfPresent(self.offset, forKey: .offset)
try container.encodeIfPresent(self.totalSize, forKey: .totalSize)
}
} }
extension Operations.GetRecentlyAddedMediaContainer {
var sizeWrapper: DecimalSerialized<Double> {
return _size
}
}

View File

@@ -12,11 +12,12 @@ extension Operations {
public let field: [Operations.GetRecentlyAddedField]? public let field: [Operations.GetRecentlyAddedField]?
public let filter: [Operations.GetRecentlyAddedFilter]? public let filter: [Operations.GetRecentlyAddedFilter]?
public let sort: [Operations.GetRecentlyAddedSort]? public let sort: [Operations.GetRecentlyAddedSort]?
public let subtype: String?
/// Creates an object with the specified parameters /// Creates an object with the specified parameters
/// ///
/// ///
public init(active: Bool, key: String, title: String, type: String, field: [Operations.GetRecentlyAddedField]? = nil, filter: [Operations.GetRecentlyAddedFilter]? = nil, sort: [Operations.GetRecentlyAddedSort]? = nil) { public init(active: Bool, key: String, title: String, type: String, field: [Operations.GetRecentlyAddedField]? = nil, filter: [Operations.GetRecentlyAddedFilter]? = nil, sort: [Operations.GetRecentlyAddedSort]? = nil, subtype: String? = nil) {
self.active = active self.active = active
self.key = key self.key = key
self.title = title self.title = title
@@ -24,6 +25,7 @@ extension Operations {
self.field = field self.field = field
self.filter = filter self.filter = filter
self.sort = sort self.sort = sort
self.subtype = subtype
} }
}} }}
@@ -36,6 +38,7 @@ extension Operations.GetRecentlyAddedType: Codable {
case field = "Field" case field = "Field"
case filter = "Filter" case filter = "Filter"
case sort = "Sort" case sort = "Sort"
case subtype
} }
} }

View File

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Whether to include collections in the search results.
public enum GetSearchAllLibrariesQueryParamIncludeCollections: Int, Codable, APIValue {
case disable = 0
case enable = 1
}}

View File

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Whether to include external media in the search results.
public enum GetSearchAllLibrariesQueryParamIncludeExternalMedia: Int, Codable, APIValue {
case disable = 0
case enable = 1
}}

View File

@@ -10,9 +10,9 @@ extension Operations {
/// The search query term. /// The search query term.
public let query: String public let query: String
/// Whether to include collections in the search results. /// Whether to include collections in the search results.
public let includeCollections: Operations.QueryParamIncludeCollections? public let includeCollections: Operations.GetSearchAllLibrariesQueryParamIncludeCollections?
/// Whether to include external media in the search results. /// Whether to include external media in the search results.
public let includeExternalMedia: Operations.QueryParamIncludeExternalMedia? public let includeExternalMedia: Operations.GetSearchAllLibrariesQueryParamIncludeExternalMedia?
/// Limit the number of results returned. /// Limit the number of results returned.
public let limit: Int? public let limit: Int?
/// A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. /// A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv.
@@ -29,7 +29,7 @@ extension Operations {
/// - Parameter searchTypes: A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. /// - Parameter searchTypes: A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv.
/// ///
/// ///
public init(clientID: String, query: String, includeCollections: Operations.QueryParamIncludeCollections? = nil, includeExternalMedia: Operations.QueryParamIncludeExternalMedia? = nil, limit: Int? = nil, searchTypes: [Operations.SearchTypes]? = nil) { public init(clientID: String, query: String, includeCollections: Operations.GetSearchAllLibrariesQueryParamIncludeCollections? = nil, includeExternalMedia: Operations.GetSearchAllLibrariesQueryParamIncludeExternalMedia? = nil, limit: Int? = nil, searchTypes: [Operations.SearchTypes]? = nil) {
self.clientID = clientID self.clientID = clientID
self.query = query self.query = query
self.includeCollections = includeCollections self.includeCollections = includeCollections

View File

@@ -10,4 +10,6 @@ extension Operations {
case tvShow = "show" case tvShow = "show"
case season = "season" case season = "season"
case episode = "episode" case episode = "episode"
case artist = "artist"
case album = "album"
}} }}

View File

@@ -5,14 +5,16 @@ import Foundation
extension Operations { extension Operations {
/// A model object /// A model object
public struct Guids { public struct Guids {
/// The GUID value. /// The unique identifier for the Guid. Can be imdb://tt0286347, tmdb://1763, tvdb://2337
public let id: String ///
public let id: String?
/// Creates an object with the specified parameters /// Creates an object with the specified parameters
/// ///
/// - Parameter id: The GUID value. /// - Parameter id: The unique identifier for the Guid. Can be imdb://tt0286347, tmdb://1763, tvdb://2337
/// ///
public init(id: String) { ///
public init(id: String? = nil) {
self.id = id self.id = id
} }
}} }}

View File

@@ -0,0 +1,10 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
public enum IncludeAdvanced: Int, Codable, APIValue {
case disable = 0
case enable = 1
}}

View File

@@ -0,0 +1,9 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
public enum One: Int, Codable, APIValue {
case zero = 0
case one = 1
}}

View File

@@ -3,7 +3,7 @@
import Foundation import Foundation
extension Operations { extension Operations {
/// Whether to include collections in the search results.
public enum QueryParamIncludeCollections: Int, Codable, APIValue { public enum QueryParamIncludeCollections: Int, Codable, APIValue {
case disable = 0 case disable = 0
case enable = 1 case enable = 1

View File

@@ -3,7 +3,7 @@
import Foundation import Foundation
extension Operations { extension Operations {
/// Whether to include external media in the search results.
public enum QueryParamIncludeExternalMedia: Int, Codable, APIValue { public enum QueryParamIncludeExternalMedia: Int, Codable, APIValue {
case disable = 0 case disable = 0
case enable = 1 case enable = 1

View File

@@ -0,0 +1,11 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Adds the Guid object to the response
///
public enum QueryParamIncludeGuids: Int, Codable, APIValue {
case disable = 0
case enable = 1
}}

View File

@@ -4,7 +4,7 @@ import Foundation
extension Operations { extension Operations {
/// A model object /// A model object
public struct Rating { public struct Ratings {
/// The image or reference for the rating. /// The image or reference for the rating.
public let image: String public let image: String
/// The type of rating (e.g., audience, critic). /// The type of rating (e.g., audience, critic).
@@ -26,7 +26,7 @@ extension Operations {
} }
}} }}
extension Operations.Rating: Codable { extension Operations.Ratings: Codable {
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case image case image
case type case type
@@ -48,7 +48,7 @@ extension Operations.Rating: Codable {
} }
} }
extension Operations.Rating { extension Operations.Ratings {
var valueWrapper: DecimalSerialized<Double> { var valueWrapper: DecimalSerialized<Double> {
return _value return _value
} }

View File

@@ -5,7 +5,6 @@ import Foundation
extension Operations { extension Operations {
/// A key representing a specific tag within the section. /// A key representing a specific tag within the section.
public enum Tag: String, Codable, APIValue { public enum Tag: String, Codable, APIValue {
case all = "all"
case unwatched = "unwatched" case unwatched = "unwatched"
case newest = "newest" case newest = "newest"
case recentlyAdded = "recentlyAdded" case recentlyAdded = "recentlyAdded"
@@ -13,12 +12,9 @@ extension Operations {
case onDeck = "onDeck" case onDeck = "onDeck"
case collection = "collection" case collection = "collection"
case edition = "edition" case edition = "edition"
case genre = "genre"
case year = "year" case year = "year"
case decade = "decade" case decade = "decade"
case director = "director" case director = "director"
case actor = "actor"
case country = "country"
case contentRating = "contentRating" case contentRating = "contentRating"
case rating = "rating" case rating = "rating"
case resolution = "resolution" case resolution = "resolution"

Some files were not shown because too many files have changed in this diff Show More