ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.6

This commit is contained in:
speakeasybot
2025-02-06 00:09:11 +00:00
parent 3b5e642d82
commit dc8f74bd40
30 changed files with 972 additions and 13 deletions

File diff suppressed because one or more lines are too long

View File

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

View File

@@ -9,8 +9,8 @@ sources:
- main
plexapi:
sourceNamespace: plexapi
sourceRevisionDigest: sha256:e73707dfae50d22dab2166b1661938446b9831bcee252ecd696a1172dfd6ae2c
sourceBlobDigest: sha256:e06caa091ad527fd21714fc0d43e7ea385e181fbad8c4f60296457a89a23c696
sourceRevisionDigest: sha256:0b88c8bfc41def63e19e91fdd4d51bab07cb947cc3d39d2b44e8523a209cec10
sourceBlobDigest: sha256:89d5b8427d4fb61b25751aebbaf71f9613958e9e91073fc084fed2c2ec62ce55
tags:
- latest
- main
@@ -18,10 +18,10 @@ targets:
plexswift:
source: plexapi
sourceNamespace: plexapi
sourceRevisionDigest: sha256:e73707dfae50d22dab2166b1661938446b9831bcee252ecd696a1172dfd6ae2c
sourceBlobDigest: sha256:e06caa091ad527fd21714fc0d43e7ea385e181fbad8c4f60296457a89a23c696
sourceRevisionDigest: sha256:0b88c8bfc41def63e19e91fdd4d51bab07cb947cc3d39d2b44e8523a209cec10
sourceBlobDigest: sha256:89d5b8427d4fb61b25751aebbaf71f9613958e9e91073fc084fed2c2ec62ce55
codeSamplesNamespace: code-samples-swift-plexswift
codeSamplesRevisionDigest: sha256:f64657a7788b54285ad429cbc4056f8385046ba90198d8047e09de18094609ba
codeSamplesRevisionDigest: sha256:a5941e7dd8124eb7deca3b089dbb00bdd37dfacb849675cd1acd0888538742d0
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest

View File

