ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.397.2

This commit is contained in:
speakeasybot
2024-09-16 18:44:33 +00:00
parent c0dafdc561
commit 6b54deac02
919 changed files with 16195 additions and 6963 deletions

File diff suppressed because it is too large Load Diff

View File

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

26
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,26 @@
# Contributing to This Repository
Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements.
## How to Report Issues
If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes:
- A clear and descriptive title
- Steps to reproduce the issue
- Expected and actual behavior
- Any relevant logs, screenshots, or error messages
- Information about your environment (e.g., operating system, software versions)
- For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed
## Issue Triage and Upstream Fixes
We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code.
## Contact
If you have any questions or need further assistance, please feel free to reach out by opening an issue.
Thank you for your understanding and cooperation!
The Maintainers

180
README.md
View File

@@ -13,16 +13,32 @@ An Open API Spec for interacting with Plex.tv and Plex Servers
The SDK supports iOS 13 and later.
<!-- Start Summary [summary] -->
## Summary
Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
<!-- End Summary [summary] -->
<!-- Start Table of Contents [toc] -->
## Table of Contents
* [SDK Installation](#sdk-installation)
* [SDK Example Usage](#sdk-example-usage)
* [Available Resources and Operations](#available-resources-and-operations)
* [Global Parameters](#global-parameters)
* [Authentication](#authentication)
<!-- End Table of Contents [toc] -->
<!-- Start SDK Installation [installation] -->
## SDK Installation
### Swift Package Manager
The SDK uses the [Swift Package Manager](https://www.swift.org/documentation/package-manager/) to handle dependencies, which is included in Swift 3.0 and above.
You can add `plexswift` to your project directly in Xcode `(File > Add Packages...)` or by adding it to your project's Package.swift file:
```bash
dependencies: [
.package(url: "https://github.com/LukeHagar/plexswift.git", .upToNextMajor(from: "0.5.0"))
.package(url: "https://github.com/LukeHagar/plexswift.git", .upToNextMajor(from: "0.6.0"))
]
```
<!-- End SDK Installation [installation] -->
@@ -41,10 +57,13 @@ let client = Client(security: .accessToken("<YOUR_API_KEY_HERE>"))
let response = try await client.server.getServerCapabilities()
switch response.data {
case .twoHundredApplicationJsonObject(let twoHundredApplicationJsonObject):
case .object(let object):
// Handle response
break
case .fourHundredAndOneApplicationJsonObject(let fourHundredAndOneApplicationJsonObject):
case .badRequest(let badRequest):
// Handle response
break
case .unauthorized(let unauthorized):
// Handle response
break
case .empty:
@@ -58,7 +77,133 @@ case .empty:
<!-- Start Available Resources and Operations [operations] -->
## Available Resources and Operations
<details open>
<summary>Available methods</summary>
### [Activities](docs/sdks/activities/README.md)
* [getServerActivities](docs/sdks/activities/README.md#getserveractivities) - Get Server Activities
* [cancelServerActivities](docs/sdks/activities/README.md#cancelserveractivities) - Cancel Server Activities
### [Authentication](docs/sdks/authentication/README.md)
* [getTransientToken](docs/sdks/authentication/README.md#gettransienttoken) - Get a Transient Token
* [getSourceConnectionInformation](docs/sdks/authentication/README.md#getsourceconnectioninformation) - Get Source Connection Information
* [getTokenDetails](docs/sdks/authentication/README.md#gettokendetails) - Get Token Details
* [postUsersSignInData](docs/sdks/authentication/README.md#postuserssignindata) - Get User Sign In Data
### [Butler](docs/sdks/butler/README.md)
* [getButlerTasks](docs/sdks/butler/README.md#getbutlertasks) - Get Butler tasks
* [startAllTasks](docs/sdks/butler/README.md#startalltasks) - Start all Butler tasks
* [stopAllTasks](docs/sdks/butler/README.md#stopalltasks) - Stop all Butler tasks
* [startTask](docs/sdks/butler/README.md#starttask) - Start a single Butler task
* [stopTask](docs/sdks/butler/README.md#stoptask) - Stop a single Butler task
### [Hubs](docs/sdks/hubs/README.md)
* [getGlobalHubs](docs/sdks/hubs/README.md#getglobalhubs) - Get Global Hubs
* [getLibraryHubs](docs/sdks/hubs/README.md#getlibraryhubs) - Get library specific hubs
### [Library](docs/sdks/library/README.md)
* [getFileHash](docs/sdks/library/README.md#getfilehash) - Get Hash Value
* [getRecentlyAdded](docs/sdks/library/README.md#getrecentlyadded) - Get Recently Added
* [getAllLibraries](docs/sdks/library/README.md#getalllibraries) - Get All Libraries
* [getLibraryDetails](docs/sdks/library/README.md#getlibrarydetails) - Get Library Details
* [deleteLibrary](docs/sdks/library/README.md#deletelibrary) - Delete Library Section
* [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
* [getMetaDataByRatingKey](docs/sdks/library/README.md#getmetadatabyratingkey) - Get Metadata by RatingKey
* [getMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children
* [getTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content
* [getOnDeck](docs/sdks/library/README.md#getondeck) - Get On Deck
### [Log](docs/sdks/log/README.md)
* [logLine](docs/sdks/log/README.md#logline) - Logging a single line message.
* [logMultiLine](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message
* [enablePaperTrail](docs/sdks/log/README.md#enablepapertrail) - Enabling Papertrail
### [Media](docs/sdks/media/README.md)
* [markPlayed](docs/sdks/media/README.md#markplayed) - Mark Media Played
* [markUnplayed](docs/sdks/media/README.md#markunplayed) - Mark Media Unplayed
* [updatePlayProgress](docs/sdks/media/README.md#updateplayprogress) - Update Media Play Progress
* [getBannerImage](docs/sdks/media/README.md#getbannerimage) - Get Banner Image
* [getThumbImage](docs/sdks/media/README.md#getthumbimage) - Get Thumb Image
### [Playlists](docs/sdks/playlists/README.md)
* [createPlaylist](docs/sdks/playlists/README.md#createplaylist) - Create a Playlist
* [getPlaylists](docs/sdks/playlists/README.md#getplaylists) - Get All Playlists
* [getPlaylist](docs/sdks/playlists/README.md#getplaylist) - Retrieve Playlist
* [deletePlaylist](docs/sdks/playlists/README.md#deleteplaylist) - Deletes a Playlist
* [updatePlaylist](docs/sdks/playlists/README.md#updateplaylist) - Update a Playlist
* [getPlaylistContents](docs/sdks/playlists/README.md#getplaylistcontents) - Retrieve Playlist Contents
* [clearPlaylistContents](docs/sdks/playlists/README.md#clearplaylistcontents) - Delete Playlist Contents
* [addPlaylistContents](docs/sdks/playlists/README.md#addplaylistcontents) - Adding to a Playlist
* [uploadPlaylist](docs/sdks/playlists/README.md#uploadplaylist) - Upload Playlist
### [Plex](docs/sdks/plex/README.md)
* [getCompanionsData](docs/sdks/plex/README.md#getcompanionsdata) - Get Companions Data
* [getUserFriends](docs/sdks/plex/README.md#getuserfriends) - Get list of friends of the user logged in
* [getGeoData](docs/sdks/plex/README.md#getgeodata) - Get Geo Data
* [getHomeData](docs/sdks/plex/README.md#gethomedata) - Get Plex Home Data
* [getServerResources](docs/sdks/plex/README.md#getserverresources) - Get Server Resources
* [getPin](docs/sdks/plex/README.md#getpin) - Get a Pin
* [getTokenByPinId](docs/sdks/plex/README.md#gettokenbypinid) - Get Access Token by PinId
### [Search](docs/sdks/search/README.md)
* [performSearch](docs/sdks/search/README.md#performsearch) - Perform a search
* [performVoiceSearch](docs/sdks/search/README.md#performvoicesearch) - Perform a voice search
* [getSearchResults](docs/sdks/search/README.md#getsearchresults) - Get Search Results
### [Server](docs/sdks/server/README.md)
* [getServerCapabilities](docs/sdks/server/README.md#getservercapabilities) - Get Server Capabilities
* [getServerPreferences](docs/sdks/server/README.md#getserverpreferences) - Get Server Preferences
* [getAvailableClients](docs/sdks/server/README.md#getavailableclients) - Get Available Clients
* [getDevices](docs/sdks/server/README.md#getdevices) - Get Devices
* [getServerIdentity](docs/sdks/server/README.md#getserveridentity) - Get Server Identity
* [getMyPlexAccount](docs/sdks/server/README.md#getmyplexaccount) - Get MyPlex Account
* [getResizedPhoto](docs/sdks/server/README.md#getresizedphoto) - Get a Resized Photo
* [getMediaProviders](docs/sdks/server/README.md#getmediaproviders) - Get Media Providers
* [getServerList](docs/sdks/server/README.md#getserverlist) - Get Server List
### [Sessions](docs/sdks/sessions/README.md)
* [getSessions](docs/sdks/sessions/README.md#getsessions) - Get Active Sessions
* [getSessionHistory](docs/sdks/sessions/README.md#getsessionhistory) - Get Session History
* [getTranscodeSessions](docs/sdks/sessions/README.md#gettranscodesessions) - Get Transcode Sessions
* [stopTranscodeSession](docs/sdks/sessions/README.md#stoptranscodesession) - Stop a Transcode Session
### [Statistics](docs/sdks/statistics/README.md)
* [getStatistics](docs/sdks/statistics/README.md#getstatistics) - Get Media Statistics
* [getResourcesStatistics](docs/sdks/statistics/README.md#getresourcesstatistics) - Get Resources Statistics
* [getBandwidthStatistics](docs/sdks/statistics/README.md#getbandwidthstatistics) - Get Bandwidth Statistics
### [Updater](docs/sdks/updater/README.md)
* [getUpdateStatus](docs/sdks/updater/README.md#getupdatestatus) - Querying status of updates
* [checkForUpdates](docs/sdks/updater/README.md#checkforupdates) - Checking for updates
* [applyUpdates](docs/sdks/updater/README.md#applyupdates) - Apply Updates
### [Video](docs/sdks/video/README.md)
* [getTimeline](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item
* [startUniversalTranscode](docs/sdks/video/README.md#startuniversaltranscode) - Start Universal Transcode
### [Watchlist](docs/sdks/watchlist/README.md)
* [getWatchList](docs/sdks/watchlist/README.md#getwatchlist) - Get User Watchlist
</details>
<!-- End Available Resources and Operations [operations] -->
<!-- Start Authentication [security] -->
@@ -83,10 +228,13 @@ let client = Client(security: .accessToken("<YOUR_API_KEY_HERE>"))
let response = try await client.server.getServerCapabilities()
switch response.data {
case .twoHundredApplicationJsonObject(let twoHundredApplicationJsonObject):
case .object(let object):
// Handle response
break
case .fourHundredAndOneApplicationJsonObject(let fourHundredAndOneApplicationJsonObject):
case .badRequest(let badRequest):
// Handle response
break
case .unauthorized(let unauthorized):
// Handle response
break
case .empty:
@@ -102,7 +250,7 @@ case .empty:
A parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.
For example, you can set `X-Plex-Client-Identifier` to `"Postman"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
For example, you can set `X-Plex-Client-Identifier` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getServerResources`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
### Available Globals
@@ -123,20 +271,24 @@ This is used to track the client application and its usage
import Foundation
import Plexswift
let client = Client()
let client = Client(security: .accessToken("<YOUR_API_KEY_HERE>"))
let response = try await client.plex.getPin(
request: Operations.GetPinRequest(
xPlexProduct: "Postman",
strong: false,
let response = try await client.plex.getServerResources(
request: Operations.GetServerResourcesRequest(
includeHttps: .one,
includeIPv6: .one,
includeRelay: .one,
)
)
switch response.data {
case .twoHundredAndOneApplicationJsonObject(let twoHundredAndOneApplicationJsonObject):
case .plexDevices(let plexDevices):
// Handle response
break
case .fourHundredApplicationJsonObject(let fourHundredApplicationJsonObject):
case .badRequest(let badRequest):
// Handle response
break
case .unauthorized(let unauthorized):
// Handle response
break
case .empty:

View File

@@ -572,4 +572,14 @@ Based on:
### Generated
- [swift v0.5.0] .
### Releases
- [Swift Package Manager v0.5.0] https://github.com/LukeHagar/plexswift/releases/tag/v0.5.0 - .
- [Swift Package Manager v0.5.0] https://github.com/LukeHagar/plexswift/releases/tag/v0.5.0 - .
## 2024-09-16 18:43:31
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.397.2 (2.415.8) https://github.com/speakeasy-api/speakeasy
### Generated
- [swift v0.6.0] .
### Releases
- [Swift Package Manager v0.6.0] https://github.com/LukeHagar/plexswift/releases/tag/v0.6.0 - .

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
#if os(Linux)
@@ -28,7 +28,9 @@ import FoundationNetworking
/// ```swift
/// let response: Response<Operations.GetResizedPhotoResponse> = ... // Response from API call
/// switch response.data {
/// case .object(let object):
/// case .badRequest(let badRequest):
/// // Handle response
/// case .unauthorized(let unauthorized):
/// // Handle response
/// case .empty:
/// // Handle empty response
@@ -70,13 +72,13 @@ import FoundationNetworking
/// - ``hubs``
/// - ``search``
/// - ``library``
/// - ``watchlist``
/// - ``log``
/// - ``playlists``
/// - ``authentication``
/// - ``statistics``
/// - ``sessions``
/// - ``updater``
/// - ``watchlist``
///
public final class Client {
internal struct APIResponse {
@@ -90,12 +92,12 @@ public final class Client {
// Underscore-prefix properties so these do not potentially conflict with any operation namespaces.
private lazy var _session = URLSession(configuration: .default)
private var _globalParameters: GlobalParameters?
private var _security: Shared.Security
private var _security: Shared.Security?
private var _selectedServer: GlobalServers?
/// Creates an API client object with the specified parameters.
public init(globalParameters: GlobalParameters? = nil, security: Shared.Security) {
public init(globalParameters: GlobalParameters? = nil, security: Shared.Security? = nil) {
self._globalParameters = globalParameters
self._security = security
}

View File

@@ -1,6 +1,6 @@
# ``plexswift``
An Open API Spec for interacting with Plex.tv and Plex Servers
Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
`plexswift` is a Swift library which provides functionality for making requests to the API using a modern, easy-to-use Swift API:
@@ -15,10 +15,13 @@ let client = Client(security: .accessToken("<YOUR_API_KEY_HERE>"))
let response = try await client.server.getServerCapabilities()
switch response.data {
case .twoHundredApplicationJsonObject(let twoHundredApplicationJsonObject):
case .object(let object):
// Handle response
break
case .fourHundredAndOneApplicationJsonObject(let fourHundredAndOneApplicationJsonObject):
case .badRequest(let badRequest):
// Handle response
break
case .unauthorized(let unauthorized):
// Handle response
break
case .empty:
@@ -60,22 +63,101 @@ case .empty:
- ``HubsAPI``
- ``SearchAPI``
- ``LibraryAPI``
- ``WatchlistAPI``
- ``LogAPI``
- ``PlaylistsAPI``
- ``AuthenticationAPI``
- ``StatisticsAPI``
- ``SessionsAPI``
- ``UpdaterAPI``
- ``WatchlistAPI``
### Server configuration
- ``PlexServers/GetCompanionsData``
- ``PlexServers/GetUserFriends``
- ``PlexServers/GetGeoData``
- ``PlexServers/GetServerResources``
- ``PlexServers/GetPin``
- ``PlexServers/GetToken``
- ``WatchlistServers/GetWatchlist``
- ``PlexServers/GetTokenByPinId``
- ``WatchlistServers/GetWatchList``
- ``AuthenticationServers/GetTokenDetails``
- ``AuthenticationServers/PostUsersSignInData``
### Shared models
### Request objects
- ``Operations/AddPlaylistContentsBadRequest``
- ``Operations/ApplyUpdatesBadRequest``
- ``Operations/CancelServerActivitiesBadRequest``
- ``Operations/CheckForUpdatesBadRequest``
- ``Operations/ClearPlaylistContentsBadRequest``
- ``Operations/CreatePlaylistBadRequest``
- ``Operations/DeleteLibraryBadRequest``
- ``Operations/DeletePlaylistBadRequest``
- ``Operations/EnablePaperTrailBadRequest``
- ``Operations/GetAllLibrariesBadRequest``
- ``Operations/GetBannerImageBadRequest``
- ``Operations/GetLibraryDetailsBadRequest``
- ``Operations/GetLibraryItemsBadRequest``
- ``Operations/GetMediaProvidersBadRequest``
- ``Operations/GetMetaDataByRatingKeyBadRequest``
- ``Operations/GetRefreshLibraryMetadataBadRequest``
- ``Operations/GetSearchLibraryBadRequest``
- ``Operations/GetServerResourcesBadRequest``
- ``Operations/GetThumbImageBadRequest``
- ``Operations/GetWatchListBadRequest``
- ``Operations/GetAvailableClientsBadRequest``
- ``Operations/GetBandwidthStatisticsBadRequest``
- ``Operations/GetButlerTasksBadRequest``
- ``Operations/GetCompanionsDataBadRequest``
- ``Operations/GetDevicesBadRequest``
- ``Operations/GetFileHashBadRequest``
- ``Operations/GetGeoDataBadRequest``
- ``Operations/GetGlobalHubsBadRequest``
- ``Operations/GetHomeDataBadRequest``
- ``Operations/GetLibraryHubsBadRequest``
- ``Operations/GetMetadataChildrenBadRequest``
- ``Operations/GetMyPlexAccountBadRequest``
- ``Operations/GetOnDeckBadRequest``
- ``Operations/GetPinBadRequest``
- ``Operations/GetPlaylistBadRequest``
- ``Operations/GetPlaylistContentsBadRequest``
- ``Operations/GetPlaylistsBadRequest``
- ``Operations/GetRecentlyAddedBadRequest``
- ``Operations/GetResizedPhotoBadRequest``
- ``Operations/GetResourcesStatisticsBadRequest``
- ``Operations/GetSearchResultsBadRequest``
- ``Operations/GetServerActivitiesBadRequest``
- ``Operations/GetServerCapabilitiesBadRequest``
- ``Operations/GetServerListBadRequest``
- ``Operations/GetServerPreferencesBadRequest``
- ``Operations/GetSessionHistoryBadRequest``
- ``Operations/GetSessionsBadRequest``
- ``Operations/GetSourceConnectionInformationBadRequest``
- ``Operations/GetStatisticsBadRequest``
- ``Operations/GetTimelineBadRequest``
- ``Operations/GetTokenByPinIdBadRequest``
- ``Operations/GetTokenDetailsBadRequest``
- ``Operations/GetTopWatchedContentBadRequest``
- ``Operations/GetTranscodeSessionsBadRequest``
- ``Operations/GetTransientTokenBadRequest``
- ``Operations/GetUpdateStatusBadRequest``
- ``Operations/GetUserFriendsBadRequest``
- ``Operations/LogLineBadRequest``
- ``Operations/LogMultiLineBadRequest``
- ``Operations/MarkPlayedBadRequest``
- ``Operations/MarkUnplayedBadRequest``
- ``Operations/PerformSearchBadRequest``
- ``Operations/PerformVoiceSearchBadRequest``
- ``Operations/PostUsersSignInDataBadRequest``
- ``Operations/StartAllTasksBadRequest``
- ``Operations/StartTaskBadRequest``
- ``Operations/StartUniversalTranscodeBadRequest``
- ``Operations/StopAllTasksBadRequest``
- ``Operations/StopTaskBadRequest``
- ``Operations/StopTranscodeSessionBadRequest``
- ``Operations/UpdatePlaylistBadRequest``
- ``Operations/UpdatePlayProgressBadRequest``
- ``Operations/UploadPlaylistBadRequest``
### Response objects
- ``Operations/AddPlaylistContentsResponse``
@@ -87,18 +169,28 @@ case .empty:
- ``Operations/DeleteLibraryResponse``
- ``Operations/DeletePlaylistResponse``
- ``Operations/EnablePaperTrailResponse``
- ``Operations/GetAllLibrariesResponse``
- ``Operations/GetBannerImageResponse``
- ``Operations/GetLibraryDetailsResponse``
- ``Operations/GetLibraryItemsResponse``
- ``Operations/GetMediaProvidersResponse``
- ``Operations/GetMetaDataByRatingKeyResponse``
- ``Operations/GetRefreshLibraryMetadataResponse``
- ``Operations/GetSearchLibraryResponse``
- ``Operations/GetServerIdentityResponse``
- ``Operations/GetServerResourcesResponse``
- ``Operations/GetThumbImageResponse``
- ``Operations/GetWatchListResponse``
- ``Operations/GetAvailableClientsResponse``
- ``Operations/GetBandwidthStatisticsResponse``
- ``Operations/GetButlerTasksResponse``
- ``Operations/GetCompanionsDataResponse``
- ``Operations/GetDevicesResponse``
- ``Operations/GetFileHashResponse``
- ``Operations/GetGeoDataResponse``
- ``Operations/GetGlobalHubsResponse``
- ``Operations/GetHomeDataResponse``
- ``Operations/GetLibrariesResponse``
- ``Operations/GetLibraryResponse``
- ``Operations/GetLibraryHubsResponse``
- ``Operations/GetLibraryItemsResponse``
- ``Operations/GetMetadataResponse``
- ``Operations/GetMetadataChildrenResponse``
- ``Operations/GetMyPlexAccountResponse``
- ``Operations/GetOnDeckResponse``
@@ -112,7 +204,6 @@ case .empty:
- ``Operations/GetSearchResultsResponse``
- ``Operations/GetServerActivitiesResponse``
- ``Operations/GetServerCapabilitiesResponse``
- ``Operations/GetServerIdentityResponse``
- ``Operations/GetServerListResponse``
- ``Operations/GetServerPreferencesResponse``
- ``Operations/GetSessionHistoryResponse``
@@ -120,20 +211,20 @@ case .empty:
- ``Operations/GetSourceConnectionInformationResponse``
- ``Operations/GetStatisticsResponse``
- ``Operations/GetTimelineResponse``
- ``Operations/GetTokenResponse``
- ``Operations/GetTokenByPinIdResponse``
- ``Operations/GetTokenDetailsResponse``
- ``Operations/GetTopWatchedContentResponse``
- ``Operations/GetTranscodeSessionsResponse``
- ``Operations/GetTransientTokenResponse``
- ``Operations/GetUpdateStatusResponse``
- ``Operations/GetWatchlistResponse``
- ``Operations/GetUserFriendsResponse``
- ``Operations/LogLineResponse``
- ``Operations/LogMultiLineResponse``
- ``Operations/MarkPlayedResponse``
- ``Operations/MarkUnplayedResponse``
- ``Operations/PerformSearchResponse``
- ``Operations/PerformVoiceSearchResponse``
- ``Operations/RefreshLibraryResponse``
- ``Operations/SearchLibraryResponse``
- ``Operations/PostUsersSignInDataResponse``
- ``Operations/StartAllTasksResponse``
- ``Operations/StartTaskResponse``
- ``Operations/StartUniversalTranscodeResponse``
@@ -150,112 +241,92 @@ case .empty:
- ``Operations/AddPlaylistContentsErrors``
- ``Operations/AddPlaylistContentsMediaContainer``
- ``Operations/AddPlaylistContentsMetadata``
- ``Operations/AddPlaylistContentsPlaylistsResponseBody``
- ``Operations/AddPlaylistContentsPlaylistsErrors``
- ``Operations/AddPlaylistContentsRequest``
- ``Operations/AddPlaylistContentsResponseBody``
- ``Operations/AddPlaylistContentsUnauthorized``
- ``Operations/ApplyUpdatesErrors``
- ``Operations/ApplyUpdatesRequest``
- ``Operations/ApplyUpdatesResponseBody``
- ``Operations/ApplyUpdatesUnauthorized``
- ``Operations/ApplyUpdatesUpdaterErrors``
- ``Operations/AutoSelectSubtitle``
- ``Operations/Billing``
- ``Operations/ButlerTask``
- ``Operations/ButlerTasks``
- ``Operations/CancelServerActivitiesActivitiesErrors``
- ``Operations/CancelServerActivitiesErrors``
- ``Operations/CancelServerActivitiesRequest``
- ``Operations/CancelServerActivitiesResponseBody``
- ``Operations/CancelServerActivitiesUnauthorized``
- ``Operations/CheckForUpdatesErrors``
- ``Operations/CheckForUpdatesRequest``
- ``Operations/CheckForUpdatesResponseBody``
- ``Operations/CheckForUpdatesUnauthorized``
- ``Operations/CheckForUpdatesUpdaterErrors``
- ``Operations/ClearPlaylistContentsErrors``
- ``Operations/ClearPlaylistContentsPlaylistsErrors``
- ``Operations/ClearPlaylistContentsRequest``
- ``Operations/ClearPlaylistContentsResponseBody``
- ``Operations/ClearPlaylistContentsUnauthorized``
- ``Operations/Connections``
- ``Operations/Context``
- ``Operations/Country``
- ``Operations/CreatePlaylistErrors``
- ``Operations/CreatePlaylistMediaContainer``
- ``Operations/CreatePlaylistMetadata``
- ``Operations/CreatePlaylistPlaylistsResponseBody``
- ``Operations/CreatePlaylistPlaylistsErrors``
- ``Operations/CreatePlaylistQueryParamType``
- ``Operations/CreatePlaylistRequest``
- ``Operations/CreatePlaylistResponseBody``
- ``Operations/CreatePlaylistUnauthorized``
- ``Operations/DefaultSubtitleAccessibility``
- ``Operations/DefaultSubtitleForced``
- ``Operations/DeleteLibraryErrors``
- ``Operations/DeleteLibraryLibraryErrors``
- ``Operations/DeleteLibraryRequest``
- ``Operations/DeleteLibraryResponseBody``
- ``Operations/DeleteLibraryUnauthorized``
- ``Operations/DeletePlaylistErrors``
- ``Operations/DeletePlaylistPlaylistsErrors``
- ``Operations/DeletePlaylistRequest``
- ``Operations/DeletePlaylistResponseBody``
- ``Operations/DeletePlaylistUnauthorized``
- ``Operations/Device``
- ``Operations/Director``
- ``Operations/Directory``
- ``Operations/Download``
- ``Operations/EnablePaperTrailErrors``
- ``Operations/EnablePaperTrailResponseBody``
- ``Operations/EnablePaperTrailLogErrors``
- ``Operations/EnablePaperTrailUnauthorized``
- ``Operations/Errors``
- ``Operations/Feature``
- ``Operations/Features``
- ``Operations/Field``
- ``Operations/FieldType``
- ``Operations/Filter``
- ``Operations/Force``
- ``Operations/Friend``
- ``Operations/Genre``
- ``Operations/GetAvailableClientsErrors``
- ``Operations/GetAvailableClientsMediaContainer``
- ``Operations/GetAvailableClientsResponseBody``
- ``Operations/GetAvailableClientsServerResponseBody``
- ``Operations/GetBandwidthStatisticsAccount``
- ``Operations/GetBandwidthStatisticsDevice``
- ``Operations/GetBandwidthStatisticsErrors``
- ``Operations/GetBandwidthStatisticsMediaContainer``
- ``Operations/GetBandwidthStatisticsRequest``
- ``Operations/GetBandwidthStatisticsResponseBody``
- ``Operations/GetBandwidthStatisticsStatisticsResponseBody``
- ``Operations/GetButlerTasksButlerResponseBody``
- ``Operations/GetButlerTasksErrors``
- ``Operations/GetButlerTasksResponseBody``
- ``Operations/GetDevicesErrors``
- ``Operations/GetDevicesMediaContainer``
- ``Operations/GetDevicesResponseBody``
- ``Operations/GetDevicesServerResponseBody``
- ``Operations/GetFileHashErrors``
- ``Operations/GetFileHashRequest``
- ``Operations/GetFileHashResponseBody``
- ``Operations/GetGlobalHubsErrors``
- ``Operations/GetGlobalHubsHubsResponseBody``
- ``Operations/GetGlobalHubsMediaContainer``
- ``Operations/GetGlobalHubsMetadata``
- ``Operations/GetGlobalHubsRequest``
- ``Operations/GetGlobalHubsResponseBody``
- ``Operations/GetHomeDataErrors``
- ``Operations/GetHomeDataPlexResponseBody``
- ``Operations/GetHomeDataResponseBody``
- ``Operations/GetLibrariesDirectory``
- ``Operations/GetLibrariesErrors``
- ``Operations/GetLibrariesLibraryResponseBody``
- ``Operations/GetLibrariesLocation``
- ``Operations/GetLibrariesMediaContainer``
- ``Operations/GetLibrariesResponseBody``
- ``Operations/GetLibraryDirectory``
- ``Operations/GetLibraryErrors``
- ``Operations/GetLibraryFilter``
- ``Operations/GetLibraryLibraryResponseBody``
- ``Operations/GetLibraryMediaContainer``
- ``Operations/GetLibraryRequest``
- ``Operations/GetLibraryResponseBody``
- ``Operations/GetLibraryType``
- ``Operations/GetLibraryHubsCountry``
- ``Operations/GetLibraryHubsDirector``
- ``Operations/GetLibraryHubsErrors``
- ``Operations/GetLibraryHubsGenre``
- ``Operations/GetLibraryHubsHub``
- ``Operations/GetLibraryHubsHubsResponseBody``
- ``Operations/GetLibraryHubsMedia``
- ``Operations/GetLibraryHubsMediaContainer``
- ``Operations/GetLibraryHubsMetadata``
- ``Operations/GetLibraryHubsPart``
- ``Operations/GetLibraryHubsRequest``
- ``Operations/GetLibraryHubsResponseBody``
- ``Operations/GetLibraryHubsRole``
- ``Operations/GetLibraryHubsWriter``
- ``Operations/GeoData``
- ``Operations/GetAllLibrariesDirectory``
- ``Operations/GetAllLibrariesErrors``
- ``Operations/GetAllLibrariesLibraryErrors``
- ``Operations/GetAllLibrariesMediaContainer``
- ``Operations/GetAllLibrariesResponseBody``
- ``Operations/GetAllLibrariesUnauthorized``
- ``Operations/GetBannerImageErrors``
- ``Operations/GetBannerImageMediaErrors``
- ``Operations/GetBannerImageRequest``
- ``Operations/GetBannerImageUnauthorized``
- ``Operations/GetLibraryDetailsDirectory``
- ``Operations/GetLibraryDetailsErrors``
- ``Operations/GetLibraryDetailsFilter``
- ``Operations/GetLibraryDetailsLibraryErrors``
- ``Operations/GetLibraryDetailsMediaContainer``
- ``Operations/GetLibraryDetailsRequest``
- ``Operations/GetLibraryDetailsResponseBody``
- ``Operations/GetLibraryDetailsType``
- ``Operations/GetLibraryDetailsUnauthorized``
- ``Operations/GetLibraryItemsCountry``
- ``Operations/GetLibraryItemsDirector``
- ``Operations/GetLibraryItemsErrors``
- ``Operations/GetLibraryItemsGenre``
- ``Operations/GetLibraryItemsLibraryResponseBody``
- ``Operations/GetLibraryItemsLibraryErrors``
- ``Operations/GetLibraryItemsMedia``
- ``Operations/GetLibraryItemsMediaContainer``
- ``Operations/GetLibraryItemsMetadata``
@@ -263,49 +334,147 @@ case .empty:
- ``Operations/GetLibraryItemsRequest``
- ``Operations/GetLibraryItemsResponseBody``
- ``Operations/GetLibraryItemsRole``
- ``Operations/GetLibraryItemsUnauthorized``
- ``Operations/GetLibraryItemsWriter``
- ``Operations/GetMetadataCountry``
- ``Operations/GetMetadataDirector``
- ``Operations/GetMetadataErrors``
- ``Operations/GetMetadataGenre``
- ``Operations/GetMetadataLibraryResponseBody``
- ``Operations/GetMetadataMedia``
- ``Operations/GetMetadataMediaContainer``
- ``Operations/GetMetadataMetadata``
- ``Operations/GetMetadataPart``
- ``Operations/GetMetadataRequest``
- ``Operations/GetMetadataResponseBody``
- ``Operations/GetMetadataRole``
- ``Operations/GetMetadataWriter``
- ``Operations/GetMediaProvidersDirectory``
- ``Operations/GetMediaProvidersErrors``
- ``Operations/GetMediaProvidersMediaContainer``
- ``Operations/GetMediaProvidersRequest``
- ``Operations/GetMediaProvidersResponseBody``
- ``Operations/GetMediaProvidersServerErrors``
- ``Operations/GetMediaProvidersUnauthorized``
- ``Operations/GetMetaDataByRatingKeyCountry``
- ``Operations/GetMetaDataByRatingKeyDirector``
- ``Operations/GetMetaDataByRatingKeyErrors``
- ``Operations/GetMetaDataByRatingKeyGenre``
- ``Operations/GetMetaDataByRatingKeyLibraryErrors``
- ``Operations/GetMetaDataByRatingKeyMedia``
- ``Operations/GetMetaDataByRatingKeyMediaContainer``
- ``Operations/GetMetaDataByRatingKeyMetadata``
- ``Operations/GetMetaDataByRatingKeyPart``
- ``Operations/GetMetaDataByRatingKeyRequest``
- ``Operations/GetMetaDataByRatingKeyResponseBody``
- ``Operations/GetMetaDataByRatingKeyRole``
- ``Operations/GetMetaDataByRatingKeyUnauthorized``
- ``Operations/GetMetaDataByRatingKeyWriter``
- ``Operations/GetRefreshLibraryMetadataErrors``
- ``Operations/GetRefreshLibraryMetadataLibraryErrors``
- ``Operations/GetRefreshLibraryMetadataRequest``
- ``Operations/GetRefreshLibraryMetadataUnauthorized``
- ``Operations/GetSearchLibraryErrors``
- ``Operations/GetSearchLibraryLibraryErrors``
- ``Operations/GetSearchLibraryMediaContainer``
- ``Operations/GetSearchLibraryMetadata``
- ``Operations/GetSearchLibraryRequest``
- ``Operations/GetSearchLibraryResponseBody``
- ``Operations/GetSearchLibraryUnauthorized``
- ``Operations/GetServerIdentityMediaContainer``
- ``Operations/GetServerIdentityRequestTimeout``
- ``Operations/GetServerIdentityResponseBody``
- ``Operations/GetServerResourcesErrors``
- ``Operations/GetServerResourcesPlexErrors``
- ``Operations/GetServerResourcesRequest``
- ``Operations/GetServerResourcesUnauthorized``
- ``Operations/GetThumbImageErrors``
- ``Operations/GetThumbImageMediaErrors``
- ``Operations/GetThumbImageRequest``
- ``Operations/GetThumbImageUnauthorized``
- ``Operations/GetWatchListErrors``
- ``Operations/GetWatchListRequest``
- ``Operations/GetWatchListResponseBody``
- ``Operations/GetWatchListUnauthorized``
- ``Operations/GetWatchListWatchlistErrors``
- ``Operations/GetAvailableClientsErrors``
- ``Operations/GetAvailableClientsMediaContainer``
- ``Operations/GetAvailableClientsResponseBody``
- ``Operations/GetAvailableClientsServerErrors``
- ``Operations/GetAvailableClientsUnauthorized``
- ``Operations/GetBandwidthStatisticsAccount``
- ``Operations/GetBandwidthStatisticsDevice``
- ``Operations/GetBandwidthStatisticsErrors``
- ``Operations/GetBandwidthStatisticsMediaContainer``
- ``Operations/GetBandwidthStatisticsRequest``
- ``Operations/GetBandwidthStatisticsResponseBody``
- ``Operations/GetBandwidthStatisticsStatisticsErrors``
- ``Operations/GetBandwidthStatisticsUnauthorized``
- ``Operations/GetButlerTasksButlerErrors``
- ``Operations/GetButlerTasksErrors``
- ``Operations/GetButlerTasksResponseBody``
- ``Operations/GetButlerTasksUnauthorized``
- ``Operations/GetCompanionsDataErrors``
- ``Operations/GetCompanionsDataPlexErrors``
- ``Operations/GetCompanionsDataUnauthorized``
- ``Operations/GetDevicesErrors``
- ``Operations/GetDevicesMediaContainer``
- ``Operations/GetDevicesResponseBody``
- ``Operations/GetDevicesServerErrors``
- ``Operations/GetDevicesUnauthorized``
- ``Operations/GetFileHashErrors``
- ``Operations/GetFileHashLibraryErrors``
- ``Operations/GetFileHashRequest``
- ``Operations/GetFileHashUnauthorized``
- ``Operations/GetGeoDataErrors``
- ``Operations/GetGeoDataGeoData``
- ``Operations/GetGeoDataPlexErrors``
- ``Operations/GetGeoDataUnauthorized``
- ``Operations/GetGlobalHubsErrors``
- ``Operations/GetGlobalHubsHubsErrors``
- ``Operations/GetGlobalHubsMediaContainer``
- ``Operations/GetGlobalHubsMetadata``
- ``Operations/GetGlobalHubsRequest``
- ``Operations/GetGlobalHubsResponseBody``
- ``Operations/GetGlobalHubsUnauthorized``
- ``Operations/GetHomeDataErrors``
- ``Operations/GetHomeDataPlexErrors``
- ``Operations/GetHomeDataResponseBody``
- ``Operations/GetHomeDataUnauthorized``
- ``Operations/GetLibraryHubsCountry``
- ``Operations/GetLibraryHubsDirector``
- ``Operations/GetLibraryHubsErrors``
- ``Operations/GetLibraryHubsGenre``
- ``Operations/GetLibraryHubsHub``
- ``Operations/GetLibraryHubsHubsErrors``
- ``Operations/GetLibraryHubsMedia``
- ``Operations/GetLibraryHubsMediaContainer``
- ``Operations/GetLibraryHubsMetadata``
- ``Operations/GetLibraryHubsPart``
- ``Operations/GetLibraryHubsRequest``
- ``Operations/GetLibraryHubsResponseBody``
- ``Operations/GetLibraryHubsRole``
- ``Operations/GetLibraryHubsUnauthorized``
- ``Operations/GetLibraryHubsWriter``
- ``Operations/GetMetadataChildrenDirectory``
- ``Operations/GetMetadataChildrenErrors``
- ``Operations/GetMetadataChildrenLibraryResponseBody``
- ``Operations/GetMetadataChildrenLibraryErrors``
- ``Operations/GetMetadataChildrenMediaContainer``
- ``Operations/GetMetadataChildrenMetadata``
- ``Operations/GetMetadataChildrenRequest``
- ``Operations/GetMetadataChildrenResponseBody``
- ``Operations/GetMetadataChildrenUnauthorized``
- ``Operations/GetMyPlexAccountErrors``
- ``Operations/GetMyPlexAccountResponseBody``
- ``Operations/GetMyPlexAccountServerResponseBody``
- ``Operations/GetMyPlexAccountServerErrors``
- ``Operations/GetMyPlexAccountUnauthorized``
- ``Operations/GetOnDeckErrors``
- ``Operations/GetOnDeckGuids``
- ``Operations/GetOnDeckLibraryResponseBody``
- ``Operations/GetOnDeckLibraryErrors``
- ``Operations/GetOnDeckMedia``
- ``Operations/GetOnDeckMediaContainer``
- ``Operations/GetOnDeckMetadata``
- ``Operations/GetOnDeckPart``
- ``Operations/GetOnDeckResponseBody``
- ``Operations/GetOnDeckStream``
- ``Operations/GetOnDeckUnauthorized``
- ``Operations/GetPinAuthPinContainer``
- ``Operations/GetPinErrors``
- ``Operations/GetPinPlexResponseBody``
- ``Operations/GetPinRequest``
- ``Operations/GetPinResponseBody``
- ``Operations/GetPlaylistErrors``
- ``Operations/GetPlaylistMediaContainer``
- ``Operations/GetPlaylistMetadata``
- ``Operations/GetPlaylistPlaylistsResponseBody``
- ``Operations/GetPlaylistPlaylistsErrors``
- ``Operations/GetPlaylistRequest``
- ``Operations/GetPlaylistResponseBody``
- ``Operations/GetPlaylistUnauthorized``
- ``Operations/GetPlaylistContentsCountry``
- ``Operations/GetPlaylistContentsDirector``
- ``Operations/GetPlaylistContentsErrors``
@@ -314,30 +483,37 @@ case .empty:
- ``Operations/GetPlaylistContentsMediaContainer``
- ``Operations/GetPlaylistContentsMetadata``
- ``Operations/GetPlaylistContentsPart``
- ``Operations/GetPlaylistContentsPlaylistsResponseBody``
- ``Operations/GetPlaylistContentsPlaylistsErrors``
- ``Operations/GetPlaylistContentsQueryParamType``
- ``Operations/GetPlaylistContentsRequest``
- ``Operations/GetPlaylistContentsResponseBody``
- ``Operations/GetPlaylistContentsRole``
- ``Operations/GetPlaylistContentsUnauthorized``
- ``Operations/GetPlaylistContentsWriter``
- ``Operations/GetPlaylistsErrors``
- ``Operations/GetPlaylistsMediaContainer``
- ``Operations/GetPlaylistsMetadata``
- ``Operations/GetPlaylistsPlaylistsResponseBody``
- ``Operations/GetPlaylistsPlaylistsErrors``
- ``Operations/GetPlaylistsRequest``
- ``Operations/GetPlaylistsResponseBody``
- ``Operations/GetPlaylistsUnauthorized``
- ``Operations/GetRecentlyAddedErrors``
- ``Operations/GetRecentlyAddedLibraryResponseBody``
- ``Operations/GetRecentlyAddedLibraryErrors``
- ``Operations/GetRecentlyAddedMediaContainer``
- ``Operations/GetRecentlyAddedMetadata``
- ``Operations/GetRecentlyAddedRequest``
- ``Operations/GetRecentlyAddedResponseBody``
- ``Operations/GetRecentlyAddedUnauthorized``
- ``Operations/GetResizedPhotoErrors``
- ``Operations/GetResizedPhotoRequest``
- ``Operations/GetResizedPhotoResponseBody``
- ``Operations/GetResizedPhotoServerErrors``
- ``Operations/GetResizedPhotoUnauthorized``
- ``Operations/GetResourcesStatisticsErrors``
- ``Operations/GetResourcesStatisticsMediaContainer``
- ``Operations/GetResourcesStatisticsRequest``
- ``Operations/GetResourcesStatisticsResponseBody``
- ``Operations/GetResourcesStatisticsStatisticsResponseBody``
- ``Operations/GetResourcesStatisticsStatisticsErrors``
- ``Operations/GetResourcesStatisticsUnauthorized``
- ``Operations/GetSearchResultsCountry``
- ``Operations/GetSearchResultsDirector``
- ``Operations/GetSearchResultsErrors``
@@ -349,183 +525,255 @@ case .empty:
- ``Operations/GetSearchResultsRequest``
- ``Operations/GetSearchResultsResponseBody``
- ``Operations/GetSearchResultsRole``
- ``Operations/GetSearchResultsSearchResponseBody``
- ``Operations/GetSearchResultsSearchErrors``
- ``Operations/GetSearchResultsUnauthorized``
- ``Operations/GetSearchResultsWriter``
- ``Operations/GetServerActivitiesActivitiesResponseBody``
- ``Operations/GetServerActivitiesActivitiesErrors``
- ``Operations/GetServerActivitiesErrors``
- ``Operations/GetServerActivitiesMediaContainer``
- ``Operations/GetServerActivitiesResponseBody``
- ``Operations/GetServerActivitiesUnauthorized``
- ``Operations/GetServerCapabilitiesErrors``
- ``Operations/GetServerCapabilitiesResponseBody``
- ``Operations/GetServerCapabilitiesServerResponseBody``
- ``Operations/GetServerIdentityErrors``
- ``Operations/GetServerIdentityMediaContainer``
- ``Operations/GetServerIdentityResponseBody``
- ``Operations/GetServerIdentityServerResponseBody``
- ``Operations/GetServerCapabilitiesUnauthorized``
- ``Operations/GetServerListErrors``
- ``Operations/GetServerListMediaContainer``
- ``Operations/GetServerListResponseBody``
- ``Operations/GetServerListServer``
- ``Operations/GetServerListServerResponseBody``
- ``Operations/GetServerListServerErrors``
- ``Operations/GetServerListUnauthorized``
- ``Operations/GetServerPreferencesErrors``
- ``Operations/GetServerPreferencesMediaContainer``
- ``Operations/GetServerPreferencesResponseBody``
- ``Operations/GetServerPreferencesServerResponseBody``
- ``Operations/GetServerPreferencesServerErrors``
- ``Operations/GetServerPreferencesUnauthorized``
- ``Operations/GetSessionHistoryErrors``
- ``Operations/GetSessionHistoryMediaContainer``
- ``Operations/GetSessionHistoryMetadata``
- ``Operations/GetSessionHistoryRequest``
- ``Operations/GetSessionHistoryResponseBody``
- ``Operations/GetSessionHistorySessionsResponseBody``
- ``Operations/GetSessionHistorySessionsErrors``
- ``Operations/GetSessionHistoryUnauthorized``
- ``Operations/GetSessionsErrors``
- ``Operations/GetSessionsMedia``
- ``Operations/GetSessionsMediaContainer``
- ``Operations/GetSessionsMetadata``
- ``Operations/GetSessionsPart``
- ``Operations/GetSessionsResponseBody``
- ``Operations/GetSessionsSessionsResponseBody``
- ``Operations/GetSessionsSessionsErrors``
- ``Operations/GetSessionsStream``
- ``Operations/GetSessionsUnauthorized``
- ``Operations/GetSessionsUser``
- ``Operations/GetSourceConnectionInformationAuthenticationErrors``
- ``Operations/GetSourceConnectionInformationErrors``
- ``Operations/GetSourceConnectionInformationRequest``
- ``Operations/GetSourceConnectionInformationResponseBody``
- ``Operations/GetSourceConnectionInformationUnauthorized``
- ``Operations/GetStatisticsDevice``
- ``Operations/GetStatisticsErrors``
- ``Operations/GetStatisticsMediaContainer``
- ``Operations/GetStatisticsRequest``
- ``Operations/GetStatisticsResponseBody``
- ``Operations/GetStatisticsStatisticsResponseBody``
- ``Operations/GetStatisticsStatisticsErrors``
- ``Operations/GetStatisticsUnauthorized``
- ``Operations/GetTimelineErrors``
- ``Operations/GetTimelineRequest``
- ``Operations/GetTimelineResponseBody``
- ``Operations/GetTokenErrors``
- ``Operations/GetTokenLocation``
- ``Operations/GetTokenPlexResponseBody``
- ``Operations/GetTokenRequest``
- ``Operations/GetTokenResponseBody``
- ``Operations/GetTimelineUnauthorized``
- ``Operations/GetTimelineVideoErrors``
- ``Operations/GetTokenByPinIdAuthPinContainer``
- ``Operations/GetTokenByPinIdErrors``
- ``Operations/GetTokenByPinIdGeoData``
- ``Operations/GetTokenByPinIdPlexErrors``
- ``Operations/GetTokenByPinIdRequest``
- ``Operations/GetTokenByPinIdResponseBody``
- ``Operations/GetTokenDetailsAuthenticationErrors``
- ``Operations/GetTokenDetailsAuthenticationResponseStatus``
- ``Operations/GetTokenDetailsAuthenticationStatus``
- ``Operations/GetTokenDetailsErrors``
- ``Operations/GetTokenDetailsFeatures``
- ``Operations/GetTokenDetailsStatus``
- ``Operations/GetTokenDetailsSubscription``
- ``Operations/GetTokenDetailsUnauthorized``
- ``Operations/GetTokenDetailsUserPlexAccount``
- ``Operations/GetTopWatchedContentCountry``
- ``Operations/GetTopWatchedContentErrors``
- ``Operations/GetTopWatchedContentGenre``
- ``Operations/GetTopWatchedContentGuids``
- ``Operations/GetTopWatchedContentLibraryErrors``
- ``Operations/GetTopWatchedContentMediaContainer``
- ``Operations/GetTopWatchedContentMetadata``
- ``Operations/GetTopWatchedContentQueryParamType``
- ``Operations/GetTopWatchedContentRequest``
- ``Operations/GetTopWatchedContentResponseBody``
- ``Operations/GetTopWatchedContentRole``
- ``Operations/GetTopWatchedContentUnauthorized``
- ``Operations/GetTranscodeSessionsErrors``
- ``Operations/GetTranscodeSessionsMediaContainer``
- ``Operations/GetTranscodeSessionsResponseBody``
- ``Operations/GetTranscodeSessionsSessionsResponseBody``
- ``Operations/GetTranscodeSessionsSessionsErrors``
- ``Operations/GetTranscodeSessionsUnauthorized``
- ``Operations/GetTransientTokenAuthenticationErrors``
- ``Operations/GetTransientTokenErrors``
- ``Operations/GetTransientTokenQueryParamType``
- ``Operations/GetTransientTokenRequest``
- ``Operations/GetTransientTokenResponseBody``
- ``Operations/GetTransientTokenUnauthorized``
- ``Operations/GetUpdateStatusErrors``
- ``Operations/GetUpdateStatusMediaContainer``
- ``Operations/GetUpdateStatusResponseBody``
- ``Operations/GetUpdateStatusUpdaterResponseBody``
- ``Operations/GetWatchlistErrors``
- ``Operations/GetWatchlistRequest``
- ``Operations/GetWatchlistResponseBody``
- ``Operations/GetWatchlistWatchlistResponseBody``
- ``Operations/GetUpdateStatusUnauthorized``
- ``Operations/GetUpdateStatusUpdaterErrors``
- ``Operations/GetUserFriendsErrors``
- ``Operations/GetUserFriendsPlexErrors``
- ``Operations/GetUserFriendsUnauthorized``
- ``Operations/Guids``
- ``Operations/Hub``
- ``Operations/Image``
- ``Operations/IncludeCollections``
- ``Operations/IncludeDetails``
- ``Operations/IncludeExternalMedia``
- ``Operations/IncludeGuids``
- ``Operations/IncludeHttps``
- ``Operations/IncludeIPv6``
- ``Operations/IncludeMeta``
- ``Operations/IncludeRelay``
- ``Operations/InternalPaymentMethod``
- ``Operations/Level``
- ``Operations/LibrarySectionID``
- ``Operations/Libtype``
- ``Operations/Location``
- ``Operations/LogLineErrors``
- ``Operations/LogLineLogErrors``
- ``Operations/LogLineRequest``
- ``Operations/LogLineResponseBody``
- ``Operations/LogLineUnauthorized``
- ``Operations/LogMultiLineErrors``
- ``Operations/LogMultiLineResponseBody``
- ``Operations/LogMultiLineLogErrors``
- ``Operations/LogMultiLineUnauthorized``
- ``Operations/MailingListStatus``
- ``Operations/MarkPlayedErrors``
- ``Operations/MarkPlayedMediaErrors``
- ``Operations/MarkPlayedRequest``
- ``Operations/MarkPlayedResponseBody``
- ``Operations/MarkPlayedUnauthorized``
- ``Operations/MarkUnplayedErrors``
- ``Operations/MarkUnplayedMediaErrors``
- ``Operations/MarkUnplayedRequest``
- ``Operations/MarkUnplayedResponseBody``
- ``Operations/MarkUnplayedUnauthorized``
- ``Operations/Media``
- ``Operations/MediaContainer``
- ``Operations/MediaProvider``
- ``Operations/MediaReviewsVisibility``
- ``Operations/Metadata``
- ``Operations/MinSize``
- ``Operations/MyPlex``
- ``Operations/OnlyTransient``
- ``Operations/Operator``
- ``Operations/Part``
- ``Operations/PathParamFilter``
- ``Operations/PastSubscription``
- ``Operations/PathParamTaskName``
- ``Operations/PerformSearchErrors``
- ``Operations/PerformSearchRequest``
- ``Operations/PerformSearchResponseBody``
- ``Operations/PerformSearchSearchErrors``
- ``Operations/PerformSearchUnauthorized``
- ``Operations/PerformVoiceSearchErrors``
- ``Operations/PerformVoiceSearchRequest``
- ``Operations/PerformVoiceSearchResponseBody``
- ``Operations/PerformVoiceSearchSearchErrors``
- ``Operations/PerformVoiceSearchUnauthorized``
- ``Operations/Pivot``
- ``Operations/Player``
- ``Operations/PlaylistType``
- ``Operations/PlexDevice``
- ``Operations/PostUsersSignInDataAuthenticationErrors``
- ``Operations/PostUsersSignInDataAuthenticationFeatures``
- ``Operations/PostUsersSignInDataAuthenticationResponseStatus``
- ``Operations/PostUsersSignInDataAuthenticationStatus``
- ``Operations/PostUsersSignInDataAuthenticationSubscription``
- ``Operations/PostUsersSignInDataAutoSelectSubtitle``
- ``Operations/PostUsersSignInDataDefaultSubtitleAccessibility``
- ``Operations/PostUsersSignInDataDefaultSubtitleForced``
- ``Operations/PostUsersSignInDataErrors``
- ``Operations/PostUsersSignInDataFeatures``
- ``Operations/PostUsersSignInDataMailingListStatus``
- ``Operations/PostUsersSignInDataMediaReviewsVisibility``
- ``Operations/PostUsersSignInDataRequest``
- ``Operations/PostUsersSignInDataRequestBody``
- ``Operations/PostUsersSignInDataServices``
- ``Operations/PostUsersSignInDataState``
- ``Operations/PostUsersSignInDataStatus``
- ``Operations/PostUsersSignInDataSubscription``
- ``Operations/PostUsersSignInDataUnauthorized``
- ``Operations/PostUsersSignInDataUserPlexAccount``
- ``Operations/PostUsersSignInDataUserProfile``
- ``Operations/PostUsersSignInDataWatchedIndicator``
- ``Operations/Producer``
- ``Operations/Provider``
- ``Operations/QueryParamFilter``
- ``Operations/QueryParamForce``
- ``Operations/QueryParamOnlyTransient``
- ``Operations/QueryParamSmart``
- ``Operations/QueryParamType``
- ``Operations/Ratings``
- ``Operations/RefreshLibraryErrors``
- ``Operations/RefreshLibraryRequest``
- ``Operations/RefreshLibraryResponseBody``
- ``Operations/Release``
- ``Operations/ResponseBody``
- ``Operations/Role``
- ``Operations/Scope``
- ``Operations/SearchLibraryErrors``
- ``Operations/SearchLibraryLibraryResponseBody``
- ``Operations/SearchLibraryMediaContainer``
- ``Operations/SearchLibraryMetadata``
- ``Operations/SearchLibraryRequest``
- ``Operations/SearchLibraryResponseBody``
- ``Operations/Server``
- ``Operations/Services``
- ``Operations/Session``
- ``Operations/Setting``
- ``Operations/SharedServers``
- ``Operations/SharedSources``
- ``Operations/Skip``
- ``Operations/Smart``
- ``Operations/Sort``
- ``Operations/StartAllTasksButlerErrors``
- ``Operations/StartAllTasksErrors``
- ``Operations/StartAllTasksResponseBody``
- ``Operations/StartAllTasksUnauthorized``
- ``Operations/StartTaskButlerErrors``
- ``Operations/StartTaskErrors``
- ``Operations/StartTaskRequest``
- ``Operations/StartTaskResponseBody``
- ``Operations/StartTaskUnauthorized``
- ``Operations/StartUniversalTranscodeErrors``
- ``Operations/StartUniversalTranscodeRequest``
- ``Operations/StartUniversalTranscodeResponseBody``
- ``Operations/StartUniversalTranscodeUnauthorized``
- ``Operations/StartUniversalTranscodeVideoErrors``
- ``Operations/State``
- ``Operations/StatisticsBandwidth``
- ``Operations/StatisticsMedia``
- ``Operations/StatisticsResources``
- ``Operations/Status``
- ``Operations/StopAllTasksButlerErrors``
- ``Operations/StopAllTasksErrors``
- ``Operations/StopAllTasksResponseBody``
- ``Operations/StopAllTasksUnauthorized``
- ``Operations/StopTaskButlerErrors``
- ``Operations/StopTaskErrors``
- ``Operations/StopTaskRequest``
- ``Operations/StopTaskResponseBody``
- ``Operations/StopTaskUnauthorized``
- ``Operations/StopTranscodeSessionErrors``
- ``Operations/StopTranscodeSessionRequest``
- ``Operations/StopTranscodeSessionResponseBody``
- ``Operations/StopTranscodeSessionSessionsErrors``
- ``Operations/StopTranscodeSessionUnauthorized``
- ``Operations/Stream``
- ``Operations/Subscription``
- ``Operations/Tag``
- ``Operations/TaskName``
- ``Operations/Tonight``
- ``Operations/TranscodeSession``
- ``Operations/Trials``
- ``Operations/TypeModel``
- ``Operations/UpdatePlaylistErrors``
- ``Operations/UpdatePlaylistPlaylistsErrors``
- ``Operations/UpdatePlaylistRequest``
- ``Operations/UpdatePlaylistResponseBody``
- ``Operations/UpdatePlaylistUnauthorized``
- ``Operations/UpdatePlayProgressErrors``
- ``Operations/UpdatePlayProgressMediaErrors``
- ``Operations/UpdatePlayProgressRequest``
- ``Operations/UpdatePlayProgressResponseBody``
- ``Operations/UpdatePlayProgressUnauthorized``
- ``Operations/UploadPlaylistErrors``
- ``Operations/UploadPlaylistPlaylistsErrors``
- ``Operations/UploadPlaylistRequest``
- ``Operations/UploadPlaylistResponseBody``
- ``Operations/UploadPlaylistUnauthorized``
- ``Operations/Upscale``
- ``Operations/User``
- ``Operations/UserProfile``
- ``Operations/WatchedIndicator``
- ``Operations/Writer``
### Type groupings

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -31,6 +31,7 @@ extension GlobalParameters: ParameterDefaults {
public func defaultQueryParameter(for key: String) -> AnyValue? {
switch key {
case "X-Plex-Client-Identifier": return xPlexClientIdentifier.map { AnyValue($0) }
default: return nil
}
}

View File

@@ -1,8 +1,9 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
/// The protocol to use for the server connection
public enum ServerProtocol: String, Codable, APIValue {
case http = "http"
case https = "https"
@@ -12,7 +13,7 @@ enum GlobalServers: Servers, ServerConvertible {
/// Supported server value with substituted variables
///
/// Corresponds to `{protocol}://{ip}:{port}`
case server1(`protocol`: ServerProtocol = .http, ip: String = "10.10.10.47", port: String = "32400")
case server1(`protocol`: ServerProtocol = .https, ip: String = "10.10.10.47", port: String = "32400")
/// Defines the raw URL strings for each server option.
///

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -53,17 +53,23 @@ private func handleGetServerActivitiesResponse(response: Client.APIResponse) thr
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerActivitiesResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetServerActivitiesResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetServerActivitiesBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerActivitiesActivitiesResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetServerActivitiesUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -76,12 +82,20 @@ private func handleGetServerActivitiesResponse(response: Client.APIResponse) thr
private func handleCancelServerActivitiesResponse(response: Client.APIResponse) throws -> Operations.CancelServerActivitiesResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.CancelServerActivitiesBadRequest.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 .object(try JSONDecoder().decode(Operations.CancelServerActivitiesResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.CancelServerActivitiesUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -27,6 +27,26 @@ class _AuthenticationAPI: AuthenticationAPI {
handleResponse: handleGetSourceConnectionInformationResponse
)
}
public func getTokenDetails(server: AuthenticationServers.GetTokenDetails?) async throws -> Response<Operations.GetTokenDetailsResponse> {
return try await client.makeRequest(
with: try server?.server() ?? AuthenticationServers.GetTokenDetails.default(),
configureRequest: { configuration in
try configureGetTokenDetailsRequest(with: configuration)
},
handleResponse: handleGetTokenDetailsResponse
)
}
public func postUsersSignInData(request: Operations.PostUsersSignInDataRequest, server: AuthenticationServers.PostUsersSignInData?) async throws -> Response<Operations.PostUsersSignInDataResponse> {
return try await client.makeRequest(
with: try server?.server() ?? AuthenticationServers.PostUsersSignInData.default(),
configureRequest: { configuration in
try configurePostUsersSignInDataRequest(with: configuration, request: request)
},
handleResponse: handlePostUsersSignInDataResponse
)
}
}
@@ -46,17 +66,40 @@ private func configureGetSourceConnectionInformationRequest(with configuration:
configuration.telemetryHeader = .userAgent
}
private func configureGetTokenDetailsRequest(with configuration: URLRequestConfiguration) throws {
configuration.path = "/user"
configuration.method = .get
configuration.telemetryHeader = .userAgent
}
private func configurePostUsersSignInDataRequest(with configuration: URLRequestConfiguration, request: Operations.PostUsersSignInDataRequest) throws {
configuration.path = "/users/signin"
configuration.method = .post
configuration.queryParameterSerializable = request
configuration.contentType = "application/x-www-form-urlencoded"
configuration.body = try serializeFormData(with: request.requestBody)
configuration.telemetryHeader = .userAgent
}
// MARK: - Response Handlers
private func handleGetTransientTokenResponse(response: Client.APIResponse) throws -> Operations.GetTransientTokenResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetTransientTokenBadRequest.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 .object(try JSONDecoder().decode(Operations.GetTransientTokenResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetTransientTokenUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -69,12 +112,84 @@ private func handleGetTransientTokenResponse(response: Client.APIResponse) throw
private func handleGetSourceConnectionInformationResponse(response: Client.APIResponse) throws -> Operations.GetSourceConnectionInformationResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetSourceConnectionInformationBadRequest.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 .object(try JSONDecoder().decode(Operations.GetSourceConnectionInformationResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetSourceConnectionInformationUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
}
return .empty
}
private func handleGetTokenDetailsResponse(response: Client.APIResponse) throws -> Operations.GetTokenDetailsResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .userPlexAccount(try JSONDecoder().decode(Operations.GetTokenDetailsUserPlexAccount.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.GetTokenDetailsBadRequest.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.GetTokenDetailsUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
}
return .empty
}
private func handlePostUsersSignInDataResponse(response: Client.APIResponse) throws -> Operations.PostUsersSignInDataResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 201 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .userPlexAccount(try JSONDecoder().decode(Operations.PostUsersSignInDataUserPlexAccount.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.PostUsersSignInDataBadRequest.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.PostUsersSignInDataUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -99,17 +99,23 @@ private func handleGetButlerTasksResponse(response: Client.APIResponse) throws -
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetButlerTasksResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetButlerTasksResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetButlerTasksBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetButlerTasksButlerResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetButlerTasksUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -122,12 +128,20 @@ private func handleGetButlerTasksResponse(response: Client.APIResponse) throws -
private func handleStartAllTasksResponse(response: Client.APIResponse) throws -> Operations.StartAllTasksResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.StartAllTasksBadRequest.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 .object(try JSONDecoder().decode(Operations.StartAllTasksResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.StartAllTasksUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -140,12 +154,20 @@ private func handleStartAllTasksResponse(response: Client.APIResponse) throws ->
private func handleStopAllTasksResponse(response: Client.APIResponse) throws -> Operations.StopAllTasksResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.StopAllTasksBadRequest.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 .object(try JSONDecoder().decode(Operations.StopAllTasksResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.StopAllTasksUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -158,12 +180,20 @@ private func handleStopAllTasksResponse(response: Client.APIResponse) throws ->
private func handleStartTaskResponse(response: Client.APIResponse) throws -> Operations.StartTaskResponse {
let httpResponse = response.httpResponse
if [200, 202, 400].contains(httpResponse.statusCode) {
if [200, 202].contains(httpResponse.statusCode) {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.StartTaskBadRequest.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 .object(try JSONDecoder().decode(Operations.StartTaskResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.StartTaskUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -176,12 +206,20 @@ private func handleStartTaskResponse(response: Client.APIResponse) throws -> Ope
private func handleStopTaskResponse(response: Client.APIResponse) throws -> Operations.StopTaskResponse {
let httpResponse = response.httpResponse
if [200, 400, 404].contains(httpResponse.statusCode) {
if [200, 404].contains(httpResponse.statusCode) {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.StopTaskBadRequest.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 .object(try JSONDecoder().decode(Operations.StopTaskResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.StopTaskUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -55,17 +55,23 @@ private func handleGetGlobalHubsResponse(response: Client.APIResponse) throws ->
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetGlobalHubsResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetGlobalHubsResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetGlobalHubsBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetGlobalHubsHubsResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetGlobalHubsUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -81,17 +87,23 @@ private func handleGetLibraryHubsResponse(response: Client.APIResponse) throws -
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetLibraryHubsResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetLibraryHubsResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetLibraryHubsBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetLibraryHubsHubsResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetLibraryHubsUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -19,30 +19,30 @@ class _LibraryAPI: LibraryAPI {
)
}
public func getRecentlyAdded() async throws -> Response<Operations.GetRecentlyAddedResponse> {
public func getRecentlyAdded(request: Operations.GetRecentlyAddedRequest) async throws -> Response<Operations.GetRecentlyAddedResponse> {
return try await client.makeRequest(
configureRequest: { configuration in
try configureGetRecentlyAddedRequest(with: configuration)
try configureGetRecentlyAddedRequest(with: configuration, request: request)
},
handleResponse: handleGetRecentlyAddedResponse
)
}
public func getLibraries() async throws -> Response<Operations.GetLibrariesResponse> {
public func getAllLibraries() async throws -> Response<Operations.GetAllLibrariesResponse> {
return try await client.makeRequest(
configureRequest: { configuration in
try configureGetLibrariesRequest(with: configuration)
try configureGetAllLibrariesRequest(with: configuration)
},
handleResponse: handleGetLibrariesResponse
handleResponse: handleGetAllLibrariesResponse
)
}
public func getLibrary(request: Operations.GetLibraryRequest) async throws -> Response<Operations.GetLibraryResponse> {
public func getLibraryDetails(request: Operations.GetLibraryDetailsRequest) async throws -> Response<Operations.GetLibraryDetailsResponse> {
return try await client.makeRequest(
configureRequest: { configuration in
try configureGetLibraryRequest(with: configuration, request: request)
try configureGetLibraryDetailsRequest(with: configuration, request: request)
},
handleResponse: handleGetLibraryResponse
handleResponse: handleGetLibraryDetailsResponse
)
}
@@ -64,30 +64,30 @@ class _LibraryAPI: LibraryAPI {
)
}
public func refreshLibrary(request: Operations.RefreshLibraryRequest) async throws -> Response<Operations.RefreshLibraryResponse> {
public func getRefreshLibraryMetadata(request: Operations.GetRefreshLibraryMetadataRequest) async throws -> Response<Operations.GetRefreshLibraryMetadataResponse> {
return try await client.makeRequest(
configureRequest: { configuration in
try configureRefreshLibraryRequest(with: configuration, request: request)
try configureGetRefreshLibraryMetadataRequest(with: configuration, request: request)
},
handleResponse: handleRefreshLibraryResponse
handleResponse: handleGetRefreshLibraryMetadataResponse
)
}
public func searchLibrary(request: Operations.SearchLibraryRequest) async throws -> Response<Operations.SearchLibraryResponse> {
public func getSearchLibrary(request: Operations.GetSearchLibraryRequest) async throws -> Response<Operations.GetSearchLibraryResponse> {
return try await client.makeRequest(
configureRequest: { configuration in
try configureSearchLibraryRequest(with: configuration, request: request)
try configureGetSearchLibraryRequest(with: configuration, request: request)
},
handleResponse: handleSearchLibraryResponse
handleResponse: handleGetSearchLibraryResponse
)
}
public func getMetadata(request: Operations.GetMetadataRequest) async throws -> Response<Operations.GetMetadataResponse> {
public func getMetaDataByRatingKey(request: Operations.GetMetaDataByRatingKeyRequest) async throws -> Response<Operations.GetMetaDataByRatingKeyResponse> {
return try await client.makeRequest(
configureRequest: { configuration in
try configureGetMetadataRequest(with: configuration, request: request)
try configureGetMetaDataByRatingKeyRequest(with: configuration, request: request)
},
handleResponse: handleGetMetadataResponse
handleResponse: handleGetMetaDataByRatingKeyResponse
)
}
@@ -129,20 +129,21 @@ private func configureGetFileHashRequest(with configuration: URLRequestConfigura
configuration.telemetryHeader = .userAgent
}
private func configureGetRecentlyAddedRequest(with configuration: URLRequestConfiguration) throws {
private func configureGetRecentlyAddedRequest(with configuration: URLRequestConfiguration, request: Operations.GetRecentlyAddedRequest) throws {
configuration.path = "/library/recentlyAdded"
configuration.method = .get
configuration.queryParameterSerializable = request
configuration.telemetryHeader = .userAgent
}
private func configureGetLibrariesRequest(with configuration: URLRequestConfiguration) throws {
private func configureGetAllLibrariesRequest(with configuration: URLRequestConfiguration) throws {
configuration.path = "/library/sections"
configuration.method = .get
configuration.telemetryHeader = .userAgent
}
private func configureGetLibraryRequest(with configuration: URLRequestConfiguration, request: Operations.GetLibraryRequest) throws {
configuration.path = "/library/sections/{sectionId}"
private func configureGetLibraryDetailsRequest(with configuration: URLRequestConfiguration, request: Operations.GetLibraryDetailsRequest) throws {
configuration.path = "/library/sections/{sectionKey}"
configuration.method = .get
configuration.pathParameterSerializable = request
configuration.queryParameterSerializable = request
@@ -150,36 +151,37 @@ private func configureGetLibraryRequest(with configuration: URLRequestConfigurat
}
private func configureDeleteLibraryRequest(with configuration: URLRequestConfiguration, request: Operations.DeleteLibraryRequest) throws {
configuration.path = "/library/sections/{sectionId}"
configuration.path = "/library/sections/{sectionKey}"
configuration.method = .delete
configuration.pathParameterSerializable = request
configuration.telemetryHeader = .userAgent
}
private func configureGetLibraryItemsRequest(with configuration: URLRequestConfiguration, request: Operations.GetLibraryItemsRequest) throws {
configuration.path = "/library/sections/{sectionId}/{tag}"
configuration.path = "/library/sections/{sectionKey}/{tag}"
configuration.method = .get
configuration.pathParameterSerializable = request
configuration.queryParameterSerializable = request
configuration.telemetryHeader = .userAgent
}
private func configureRefreshLibraryRequest(with configuration: URLRequestConfiguration, request: Operations.RefreshLibraryRequest) throws {
configuration.path = "/library/sections/{sectionId}/refresh"
configuration.method = .get
configuration.pathParameterSerializable = request
configuration.telemetryHeader = .userAgent
}
private func configureSearchLibraryRequest(with configuration: URLRequestConfiguration, request: Operations.SearchLibraryRequest) throws {
configuration.path = "/library/sections/{sectionId}/search"
private func configureGetRefreshLibraryMetadataRequest(with configuration: URLRequestConfiguration, request: Operations.GetRefreshLibraryMetadataRequest) throws {
configuration.path = "/library/sections/{sectionKey}/refresh"
configuration.method = .get
configuration.pathParameterSerializable = request
configuration.queryParameterSerializable = request
configuration.telemetryHeader = .userAgent
}
private func configureGetMetadataRequest(with configuration: URLRequestConfiguration, request: Operations.GetMetadataRequest) throws {
private func configureGetSearchLibraryRequest(with configuration: URLRequestConfiguration, request: Operations.GetSearchLibraryRequest) throws {
configuration.path = "/library/sections/{sectionKey}/search"
configuration.method = .get
configuration.pathParameterSerializable = request
configuration.queryParameterSerializable = request
configuration.telemetryHeader = .userAgent
}
private func configureGetMetaDataByRatingKeyRequest(with configuration: URLRequestConfiguration, request: Operations.GetMetaDataByRatingKeyRequest) throws {
configuration.path = "/library/metadata/{ratingKey}"
configuration.method = .get
configuration.pathParameterSerializable = request
@@ -212,12 +214,20 @@ private func configureGetOnDeckRequest(with configuration: URLRequestConfigurati
private func handleGetFileHashResponse(response: Client.APIResponse) throws -> Operations.GetFileHashResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetFileHashBadRequest.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 .object(try JSONDecoder().decode(Operations.GetFileHashResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetFileHashUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -233,17 +243,23 @@ private func handleGetRecentlyAddedResponse(response: Client.APIResponse) throws
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetRecentlyAddedResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetRecentlyAddedResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetRecentlyAddedBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetRecentlyAddedLibraryResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetRecentlyAddedUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -253,23 +269,29 @@ private func handleGetRecentlyAddedResponse(response: Client.APIResponse) throws
return .empty
}
private func handleGetLibrariesResponse(response: Client.APIResponse) throws -> Operations.GetLibrariesResponse {
private func handleGetAllLibrariesResponse(response: Client.APIResponse) throws -> Operations.GetAllLibrariesResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetLibrariesResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetAllLibrariesResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetAllLibrariesBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetLibrariesLibraryResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetAllLibrariesUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -279,23 +301,29 @@ private func handleGetLibrariesResponse(response: Client.APIResponse) throws ->
return .empty
}
private func handleGetLibraryResponse(response: Client.APIResponse) throws -> Operations.GetLibraryResponse {
private func handleGetLibraryDetailsResponse(response: Client.APIResponse) throws -> Operations.GetLibraryDetailsResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetLibraryResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetLibraryDetailsResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetLibraryDetailsBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetLibraryLibraryResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetLibraryDetailsUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -308,12 +336,20 @@ private func handleGetLibraryResponse(response: Client.APIResponse) throws -> Op
private func handleDeleteLibraryResponse(response: Client.APIResponse) throws -> Operations.DeleteLibraryResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.DeleteLibraryBadRequest.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 .object(try JSONDecoder().decode(Operations.DeleteLibraryResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.DeleteLibraryUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -329,17 +365,23 @@ private func handleGetLibraryItemsResponse(response: Client.APIResponse) throws
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetLibraryItemsResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetLibraryItemsResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetLibraryItemsBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetLibraryItemsLibraryResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetLibraryItemsUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -349,15 +391,23 @@ private func handleGetLibraryItemsResponse(response: Client.APIResponse) throws
return .empty
}
private func handleRefreshLibraryResponse(response: Client.APIResponse) throws -> Operations.RefreshLibraryResponse {
private func handleGetRefreshLibraryMetadataResponse(response: Client.APIResponse) throws -> Operations.GetRefreshLibraryMetadataResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetRefreshLibraryMetadataBadRequest.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 .object(try JSONDecoder().decode(Operations.RefreshLibraryResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetRefreshLibraryMetadataUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -367,23 +417,29 @@ private func handleRefreshLibraryResponse(response: Client.APIResponse) throws -
return .empty
}
private func handleSearchLibraryResponse(response: Client.APIResponse) throws -> Operations.SearchLibraryResponse {
private func handleGetSearchLibraryResponse(response: Client.APIResponse) throws -> Operations.GetSearchLibraryResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.SearchLibraryResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetSearchLibraryResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetSearchLibraryBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.SearchLibraryLibraryResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetSearchLibraryUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -393,23 +449,29 @@ private func handleSearchLibraryResponse(response: Client.APIResponse) throws ->
return .empty
}
private func handleGetMetadataResponse(response: Client.APIResponse) throws -> Operations.GetMetadataResponse {
private func handleGetMetaDataByRatingKeyResponse(response: Client.APIResponse) throws -> Operations.GetMetaDataByRatingKeyResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetMetadataResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetMetaDataByRatingKeyResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetMetaDataByRatingKeyBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetMetadataLibraryResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetMetaDataByRatingKeyUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -425,17 +487,23 @@ private func handleGetMetadataChildrenResponse(response: Client.APIResponse) thr
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetMetadataChildrenResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetMetadataChildrenResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetMetadataChildrenBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetMetadataChildrenLibraryResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetMetadataChildrenUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -456,6 +524,22 @@ private func handleGetTopWatchedContentResponse(response: Client.APIResponse) th
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.GetTopWatchedContentBadRequest.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.GetTopWatchedContentUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
}
return .empty
@@ -467,17 +551,23 @@ private func handleGetOnDeckResponse(response: Client.APIResponse) throws -> Ope
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetOnDeckResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetOnDeckResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetOnDeckBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetOnDeckLibraryResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetOnDeckUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -70,12 +70,20 @@ private func configureEnablePaperTrailRequest(with configuration: URLRequestConf
private func handleLogLineResponse(response: Client.APIResponse) throws -> Operations.LogLineResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.LogLineBadRequest.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 .object(try JSONDecoder().decode(Operations.LogLineResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.LogLineUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -88,12 +96,20 @@ private func handleLogLineResponse(response: Client.APIResponse) throws -> Opera
private func handleLogMultiLineResponse(response: Client.APIResponse) throws -> Operations.LogMultiLineResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.LogMultiLineBadRequest.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 .object(try JSONDecoder().decode(Operations.LogMultiLineResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.LogMultiLineUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -106,12 +122,20 @@ private func handleLogMultiLineResponse(response: Client.APIResponse) throws ->
private func handleEnablePaperTrailResponse(response: Client.APIResponse) throws -> Operations.EnablePaperTrailResponse {
let httpResponse = response.httpResponse
if [200, 400, 403].contains(httpResponse.statusCode) {
if [200, 403].contains(httpResponse.statusCode) {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.EnablePaperTrailBadRequest.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 .object(try JSONDecoder().decode(Operations.EnablePaperTrailResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.EnablePaperTrailUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -36,6 +36,24 @@ class _MediaAPI: MediaAPI {
handleResponse: handleUpdatePlayProgressResponse
)
}
public func getBannerImage(request: Operations.GetBannerImageRequest) async throws -> ResponseWithHeaders<Operations.GetBannerImageResponse> {
return try await client.makeRequest(
configureRequest: { configuration in
try configureGetBannerImageRequest(with: configuration, request: request)
},
handleResponse: handleGetBannerImageResponse
)
}
public func getThumbImage(request: Operations.GetThumbImageRequest) async throws -> ResponseWithHeaders<Operations.GetThumbImageResponse> {
return try await client.makeRequest(
configureRequest: { configuration in
try configureGetThumbImageRequest(with: configuration, request: request)
},
handleResponse: handleGetThumbImageResponse
)
}
}
@@ -62,17 +80,41 @@ private func configureUpdatePlayProgressRequest(with configuration: URLRequestCo
configuration.telemetryHeader = .userAgent
}
private func configureGetBannerImageRequest(with configuration: URLRequestConfiguration, request: Operations.GetBannerImageRequest) throws {
configuration.path = "/library/metadata/{ratingKey}/banner"
configuration.method = .get
configuration.pathParameterSerializable = request
configuration.queryParameterSerializable = request
configuration.telemetryHeader = .userAgent
}
private func configureGetThumbImageRequest(with configuration: URLRequestConfiguration, request: Operations.GetThumbImageRequest) throws {
configuration.path = "/library/metadata/{ratingKey}/thumb"
configuration.method = .get
configuration.pathParameterSerializable = request
configuration.queryParameterSerializable = request
configuration.telemetryHeader = .userAgent
}
// MARK: - Response Handlers
private func handleMarkPlayedResponse(response: Client.APIResponse) throws -> Operations.MarkPlayedResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.MarkPlayedBadRequest.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 .object(try JSONDecoder().decode(Operations.MarkPlayedResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.MarkPlayedUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -85,12 +127,20 @@ private func handleMarkPlayedResponse(response: Client.APIResponse) throws -> Op
private func handleMarkUnplayedResponse(response: Client.APIResponse) throws -> Operations.MarkUnplayedResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.MarkUnplayedBadRequest.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 .object(try JSONDecoder().decode(Operations.MarkUnplayedResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.MarkUnplayedUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -103,12 +153,76 @@ private func handleMarkUnplayedResponse(response: Client.APIResponse) throws ->
private func handleUpdatePlayProgressResponse(response: Client.APIResponse) throws -> Operations.UpdatePlayProgressResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.UpdatePlayProgressBadRequest.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 .object(try JSONDecoder().decode(Operations.UpdatePlayProgressResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.UpdatePlayProgressUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
}
return .empty
}
private func handleGetBannerImageResponse(response: Client.APIResponse) throws -> Operations.GetBannerImageResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "image/jpeg"), let data = response.data {
return .bytes(data)
}
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetBannerImageBadRequest.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.GetBannerImageUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
}
return .empty
}
private func handleGetThumbImageResponse(response: Client.APIResponse) throws -> Operations.GetThumbImageResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "image/jpeg"), let data = response.data {
return .bytes(data)
}
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetThumbImageBadRequest.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.GetThumbImageUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -169,17 +169,23 @@ private func handleCreatePlaylistResponse(response: Client.APIResponse) throws -
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.CreatePlaylistResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.CreatePlaylistResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.CreatePlaylistBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.CreatePlaylistPlaylistsResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.CreatePlaylistUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -195,17 +201,23 @@ private func handleGetPlaylistsResponse(response: Client.APIResponse) throws ->
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetPlaylistsResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetPlaylistsResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetPlaylistsBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetPlaylistsPlaylistsResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetPlaylistsUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -221,17 +233,23 @@ private func handleGetPlaylistResponse(response: Client.APIResponse) throws -> O
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetPlaylistResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetPlaylistResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetPlaylistBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetPlaylistPlaylistsResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetPlaylistUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -244,12 +262,20 @@ private func handleGetPlaylistResponse(response: Client.APIResponse) throws -> O
private func handleDeletePlaylistResponse(response: Client.APIResponse) throws -> Operations.DeletePlaylistResponse {
let httpResponse = response.httpResponse
if [204, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 204 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.DeletePlaylistBadRequest.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 .object(try JSONDecoder().decode(Operations.DeletePlaylistResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.DeletePlaylistUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -262,12 +288,20 @@ private func handleDeletePlaylistResponse(response: Client.APIResponse) throws -
private func handleUpdatePlaylistResponse(response: Client.APIResponse) throws -> Operations.UpdatePlaylistResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.UpdatePlaylistBadRequest.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 .object(try JSONDecoder().decode(Operations.UpdatePlaylistResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.UpdatePlaylistUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -283,17 +317,23 @@ private func handleGetPlaylistContentsResponse(response: Client.APIResponse) thr
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetPlaylistContentsResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetPlaylistContentsResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetPlaylistContentsBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetPlaylistContentsPlaylistsResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetPlaylistContentsUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -306,12 +346,20 @@ private func handleGetPlaylistContentsResponse(response: Client.APIResponse) thr
private func handleClearPlaylistContentsResponse(response: Client.APIResponse) throws -> Operations.ClearPlaylistContentsResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.ClearPlaylistContentsBadRequest.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 .object(try JSONDecoder().decode(Operations.ClearPlaylistContentsResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.ClearPlaylistContentsUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -327,17 +375,23 @@ private func handleAddPlaylistContentsResponse(response: Client.APIResponse) thr
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.AddPlaylistContentsResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.AddPlaylistContentsResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.AddPlaylistContentsBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.AddPlaylistContentsPlaylistsResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.AddPlaylistContentsUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -350,12 +404,20 @@ private func handleAddPlaylistContentsResponse(response: Client.APIResponse) thr
private func handleUploadPlaylistResponse(response: Client.APIResponse) throws -> Operations.UploadPlaylistResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.UploadPlaylistBadRequest.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 .object(try JSONDecoder().decode(Operations.UploadPlaylistResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.UploadPlaylistUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -10,6 +10,36 @@ class _PlexAPI: PlexAPI {
self.client = client
}
public func getCompanionsData(server: PlexServers.GetCompanionsData?) async throws -> Response<Operations.GetCompanionsDataResponse> {
return try await client.makeRequest(
with: try server?.server() ?? PlexServers.GetCompanionsData.default(),
configureRequest: { configuration in
try configureGetCompanionsDataRequest(with: configuration)
},
handleResponse: handleGetCompanionsDataResponse
)
}
public func getUserFriends(server: PlexServers.GetUserFriends?) async throws -> Response<Operations.GetUserFriendsResponse> {
return try await client.makeRequest(
with: try server?.server() ?? PlexServers.GetUserFriends.default(),
configureRequest: { configuration in
try configureGetUserFriendsRequest(with: configuration)
},
handleResponse: handleGetUserFriendsResponse
)
}
public func getGeoData(server: PlexServers.GetGeoData?) async throws -> Response<Operations.GetGeoDataResponse> {
return try await client.makeRequest(
with: try server?.server() ?? PlexServers.GetGeoData.default(),
configureRequest: { configuration in
try configureGetGeoDataRequest(with: configuration)
},
handleResponse: handleGetGeoDataResponse
)
}
public func getHomeData() async throws -> Response<Operations.GetHomeDataResponse> {
return try await client.makeRequest(
configureRequest: { configuration in
@@ -19,6 +49,16 @@ class _PlexAPI: PlexAPI {
)
}
public func getServerResources(request: Operations.GetServerResourcesRequest, server: PlexServers.GetServerResources?) async throws -> Response<Operations.GetServerResourcesResponse> {
return try await client.makeRequest(
with: try server?.server() ?? PlexServers.GetServerResources.default(),
configureRequest: { configuration in
try configureGetServerResourcesRequest(with: configuration, request: request)
},
handleResponse: handleGetServerResourcesResponse
)
}
public func getPin(request: Operations.GetPinRequest, server: PlexServers.GetPin?) async throws -> Response<Operations.GetPinResponse> {
return try await client.makeRequest(
with: try server?.server() ?? PlexServers.GetPin.default(),
@@ -29,13 +69,13 @@ class _PlexAPI: PlexAPI {
)
}
public func getToken(request: Operations.GetTokenRequest, server: PlexServers.GetToken?) async throws -> Response<Operations.GetTokenResponse> {
public func getTokenByPinId(request: Operations.GetTokenByPinIdRequest, server: PlexServers.GetTokenByPinId?) async throws -> Response<Operations.GetTokenByPinIdResponse> {
return try await client.makeRequest(
with: try server?.server() ?? PlexServers.GetToken.default(),
with: try server?.server() ?? PlexServers.GetTokenByPinId.default(),
configureRequest: { configuration in
try configureGetTokenRequest(with: configuration, request: request)
try configureGetTokenByPinIdRequest(with: configuration, request: request)
},
handleResponse: handleGetTokenResponse
handleResponse: handleGetTokenByPinIdResponse
)
}
@@ -43,47 +83,205 @@ class _PlexAPI: PlexAPI {
// MARK: - Request Configuration
private func configureGetCompanionsDataRequest(with configuration: URLRequestConfiguration) throws {
configuration.path = "/companions"
configuration.method = .get
configuration.telemetryHeader = .userAgent
}
private func configureGetUserFriendsRequest(with configuration: URLRequestConfiguration) throws {
configuration.path = "/friends"
configuration.method = .get
configuration.telemetryHeader = .userAgent
}
private func configureGetGeoDataRequest(with configuration: URLRequestConfiguration) throws {
configuration.path = "/geoip"
configuration.method = .get
configuration.telemetryHeader = .userAgent
}
private func configureGetHomeDataRequest(with configuration: URLRequestConfiguration) throws {
configuration.path = "/home"
configuration.method = .get
configuration.telemetryHeader = .userAgent
}
private func configureGetServerResourcesRequest(with configuration: URLRequestConfiguration, request: Operations.GetServerResourcesRequest) throws {
configuration.path = "/resources"
configuration.method = .get
configuration.queryParameterSerializable = request
configuration.telemetryHeader = .userAgent
}
private func configureGetPinRequest(with configuration: URLRequestConfiguration, request: Operations.GetPinRequest) throws {
configuration.path = "/pins"
configuration.method = .post
configuration.queryParameterSerializable = request
configuration.headerParameterSerializable = request
configuration.telemetryHeader = .userAgent
}
private func configureGetTokenRequest(with configuration: URLRequestConfiguration, request: Operations.GetTokenRequest) throws {
private func configureGetTokenByPinIdRequest(with configuration: URLRequestConfiguration, request: Operations.GetTokenByPinIdRequest) throws {
configuration.path = "/pins/{pinID}"
configuration.method = .get
configuration.pathParameterSerializable = request
configuration.headerParameterSerializable = request
configuration.queryParameterSerializable = request
configuration.telemetryHeader = .userAgent
}
// MARK: - Response Handlers
private func handleGetCompanionsDataResponse(response: Client.APIResponse) throws -> Operations.GetCompanionsDataResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .responseBodies(try JSONDecoder().decode([Operations.ResponseBody].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.GetCompanionsDataBadRequest.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.GetCompanionsDataUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
}
return .empty
}
private func handleGetUserFriendsResponse(response: Client.APIResponse) throws -> Operations.GetUserFriendsResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .friends(try JSONDecoder().decode([Operations.Friend].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.GetUserFriendsBadRequest.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.GetUserFriendsUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
}
return .empty
}
private func handleGetGeoDataResponse(response: Client.APIResponse) throws -> Operations.GetGeoDataResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .geoData(try JSONDecoder().decode(Operations.GetGeoDataGeoData.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.GetGeoDataBadRequest.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.GetGeoDataUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
}
return .empty
}
private func handleGetHomeDataResponse(response: Client.APIResponse) throws -> Operations.GetHomeDataResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetHomeDataResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetHomeDataResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetHomeDataBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetHomeDataPlexResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetHomeDataUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
}
return .empty
}
private func handleGetServerResourcesResponse(response: Client.APIResponse) throws -> Operations.GetServerResourcesResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .plexDevices(try JSONDecoder().decode([Operations.PlexDevice].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.GetServerResourcesBadRequest.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.GetServerResourcesUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -96,10 +294,10 @@ private func handleGetHomeDataResponse(response: Client.APIResponse) throws -> O
private func handleGetPinResponse(response: Client.APIResponse) throws -> Operations.GetPinResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 201 {
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetPinResponseBody.self, from: data))
return .authPinContainer(try JSONDecoder().decode(Operations.GetPinAuthPinContainer.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -107,7 +305,7 @@ private func handleGetPinResponse(response: Client.APIResponse) throws -> Operat
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .fourHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetPinPlexResponseBody.self, from: data))
return .badRequest(try JSONDecoder().decode(Operations.GetPinBadRequest.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -117,13 +315,13 @@ private func handleGetPinResponse(response: Client.APIResponse) throws -> Operat
return .empty
}
private func handleGetTokenResponse(response: Client.APIResponse) throws -> Operations.GetTokenResponse {
private func handleGetTokenByPinIdResponse(response: Client.APIResponse) throws -> Operations.GetTokenByPinIdResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetTokenResponseBody.self, from: data))
return .authPinContainer(try JSONDecoder().decode(Operations.GetTokenByPinIdAuthPinContainer.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -131,7 +329,15 @@ private func handleGetTokenResponse(response: Client.APIResponse) throws -> Oper
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .fourHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetTokenPlexResponseBody.self, from: data))
return .badRequest(try JSONDecoder().decode(Operations.GetTokenByPinIdBadRequest.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 404 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .object(try JSONDecoder().decode(Operations.GetTokenByPinIdResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -67,12 +67,20 @@ private func configureGetSearchResultsRequest(with configuration: URLRequestConf
private func handlePerformSearchResponse(response: Client.APIResponse) throws -> Operations.PerformSearchResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.PerformSearchBadRequest.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 .object(try JSONDecoder().decode(Operations.PerformSearchResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.PerformSearchUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -85,12 +93,20 @@ private func handlePerformSearchResponse(response: Client.APIResponse) throws ->
private func handlePerformVoiceSearchResponse(response: Client.APIResponse) throws -> Operations.PerformVoiceSearchResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.PerformVoiceSearchBadRequest.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 .object(try JSONDecoder().decode(Operations.PerformVoiceSearchResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.PerformVoiceSearchUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -106,17 +122,23 @@ private func handleGetSearchResultsResponse(response: Client.APIResponse) throws
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetSearchResultsResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetSearchResultsResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetSearchResultsBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetSearchResultsSearchResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetSearchResultsUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -73,6 +73,15 @@ class _ServerAPI: ServerAPI {
)
}
public func getMediaProviders(request: Operations.GetMediaProvidersRequest) async throws -> Response<Operations.GetMediaProvidersResponse> {
return try await client.makeRequest(
configureRequest: { configuration in
try configureGetMediaProvidersRequest(with: configuration, request: request)
},
handleResponse: handleGetMediaProvidersResponse
)
}
public func getServerList() async throws -> Response<Operations.GetServerListResponse> {
return try await client.makeRequest(
configureRequest: { configuration in
@@ -129,6 +138,13 @@ private func configureGetResizedPhotoRequest(with configuration: URLRequestConfi
configuration.telemetryHeader = .userAgent
}
private func configureGetMediaProvidersRequest(with configuration: URLRequestConfiguration, request: Operations.GetMediaProvidersRequest) throws {
configuration.path = "/media/providers"
configuration.method = .get
configuration.queryParameterSerializable = request
configuration.telemetryHeader = .userAgent
}
private func configureGetServerListRequest(with configuration: URLRequestConfiguration) throws {
configuration.path = "/servers"
configuration.method = .get
@@ -143,17 +159,23 @@ private func handleGetServerCapabilitiesResponse(response: Client.APIResponse) t
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerCapabilitiesResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetServerCapabilitiesResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetServerCapabilitiesBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerCapabilitiesServerResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetServerCapabilitiesUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -169,17 +191,23 @@ private func handleGetServerPreferencesResponse(response: Client.APIResponse) th
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerPreferencesResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetServerPreferencesResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetServerPreferencesBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerPreferencesServerResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetServerPreferencesUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -195,17 +223,23 @@ private func handleGetAvailableClientsResponse(response: Client.APIResponse) thr
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetAvailableClientsResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetAvailableClientsResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetAvailableClientsBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetAvailableClientsServerResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetAvailableClientsUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -221,17 +255,23 @@ private func handleGetDevicesResponse(response: Client.APIResponse) throws -> Op
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetDevicesResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetDevicesResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetDevicesBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetDevicesServerResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetDevicesUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -247,17 +287,15 @@ private func handleGetServerIdentityResponse(response: Client.APIResponse) throw
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerIdentityResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetServerIdentityResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
} else if httpResponse.statusCode == 401 {
} else if httpResponse.statusCode == 408 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerIdentityServerResponseBody.self, from: data))
return .requestTimeout(try JSONDecoder().decode(Operations.GetServerIdentityRequestTimeout.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -273,17 +311,23 @@ private func handleGetMyPlexAccountResponse(response: Client.APIResponse) throws
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetMyPlexAccountResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetMyPlexAccountResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetMyPlexAccountBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetMyPlexAccountServerResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetMyPlexAccountUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -296,12 +340,52 @@ private func handleGetMyPlexAccountResponse(response: Client.APIResponse) throws
private func handleGetResizedPhotoResponse(response: Client.APIResponse) throws -> Operations.GetResizedPhotoResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetResizedPhotoBadRequest.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 .object(try JSONDecoder().decode(Operations.GetResizedPhotoResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetResizedPhotoUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
}
return .empty
}
private func handleGetMediaProvidersResponse(response: Client.APIResponse) throws -> Operations.GetMediaProvidersResponse {
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.GetMediaProvidersResponseBody.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.GetMediaProvidersBadRequest.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.GetMediaProvidersUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -317,17 +401,23 @@ private func handleGetServerListResponse(response: Client.APIResponse) throws ->
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerListResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetServerListResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetServerListBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerListServerResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetServerListUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -84,17 +84,23 @@ private func handleGetSessionsResponse(response: Client.APIResponse) throws -> O
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetSessionsResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetSessionsResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetSessionsBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetSessionsSessionsResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetSessionsUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -110,17 +116,23 @@ private func handleGetSessionHistoryResponse(response: Client.APIResponse) throw
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetSessionHistoryResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetSessionHistoryResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetSessionHistoryBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetSessionHistorySessionsResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetSessionHistoryUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -136,17 +148,23 @@ private func handleGetTranscodeSessionsResponse(response: Client.APIResponse) th
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetTranscodeSessionsResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetTranscodeSessionsResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetTranscodeSessionsBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetTranscodeSessionsSessionsResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetTranscodeSessionsUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -159,12 +177,20 @@ private func handleGetTranscodeSessionsResponse(response: Client.APIResponse) th
private func handleStopTranscodeSessionResponse(response: Client.APIResponse) throws -> Operations.StopTranscodeSessionResponse {
let httpResponse = response.httpResponse
if [204, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 204 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.StopTranscodeSessionBadRequest.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 .object(try JSONDecoder().decode(Operations.StopTranscodeSessionResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.StopTranscodeSessionUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -70,17 +70,23 @@ private func handleGetStatisticsResponse(response: Client.APIResponse) throws ->
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetStatisticsResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetStatisticsResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetStatisticsBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetStatisticsStatisticsResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetStatisticsUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -96,17 +102,23 @@ private func handleGetResourcesStatisticsResponse(response: Client.APIResponse)
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetResourcesStatisticsResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetResourcesStatisticsResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetResourcesStatisticsBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetResourcesStatisticsStatisticsResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetResourcesStatisticsUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -122,17 +134,23 @@ private func handleGetBandwidthStatisticsResponse(response: Client.APIResponse)
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetBandwidthStatisticsResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetBandwidthStatisticsResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetBandwidthStatisticsBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetBandwidthStatisticsStatisticsResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetBandwidthStatisticsUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -69,17 +69,23 @@ private func handleGetUpdateStatusResponse(response: Client.APIResponse) throws
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetUpdateStatusResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetUpdateStatusResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetUpdateStatusBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetUpdateStatusUpdaterResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetUpdateStatusUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -92,12 +98,20 @@ private func handleGetUpdateStatusResponse(response: Client.APIResponse) throws
private func handleCheckForUpdatesResponse(response: Client.APIResponse) throws -> Operations.CheckForUpdatesResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.CheckForUpdatesBadRequest.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 .object(try JSONDecoder().decode(Operations.CheckForUpdatesResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.CheckForUpdatesUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -110,12 +124,20 @@ private func handleCheckForUpdatesResponse(response: Client.APIResponse) throws
private func handleApplyUpdatesResponse(response: Client.APIResponse) throws -> Operations.ApplyUpdatesResponse {
let httpResponse = response.httpResponse
if [200, 400, 500].contains(httpResponse.statusCode) {
if [200, 500].contains(httpResponse.statusCode) {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.ApplyUpdatesBadRequest.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 .object(try JSONDecoder().decode(Operations.ApplyUpdatesResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.ApplyUpdatesUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -51,12 +51,20 @@ private func configureStartUniversalTranscodeRequest(with configuration: URLRequ
private func handleGetTimelineResponse(response: Client.APIResponse) throws -> Operations.GetTimelineResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetTimelineBadRequest.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 .object(try JSONDecoder().decode(Operations.GetTimelineResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetTimelineUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
@@ -69,12 +77,20 @@ private func handleGetTimelineResponse(response: Client.APIResponse) throws -> O
private func handleStartUniversalTranscodeResponse(response: Client.APIResponse) throws -> Operations.StartUniversalTranscodeResponse {
let httpResponse = response.httpResponse
if [200, 400].contains(httpResponse.statusCode) {
if httpResponse.statusCode == 200 {
return .empty
} else if httpResponse.statusCode == 400 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.StartUniversalTranscodeBadRequest.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 .object(try JSONDecoder().decode(Operations.StartUniversalTranscodeResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.StartUniversalTranscodeUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -10,13 +10,13 @@ class _WatchlistAPI: WatchlistAPI {
self.client = client
}
public func getWatchlist(request: Operations.GetWatchlistRequest, server: WatchlistServers.GetWatchlist?) async throws -> Response<Operations.GetWatchlistResponse> {
public func getWatchList(request: Operations.GetWatchListRequest, server: WatchlistServers.GetWatchList?) async throws -> Response<Operations.GetWatchListResponse> {
return try await client.makeRequest(
with: try server?.server() ?? WatchlistServers.GetWatchlist.default(),
with: try server?.server() ?? WatchlistServers.GetWatchList.default(),
configureRequest: { configuration in
try configureGetWatchlistRequest(with: configuration, request: request)
try configureGetWatchListRequest(with: configuration, request: request)
},
handleResponse: handleGetWatchlistResponse
handleResponse: handleGetWatchListResponse
)
}
@@ -24,7 +24,7 @@ class _WatchlistAPI: WatchlistAPI {
// MARK: - Request Configuration
private func configureGetWatchlistRequest(with configuration: URLRequestConfiguration, request: Operations.GetWatchlistRequest) throws {
private func configureGetWatchListRequest(with configuration: URLRequestConfiguration, request: Operations.GetWatchListRequest) throws {
configuration.path = "/library/sections/watchlist/{filter}"
configuration.method = .get
configuration.pathParameterSerializable = request
@@ -34,23 +34,29 @@ private func configureGetWatchlistRequest(with configuration: URLRequestConfigur
// MARK: - Response Handlers
private func handleGetWatchlistResponse(response: Client.APIResponse) throws -> Operations.GetWatchlistResponse {
private func handleGetWatchListResponse(response: Client.APIResponse) throws -> Operations.GetWatchListResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetWatchlistResponseBody.self, from: data))
return .object(try JSONDecoder().decode(Operations.GetWatchListResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if httpResponse.statusCode == 400 {
return .empty
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .badRequest(try JSONDecoder().decode(Operations.GetWatchListBadRequest.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 .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetWatchlistWatchlistResponseBody.self, from: data))
return .unauthorized(try JSONDecoder().decode(Operations.GetWatchListUnauthorized.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,9 +1,9 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.PathParamFilter: Serializable {
extension Operations.AutoSelectSubtitle: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return try rawValue.serialize(with: format)
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

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

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.DefaultSubtitleAccessibility: 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.DefaultSubtitleForced: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return try rawValue.serialize(with: format)
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return [QueryParameter(key: [], serialized: try serialize(with: format))]
}
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -17,7 +17,7 @@ extension Operations.DeleteLibraryRequest: Serializable {
extension Operations.DeleteLibraryRequest: PathParameterSerializable {
func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
return [
"sectionId": try sectionIdWrapper.serialize(with: formatOverride ?? .path(explode: false)),
"sectionKey": try sectionKey.serialize(with: formatOverride ?? .path(explode: false)),
].compactMapValues { $0 }
}
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -0,0 +1,41 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetBannerImageRequest: 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.GetBannerImageRequest", format: format.formatDescription)
}
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return try serializedQueryParameters(with: nil, formatOverride: format)
}
}
extension Operations.GetBannerImageRequest: PathParameterSerializable {
func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
return [
"ratingKey": try ratingKey.serialize(with: formatOverride ?? .path(explode: false)),
].compactMapValues { $0 }
}
}
extension Operations.GetBannerImageRequest: QueryParameterSerializable {
func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
let builder = QueryParameterBuilder()
try builder.addQueryParameters(from: height, named: "height", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: minSize, named: "minSize", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: upscale, named: "upscale", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: width, named: "width", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: xPlexToken, named: "X-Plex-Token", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
return builder.build()
}
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,9 +1,9 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetLibraryRequest: Serializable {
extension Operations.GetLibraryDetailsRequest: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
switch format {
case .path:
@@ -11,7 +11,7 @@ extension Operations.GetLibraryRequest: Serializable {
case .query:
return try serializeQueryParameterSerializable(self, with: format)
case .header, .multipart, .form:
throw SerializationError.invalidSerializationParameter(type: "Operations.GetLibraryRequest", format: format.formatDescription)
throw SerializationError.invalidSerializationParameter(type: "Operations.GetLibraryDetailsRequest", format: format.formatDescription)
}
}
@@ -20,15 +20,15 @@ extension Operations.GetLibraryRequest: Serializable {
}
}
extension Operations.GetLibraryRequest: PathParameterSerializable {
extension Operations.GetLibraryDetailsRequest: PathParameterSerializable {
func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
return [
"sectionId": try sectionIdWrapper.serialize(with: formatOverride ?? .path(explode: false)),
"sectionKey": try sectionKey.serialize(with: formatOverride ?? .path(explode: false)),
].compactMapValues { $0 }
}
}
extension Operations.GetLibraryRequest: QueryParameterSerializable {
extension Operations.GetLibraryDetailsRequest: QueryParameterSerializable {
func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
let builder = QueryParameterBuilder()
try builder.addQueryParameters(from: includeDetails, named: "includeDetails", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -23,7 +23,7 @@ extension Operations.GetLibraryItemsRequest: Serializable {
extension Operations.GetLibraryItemsRequest: PathParameterSerializable {
func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
return [
"sectionId": try sectionId.serialize(with: formatOverride ?? .path(explode: false)),
"sectionKey": try sectionKey.serialize(with: formatOverride ?? .path(explode: false)),
"tag": try tag.serialize(with: formatOverride ?? .path(explode: false)),
].compactMapValues { $0 }
}
@@ -32,7 +32,11 @@ extension Operations.GetLibraryItemsRequest: PathParameterSerializable {
extension Operations.GetLibraryItemsRequest: 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: 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,27 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetMediaProvidersRequest: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
switch format {
case .query:
return try serializeQueryParameterSerializable(self, with: format)
case .path, .header, .multipart, .form:
throw SerializationError.invalidSerializationParameter(type: "Operations.GetMediaProvidersRequest", format: format.formatDescription)
}
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return try serializedQueryParameters(with: nil, formatOverride: format)
}
}
extension Operations.GetMediaProvidersRequest: QueryParameterSerializable {
func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
let builder = QueryParameterBuilder()
try builder.addQueryParameters(from: xPlexToken, named: "X-Plex-Token", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
return builder.build()
}
}

View File

@@ -1,23 +1,23 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetMetadataRequest: Serializable {
extension Operations.GetMetaDataByRatingKeyRequest: 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.GetMetadataRequest", format: format.formatDescription)
throw SerializationError.invalidSerializationParameter(type: "Operations.GetMetaDataByRatingKeyRequest", format: format.formatDescription)
}
}
}
extension Operations.GetMetadataRequest: PathParameterSerializable {
extension Operations.GetMetaDataByRatingKeyRequest: PathParameterSerializable {
func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
return [
"ratingKey": try ratingKeyWrapper.serialize(with: formatOverride ?? .path(explode: false)),
"ratingKey": try ratingKey.serialize(with: formatOverride ?? .path(explode: false)),
].compactMapValues { $0 }
}
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -8,9 +8,7 @@ extension Operations.GetPinRequest: Serializable {
switch format {
case .query:
return try serializeQueryParameterSerializable(self, with: format)
case .header:
return serializeModel(with: try serializedHeaderParameters(), format: format)
case .path, .multipart, .form:
case .path, .header, .multipart, .form:
throw SerializationError.invalidSerializationParameter(type: "Operations.GetPinRequest", format: format.formatDescription)
}
}
@@ -24,15 +22,8 @@ extension Operations.GetPinRequest: QueryParameterSerializable {
func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
let builder = QueryParameterBuilder()
try builder.addQueryParameters(from: strong, named: "strong", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: xPlexClientIdentifier, named: "X-Plex-Client-Identifier", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: xPlexProduct, named: "X-Plex-Product", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
return builder.build()
}
}
extension Operations.GetPinRequest: HeaderParameterSerializable {
func serializedHeaderParameters() throws -> [SerializedParameter] {
return [
SerializedParameter(name: "X-Plex-Product", serialized: try xPlexProduct.serialize(with: .header(explode: false))),
SerializedParameter(name: "X-Plex-Client-Identifier", serialized: try xPlexClientIdentifier?.serialize(with: .header(explode: false)))
]
}
}

View File

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

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
@@ -31,7 +31,7 @@ extension Operations.GetPlaylistContentsRequest: PathParameterSerializable {
extension Operations.GetPlaylistContentsRequest: QueryParameterSerializable {
func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
let builder = QueryParameterBuilder()
try builder.addQueryParameters(from: typeWrapper, named: "type", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: type, named: "type", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
return builder.build()
}
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -0,0 +1,28 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetRecentlyAddedRequest: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
switch format {
case .query:
return try serializeQueryParameterSerializable(self, with: format)
case .path, .header, .multipart, .form:
throw SerializationError.invalidSerializationParameter(type: "Operations.GetRecentlyAddedRequest", format: format.formatDescription)
}
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return try serializedQueryParameters(with: nil, formatOverride: format)
}
}
extension Operations.GetRecentlyAddedRequest: QueryParameterSerializable {
func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
let builder = QueryParameterBuilder()
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,37 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetRefreshLibraryMetadataRequest: 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.GetRefreshLibraryMetadataRequest", format: format.formatDescription)
}
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return try serializedQueryParameters(with: nil, formatOverride: format)
}
}
extension Operations.GetRefreshLibraryMetadataRequest: PathParameterSerializable {
func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
return [
"sectionKey": try sectionKey.serialize(with: formatOverride ?? .path(explode: false)),
].compactMapValues { $0 }
}
}
extension Operations.GetRefreshLibraryMetadataRequest: QueryParameterSerializable {
func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
let builder = QueryParameterBuilder()
try builder.addQueryParameters(from: force, named: "force", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
return builder.build()
}
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,9 +1,9 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.SearchLibraryRequest: Serializable {
extension Operations.GetSearchLibraryRequest: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
switch format {
case .path:
@@ -11,7 +11,7 @@ extension Operations.SearchLibraryRequest: Serializable {
case .query:
return try serializeQueryParameterSerializable(self, with: format)
case .header, .multipart, .form:
throw SerializationError.invalidSerializationParameter(type: "Operations.SearchLibraryRequest", format: format.formatDescription)
throw SerializationError.invalidSerializationParameter(type: "Operations.GetSearchLibraryRequest", format: format.formatDescription)
}
}
@@ -20,15 +20,15 @@ extension Operations.SearchLibraryRequest: Serializable {
}
}
extension Operations.SearchLibraryRequest: PathParameterSerializable {
extension Operations.GetSearchLibraryRequest: PathParameterSerializable {
func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
return [
"sectionId": try sectionId.serialize(with: formatOverride ?? .path(explode: false)),
"sectionKey": try sectionKey.serialize(with: formatOverride ?? .path(explode: false)),
].compactMapValues { $0 }
}
}
extension Operations.SearchLibraryRequest: QueryParameterSerializable {
extension Operations.GetSearchLibraryRequest: 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)

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -0,0 +1,30 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetServerResourcesRequest: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
switch format {
case .query:
return try serializeQueryParameterSerializable(self, with: format)
case .path, .header, .multipart, .form:
throw SerializationError.invalidSerializationParameter(type: "Operations.GetServerResourcesRequest", format: format.formatDescription)
}
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return try serializedQueryParameters(with: nil, formatOverride: format)
}
}
extension Operations.GetServerResourcesRequest: QueryParameterSerializable {
func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
let builder = QueryParameterBuilder()
try builder.addQueryParameters(from: includeHttps, named: "includeHttps", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: includeIPv6, named: "includeIPv6", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: includeRelay, named: "includeRelay", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: xPlexClientIdentifier, named: "X-Plex-Client-Identifier", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
return builder.build()
}
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -0,0 +1,41 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetThumbImageRequest: 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.GetThumbImageRequest", format: format.formatDescription)
}
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return try serializedQueryParameters(with: nil, formatOverride: format)
}
}
extension Operations.GetThumbImageRequest: PathParameterSerializable {
func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
return [
"ratingKey": try ratingKey.serialize(with: formatOverride ?? .path(explode: false)),
].compactMapValues { $0 }
}
}
extension Operations.GetThumbImageRequest: QueryParameterSerializable {
func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
let builder = QueryParameterBuilder()
try builder.addQueryParameters(from: height, named: "height", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: minSize, named: "minSize", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: upscale, named: "upscale", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: width, named: "width", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
try builder.addQueryParameters(from: xPlexToken, named: "X-Plex-Token", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
return builder.build()
}
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -0,0 +1,37 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetTokenByPinIdRequest: 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.GetTokenByPinIdRequest", format: format.formatDescription)
}
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return try serializedQueryParameters(with: nil, formatOverride: format)
}
}
extension Operations.GetTokenByPinIdRequest: PathParameterSerializable {
func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
return [
"pinID": try pinID.serialize(with: formatOverride ?? .path(explode: false)),
].compactMapValues { $0 }
}
}
extension Operations.GetTokenByPinIdRequest: QueryParameterSerializable {
func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
let builder = QueryParameterBuilder()
try builder.addQueryParameters(from: xPlexClientIdentifier, named: "X-Plex-Client-Identifier", 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.GetTokenDetailsAuthenticationResponseStatus: 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.GetTokenDetailsAuthenticationStatus: 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.GetTokenDetailsFeatures: 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.GetTokenDetailsStatus: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return try rawValue.serialize(with: format)
}
func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
return [QueryParameter(key: [], serialized: try serialize(with: format))]
}
}

View File

@@ -1,33 +0,0 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations.GetTokenRequest: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
switch format {
case .path:
return try serializePathParameterSerializable(self, with: format)
case .header:
return serializeModel(with: try serializedHeaderParameters(), format: format)
case .query, .multipart, .form:
throw SerializationError.invalidSerializationParameter(type: "Operations.GetTokenRequest", format: format.formatDescription)
}
}
}
extension Operations.GetTokenRequest: PathParameterSerializable {
func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
return [
"pinID": try pinID.serialize(with: formatOverride ?? .path(explode: false)),
].compactMapValues { $0 }
}
}
extension Operations.GetTokenRequest: HeaderParameterSerializable {
func serializedHeaderParameters() throws -> [SerializedParameter] {
return [
SerializedParameter(name: "X-Plex-Client-Identifier", serialized: try xPlexClientIdentifier?.serialize(with: .header(explode: false)))
]
}
}

View File

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

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,9 +1,9 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.GetWatchlistRequest: Serializable {
extension Operations.GetWatchListRequest: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
switch format {
case .path:
@@ -11,7 +11,7 @@ extension Operations.GetWatchlistRequest: Serializable {
case .query:
return try serializeQueryParameterSerializable(self, with: format)
case .header, .multipart, .form:
throw SerializationError.invalidSerializationParameter(type: "Operations.GetWatchlistRequest", format: format.formatDescription)
throw SerializationError.invalidSerializationParameter(type: "Operations.GetWatchListRequest", format: format.formatDescription)
}
}
@@ -20,7 +20,7 @@ extension Operations.GetWatchlistRequest: Serializable {
}
}
extension Operations.GetWatchlistRequest: PathParameterSerializable {
extension Operations.GetWatchListRequest: PathParameterSerializable {
func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
return [
"filter": try filter.serialize(with: formatOverride ?? .path(explode: false)),
@@ -28,7 +28,7 @@ extension Operations.GetWatchlistRequest: PathParameterSerializable {
}
}
extension Operations.GetWatchlistRequest: QueryParameterSerializable {
extension Operations.GetWatchListRequest: QueryParameterSerializable {
func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
let builder = QueryParameterBuilder()
try builder.addQueryParameters(from: xPlexToken, named: "X-Plex-Token", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -0,0 +1,14 @@
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations.IncludeGuids: 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.IncludeHttps: 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.IncludeIPv6: 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.IncludeMeta: 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.IncludeRelay: 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.InternalPaymentMethod: Serializable {
func serialize(with format: SerializableFormat) throws -> String {
return ""
}
}

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

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

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

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

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

View File

@@ -1,4 +1,4 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation

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