mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-09 20:57:45 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.6
This commit is contained in:
@@ -118,6 +118,8 @@ case .empty:
|
||||
- ``Operations/EnablePaperTrailBadRequest``
|
||||
- ``Operations/GetAllLibrariesBadRequest``
|
||||
- ``Operations/GetBannerImageBadRequest``
|
||||
- ``Operations/GetCountriesLibraryBadRequest``
|
||||
- ``Operations/GetGenresLibraryBadRequest``
|
||||
- ``Operations/GetLibraryDetailsBadRequest``
|
||||
- ``Operations/GetLibraryItemsBadRequest``
|
||||
- ``Operations/GetMediaProvidersBadRequest``
|
||||
@@ -194,6 +196,8 @@ case .empty:
|
||||
- ``Operations/EnablePaperTrailResponse``
|
||||
- ``Operations/GetAllLibrariesResponse``
|
||||
- ``Operations/GetBannerImageResponse``
|
||||
- ``Operations/GetCountriesLibraryResponse``
|
||||
- ``Operations/GetGenresLibraryResponse``
|
||||
- ``Operations/GetLibraryDetailsResponse``
|
||||
- ``Operations/GetLibraryItemsResponse``
|
||||
- ``Operations/GetMediaProvidersResponse``
|
||||
@@ -345,6 +349,20 @@ case .empty:
|
||||
- ``Operations/GetBannerImageMediaErrors``
|
||||
- ``Operations/GetBannerImageRequest``
|
||||
- ``Operations/GetBannerImageUnauthorized``
|
||||
- ``Operations/GetCountriesLibraryDirectory``
|
||||
- ``Operations/GetCountriesLibraryErrors``
|
||||
- ``Operations/GetCountriesLibraryLibraryErrors``
|
||||
- ``Operations/GetCountriesLibraryMediaContainer``
|
||||
- ``Operations/GetCountriesLibraryRequest``
|
||||
- ``Operations/GetCountriesLibraryResponseBody``
|
||||
- ``Operations/GetCountriesLibraryUnauthorized``
|
||||
- ``Operations/GetGenresLibraryDirectory``
|
||||
- ``Operations/GetGenresLibraryErrors``
|
||||
- ``Operations/GetGenresLibraryLibraryErrors``
|
||||
- ``Operations/GetGenresLibraryMediaContainer``
|
||||
- ``Operations/GetGenresLibraryRequest``
|
||||
- ``Operations/GetGenresLibraryResponseBody``
|
||||
- ``Operations/GetGenresLibraryUnauthorized``
|
||||
- ``Operations/GetLibraryDetailsDirectory``
|
||||
- ``Operations/GetLibraryDetailsErrors``
|
||||
- ``Operations/GetLibraryDetailsField``
|
||||
|
||||
@@ -82,6 +82,24 @@ class _LibraryAPI: LibraryAPI {
|
||||
)
|
||||
}
|
||||
|
||||
public func getGenresLibrary(request: Operations.GetGenresLibraryRequest) async throws -> Response<Operations.GetGenresLibraryResponse> {
|
||||
return try await client.makeRequest(
|
||||
configureRequest: { configuration in
|
||||
try configureGetGenresLibraryRequest(with: configuration, request: request)
|
||||
},
|
||||
handleResponse: handleGetGenresLibraryResponse
|
||||
)
|
||||
}
|
||||
|
||||
public func getCountriesLibrary(request: Operations.GetCountriesLibraryRequest) async throws -> Response<Operations.GetCountriesLibraryResponse> {
|
||||
return try await client.makeRequest(
|
||||
configureRequest: { configuration in
|
||||
try configureGetCountriesLibraryRequest(with: configuration, request: request)
|
||||
},
|
||||
handleResponse: handleGetCountriesLibraryResponse
|
||||
)
|
||||
}
|
||||
|
||||
public func getSearchAllLibraries(request: Operations.GetSearchAllLibrariesRequest) async throws -> Response<Operations.GetSearchAllLibrariesResponse> {
|
||||
return try await client.makeRequest(
|
||||
configureRequest: { configuration in
|
||||
@@ -190,6 +208,20 @@ private func configureGetSearchLibraryRequest(with configuration: URLRequestConf
|
||||
configuration.telemetryHeader = .userAgent
|
||||
}
|
||||
|
||||
private func configureGetGenresLibraryRequest(with configuration: URLRequestConfiguration, request: Operations.GetGenresLibraryRequest) throws {
|
||||
configuration.path = "/library/sections/{sectionKey}/genre"
|
||||
configuration.method = .get
|
||||
configuration.pathParameterSerializable = request
|
||||
configuration.telemetryHeader = .userAgent
|
||||
}
|
||||
|
||||
private func configureGetCountriesLibraryRequest(with configuration: URLRequestConfiguration, request: Operations.GetCountriesLibraryRequest) throws {
|
||||
configuration.path = "/library/sections/{sectionKey}/country"
|
||||
configuration.method = .get
|
||||
configuration.pathParameterSerializable = request
|
||||
configuration.telemetryHeader = .userAgent
|
||||
}
|
||||
|
||||
private func configureGetSearchAllLibrariesRequest(with configuration: URLRequestConfiguration, request: Operations.GetSearchAllLibrariesRequest) throws {
|
||||
configuration.path = "/library/search"
|
||||
configuration.method = .get
|
||||
@@ -466,6 +498,74 @@ private func handleGetSearchLibraryResponse(response: Client.APIResponse) throws
|
||||
return .empty
|
||||
}
|
||||
|
||||
private func handleGetGenresLibraryResponse(response: Client.APIResponse) throws -> Operations.GetGenresLibraryResponse {
|
||||
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.GetGenresLibraryResponseBody.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.GetGenresLibraryBadRequest.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.GetGenresLibraryUnauthorized.self, from: data))
|
||||
} catch {
|
||||
throw ResponseHandlerError.failedToDecodeJSON(error)
|
||||
}
|
||||
}
|
||||
} else if httpResponse.statusCode == 404 {
|
||||
return .empty
|
||||
}
|
||||
|
||||
return .empty
|
||||
}
|
||||
|
||||
private func handleGetCountriesLibraryResponse(response: Client.APIResponse) throws -> Operations.GetCountriesLibraryResponse {
|
||||
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.GetCountriesLibraryResponseBody.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.GetCountriesLibraryBadRequest.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.GetCountriesLibraryUnauthorized.self, from: data))
|
||||
} catch {
|
||||
throw ResponseHandlerError.failedToDecodeJSON(error)
|
||||
}
|
||||
}
|
||||
} else if httpResponse.statusCode == 404 {
|
||||
return .empty
|
||||
}
|
||||
|
||||
return .empty
|
||||
}
|
||||
|
||||
private func handleGetSearchAllLibrariesResponse(response: Client.APIResponse) throws -> Operations.GetSearchAllLibrariesResponse {
|
||||
let httpResponse = response.httpResponse
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Operations.GetCountriesLibraryRequest: Serializable {
|
||||
func serialize(with format: SerializableFormat) throws -> String {
|
||||
switch format {
|
||||
case .path:
|
||||
return try serializePathParameterSerializable(self, with: format)
|
||||
case .query, .header, .multipart, .form:
|
||||
throw SerializationError.invalidSerializationParameter(type: "Operations.GetCountriesLibraryRequest", format: format.formatDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension Operations.GetCountriesLibraryRequest: PathParameterSerializable {
|
||||
func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
|
||||
return [
|
||||
"sectionKey": try sectionKey.serialize(with: formatOverride ?? .path(explode: false)),
|
||||
].compactMapValues { $0 }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Operations.GetGenresLibraryRequest: Serializable {
|
||||
func serialize(with format: SerializableFormat) throws -> String {
|
||||
switch format {
|
||||
case .path:
|
||||
return try serializePathParameterSerializable(self, with: format)
|
||||
case .query, .header, .multipart, .form:
|
||||
throw SerializationError.invalidSerializationParameter(type: "Operations.GetGenresLibraryRequest", format: format.formatDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension Operations.GetGenresLibraryRequest: PathParameterSerializable {
|
||||
func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
|
||||
return [
|
||||
"sectionKey": try sectionKey.serialize(with: formatOverride ?? .path(explode: false)),
|
||||
].compactMapValues { $0 }
|
||||
}
|
||||
}
|
||||
@@ -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 GetCountriesLibraryBadRequest {
|
||||
public let errors: [Operations.GetCountriesLibraryErrors]?
|
||||
|
||||
/// Creates a request model with the specified parameters
|
||||
///
|
||||
///
|
||||
public init(errors: [Operations.GetCountriesLibraryErrors]? = nil) {
|
||||
self.errors = errors
|
||||
}
|
||||
}}
|
||||
|
||||
extension Operations.GetCountriesLibraryBadRequest: Codable {
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case errors
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Operations {
|
||||
/// A model object
|
||||
public struct GetCountriesLibraryDirectory {
|
||||
public let fastKey: String
|
||||
public let key: String
|
||||
public let title: String
|
||||
|
||||
/// Creates an object with the specified parameters
|
||||
///
|
||||
///
|
||||
public init(fastKey: String, key: String, title: String) {
|
||||
self.fastKey = fastKey
|
||||
self.key = key
|
||||
self.title = title
|
||||
}
|
||||
}}
|
||||
|
||||
extension Operations.GetCountriesLibraryDirectory: Codable {
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case fastKey
|
||||
case key
|
||||
case title
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Operations {
|
||||
/// A model object
|
||||
public struct GetCountriesLibraryErrors {
|
||||
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.GetCountriesLibraryErrors: Codable {
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case code
|
||||
case message
|
||||
case status
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Operations {
|
||||
/// A model object
|
||||
public struct GetCountriesLibraryLibraryErrors {
|
||||
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.GetCountriesLibraryLibraryErrors: Codable {
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case code
|
||||
case message
|
||||
case status
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Operations {
|
||||
/// A model object
|
||||
public struct GetCountriesLibraryMediaContainer {
|
||||
public let allowSync: Bool
|
||||
public let art: String
|
||||
public let content: String
|
||||
public let identifier: String
|
||||
public let mediaTagPrefix: String
|
||||
public let mediaTagVersion: Int
|
||||
public let nocache: Bool
|
||||
@DecimalSerialized
|
||||
public private(set) var size: Double
|
||||
public let thumb: String
|
||||
public let title1: String
|
||||
public let title2: String
|
||||
public let viewGroup: String
|
||||
public let directory: [Operations.GetCountriesLibraryDirectory]?
|
||||
public let offset: Int?
|
||||
public let totalSize: Int?
|
||||
|
||||
/// Creates an object with the specified parameters
|
||||
///
|
||||
///
|
||||
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) {
|
||||
self.allowSync = allowSync
|
||||
self.art = art
|
||||
self.content = content
|
||||
self.identifier = identifier
|
||||
self.mediaTagPrefix = mediaTagPrefix
|
||||
self.mediaTagVersion = mediaTagVersion
|
||||
self.nocache = nocache
|
||||
self._size = DecimalSerialized<Double>(wrappedValue: size)
|
||||
self.thumb = thumb
|
||||
self.title1 = title1
|
||||
self.title2 = title2
|
||||
self.viewGroup = viewGroup
|
||||
self.directory = directory
|
||||
self.offset = offset
|
||||
self.totalSize = totalSize
|
||||
}
|
||||
}}
|
||||
|
||||
extension Operations.GetCountriesLibraryMediaContainer: Codable {
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case allowSync
|
||||
case art
|
||||
case content
|
||||
case identifier
|
||||
case mediaTagPrefix
|
||||
case mediaTagVersion
|
||||
case nocache
|
||||
case size
|
||||
case thumb
|
||||
case title1
|
||||
case title2
|
||||
case viewGroup
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Operations {
|
||||
/// A model object
|
||||
public struct GetCountriesLibraryRequest: APIValue {
|
||||
/// The unique key of the Plex library.
|
||||
/// Note: This is unique in the context of the Plex server.
|
||||
///
|
||||
public let sectionKey: 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.
|
||||
///
|
||||
///
|
||||
public init(sectionKey: Int) {
|
||||
self.sectionKey = sectionKey
|
||||
}
|
||||
}}
|
||||
@@ -0,0 +1,41 @@
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Operations {
|
||||
/// A response model
|
||||
public enum GetCountriesLibraryResponse {
|
||||
case empty
|
||||
case badRequest(Operations.GetCountriesLibraryBadRequest)
|
||||
case object(Operations.GetCountriesLibraryResponseBody)
|
||||
case unauthorized(Operations.GetCountriesLibraryUnauthorized)
|
||||
|
||||
var isEmpty: Bool {
|
||||
if case .empty = self {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
public func badRequest() throws -> Operations.GetCountriesLibraryBadRequest {
|
||||
guard case .badRequest(let value) = self else {
|
||||
throw PlexswiftError.missingResponseData
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
public func object() throws -> Operations.GetCountriesLibraryResponseBody {
|
||||
guard case .object(let value) = self else {
|
||||
throw PlexswiftError.missingResponseData
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
public func unauthorized() throws -> Operations.GetCountriesLibraryUnauthorized {
|
||||
guard case .unauthorized(let value) = self else {
|
||||
throw PlexswiftError.missingResponseData
|
||||
}
|
||||
return value
|
||||
}
|
||||
}}
|
||||
@@ -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 GetCountriesLibraryResponseBody {
|
||||
public let mediaContainer: Operations.GetCountriesLibraryMediaContainer?
|
||||
|
||||
/// Creates an object with the specified parameters
|
||||
///
|
||||
///
|
||||
public init(mediaContainer: Operations.GetCountriesLibraryMediaContainer? = nil) {
|
||||
self.mediaContainer = mediaContainer
|
||||
}
|
||||
}}
|
||||
|
||||
extension Operations.GetCountriesLibraryResponseBody: Codable {
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case mediaContainer = "MediaContainer"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 GetCountriesLibraryUnauthorized {
|
||||
public let errors: [Operations.GetCountriesLibraryLibraryErrors]?
|
||||
|
||||
/// Creates an object with the specified parameters
|
||||
///
|
||||
///
|
||||
public init(errors: [Operations.GetCountriesLibraryLibraryErrors]? = nil) {
|
||||
self.errors = errors
|
||||
}
|
||||
}}
|
||||
|
||||
extension Operations.GetCountriesLibraryUnauthorized: Codable {
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case errors
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 GetGenresLibraryBadRequest {
|
||||
public let errors: [Operations.GetGenresLibraryErrors]?
|
||||
|
||||
/// Creates a request model with the specified parameters
|
||||
///
|
||||
///
|
||||
public init(errors: [Operations.GetGenresLibraryErrors]? = nil) {
|
||||
self.errors = errors
|
||||
}
|
||||
}}
|
||||
|
||||
extension Operations.GetGenresLibraryBadRequest: Codable {
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case errors
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Operations {
|
||||
/// A model object
|
||||
public struct GetGenresLibraryDirectory {
|
||||
public let fastKey: String
|
||||
public let key: String
|
||||
public let title: String
|
||||
public let type: String
|
||||
|
||||
/// Creates an object with the specified parameters
|
||||
///
|
||||
///
|
||||
public init(fastKey: String, key: String, title: String, type: String) {
|
||||
self.fastKey = fastKey
|
||||
self.key = key
|
||||
self.title = title
|
||||
self.type = type
|
||||
}
|
||||
}}
|
||||
|
||||
extension Operations.GetGenresLibraryDirectory: Codable {
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case fastKey
|
||||
case key
|
||||
case title
|
||||
case type
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Operations {
|
||||
/// A model object
|
||||
public struct GetGenresLibraryErrors {
|
||||
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.GetGenresLibraryErrors: Codable {
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case code
|
||||
case message
|
||||
case status
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Operations {
|
||||
/// A model object
|
||||
public struct GetGenresLibraryLibraryErrors {
|
||||
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.GetGenresLibraryLibraryErrors: Codable {
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case code
|
||||
case message
|
||||
case status
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Operations {
|
||||
/// A model object
|
||||
public struct GetGenresLibraryMediaContainer {
|
||||
public let allowSync: Bool
|
||||
public let art: String
|
||||
public let content: String
|
||||
public let identifier: String
|
||||
public let mediaTagPrefix: String
|
||||
public let mediaTagVersion: Int
|
||||
public let nocache: Bool
|
||||
@DecimalSerialized
|
||||
public private(set) var size: Double
|
||||
public let thumb: String
|
||||
public let title1: String
|
||||
public let title2: String
|
||||
public let viewGroup: String
|
||||
public let directory: [Operations.GetGenresLibraryDirectory]?
|
||||
public let offset: Int?
|
||||
public let totalSize: Int?
|
||||
|
||||
/// Creates an object with the specified parameters
|
||||
///
|
||||
///
|
||||
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) {
|
||||
self.allowSync = allowSync
|
||||
self.art = art
|
||||
self.content = content
|
||||
self.identifier = identifier
|
||||
self.mediaTagPrefix = mediaTagPrefix
|
||||
self.mediaTagVersion = mediaTagVersion
|
||||
self.nocache = nocache
|
||||
self._size = DecimalSerialized<Double>(wrappedValue: size)
|
||||
self.thumb = thumb
|
||||
self.title1 = title1
|
||||
self.title2 = title2
|
||||
self.viewGroup = viewGroup
|
||||
self.directory = directory
|
||||
self.offset = offset
|
||||
self.totalSize = totalSize
|
||||
}
|
||||
}}
|
||||
|
||||
extension Operations.GetGenresLibraryMediaContainer: Codable {
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case allowSync
|
||||
case art
|
||||
case content
|
||||
case identifier
|
||||
case mediaTagPrefix
|
||||
case mediaTagVersion
|
||||
case nocache
|
||||
case size
|
||||
case thumb
|
||||
case title1
|
||||
case title2
|
||||
case viewGroup
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Operations {
|
||||
/// A model object
|
||||
public struct GetGenresLibraryRequest: APIValue {
|
||||
/// The unique key of the Plex library.
|
||||
/// Note: This is unique in the context of the Plex server.
|
||||
///
|
||||
public let sectionKey: 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.
|
||||
///
|
||||
///
|
||||
public init(sectionKey: Int) {
|
||||
self.sectionKey = sectionKey
|
||||
}
|
||||
}}
|
||||
@@ -0,0 +1,41 @@
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Operations {
|
||||
/// A response model
|
||||
public enum GetGenresLibraryResponse {
|
||||
case empty
|
||||
case badRequest(Operations.GetGenresLibraryBadRequest)
|
||||
case object(Operations.GetGenresLibraryResponseBody)
|
||||
case unauthorized(Operations.GetGenresLibraryUnauthorized)
|
||||
|
||||
var isEmpty: Bool {
|
||||
if case .empty = self {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
public func badRequest() throws -> Operations.GetGenresLibraryBadRequest {
|
||||
guard case .badRequest(let value) = self else {
|
||||
throw PlexswiftError.missingResponseData
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
public func object() throws -> Operations.GetGenresLibraryResponseBody {
|
||||
guard case .object(let value) = self else {
|
||||
throw PlexswiftError.missingResponseData
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
public func unauthorized() throws -> Operations.GetGenresLibraryUnauthorized {
|
||||
guard case .unauthorized(let value) = self else {
|
||||
throw PlexswiftError.missingResponseData
|
||||
}
|
||||
return value
|
||||
}
|
||||
}}
|
||||
@@ -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 GetGenresLibraryResponseBody {
|
||||
public let mediaContainer: Operations.GetGenresLibraryMediaContainer?
|
||||
|
||||
/// Creates an object with the specified parameters
|
||||
///
|
||||
///
|
||||
public init(mediaContainer: Operations.GetGenresLibraryMediaContainer? = nil) {
|
||||
self.mediaContainer = mediaContainer
|
||||
}
|
||||
}}
|
||||
|
||||
extension Operations.GetGenresLibraryResponseBody: Codable {
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case mediaContainer = "MediaContainer"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 GetGenresLibraryUnauthorized {
|
||||
public let errors: [Operations.GetGenresLibraryLibraryErrors]?
|
||||
|
||||
/// Creates an object with the specified parameters
|
||||
///
|
||||
///
|
||||
public init(errors: [Operations.GetGenresLibraryLibraryErrors]? = nil) {
|
||||
self.errors = errors
|
||||
}
|
||||
}}
|
||||
|
||||
extension Operations.GetGenresLibraryUnauthorized: Codable {
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case errors
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user