@@ -62,7 +62,7 @@ You can add `plexswift` to your project directly in Xcode `(File > Add Packages.
```bash
dependencies: [
.package(url: "https://github.com/LukeHagar/plexswift.git", .upToNextMajor(from: "0.9.7"))
.package(url: "https://github.com/LukeHagar/plexswift.git", .upToNextMajor(from: "0.9.9"))
]
```
<!-- End SDK Installation [installation] -->
@@ -140,6 +140,8 @@ case .empty:
* [getLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items
* [getRefreshLibraryMetadata](docs/sdks/library/README.md#getrefreshlibrarymetadata) - Refresh Metadata Of The Library
* [getSearchLibrary](docs/sdks/library/README.md#getsearchlibrary) - Search Library
* [getGenresLibrary](docs/sdks/library/README.md#getgenreslibrary) - Get Genres of library media
* [getCountriesLibrary](docs/sdks/library/README.md#getcountrieslibrary) - Get Countries of library media
* [getSearchAllLibraries](docs/sdks/library/README.md#getsearchalllibraries) - Search All Libraries
* [getMetaDataByRatingKey](docs/sdks/library/README.md#getmetadatabyratingkey) - Get Metadata by RatingKey
* [getMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children

View File

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

View File

@@ -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``

View File

@@ -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

View File

@@ -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 }
}
}

View File

@@ -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 }
}
}

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 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
}
}

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 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
}
}

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 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
}
}

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 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
}
}

View File

@@ -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
}
}

View File

@@ -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
}
}}

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 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
}
}}

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 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"
}
}

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 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
}
}

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 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
}
}

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 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
}
}

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 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
}
}

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 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
}
}

View File

@@ -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
}
}

View File

@@ -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
}
}}

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 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
}
}}

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 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"
}
}

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 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
}
}

View File

@@ -739,6 +739,8 @@ public protocol SearchAPI {
/// - ``getLibraryItems(request:)``
/// - ``getRefreshLibraryMetadata(request:)``
/// - ``getSearchLibrary(request:)``
/// - ``getGenresLibrary(request:)``
/// - ``getCountriesLibrary(request:)``
/// - ``getSearchAllLibraries(request:)``
/// - ``getMetaDataByRatingKey(request:)``
/// - ``getMetadataChildren(request:)``
@@ -887,6 +889,22 @@ public protocol LibraryAPI {
/// - Throws: An error of type ``PlexswiftError``
func getSearchLibrary(request: Operations.GetSearchLibraryRequest) async throws -> Response<Operations.GetSearchLibraryResponse>
/// Retrieves a list of all the genres that are found for the media in this library.
///
///
/// - Parameter request: A ``Operations/GetGenresLibraryRequest`` object describing the input to the API operation
/// - Returns: A ``Operations/GetGenresLibraryResponse`` object describing the result of the API operation
/// - Throws: An error of type ``PlexswiftError``
func getGenresLibrary(request: Operations.GetGenresLibraryRequest) async throws -> Response<Operations.GetGenresLibraryResponse>
/// Retrieves a list of all the countries that are found for the media in this library.
///
///
/// - Parameter request: A ``Operations/GetCountriesLibraryRequest`` object describing the input to the API operation
/// - Returns: A ``Operations/GetCountriesLibraryResponse`` object describing the result of the API operation
/// - Throws: An error of type ``PlexswiftError``
func getCountriesLibrary(request: Operations.GetCountriesLibraryRequest) async throws -> Response<Operations.GetCountriesLibraryResponse>
/// Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type.
///
///

View File

@@ -62,7 +62,7 @@ final class URLRequestBuilder: URLRequestConfiguration {
urlRequest.setValue(contentType, forHTTPHeaderField: "Content-Type")
}
urlRequest.setValue("speakeasy-sdk/swift 0.9.7 2.428.1 0.0.3 plexswift", forHTTPHeaderField: telemetryHeader.headerName)
urlRequest.setValue("speakeasy-sdk/swift 0.9.9 2.428.1 0.0.3 plexswift", forHTTPHeaderField: telemetryHeader.headerName)
addSecurityParameters(to: &urlRequest)

View File

@@ -717,6 +717,68 @@ actions:
- lang: swift
label: details
source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"<YOUR_API_KEY_HERE>\"))\n\nlet response = try await client.library.getLibraryDetails(\n request: Operations.GetLibraryDetailsRequest(\n sectionKey: 9518, \n )\n)\n\nswitch response.data {\ncase .object(let object):\n // Handle response\n break\ncase .badRequest(let badRequest):\n // Handle response\n break\ncase .unauthorized(let unauthorized):\n // Handle response\n break\ncase .empty:\n // Handle empty response\n break\n}"
- target: $["paths"]["/library/sections/{sectionKey}/country"]["get"]
update:
x-codeSamples:
- lang: swift
label: library
source: |-
import Foundation
import Plexswift
let client = Client(security: .accessToken("<YOUR_API_KEY_HERE>"))
let response = try await client.library.getCountriesLibrary(
request: Operations.GetCountriesLibraryRequest(
sectionKey: 9518
)
)
switch response.data {
case .object(let object):
// Handle response
break
case .badRequest(let badRequest):
// Handle response
break
case .unauthorized(let unauthorized):
// Handle response
break
case .empty:
// Handle empty response
break
}
- target: $["paths"]["/library/sections/{sectionKey}/genre"]["get"]
update:
x-codeSamples:
- lang: swift
label: library
source: |-
import Foundation
import Plexswift
let client = Client(security: .accessToken("<YOUR_API_KEY_HERE>"))
let response = try await client.library.getGenresLibrary(
request: Operations.GetGenresLibraryRequest(
sectionKey: 9518
)
)
switch response.data {
case .object(let object):
// Handle response
break
case .badRequest(let badRequest):
// Handle response
break
case .unauthorized(let unauthorized):
// Handle response
break
case .empty:
// Handle empty response
break
}
- target: $["paths"]["/library/sections/{sectionKey}/refresh"]["get"]
update:
x-codeSamples: