mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 12:37:46 +00:00
Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9f461ec33 | ||
|
|
9b882120dd | ||
|
|
673a771f04 | ||
|
|
216a94fe7d | ||
|
|
88d690ffc2 | ||
|
|
48a739d923 | ||
|
|
8b50020e1e | ||
|
|
4bcd080211 | ||
|
|
2e0f3b64ea | ||
|
|
9b0ac863a4 | ||
|
|
33fe0755b5 | ||
|
|
1cfc2d604f | ||
|
|
ef0d39928c | ||
|
|
d2a1c188d5 | ||
|
|
6db5d8fb30 | ||
|
|
89fbd6238e | ||
|
|
7af7441ac7 | ||
|
|
d1945b544b | ||
|
|
16bb49d558 | ||
|
|
4bea7ae0d8 | ||
|
|
da5491e935 | ||
|
|
aeebf438e1 | ||
|
|
dc815780a6 | ||
|
|
636840a553 | ||
|
|
c65c9e0cae | ||
|
|
95df2396e7 | ||
|
|
f52d81d1f6 | ||
|
|
d83bd96c5f | ||
|
|
2289036c2b | ||
|
|
a7eedd3598 | ||
|
|
e579b8d23b | ||
|
|
fd429e38e0 | ||
|
|
2b4a59f67f | ||
|
|
6268a854c1 | ||
|
|
d061e9c253 | ||
|
|
fcfb68eec7 | ||
|
|
37dabea51a | ||
|
|
f47e4b689b | ||
|
|
04130d41d4 | ||
|
|
393db01a6c | ||
|
|
41621a4bbd | ||
|
|
05f0b1a99a | ||
|
|
0ce63f1ceb |
2
.github/workflows/sdk_generation.yaml
vendored
2
.github/workflows/sdk_generation.yaml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
|
||||
with:
|
||||
force: ${{ github.event.inputs.force }}
|
||||
mode: pr
|
||||
mode: direct
|
||||
set_version: ${{ github.event.inputs.set_version }}
|
||||
speakeasy_version: latest
|
||||
secrets:
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1 +1,5 @@
|
||||
.DS_Store
|
||||
**/.speakeasy/temp/
|
||||
**/.speakeasy/logs/
|
||||
.speakeasy/reports
|
||||
# .gitignore
|
||||
|
||||
1349
.speakeasy/gen.lock
1349
.speakeasy/gen.lock
File diff suppressed because one or more lines are too long
@@ -7,15 +7,20 @@ generation:
|
||||
useClassNamesForArrayFields: true
|
||||
fixes:
|
||||
nameResolutionDec2023: true
|
||||
nameResolutionFeb2025: false
|
||||
parameterOrderingFeb2024: true
|
||||
requestResponseComponentNamesFeb2024: true
|
||||
securityFeb2025: false
|
||||
sharedErrorComponentsApr2025: false
|
||||
auth:
|
||||
oAuth2ClientCredentialsEnabled: true
|
||||
oAuth2PasswordEnabled: false
|
||||
go:
|
||||
version: 0.11.1
|
||||
version: 0.21.2
|
||||
additionalDependencies: {}
|
||||
allowUnknownFieldsInWeakUnions: false
|
||||
clientServerStatusCodesAsErrors: true
|
||||
defaultErrorName: SDKError
|
||||
flattenGlobalSecurity: true
|
||||
imports:
|
||||
option: openapi
|
||||
|
||||
@@ -1,33 +1,41 @@
|
||||
speakeasyVersion: 1.393.1
|
||||
speakeasyVersion: 1.542.3
|
||||
sources:
|
||||
my-source:
|
||||
sourceNamespace: my-source
|
||||
sourceRevisionDigest: sha256:44184fe64938a688d21d58aa0e390471812eda6f10c9ca0145a7328cf31a4f0a
|
||||
sourceBlobDigest: sha256:7257c51225e1fb6fa7de445fbe2f31151dc89771894c9b731a29ab01b504f503
|
||||
sourceRevisionDigest: sha256:92a2a2049bfbf67bea601a6b1b77d274e83a2d3b6968a0bc02dc290b21c7689d
|
||||
sourceBlobDigest: sha256:f7e2709f52370dff16c1851a7a4e44a89f2e978e9cae335bffc10625950b3bd9
|
||||
tags:
|
||||
- latest
|
||||
- main
|
||||
plexapi:
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:37adc934a79841fb00cfe6ed569f5b1c88534b20202ecbde64b4e84828cee22a
|
||||
sourceBlobDigest: sha256:ffb5b8d288111a763e4d035c8c9e37f5c89690d146b7297493b43a71d8298e6c
|
||||
tags:
|
||||
- latest
|
||||
- speakeasy-sdk-regen-1746490234
|
||||
targets:
|
||||
plexgo:
|
||||
source: my-source
|
||||
sourceNamespace: my-source
|
||||
sourceRevisionDigest: sha256:44184fe64938a688d21d58aa0e390471812eda6f10c9ca0145a7328cf31a4f0a
|
||||
sourceBlobDigest: sha256:7257c51225e1fb6fa7de445fbe2f31151dc89771894c9b731a29ab01b504f503
|
||||
source: plexapi
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:37adc934a79841fb00cfe6ed569f5b1c88534b20202ecbde64b4e84828cee22a
|
||||
sourceBlobDigest: sha256:ffb5b8d288111a763e4d035c8c9e37f5c89690d146b7297493b43a71d8298e6c
|
||||
codeSamplesNamespace: code-samples-go-plexgo
|
||||
codeSamplesRevisionDigest: sha256:367216afa9fb24c1dc1897cadc3feb86418148d80ebe2f8263ec65dbba5f2cee
|
||||
outLocation: /github/workspace/repo
|
||||
codeSamplesRevisionDigest: sha256:503a6f9a35834921087204d51ede9941cacedef3a61b322bbd2b269d24ccb970
|
||||
workflow:
|
||||
workflowVersion: 1.0.0
|
||||
speakeasyVersion: latest
|
||||
sources:
|
||||
my-source:
|
||||
plexapi:
|
||||
inputs:
|
||||
- location: registry.speakeasyapi.dev/lukehagar/lukehagar/plex-api:main
|
||||
- location: registry.speakeasyapi.dev/plexapi/plexapi/plexapi:main
|
||||
targets:
|
||||
plexgo:
|
||||
target: go
|
||||
source: my-source
|
||||
source: plexapi
|
||||
codeSamples:
|
||||
output: codeSamples.yaml
|
||||
registry:
|
||||
location: registry.speakeasyapi.dev/lukehagar/lukehagar/code-samples-go-plexgo
|
||||
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-go-plexgo
|
||||
labelOverride:
|
||||
fixedValue: PlexGO
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
workflowVersion: 1.0.0
|
||||
speakeasyVersion: latest
|
||||
sources:
|
||||
my-source:
|
||||
plexapi:
|
||||
inputs:
|
||||
- location: registry.speakeasyapi.dev/lukehagar/lukehagar/plex-api:main
|
||||
- location: registry.speakeasyapi.dev/plexapi/plexapi/plexapi:main
|
||||
targets:
|
||||
plexgo:
|
||||
target: go
|
||||
source: my-source
|
||||
source: plexapi
|
||||
codeSamples:
|
||||
output: codeSamples.yaml
|
||||
registry:
|
||||
location: registry.speakeasyapi.dev/lukehagar/lukehagar/code-samples-go-plexgo
|
||||
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-go-plexgo
|
||||
labelOverride:
|
||||
fixedValue: PlexGO
|
||||
|
||||
326
README.md
326
README.md
@@ -11,21 +11,53 @@
|
||||
## Summary
|
||||
|
||||
Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
|
||||
|
||||
# Plex Media Server OpenAPI Specification
|
||||
|
||||
An Open Source OpenAPI Specification for Plex Media Server
|
||||
|
||||
Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/)
|
||||
|
||||
## Documentation
|
||||
|
||||
[API Documentation](https://plexapi.dev)
|
||||
|
||||
## SDKs
|
||||
|
||||
The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the [main specification Repository](https://github.com/LukeHagar/plex-api-spec).
|
||||
|
||||
| Language | Repository | Releases | Other |
|
||||
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
|
||||
| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - |
|
||||
| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - |
|
||||
| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) |
|
||||
| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - |
|
||||
| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
|
||||
| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
|
||||
| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
|
||||
| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
|
||||
<!-- End Summary [summary] -->
|
||||
|
||||
<!-- Start Table of Contents [toc] -->
|
||||
## Table of Contents
|
||||
<!-- $toc-max-depth=2 -->
|
||||
* [github.com/LukeHagar/plexgo](#githubcomlukehagarplexgo)
|
||||
* [Plex Media Server OpenAPI Specification](#plex-media-server-openapi-specification)
|
||||
* [Documentation](#documentation)
|
||||
* [SDKs](#sdks)
|
||||
* [SDK Installation](#sdk-installation)
|
||||
* [SDK Example Usage](#sdk-example-usage)
|
||||
* [Available Resources and Operations](#available-resources-and-operations)
|
||||
* [Retries](#retries)
|
||||
* [Error Handling](#error-handling)
|
||||
* [Server Selection](#server-selection)
|
||||
* [Custom HTTP Client](#custom-http-client)
|
||||
* [Authentication](#authentication)
|
||||
* [Special Types](#special-types)
|
||||
* [Development](#development)
|
||||
* [Maturity](#maturity)
|
||||
* [Contributions](#contributions)
|
||||
|
||||
* [SDK Installation](#sdk-installation)
|
||||
* [SDK Example Usage](#sdk-example-usage)
|
||||
* [Available Resources and Operations](#available-resources-and-operations)
|
||||
* [Global Parameters](#global-parameters)
|
||||
* [Retries](#retries)
|
||||
* [Error Handling](#error-handling)
|
||||
* [Server Selection](#server-selection)
|
||||
* [Custom HTTP Client](#custom-http-client)
|
||||
* [Authentication](#authentication)
|
||||
* [Special Types](#special-types)
|
||||
<!-- End Table of Contents [toc] -->
|
||||
|
||||
<!-- Start SDK Installation [installation] -->
|
||||
@@ -52,12 +84,12 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"),
|
||||
)
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Server.GetServerCapabilities(ctx)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -73,36 +105,21 @@ func main() {
|
||||
<!-- Start Available Resources and Operations [operations] -->
|
||||
## Available Resources and Operations
|
||||
|
||||
### [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
|
||||
|
||||
### [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
|
||||
|
||||
### [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
|
||||
<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
|
||||
@@ -111,45 +128,34 @@ func main() {
|
||||
* [StartTask](docs/sdks/butler/README.md#starttask) - Start a single Butler task
|
||||
* [StopTask](docs/sdks/butler/README.md#stoptask) - Stop a single Butler task
|
||||
|
||||
### [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
|
||||
|
||||
### [Hubs](docs/sdks/hubs/README.md)
|
||||
|
||||
* [GetGlobalHubs](docs/sdks/hubs/README.md#getglobalhubs) - Get Global Hubs
|
||||
* [GetRecentlyAdded](docs/sdks/hubs/README.md#getrecentlyadded) - Get Recently Added
|
||||
* [GetLibraryHubs](docs/sdks/hubs/README.md#getlibraryhubs) - Get library specific hubs
|
||||
|
||||
### [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
|
||||
|
||||
### [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
|
||||
* [GetRecentlyAddedLibrary](docs/sdks/library/README.md#getrecentlyaddedlibrary) - 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
|
||||
* [GetAllMediaLibrary](docs/sdks/library/README.md#getallmedialibrary) - Get all media of library
|
||||
* [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
|
||||
* [GetGenresLibrary](docs/sdks/library/README.md#getgenreslibrary) - Get Genres of library media
|
||||
* [GetCountriesLibrary](docs/sdks/library/README.md#getcountrieslibrary) - Get Countries of library media
|
||||
* [GetActorsLibrary](docs/sdks/library/README.md#getactorslibrary) - Get Actors of library media
|
||||
* [GetSearchAllLibraries](docs/sdks/library/README.md#getsearchalllibraries) - Search All Libraries
|
||||
* [GetMediaMetaData](docs/sdks/library/README.md#getmediametadata) - Get Media Metadata
|
||||
* [GetMediaArts](docs/sdks/library/README.md#getmediaarts) - Get Media Background Artwork
|
||||
* [PostMediaArts](docs/sdks/library/README.md#postmediaarts) - Upload Media Background Artwork
|
||||
* [GetMediaPosters](docs/sdks/library/README.md#getmediaposters) - Get Media Posters
|
||||
* [PostMediaPoster](docs/sdks/library/README.md#postmediaposter) - Upload Media Poster
|
||||
* [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
|
||||
|
||||
### [Watchlist](docs/sdks/watchlist/README.md)
|
||||
|
||||
* [GetWatchList](docs/sdks/watchlist/README.md#getwatchlist) - Get User Watchlist
|
||||
|
||||
### [Log](docs/sdks/log/README.md)
|
||||
|
||||
@@ -157,6 +163,14 @@ func main() {
|
||||
* [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
|
||||
@@ -169,18 +183,34 @@ func main() {
|
||||
* [AddPlaylistContents](docs/sdks/playlists/README.md#addplaylistcontents) - Adding to a Playlist
|
||||
* [UploadPlaylist](docs/sdks/playlists/README.md#uploadplaylist) - Upload Playlist
|
||||
|
||||
### [Authentication](docs/sdks/authentication/README.md)
|
||||
### [Plex](docs/sdks/plex/README.md)
|
||||
|
||||
* [GetTransientToken](docs/sdks/authentication/README.md#gettransienttoken) - Get a Transient Token.
|
||||
* [GetSourceConnectionInformation](docs/sdks/authentication/README.md#getsourceconnectioninformation) - Get Source Connection Information
|
||||
* [GetUserDetails](docs/sdks/authentication/README.md#getuserdetails) - Get User Data By Token
|
||||
* [PostUsersSignInData](docs/sdks/authentication/README.md#postuserssignindata) - Get User Sign In Data
|
||||
* [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
|
||||
|
||||
### [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
|
||||
### [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)
|
||||
|
||||
@@ -189,11 +219,32 @@ func main() {
|
||||
* [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
|
||||
|
||||
### [Users](docs/sdks/users/README.md)
|
||||
|
||||
* [GetUsers](docs/sdks/users/README.md#getusers) - Get list of all connected users
|
||||
|
||||
### [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 Retries [retries] -->
|
||||
@@ -214,12 +265,12 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"),
|
||||
)
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Server.GetServerCapabilities(ctx, operations.WithRetries(
|
||||
retry.Config{
|
||||
Strategy: "backoff",
|
||||
@@ -253,6 +304,8 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
s := plexgo.New(
|
||||
plexgo.WithRetryConfig(
|
||||
retry.Config{
|
||||
@@ -266,10 +319,8 @@ func main() {
|
||||
RetryConnectionErrors: false,
|
||||
}),
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"),
|
||||
)
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Server.GetServerCapabilities(ctx)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -285,13 +336,17 @@ func main() {
|
||||
<!-- Start Error Handling [errors] -->
|
||||
## Error Handling
|
||||
|
||||
Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both. When specified by the OpenAPI spec document, the SDK will return the appropriate subclass.
|
||||
Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both.
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- |
|
||||
| sdkerrors.GetServerCapabilitiesResponseBody | 400 | application/json |
|
||||
| sdkerrors.GetServerCapabilitiesServerResponseBody | 401 | application/json |
|
||||
| sdkerrors.SDKError | 4xx-5xx | */* |
|
||||
By Default, an API error will return `sdkerrors.SDKError`. When custom error responses are specified for an operation, the SDK may also return their associated error. You can refer to respective *Errors* tables in SDK docs for more details on possible error types for each operation.
|
||||
|
||||
For example, the `GetServerCapabilities` function may return the following errors:
|
||||
|
||||
| Error Type | Status Code | Content Type |
|
||||
| ------------------------------------------- | ----------- | ---------------- |
|
||||
| sdkerrors.GetServerCapabilitiesBadRequest | 400 | application/json |
|
||||
| sdkerrors.GetServerCapabilitiesUnauthorized | 401 | application/json |
|
||||
| sdkerrors.SDKError | 4XX, 5XX | \*/\* |
|
||||
|
||||
### Example
|
||||
|
||||
@@ -307,22 +362,22 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"),
|
||||
)
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Server.GetServerCapabilities(ctx)
|
||||
if err != nil {
|
||||
|
||||
var e *sdkerrors.GetServerCapabilitiesResponseBody
|
||||
var e *sdkerrors.GetServerCapabilitiesBadRequest
|
||||
if errors.As(err, &e) {
|
||||
// handle error
|
||||
log.Fatal(e.Error())
|
||||
}
|
||||
|
||||
var e *sdkerrors.GetServerCapabilitiesServerResponseBody
|
||||
var e *sdkerrors.GetServerCapabilitiesUnauthorized
|
||||
if errors.As(err, &e) {
|
||||
// handle error
|
||||
log.Fatal(e.Error())
|
||||
@@ -342,13 +397,15 @@ func main() {
|
||||
<!-- Start Server Selection [server] -->
|
||||
## Server Selection
|
||||
|
||||
### Select Server by Index
|
||||
### Server Variables
|
||||
|
||||
You can override the default server globally using the `WithServerIndex` option when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
|
||||
The default server `{protocol}://{ip}:{port}` contains variables and is set to `https://10.10.10.47:32400` by default. To override default values, the following options are available when initializing the SDK client instance:
|
||||
|
||||
| # | Server | Variables |
|
||||
| - | ------ | --------- |
|
||||
| 0 | `{protocol}://{ip}:{port}` | `protocol` (default is `https`), `ip` (default is `10.10.10.47`), `port` (default is `32400`) |
|
||||
| Variable | Option | Supported Values | Default | Description |
|
||||
| ---------- | --------------------------------------- | -------------------------- | --------------- | ---------------------------------------------- |
|
||||
| `protocol` | `WithProtocol(protocol ServerProtocol)` | - `"http"`<br/>- `"https"` | `"https"` | The protocol to use for the server connection |
|
||||
| `ip` | `WithIP(ip string)` | string | `"10.10.10.47"` | The IP address or hostname of your Plex Server |
|
||||
| `port` | `WithPort(port string)` | string | `"32400"` | The port of your Plex Server |
|
||||
|
||||
#### Example
|
||||
|
||||
@@ -362,13 +419,15 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
s := plexgo.New(
|
||||
plexgo.WithServerIndex(0),
|
||||
plexgo.WithProtocol("https"),
|
||||
plexgo.WithIP("e0c3:bcc0:6bac:dccc:c4ec:34b1:ca98:4cb9"),
|
||||
plexgo.WithPort("40311"),
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"),
|
||||
)
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Server.GetServerCapabilities(ctx)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -380,16 +439,9 @@ func main() {
|
||||
|
||||
```
|
||||
|
||||
#### Variables
|
||||
|
||||
Some of the server options above contain variables. If you want to set the values of those variables, the following options are provided for doing so:
|
||||
* `WithProtocol plexgo.ServerProtocol`
|
||||
* `WithIP string`
|
||||
* `WithPort string`
|
||||
|
||||
### Override Server URL Per-Client
|
||||
|
||||
The default server can also be overridden globally using the `WithServerURL` option when initializing the SDK client instance. For example:
|
||||
The default server can be overridden globally using the `WithServerURL(serverURL string)` option when initializing the SDK client instance. For example:
|
||||
```go
|
||||
package main
|
||||
|
||||
@@ -400,13 +452,13 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
s := plexgo.New(
|
||||
plexgo.WithServerURL("{protocol}://{ip}:{port}"),
|
||||
plexgo.WithServerURL("https://10.10.10.47:32400"),
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"),
|
||||
)
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Server.GetServerCapabilities(ctx)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -432,13 +484,13 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"),
|
||||
)
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Plex.GetCompanionsData(ctx, operations.WithServerURL("https://plex.tv/api/v2/"))
|
||||
res, err := s.Plex.GetCompanionsData(ctx, operations.WithServerURL("https://plex.tv/api/v2"))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -486,9 +538,9 @@ This can be a convenient way to configure timeouts, cookies, proxies, custom hea
|
||||
|
||||
This SDK supports the following security scheme globally:
|
||||
|
||||
| Name | Type | Scheme |
|
||||
| ------------- | ------------- | ------------- |
|
||||
| `AccessToken` | apiKey | API key |
|
||||
| Name | Type | Scheme |
|
||||
| ------------- | ------ | ------- |
|
||||
| `AccessToken` | apiKey | API key |
|
||||
|
||||
You can configure it using the `WithSecurity` option when initializing the SDK client instance. For example:
|
||||
```go
|
||||
@@ -501,12 +553,12 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"),
|
||||
)
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Server.GetServerCapabilities(ctx)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -545,62 +597,6 @@ d6 := types.MustDateFromString("2019-01-01") // returns types.Date and panics on
|
||||
```
|
||||
<!-- End Special Types [types] -->
|
||||
|
||||
<!-- Start Global Parameters [global-parameters] -->
|
||||
## Global Parameters
|
||||
|
||||
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 `"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
|
||||
|
||||
The following global parameter is available.
|
||||
|
||||
| Name | Type | Required | Description |
|
||||
| ---- | ---- |:--------:| ----------- |
|
||||
| XPlexClientIdentifier | string | | The unique identifier for the client application
|
||||
This is used to track the client application and its usage
|
||||
(UUID, serial number, or other number unique per device)
|
||||
|
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"github.com/LukeHagar/plexgo/models/operations"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"),
|
||||
)
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Plex.GetServerResources(ctx, operations.GetServerResourcesRequest{
|
||||
XPlexToken: "CV5xoxjTpFKUzBTShsaf",
|
||||
IncludeHTTPS: operations.IncludeHTTPSOne.ToPointer(),
|
||||
IncludeRelay: operations.IncludeRelayOne.ToPointer(),
|
||||
IncludeIPv6: operations.IncludeIPv6One.ToPointer(),
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if res.PlexDevices != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
<!-- End Global Parameters [global-parameters] -->
|
||||
|
||||
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
||||
|
||||
# Development
|
||||
|
||||
390
RELEASES.md
390
RELEASES.md
@@ -763,3 +763,393 @@ Based on:
|
||||
- [go v0.11.1] .
|
||||
### Releases
|
||||
- [Go v0.11.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.11.1 - .
|
||||
|
||||
## 2024-09-09 20:35:17
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.393.2 (2.413.0) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.11.2] .
|
||||
### Releases
|
||||
- [Go v0.11.2] https://github.com/LukeHagar/plexgo/releases/tag/v0.11.2 - .
|
||||
|
||||
## 2024-09-10 00:08:55
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.394.0 (2.413.0) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.11.3] .
|
||||
### Releases
|
||||
- [Go v0.11.3] https://github.com/LukeHagar/plexgo/releases/tag/v0.11.3 - .
|
||||
|
||||
## 2024-09-11 00:08:50
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.395.1 (2.415.0) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.11.4] .
|
||||
### Releases
|
||||
- [Go v0.11.4] https://github.com/LukeHagar/plexgo/releases/tag/v0.11.4 - .
|
||||
|
||||
## 2024-09-12 00:08:45
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.396.2 (2.415.0) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.11.5] .
|
||||
### Releases
|
||||
- [Go v0.11.5] https://github.com/LukeHagar/plexgo/releases/tag/v0.11.5 - .
|
||||
|
||||
## 2024-09-13 00:08:56
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.396.6 (2.415.6) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.11.6] .
|
||||
### Releases
|
||||
- [Go v0.11.6] https://github.com/LukeHagar/plexgo/releases/tag/v0.11.6 - .
|
||||
|
||||
## 2024-09-14 00:08:16
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.396.9 (2.415.7) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.11.7] .
|
||||
### Releases
|
||||
- [Go v0.11.7] https://github.com/LukeHagar/plexgo/releases/tag/v0.11.7 - .
|
||||
|
||||
## 2024-09-15 00:09:40
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.396.9 (2.415.7) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.11.8] .
|
||||
### Releases
|
||||
- [Go v0.11.8] https://github.com/LukeHagar/plexgo/releases/tag/v0.11.8 - .
|
||||
|
||||
## 2024-09-16 00:09:14
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.396.9 (2.415.7) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.11.9] .
|
||||
### Releases
|
||||
- [Go v0.11.9] https://github.com/LukeHagar/plexgo/releases/tag/v0.11.9 - .
|
||||
|
||||
## 2024-09-16 18:35:29
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.397.2 (2.415.8) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.11.10] .
|
||||
### Releases
|
||||
- [Go v0.11.10] https://github.com/LukeHagar/plexgo/releases/tag/v0.11.10 - .
|
||||
|
||||
## 2024-09-18 03:01:47
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.399.0 (2.415.8) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.11.11] .
|
||||
### Releases
|
||||
- [Go v0.11.11] https://github.com/LukeHagar/plexgo/releases/tag/v0.11.11 - .
|
||||
|
||||
## 2024-09-18 14:09:58
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.399.1 (2.415.8) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.11.12] .
|
||||
### Releases
|
||||
- [Go v0.11.12] https://github.com/LukeHagar/plexgo/releases/tag/v0.11.12 - .
|
||||
|
||||
## 2024-09-18 15:01:19
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.399.2 (2.416.6) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.11.13] .
|
||||
### Releases
|
||||
- [Go v0.11.13] https://github.com/LukeHagar/plexgo/releases/tag/v0.11.13 - .
|
||||
|
||||
## 2024-09-19 00:08:52
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.399.2 (2.416.6) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.11.14] .
|
||||
### Releases
|
||||
- [Go v0.11.14] https://github.com/LukeHagar/plexgo/releases/tag/v0.11.14 - .
|
||||
|
||||
## 2024-09-21 00:08:46
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.401.2 (2.421.3) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.12.0] .
|
||||
### Releases
|
||||
- [Go v0.12.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.12.0 - .
|
||||
|
||||
## 2024-09-22 00:09:45
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.401.2 (2.421.3) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.12.1] .
|
||||
### Releases
|
||||
- [Go v0.12.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.12.1 - .
|
||||
|
||||
## 2024-09-26 00:09:00
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.402.14 (2.422.22) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.13.0] .
|
||||
### Releases
|
||||
- [Go v0.13.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.13.0 - .
|
||||
|
||||
## 2024-10-01 00:10:01
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.405.6 (2.428.1) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.14.0] .
|
||||
### Releases
|
||||
- [Go v0.14.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.14.0 - .
|
||||
|
||||
## 2024-10-03 00:09:11
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.406.0 (2.429.0) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.15.0] .
|
||||
### Releases
|
||||
- [Go v0.15.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.15.0 - .
|
||||
|
||||
## 2024-10-04 00:09:04
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.406.0 (2.429.0) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.15.1] .
|
||||
### Releases
|
||||
- [Go v0.15.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.15.1 - .
|
||||
|
||||
## 2024-11-12 00:08:55
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.438.1 (2.457.2) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.16.0] .
|
||||
### Releases
|
||||
- [Go v0.16.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.16.0 - .
|
||||
|
||||
## 2024-11-14 00:09:05
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.438.3 (2.457.9) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.16.1] .
|
||||
### Releases
|
||||
- [Go v0.16.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.16.1 - .
|
||||
|
||||
## 2024-12-21 00:09:02
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.459.2 (2.483.1) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.17.0] .
|
||||
### Releases
|
||||
- [Go v0.17.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.17.0 - .
|
||||
|
||||
## 2024-12-23 00:09:31
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.459.2 (2.483.1) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.17.1] .
|
||||
### Releases
|
||||
- [Go v0.17.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.17.1 - .
|
||||
|
||||
## 2025-01-25 00:08:47
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.476.0 (2.496.0) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.17.2] .
|
||||
### Releases
|
||||
- [Go v0.17.2] https://github.com/LukeHagar/plexgo/releases/tag/v0.17.2 - .
|
||||
|
||||
## 2025-01-28 00:08:53
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.476.2 (2.495.1) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.17.3] .
|
||||
### Releases
|
||||
- [Go v0.17.3] https://github.com/LukeHagar/plexgo/releases/tag/v0.17.3 - .
|
||||
|
||||
## 2025-02-06 00:09:00
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.484.1 (2.503.2) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.17.4] .
|
||||
### Releases
|
||||
- [Go v0.17.4] https://github.com/LukeHagar/plexgo/releases/tag/v0.17.4 - .
|
||||
|
||||
## 2025-02-07 00:09:08
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.487.0 (2.506.0) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.18.0] .
|
||||
### Releases
|
||||
- [Go v0.18.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.18.0 - .
|
||||
|
||||
## 2025-02-08 00:08:51
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.487.1 (2.506.0) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.18.1] .
|
||||
### Releases
|
||||
- [Go v0.18.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.18.1 - .
|
||||
|
||||
## 2025-02-11 00:09:00
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.488.0 (2.506.0) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.19.0] .
|
||||
### Releases
|
||||
- [Go v0.19.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.19.0 - .
|
||||
|
||||
## 2025-03-08 00:07:57
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.513.4 (2.545.4) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.19.1] .
|
||||
### Releases
|
||||
- [Go v0.19.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.19.1 - .
|
||||
|
||||
## 2025-03-10 00:08:31
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.513.4 (2.545.4) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.19.2] .
|
||||
### Releases
|
||||
- [Go v0.19.2] https://github.com/LukeHagar/plexgo/releases/tag/v0.19.2 - .
|
||||
|
||||
## 2025-03-31 17:29:50
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.526.6 (2.563.1) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.19.3] .
|
||||
### Releases
|
||||
- [Go v0.19.3] https://github.com/LukeHagar/plexgo/releases/tag/v0.19.3 - .
|
||||
|
||||
## 2025-04-03 21:55:33
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.528.1 (2.565.1) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.20.0] .
|
||||
### Releases
|
||||
- [Go v0.20.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.20.0 - .
|
||||
|
||||
## 2025-04-07 00:10:20
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.529.1 (2.566.5) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.20.1] .
|
||||
### Releases
|
||||
- [Go v0.20.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.20.1 - .
|
||||
|
||||
## 2025-04-15 00:10:03
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.531.4 (2.570.4) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.20.2] .
|
||||
### Releases
|
||||
- [Go v0.20.2] https://github.com/LukeHagar/plexgo/releases/tag/v0.20.2 - .
|
||||
|
||||
## 2025-04-18 22:59:48
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.535.1 (2.585.2) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.20.3] .
|
||||
### Releases
|
||||
- [Go v0.20.3] https://github.com/LukeHagar/plexgo/releases/tag/v0.20.3 - .
|
||||
|
||||
## 2025-04-19 17:12:25
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.535.1 (2.585.2) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.21.0] .
|
||||
### Releases
|
||||
- [Go v0.21.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.21.0 - .
|
||||
|
||||
## 2025-05-02 00:10:13
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.542.0 (2.596.2) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.21.1] .
|
||||
### Releases
|
||||
- [Go v0.21.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.21.1 - .
|
||||
|
||||
## 2025-05-06 00:10:17
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.542.3 (2.597.9) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.21.2] .
|
||||
### Releases
|
||||
- [Go v0.21.2] https://github.com/LukeHagar/plexgo/releases/tag/v0.21.2 - .
|
||||
4
USAGE.md
4
USAGE.md
@@ -9,12 +9,12 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"),
|
||||
)
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Server.GetServerCapabilities(ctx)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
||||
148
activities.go
148
activities.go
@@ -10,8 +10,7 @@ import (
|
||||
"github.com/LukeHagar/plexgo/internal/utils"
|
||||
"github.com/LukeHagar/plexgo/models/operations"
|
||||
"github.com/LukeHagar/plexgo/models/sdkerrors"
|
||||
"github.com/cenkalti/backoff/v4"
|
||||
"io"
|
||||
"github.com/LukeHagar/plexgo/retry"
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
@@ -36,13 +35,6 @@ func newActivities(sdkConfig sdkConfiguration) *Activities {
|
||||
// GetServerActivities - Get Server Activities
|
||||
// Get Server Activities
|
||||
func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations.Option) (*operations.GetServerActivitiesResponse, error) {
|
||||
hookCtx := hooks.HookContext{
|
||||
Context: ctx,
|
||||
OperationID: "getServerActivities",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
o := operations.Options{}
|
||||
supportedOptions := []string{
|
||||
operations.SupportedOptionRetries,
|
||||
@@ -55,12 +47,25 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := url.JoinPath(baseURL, "/activities")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
}
|
||||
|
||||
hookCtx := hooks.HookContext{
|
||||
BaseURL: baseURL,
|
||||
Context: ctx,
|
||||
OperationID: "getServerActivities",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
timeout := o.Timeout
|
||||
if timeout == nil {
|
||||
timeout = s.sdkConfiguration.Timeout
|
||||
@@ -83,6 +88,10 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -113,7 +122,11 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -174,21 +187,11 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
||||
RawResponse: httpRes,
|
||||
}
|
||||
|
||||
getRawBody := func() ([]byte, error) {
|
||||
rawBody, err := io.ReadAll(httpRes.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error reading response body: %w", err)
|
||||
}
|
||||
httpRes.Body.Close()
|
||||
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
|
||||
return rawBody, nil
|
||||
}
|
||||
|
||||
switch {
|
||||
case httpRes.StatusCode == 200:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -200,22 +203,21 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
||||
|
||||
res.Object = &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode == 400:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.GetServerActivitiesResponseBody
|
||||
var out sdkerrors.GetServerActivitiesBadRequest
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -223,22 +225,21 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode == 401:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.GetServerActivitiesActivitiesResponseBody
|
||||
var out sdkerrors.GetServerActivitiesUnauthorized
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -246,28 +247,29 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
|
||||
@@ -278,13 +280,6 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
||||
// CancelServerActivities - Cancel Server Activities
|
||||
// Cancel Server Activities
|
||||
func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID string, opts ...operations.Option) (*operations.CancelServerActivitiesResponse, error) {
|
||||
hookCtx := hooks.HookContext{
|
||||
Context: ctx,
|
||||
OperationID: "cancelServerActivities",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
request := operations.CancelServerActivitiesRequest{
|
||||
ActivityUUID: activityUUID,
|
||||
}
|
||||
@@ -301,12 +296,25 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := utils.GenerateURL(ctx, baseURL, "/activities/{activityUUID}", request, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
}
|
||||
|
||||
hookCtx := hooks.HookContext{
|
||||
BaseURL: baseURL,
|
||||
Context: ctx,
|
||||
OperationID: "cancelServerActivities",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
timeout := o.Timeout
|
||||
if timeout == nil {
|
||||
timeout = s.sdkConfiguration.Timeout
|
||||
@@ -329,6 +337,10 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -359,7 +371,11 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -420,27 +436,17 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st
|
||||
RawResponse: httpRes,
|
||||
}
|
||||
|
||||
getRawBody := func() ([]byte, error) {
|
||||
rawBody, err := io.ReadAll(httpRes.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error reading response body: %w", err)
|
||||
}
|
||||
httpRes.Body.Close()
|
||||
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
|
||||
return rawBody, nil
|
||||
}
|
||||
|
||||
switch {
|
||||
case httpRes.StatusCode == 200:
|
||||
case httpRes.StatusCode == 400:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.CancelServerActivitiesResponseBody
|
||||
var out sdkerrors.CancelServerActivitiesBadRequest
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -448,22 +454,21 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode == 401:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.CancelServerActivitiesActivitiesResponseBody
|
||||
var out sdkerrors.CancelServerActivitiesUnauthorized
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -471,28 +476,29 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
|
||||
|
||||
@@ -10,8 +10,7 @@ import (
|
||||
"github.com/LukeHagar/plexgo/internal/utils"
|
||||
"github.com/LukeHagar/plexgo/models/operations"
|
||||
"github.com/LukeHagar/plexgo/models/sdkerrors"
|
||||
"github.com/cenkalti/backoff/v4"
|
||||
"io"
|
||||
"github.com/LukeHagar/plexgo/retry"
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
@@ -27,16 +26,9 @@ func newAuthentication(sdkConfig sdkConfiguration) *Authentication {
|
||||
}
|
||||
}
|
||||
|
||||
// GetTransientToken - Get a Transient Token.
|
||||
// GetTransientToken - Get a Transient Token
|
||||
// This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted.
|
||||
func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations.GetTransientTokenQueryParamType, scope operations.Scope, opts ...operations.Option) (*operations.GetTransientTokenResponse, error) {
|
||||
hookCtx := hooks.HookContext{
|
||||
Context: ctx,
|
||||
OperationID: "getTransientToken",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
request := operations.GetTransientTokenRequest{
|
||||
Type: type_,
|
||||
Scope: scope,
|
||||
@@ -54,12 +46,25 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := url.JoinPath(baseURL, "/security/token")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
}
|
||||
|
||||
hookCtx := hooks.HookContext{
|
||||
BaseURL: baseURL,
|
||||
Context: ctx,
|
||||
OperationID: "getTransientToken",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
timeout := o.Timeout
|
||||
if timeout == nil {
|
||||
timeout = s.sdkConfiguration.Timeout
|
||||
@@ -86,6 +91,10 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -116,7 +125,11 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -177,27 +190,17 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
|
||||
RawResponse: httpRes,
|
||||
}
|
||||
|
||||
getRawBody := func() ([]byte, error) {
|
||||
rawBody, err := io.ReadAll(httpRes.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error reading response body: %w", err)
|
||||
}
|
||||
httpRes.Body.Close()
|
||||
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
|
||||
return rawBody, nil
|
||||
}
|
||||
|
||||
switch {
|
||||
case httpRes.StatusCode == 200:
|
||||
case httpRes.StatusCode == 400:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.GetTransientTokenResponseBody
|
||||
var out sdkerrors.GetTransientTokenBadRequest
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -205,22 +208,21 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode == 401:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.GetTransientTokenAuthenticationResponseBody
|
||||
var out sdkerrors.GetTransientTokenUnauthorized
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -228,28 +230,29 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
|
||||
@@ -261,13 +264,6 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
|
||||
// If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token.
|
||||
// Note: requires Plex Media Server >= 1.15.4.
|
||||
func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, source string, opts ...operations.Option) (*operations.GetSourceConnectionInformationResponse, error) {
|
||||
hookCtx := hooks.HookContext{
|
||||
Context: ctx,
|
||||
OperationID: "getSourceConnectionInformation",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
request := operations.GetSourceConnectionInformationRequest{
|
||||
Source: source,
|
||||
}
|
||||
@@ -284,12 +280,25 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := url.JoinPath(baseURL, "/security/resources")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
}
|
||||
|
||||
hookCtx := hooks.HookContext{
|
||||
BaseURL: baseURL,
|
||||
Context: ctx,
|
||||
OperationID: "getSourceConnectionInformation",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
timeout := o.Timeout
|
||||
if timeout == nil {
|
||||
timeout = s.sdkConfiguration.Timeout
|
||||
@@ -316,6 +325,10 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -346,7 +359,11 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -407,27 +424,17 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
|
||||
RawResponse: httpRes,
|
||||
}
|
||||
|
||||
getRawBody := func() ([]byte, error) {
|
||||
rawBody, err := io.ReadAll(httpRes.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error reading response body: %w", err)
|
||||
}
|
||||
httpRes.Body.Close()
|
||||
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
|
||||
return rawBody, nil
|
||||
}
|
||||
|
||||
switch {
|
||||
case httpRes.StatusCode == 200:
|
||||
case httpRes.StatusCode == 400:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.GetSourceConnectionInformationResponseBody
|
||||
var out sdkerrors.GetSourceConnectionInformationBadRequest
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -435,22 +442,21 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode == 401:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.GetSourceConnectionInformationAuthenticationResponseBody
|
||||
var out sdkerrors.GetSourceConnectionInformationUnauthorized
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -458,28 +464,29 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
|
||||
@@ -487,23 +494,11 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
|
||||
|
||||
}
|
||||
|
||||
// GetUserDetails - Get User Data By Token
|
||||
// GetTokenDetails - Get Token Details
|
||||
// Get the User data from the provided X-Plex-Token
|
||||
func (s *Authentication) GetUserDetails(ctx context.Context, xPlexToken string, opts ...operations.Option) (*operations.GetUserDetailsResponse, error) {
|
||||
hookCtx := hooks.HookContext{
|
||||
Context: ctx,
|
||||
OperationID: "getUserDetails",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
request := operations.GetUserDetailsRequest{
|
||||
XPlexToken: xPlexToken,
|
||||
}
|
||||
|
||||
func (s *Authentication) GetTokenDetails(ctx context.Context, opts ...operations.Option) (*operations.GetTokenDetailsResponse, error) {
|
||||
o := operations.Options{}
|
||||
supportedOptions := []string{
|
||||
operations.SupportedOptionServerURL,
|
||||
operations.SupportedOptionRetries,
|
||||
operations.SupportedOptionTimeout,
|
||||
}
|
||||
@@ -514,7 +509,7 @@ func (s *Authentication) GetUserDetails(ctx context.Context, xPlexToken string,
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(operations.GetUserDetailsServerList[0], map[string]string{})
|
||||
baseURL := utils.ReplaceParameters(operations.GetTokenDetailsServerList[0], map[string]string{})
|
||||
if o.ServerURL != nil {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
@@ -524,6 +519,14 @@ func (s *Authentication) GetUserDetails(ctx context.Context, xPlexToken string,
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
}
|
||||
|
||||
hookCtx := hooks.HookContext{
|
||||
BaseURL: baseURL,
|
||||
Context: ctx,
|
||||
OperationID: "getTokenDetails",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
timeout := o.Timeout
|
||||
if timeout == nil {
|
||||
timeout = s.sdkConfiguration.Timeout
|
||||
@@ -542,14 +545,14 @@ func (s *Authentication) GetUserDetails(ctx context.Context, xPlexToken string,
|
||||
req.Header.Set("Accept", "application/json")
|
||||
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
|
||||
|
||||
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil {
|
||||
return nil, fmt.Errorf("error populating query params: %w", err)
|
||||
}
|
||||
|
||||
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -580,7 +583,11 @@ func (s *Authentication) GetUserDetails(ctx context.Context, xPlexToken string,
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -635,54 +642,43 @@ func (s *Authentication) GetUserDetails(ctx context.Context, xPlexToken string,
|
||||
}
|
||||
}
|
||||
|
||||
res := &operations.GetUserDetailsResponse{
|
||||
res := &operations.GetTokenDetailsResponse{
|
||||
StatusCode: httpRes.StatusCode,
|
||||
ContentType: httpRes.Header.Get("Content-Type"),
|
||||
RawResponse: httpRes,
|
||||
}
|
||||
|
||||
getRawBody := func() ([]byte, error) {
|
||||
rawBody, err := io.ReadAll(httpRes.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error reading response body: %w", err)
|
||||
}
|
||||
httpRes.Body.Close()
|
||||
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
|
||||
return rawBody, nil
|
||||
}
|
||||
|
||||
switch {
|
||||
case httpRes.StatusCode == 200:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out operations.GetUserDetailsUserPlexAccount
|
||||
var out operations.GetTokenDetailsUserPlexAccount
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
res.UserPlexAccount = &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode == 400:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.GetUserDetailsResponseBody
|
||||
var out sdkerrors.GetTokenDetailsBadRequest
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -690,22 +686,21 @@ func (s *Authentication) GetUserDetails(ctx context.Context, xPlexToken string,
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode == 401:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.GetUserDetailsAuthenticationResponseBody
|
||||
var out sdkerrors.GetTokenDetailsUnauthorized
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -713,28 +708,29 @@ func (s *Authentication) GetUserDetails(ctx context.Context, xPlexToken string,
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
|
||||
@@ -744,26 +740,9 @@ func (s *Authentication) GetUserDetails(ctx context.Context, xPlexToken string,
|
||||
|
||||
// PostUsersSignInData - Get User Sign In Data
|
||||
// Sign in user with username and password and return user data with Plex authentication token
|
||||
func (s *Authentication) PostUsersSignInData(ctx context.Context, xPlexClientIdentifier *string, requestBody *operations.PostUsersSignInDataRequestBody, opts ...operations.Option) (*operations.PostUsersSignInDataResponse, error) {
|
||||
hookCtx := hooks.HookContext{
|
||||
Context: ctx,
|
||||
OperationID: "post-users-sign-in-data",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: nil,
|
||||
}
|
||||
|
||||
request := operations.PostUsersSignInDataRequest{
|
||||
XPlexClientIdentifier: xPlexClientIdentifier,
|
||||
RequestBody: requestBody,
|
||||
}
|
||||
|
||||
globals := operations.PostUsersSignInDataGlobals{
|
||||
XPlexClientIdentifier: s.sdkConfiguration.Globals.XPlexClientIdentifier,
|
||||
}
|
||||
|
||||
func (s *Authentication) PostUsersSignInData(ctx context.Context, request operations.PostUsersSignInDataRequest, opts ...operations.Option) (*operations.PostUsersSignInDataResponse, error) {
|
||||
o := operations.Options{}
|
||||
supportedOptions := []string{
|
||||
operations.SupportedOptionServerURL,
|
||||
operations.SupportedOptionRetries,
|
||||
operations.SupportedOptionTimeout,
|
||||
}
|
||||
@@ -784,6 +763,13 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, xPlexClientIde
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
}
|
||||
|
||||
hookCtx := hooks.HookContext{
|
||||
BaseURL: baseURL,
|
||||
Context: ctx,
|
||||
OperationID: "post-users-sign-in-data",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: nil,
|
||||
}
|
||||
bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "form", `request:"mediaType=application/x-www-form-urlencoded"`)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -806,10 +792,14 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, xPlexClientIde
|
||||
}
|
||||
req.Header.Set("Accept", "application/json")
|
||||
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
|
||||
req.Header.Set("Content-Type", reqContentType)
|
||||
if reqContentType != "" {
|
||||
req.Header.Set("Content-Type", reqContentType)
|
||||
}
|
||||
|
||||
if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil {
|
||||
return nil, fmt.Errorf("error populating query params: %w", err)
|
||||
utils.PopulateHeaders(ctx, req, request, nil)
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
@@ -842,7 +832,11 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, xPlexClientIde
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -903,21 +897,11 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, xPlexClientIde
|
||||
RawResponse: httpRes,
|
||||
}
|
||||
|
||||
getRawBody := func() ([]byte, error) {
|
||||
rawBody, err := io.ReadAll(httpRes.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error reading response body: %w", err)
|
||||
}
|
||||
httpRes.Body.Close()
|
||||
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
|
||||
return rawBody, nil
|
||||
}
|
||||
|
||||
switch {
|
||||
case httpRes.StatusCode == 201:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -929,22 +913,21 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, xPlexClientIde
|
||||
|
||||
res.UserPlexAccount = &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode == 400:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.PostUsersSignInDataResponseBody
|
||||
var out sdkerrors.PostUsersSignInDataBadRequest
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -952,22 +935,21 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, xPlexClientIde
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode == 401:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.PostUsersSignInDataAuthenticationResponseBody
|
||||
var out sdkerrors.PostUsersSignInDataUnauthorized
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -975,28 +957,29 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, xPlexClientIde
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
|
||||
|
||||
358
butler.go
358
butler.go
@@ -10,8 +10,7 @@ import (
|
||||
"github.com/LukeHagar/plexgo/internal/utils"
|
||||
"github.com/LukeHagar/plexgo/models/operations"
|
||||
"github.com/LukeHagar/plexgo/models/sdkerrors"
|
||||
"github.com/cenkalti/backoff/v4"
|
||||
"io"
|
||||
"github.com/LukeHagar/plexgo/retry"
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
@@ -30,13 +29,6 @@ func newButler(sdkConfig sdkConfiguration) *Butler {
|
||||
// GetButlerTasks - Get Butler tasks
|
||||
// Returns a list of butler tasks
|
||||
func (s *Butler) GetButlerTasks(ctx context.Context, opts ...operations.Option) (*operations.GetButlerTasksResponse, error) {
|
||||
hookCtx := hooks.HookContext{
|
||||
Context: ctx,
|
||||
OperationID: "getButlerTasks",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
o := operations.Options{}
|
||||
supportedOptions := []string{
|
||||
operations.SupportedOptionRetries,
|
||||
@@ -49,12 +41,25 @@ func (s *Butler) GetButlerTasks(ctx context.Context, opts ...operations.Option)
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := url.JoinPath(baseURL, "/butler")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
}
|
||||
|
||||
hookCtx := hooks.HookContext{
|
||||
BaseURL: baseURL,
|
||||
Context: ctx,
|
||||
OperationID: "getButlerTasks",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
timeout := o.Timeout
|
||||
if timeout == nil {
|
||||
timeout = s.sdkConfiguration.Timeout
|
||||
@@ -77,6 +82,10 @@ func (s *Butler) GetButlerTasks(ctx context.Context, opts ...operations.Option)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -107,7 +116,11 @@ func (s *Butler) GetButlerTasks(ctx context.Context, opts ...operations.Option)
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -168,21 +181,11 @@ func (s *Butler) GetButlerTasks(ctx context.Context, opts ...operations.Option)
|
||||
RawResponse: httpRes,
|
||||
}
|
||||
|
||||
getRawBody := func() ([]byte, error) {
|
||||
rawBody, err := io.ReadAll(httpRes.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error reading response body: %w", err)
|
||||
}
|
||||
httpRes.Body.Close()
|
||||
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
|
||||
return rawBody, nil
|
||||
}
|
||||
|
||||
switch {
|
||||
case httpRes.StatusCode == 200:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -194,22 +197,21 @@ func (s *Butler) GetButlerTasks(ctx context.Context, opts ...operations.Option)
|
||||
|
||||
res.Object = &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode == 400:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.GetButlerTasksResponseBody
|
||||
var out sdkerrors.GetButlerTasksBadRequest
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -217,22 +219,21 @@ func (s *Butler) GetButlerTasks(ctx context.Context, opts ...operations.Option)
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode == 401:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.GetButlerTasksButlerResponseBody
|
||||
var out sdkerrors.GetButlerTasksUnauthorized
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -240,28 +241,29 @@ func (s *Butler) GetButlerTasks(ctx context.Context, opts ...operations.Option)
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
|
||||
@@ -276,13 +278,6 @@ func (s *Butler) GetButlerTasks(ctx context.Context, opts ...operations.Option)
|
||||
// 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
|
||||
// 4. If we are outside the configured window, the task will start immediately.
|
||||
func (s *Butler) StartAllTasks(ctx context.Context, opts ...operations.Option) (*operations.StartAllTasksResponse, error) {
|
||||
hookCtx := hooks.HookContext{
|
||||
Context: ctx,
|
||||
OperationID: "startAllTasks",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
o := operations.Options{}
|
||||
supportedOptions := []string{
|
||||
operations.SupportedOptionRetries,
|
||||
@@ -295,12 +290,25 @@ func (s *Butler) StartAllTasks(ctx context.Context, opts ...operations.Option) (
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := url.JoinPath(baseURL, "/butler")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
}
|
||||
|
||||
hookCtx := hooks.HookContext{
|
||||
BaseURL: baseURL,
|
||||
Context: ctx,
|
||||
OperationID: "startAllTasks",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
timeout := o.Timeout
|
||||
if timeout == nil {
|
||||
timeout = s.sdkConfiguration.Timeout
|
||||
@@ -323,6 +331,10 @@ func (s *Butler) StartAllTasks(ctx context.Context, opts ...operations.Option) (
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -353,7 +365,11 @@ func (s *Butler) StartAllTasks(ctx context.Context, opts ...operations.Option) (
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -414,27 +430,17 @@ func (s *Butler) StartAllTasks(ctx context.Context, opts ...operations.Option) (
|
||||
RawResponse: httpRes,
|
||||
}
|
||||
|
||||
getRawBody := func() ([]byte, error) {
|
||||
rawBody, err := io.ReadAll(httpRes.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error reading response body: %w", err)
|
||||
}
|
||||
httpRes.Body.Close()
|
||||
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
|
||||
return rawBody, nil
|
||||
}
|
||||
|
||||
switch {
|
||||
case httpRes.StatusCode == 200:
|
||||
case httpRes.StatusCode == 400:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.StartAllTasksResponseBody
|
||||
var out sdkerrors.StartAllTasksBadRequest
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -442,22 +448,21 @@ func (s *Butler) StartAllTasks(ctx context.Context, opts ...operations.Option) (
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode == 401:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.StartAllTasksButlerResponseBody
|
||||
var out sdkerrors.StartAllTasksUnauthorized
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -465,28 +470,29 @@ func (s *Butler) StartAllTasks(ctx context.Context, opts ...operations.Option) (
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
|
||||
@@ -497,13 +503,6 @@ func (s *Butler) StartAllTasks(ctx context.Context, opts ...operations.Option) (
|
||||
// StopAllTasks - Stop all Butler tasks
|
||||
// This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
|
||||
func (s *Butler) StopAllTasks(ctx context.Context, opts ...operations.Option) (*operations.StopAllTasksResponse, error) {
|
||||
hookCtx := hooks.HookContext{
|
||||
Context: ctx,
|
||||
OperationID: "stopAllTasks",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
o := operations.Options{}
|
||||
supportedOptions := []string{
|
||||
operations.SupportedOptionRetries,
|
||||
@@ -516,12 +515,25 @@ func (s *Butler) StopAllTasks(ctx context.Context, opts ...operations.Option) (*
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := url.JoinPath(baseURL, "/butler")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
}
|
||||
|
||||
hookCtx := hooks.HookContext{
|
||||
BaseURL: baseURL,
|
||||
Context: ctx,
|
||||
OperationID: "stopAllTasks",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
timeout := o.Timeout
|
||||
if timeout == nil {
|
||||
timeout = s.sdkConfiguration.Timeout
|
||||
@@ -544,6 +556,10 @@ func (s *Butler) StopAllTasks(ctx context.Context, opts ...operations.Option) (*
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -574,7 +590,11 @@ func (s *Butler) StopAllTasks(ctx context.Context, opts ...operations.Option) (*
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -635,27 +655,17 @@ func (s *Butler) StopAllTasks(ctx context.Context, opts ...operations.Option) (*
|
||||
RawResponse: httpRes,
|
||||
}
|
||||
|
||||
getRawBody := func() ([]byte, error) {
|
||||
rawBody, err := io.ReadAll(httpRes.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error reading response body: %w", err)
|
||||
}
|
||||
httpRes.Body.Close()
|
||||
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
|
||||
return rawBody, nil
|
||||
}
|
||||
|
||||
switch {
|
||||
case httpRes.StatusCode == 200:
|
||||
case httpRes.StatusCode == 400:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.StopAllTasksResponseBody
|
||||
var out sdkerrors.StopAllTasksBadRequest
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -663,22 +673,21 @@ func (s *Butler) StopAllTasks(ctx context.Context, opts ...operations.Option) (*
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode == 401:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.StopAllTasksButlerResponseBody
|
||||
var out sdkerrors.StopAllTasksUnauthorized
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -686,28 +695,29 @@ func (s *Butler) StopAllTasks(ctx context.Context, opts ...operations.Option) (*
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
|
||||
@@ -722,13 +732,6 @@ func (s *Butler) StopAllTasks(ctx context.Context, opts ...operations.Option) (*
|
||||
// 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
|
||||
// 4. If we are outside the configured window, the task will start immediately.
|
||||
func (s *Butler) StartTask(ctx context.Context, taskName operations.TaskName, opts ...operations.Option) (*operations.StartTaskResponse, error) {
|
||||
hookCtx := hooks.HookContext{
|
||||
Context: ctx,
|
||||
OperationID: "startTask",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
request := operations.StartTaskRequest{
|
||||
TaskName: taskName,
|
||||
}
|
||||
@@ -745,12 +748,25 @@ func (s *Butler) StartTask(ctx context.Context, taskName operations.TaskName, op
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := utils.GenerateURL(ctx, baseURL, "/butler/{taskName}", request, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
}
|
||||
|
||||
hookCtx := hooks.HookContext{
|
||||
BaseURL: baseURL,
|
||||
Context: ctx,
|
||||
OperationID: "startTask",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
timeout := o.Timeout
|
||||
if timeout == nil {
|
||||
timeout = s.sdkConfiguration.Timeout
|
||||
@@ -773,6 +789,10 @@ func (s *Butler) StartTask(ctx context.Context, taskName operations.TaskName, op
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -803,7 +823,11 @@ func (s *Butler) StartTask(ctx context.Context, taskName operations.TaskName, op
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -864,16 +888,6 @@ func (s *Butler) StartTask(ctx context.Context, taskName operations.TaskName, op
|
||||
RawResponse: httpRes,
|
||||
}
|
||||
|
||||
getRawBody := func() ([]byte, error) {
|
||||
rawBody, err := io.ReadAll(httpRes.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error reading response body: %w", err)
|
||||
}
|
||||
httpRes.Body.Close()
|
||||
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
|
||||
return rawBody, nil
|
||||
}
|
||||
|
||||
switch {
|
||||
case httpRes.StatusCode == 200:
|
||||
fallthrough
|
||||
@@ -881,12 +895,12 @@ func (s *Butler) StartTask(ctx context.Context, taskName operations.TaskName, op
|
||||
case httpRes.StatusCode == 400:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.StartTaskResponseBody
|
||||
var out sdkerrors.StartTaskBadRequest
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -894,22 +908,21 @@ func (s *Butler) StartTask(ctx context.Context, taskName operations.TaskName, op
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode == 401:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.StartTaskButlerResponseBody
|
||||
var out sdkerrors.StartTaskUnauthorized
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -917,28 +930,29 @@ func (s *Butler) StartTask(ctx context.Context, taskName operations.TaskName, op
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
|
||||
@@ -949,13 +963,6 @@ func (s *Butler) StartTask(ctx context.Context, taskName operations.TaskName, op
|
||||
// StopTask - Stop a single Butler task
|
||||
// This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint.
|
||||
func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTaskName, opts ...operations.Option) (*operations.StopTaskResponse, error) {
|
||||
hookCtx := hooks.HookContext{
|
||||
Context: ctx,
|
||||
OperationID: "stopTask",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
request := operations.StopTaskRequest{
|
||||
TaskName: taskName,
|
||||
}
|
||||
@@ -972,12 +979,25 @@ func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTask
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := utils.GenerateURL(ctx, baseURL, "/butler/{taskName}", request, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
}
|
||||
|
||||
hookCtx := hooks.HookContext{
|
||||
BaseURL: baseURL,
|
||||
Context: ctx,
|
||||
OperationID: "stopTask",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
timeout := o.Timeout
|
||||
if timeout == nil {
|
||||
timeout = s.sdkConfiguration.Timeout
|
||||
@@ -1000,6 +1020,10 @@ func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTask
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -1030,7 +1054,11 @@ func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTask
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -1091,27 +1119,17 @@ func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTask
|
||||
RawResponse: httpRes,
|
||||
}
|
||||
|
||||
getRawBody := func() ([]byte, error) {
|
||||
rawBody, err := io.ReadAll(httpRes.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error reading response body: %w", err)
|
||||
}
|
||||
httpRes.Body.Close()
|
||||
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
|
||||
return rawBody, nil
|
||||
}
|
||||
|
||||
switch {
|
||||
case httpRes.StatusCode == 200:
|
||||
case httpRes.StatusCode == 400:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.StopTaskResponseBody
|
||||
var out sdkerrors.StopTaskBadRequest
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1119,22 +1137,21 @@ func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTask
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode == 401:
|
||||
switch {
|
||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var out sdkerrors.StopTaskButlerResponseBody
|
||||
var out sdkerrors.StopTaskUnauthorized
|
||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1142,30 +1159,31 @@ func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTask
|
||||
out.RawResponse = httpRes
|
||||
return nil, &out
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode == 404:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
default:
|
||||
rawBody, err := getRawBody()
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
|
||||
|
||||
1056
codeSamples.yaml
1056
codeSamples.yaml
File diff suppressed because it is too large
Load Diff
9
docs/models/operations/action.md
Normal file
9
docs/models/operations/action.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Action
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ |
|
||||
| `ID` | *string* | :heavy_check_mark: | N/A | addToContinueWatching |
|
||||
| `Key` | *string* | :heavy_check_mark: | N/A | /actions/addToContinueWatching |
|
||||
12
docs/models/operations/activedirection.md
Normal file
12
docs/models/operations/activedirection.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# ActiveDirection
|
||||
|
||||
The direction of the sort. Can be either `asc` or `desc`.
|
||||
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------------------------- | --------------------------- |
|
||||
| `ActiveDirectionAscending` | asc |
|
||||
| `ActiveDirectionDescending` | desc |
|
||||
11
docs/models/operations/alllibraries.md
Normal file
11
docs/models/operations/alllibraries.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# AllLibraries
|
||||
|
||||
Indicates if the user has access to all libraries.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------------------- | --------------------- |
|
||||
| `AllLibrariesDisable` | 0 |
|
||||
| `AllLibrariesEnable` | 1 |
|
||||
11
docs/models/operations/allowcameraupload.md
Normal file
11
docs/models/operations/allowcameraupload.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# AllowCameraUpload
|
||||
|
||||
Indicates if the user is allowed to upload from a camera.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| -------------------------- | -------------------------- |
|
||||
| `AllowCameraUploadDisable` | 0 |
|
||||
| `AllowCameraUploadEnable` | 1 |
|
||||
11
docs/models/operations/allowchannels.md
Normal file
11
docs/models/operations/allowchannels.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# AllowChannels
|
||||
|
||||
Indicates if the user has access to channels.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ---------------------- | ---------------------- |
|
||||
| `AllowChannelsDisable` | 0 |
|
||||
| `AllowChannelsEnable` | 1 |
|
||||
11
docs/models/operations/allowsubtitleadmin.md
Normal file
11
docs/models/operations/allowsubtitleadmin.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# AllowSubtitleAdmin
|
||||
|
||||
Indicates if the user can manage subtitles.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------------------------- | --------------------------- |
|
||||
| `AllowSubtitleAdminDisable` | 0 |
|
||||
| `AllowSubtitleAdminEnable` | 1 |
|
||||
11
docs/models/operations/allowsync.md
Normal file
11
docs/models/operations/allowsync.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# AllowSync
|
||||
|
||||
Indicates if the user is allowed to sync media.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------------ | ------------------ |
|
||||
| `AllowSyncDisable` | 0 |
|
||||
| `AllowSyncEnable` | 1 |
|
||||
11
docs/models/operations/allowtuners.md
Normal file
11
docs/models/operations/allowtuners.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# AllowTuners
|
||||
|
||||
Indicates if the user is allowed to use tuners.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| -------------------- | -------------------- |
|
||||
| `AllowTunersDisable` | 0 |
|
||||
| `AllowTunersEnable` | 1 |
|
||||
11
docs/models/operations/attributes.md
Normal file
11
docs/models/operations/attributes.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Attributes
|
||||
|
||||
Attributes associated with the marker.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
|
||||
| `ID` | *int64* | :heavy_check_mark: | The identifier for the attributes. | 306970 |
|
||||
| `Version` | **int64* | :heavy_minus_sign: | The version number of the marker attributes. | 4 |
|
||||
@@ -5,7 +5,7 @@ The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign aud
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------------------ | ------------------------ |
|
||||
| `AutoSelectSubtitleZero` | 0 |
|
||||
| `AutoSelectSubtitleOne` | 1 |
|
||||
| Name | Value |
|
||||
| --------------------------- | --------------------------- |
|
||||
| `AutoSelectSubtitleDisable` | 0 |
|
||||
| `AutoSelectSubtitleEnable` | 1 |
|
||||
15
docs/models/operations/chapter.md
Normal file
15
docs/models/operations/chapter.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Chapter
|
||||
|
||||
The thumbnail for the chapter
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ |
|
||||
| `ID` | *int64* | :heavy_check_mark: | N/A | 4 |
|
||||
| `Filter` | *string* | :heavy_check_mark: | N/A | thumb=4 |
|
||||
| `Index` | *int64* | :heavy_check_mark: | N/A | 1 |
|
||||
| `StartTimeOffset` | *int64* | :heavy_check_mark: | N/A | 0 |
|
||||
| `EndTimeOffset` | *int64* | :heavy_check_mark: | N/A | 100100 |
|
||||
| `Thumb` | *string* | :heavy_check_mark: | N/A | /library/media/46883/chapterImages/1 |
|
||||
8
docs/models/operations/collection.md
Normal file
8
docs/models/operations/collection.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# Collection
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- |
|
||||
| `Tag` | *string* | :heavy_check_mark: | The user-made collection this media item belongs to | My Awesome Collection |
|
||||
@@ -3,12 +3,12 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `Protocol` | *string* | :heavy_check_mark: | N/A |
|
||||
| `Address` | *string* | :heavy_check_mark: | N/A |
|
||||
| `Port` | *float64* | :heavy_check_mark: | N/A |
|
||||
| `URI` | *string* | :heavy_check_mark: | N/A |
|
||||
| `Local` | *bool* | :heavy_check_mark: | N/A |
|
||||
| `Relay` | *bool* | :heavy_check_mark: | N/A |
|
||||
| `IPv6` | *bool* | :heavy_check_mark: | N/A |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
|
||||
| `Protocol` | [operations.Protocol](../../models/operations/protocol.md) | :heavy_check_mark: | The protocol used for the connection (http, https, etc) | http |
|
||||
| `Address` | *string* | :heavy_check_mark: | The (ip) address or domain name used for the connection | |
|
||||
| `Port` | *int* | :heavy_check_mark: | The port used for the connection | |
|
||||
| `URI` | *string* | :heavy_check_mark: | The full URI of the connection | |
|
||||
| `Local` | *bool* | :heavy_check_mark: | If the connection is local address | |
|
||||
| `Relay` | *bool* | :heavy_check_mark: | If the connection is relayed through plex.direct | |
|
||||
| `IPv6` | *bool* | :heavy_check_mark: | If the connection is using IPv6 | |
|
||||
@@ -1,8 +1,12 @@
|
||||
# Country
|
||||
|
||||
The filter query string for country media items.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ |
|
||||
| `Tag` | **string* | :heavy_minus_sign: | N/A | United States of America |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
||||
| `ID` | *int* | :heavy_check_mark: | N/A | 259 |
|
||||
| `Tag` | *string* | :heavy_check_mark: | The country of origin of this media item | United States of America |
|
||||
| `Filter` | **string* | :heavy_minus_sign: | N/A | country=19 |
|
||||
12
docs/models/operations/defaultdirection.md
Normal file
12
docs/models/operations/defaultdirection.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# DefaultDirection
|
||||
|
||||
The direction of the sort. Can be either `asc` or `desc`.
|
||||
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ---------------------------- | ---------------------------- |
|
||||
| `DefaultDirectionAscending` | asc |
|
||||
| `DefaultDirectionDescending` | desc |
|
||||
@@ -1,11 +1,11 @@
|
||||
# DefaultSubtitleAccessibility
|
||||
|
||||
The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles)
|
||||
The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles)
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ---------------------------------- | ---------------------------------- |
|
||||
| `DefaultSubtitleAccessibilityZero` | 0 |
|
||||
| `DefaultSubtitleAccessibilityOne` | 1 |
|
||||
| Name | Value |
|
||||
| ------------------------------------- | ------------------------------------- |
|
||||
| `DefaultSubtitleAccessibilityDisable` | 0 |
|
||||
| `DefaultSubtitleAccessibilityEnable` | 1 |
|
||||
@@ -5,7 +5,7 @@ The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------------------------- | --------------------------- |
|
||||
| `DefaultSubtitleForcedZero` | 0 |
|
||||
| `DefaultSubtitleForcedOne` | 1 |
|
||||
| Name | Value |
|
||||
| ------------------------------ | ------------------------------ |
|
||||
| `DefaultSubtitleForcedDisable` | 0 |
|
||||
| `DefaultSubtitleForcedEnable` | 1 |
|
||||
@@ -3,6 +3,6 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `Tag` | **string* | :heavy_minus_sign: | N/A | Peyton Reed |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------- | -------------------- | -------------------- | -------------------- | -------------------- |
|
||||
| `Tag` | *string* | :heavy_check_mark: | The role of Director | Danny Boyle |
|
||||
11
docs/models/operations/enablecreditsmarkergeneration.md
Normal file
11
docs/models/operations/enablecreditsmarkergeneration.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# EnableCreditsMarkerGeneration
|
||||
|
||||
Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------------------------------------------- | --------------------------------------------- |
|
||||
| `EnableCreditsMarkerGenerationLibraryDefault` | -1 |
|
||||
| `EnableCreditsMarkerGenerationDisabled` | 0 |
|
||||
12
docs/models/operations/episodesort.md
Normal file
12
docs/models/operations/episodesort.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# EpisodeSort
|
||||
|
||||
Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------------------------- | --------------------------- |
|
||||
| `EpisodeSortLibraryDefault` | -1 |
|
||||
| `EpisodeSortOldestFirst` | 0 |
|
||||
| `EpisodeSortNewestFirst` | 1 |
|
||||
8
docs/models/operations/extras.md
Normal file
8
docs/models/operations/extras.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# Extras
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ----------------------- | ----------------------- | ----------------------- | ----------------------- | ----------------------- |
|
||||
| `Size` | **int64* | :heavy_minus_sign: | The size of the extras. | 1 |
|
||||
@@ -3,8 +3,12 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||
| `Key` | **string* | :heavy_minus_sign: | N/A |
|
||||
| `Type` | **string* | :heavy_minus_sign: | N/A |
|
||||
| `Directory` | [][operations.GetMediaProvidersDirectory](../../models/operations/getmediaprovidersdirectory.md) | :heavy_minus_sign: | N/A |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||
| `Key` | **string* | :heavy_minus_sign: | N/A | |
|
||||
| `Type` | *string* | :heavy_check_mark: | N/A | |
|
||||
| `Flavor` | **string* | :heavy_minus_sign: | N/A | global |
|
||||
| `ScrobbleKey` | **string* | :heavy_minus_sign: | N/A | /:/scrobble/new |
|
||||
| `UnscrobbleKey` | **string* | :heavy_minus_sign: | N/A | /:/unscrobble/new |
|
||||
| `Directory` | [][operations.GetMediaProvidersDirectory](../../models/operations/getmediaprovidersdirectory.md) | :heavy_minus_sign: | N/A | |
|
||||
| `Action` | [][operations.Action](../../models/operations/action.md) | :heavy_minus_sign: | N/A | |
|
||||
@@ -1,66 +0,0 @@
|
||||
# Features
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------------------------------------------- | --------------------------------------------- |
|
||||
| `FeaturesAndroidDolbyVision` | Android - Dolby Vision |
|
||||
| `FeaturesAndroidPiP` | Android - PiP |
|
||||
| `FeaturesCuSunset` | CU Sunset |
|
||||
| `FeaturesHrkEnableEur` | HRK_enable_EUR |
|
||||
| `FeaturesTrebleShowFeatures` | TREBLE-show-features |
|
||||
| `FeaturesAdCountdownTimer` | ad-countdown-timer |
|
||||
| `FeaturesAdaptiveBitrate` | adaptive_bitrate |
|
||||
| `FeaturesAmazonLoopDebug` | amazon-loop-debug |
|
||||
| `FeaturesAvodAdAnalysis` | avod-ad-analysis |
|
||||
| `FeaturesAvodNewMedia` | avod-new-media |
|
||||
| `FeaturesBlacklistGetSignin` | blacklist_get_signin |
|
||||
| `FeaturesClientRadioStations` | client-radio-stations |
|
||||
| `FeaturesCloudflareTurnstileRequired` | cloudflare-turnstile-required |
|
||||
| `FeaturesCollections` | collections |
|
||||
| `FeaturesCommentsAndRepliesPushNotifications` | comments_and_replies_push_notifications |
|
||||
| `FeaturesCommunityAccessPlexTv` | community_access_plex_tv |
|
||||
| `FeaturesCompanionsSonos` | companions_sonos |
|
||||
| `FeaturesCustomHomeRemoval` | custom-home-removal |
|
||||
| `FeaturesDisableHomeUserFriendships` | disable_home_user_friendships |
|
||||
| `FeaturesDisableSharingFriendships` | disable_sharing_friendships |
|
||||
| `FeaturesDrmSupport` | drm_support |
|
||||
| `FeaturesExcludeRestrictions` | exclude restrictions |
|
||||
| `FeaturesFederatedAuth` | federated-auth |
|
||||
| `FeaturesFriendRequestPushNotifications` | friend_request_push_notifications |
|
||||
| `FeaturesGuidedUpgrade` | guided-upgrade |
|
||||
| `FeaturesHome` | home |
|
||||
| `FeaturesIncreasePasswordComplexity` | increase-password-complexity |
|
||||
| `FeaturesIos14PrivacyBanner` | ios14-privacy-banner |
|
||||
| `FeaturesIterableNotificationTokens` | iterable-notification-tokens |
|
||||
| `FeaturesKeepPaymentMethod` | keep-payment-method |
|
||||
| `FeaturesKevinBacon` | kevin-bacon |
|
||||
| `FeaturesKoreaConsent` | korea-consent |
|
||||
| `FeaturesLeIsrgRootX1` | le_isrg_root_x1 |
|
||||
| `FeaturesLetsEncrypt` | lets_encrypt |
|
||||
| `FeaturesLightningDvrPivot` | lightning-dvr-pivot |
|
||||
| `FeaturesLiveTvSupportIncompleteSegments` | live-tv-support-incomplete-segments |
|
||||
| `FeaturesLivetv` | livetv |
|
||||
| `FeaturesMetadataSearch` | metadata_search |
|
||||
| `FeaturesNewPlexPassPrices` | new_plex_pass_prices |
|
||||
| `FeaturesNewsProviderSunsetModal` | news-provider-sunset-modal |
|
||||
| `FeaturesPhotosFavorites` | photos-favorites |
|
||||
| `FeaturesPhotosMetadataEdition` | photos-metadata-edition |
|
||||
| `FeaturesPmsHealth` | pms_health |
|
||||
| `FeaturesRadio` | radio |
|
||||
| `FeaturesRateLimitClientToken` | rate-limit-client-token |
|
||||
| `FeaturesScrobblingServicePlexTv` | scrobbling-service-plex-tv |
|
||||
| `FeaturesSharedServerNotification` | shared_server_notification |
|
||||
| `FeaturesSharedSourceNotification` | shared_source_notification |
|
||||
| `FeaturesSigninWithApple` | signin_with_apple |
|
||||
| `FeaturesSpringServeAdProvider` | spring_serve_ad_provider |
|
||||
| `FeaturesTranscoderCache` | transcoder_cache |
|
||||
| `FeaturesTunerSharing` | tuner-sharing |
|
||||
| `FeaturesTwoFactorAuthentication` | two-factor-authentication |
|
||||
| `FeaturesUnsupportedtuners` | unsupportedtuners |
|
||||
| `FeaturesUpgrade3ds2` | upgrade-3ds2 |
|
||||
| `FeaturesVodSchema` | vod-schema |
|
||||
| `FeaturesVodCloudflare` | vod_cloudflare |
|
||||
| `FeaturesWatchTogetherInvite` | watch-together-invite |
|
||||
| `FeaturesWebServerDashboard` | web_server_dashboard |
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `Key` | **string* | :heavy_minus_sign: | N/A | label |
|
||||
| `Title` | **string* | :heavy_minus_sign: | N/A | Label |
|
||||
| `Type` | **string* | :heavy_minus_sign: | N/A | tag |
|
||||
| `SubType` | **string* | :heavy_minus_sign: | N/A | bitrate |
|
||||
| `Key` | *string* | :heavy_check_mark: | N/A | show.title |
|
||||
| `Title` | *string* | :heavy_check_mark: | N/A | Show Title |
|
||||
| `Type` | *string* | :heavy_check_mark: | N/A | string |
|
||||
| `SubType` | **string* | :heavy_minus_sign: | N/A | rating |
|
||||
@@ -5,5 +5,5 @@
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
|
||||
| `Type` | **string* | :heavy_minus_sign: | N/A | resolution |
|
||||
| `Operator` | [][operations.Operator](../../models/operations/operator.md) | :heavy_minus_sign: | N/A | |
|
||||
| `Type` | *string* | :heavy_check_mark: | N/A | tag |
|
||||
| `Operator` | [][operations.Operator](../../models/operations/operator.md) | :heavy_check_mark: | N/A | |
|
||||
12
docs/models/operations/flattenseasons.md
Normal file
12
docs/models/operations/flattenseasons.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# FlattenSeasons
|
||||
|
||||
Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------------------------ | ------------------------------ |
|
||||
| `FlattenSeasonsLibraryDefault` | -1 |
|
||||
| `FlattenSeasonsHide` | 0 |
|
||||
| `FlattenSeasonsShow` | 1 |
|
||||
@@ -1,8 +1,12 @@
|
||||
# Genre
|
||||
|
||||
The filter query string for similar items.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `Tag` | **string* | :heavy_minus_sign: | N/A | Comedy |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- |
|
||||
| `ID` | *int64* | :heavy_check_mark: | N/A | 259 |
|
||||
| `Filter` | *string* | :heavy_check_mark: | N/A | genre=19 |
|
||||
| `Tag` | *string* | :heavy_check_mark: | The genre name of this media-item<br/> | Crime |
|
||||
@@ -13,7 +13,7 @@ Geo location data
|
||||
| `City` | *string* | :heavy_check_mark: | The name of the city. | Amsterdam |
|
||||
| `EuropeanUnionMember` | **bool* | :heavy_minus_sign: | Indicates if the country is a member of the European Union. | true |
|
||||
| `TimeZone` | *string* | :heavy_check_mark: | The time zone of the country. | America/St_Thomas |
|
||||
| `PostalCode` | *int64* | :heavy_check_mark: | The postal code of the location. | 802 |
|
||||
| `PostalCode` | *string* | :heavy_check_mark: | The postal code of the location. | 802 |
|
||||
| `InPrivacyRestrictedCountry` | **bool* | :heavy_minus_sign: | Indicates if the country has privacy restrictions. | true |
|
||||
| `InPrivacyRestrictedRegion` | **bool* | :heavy_minus_sign: | Indicates if the region has privacy restrictions. | true |
|
||||
| `Subdivisions` | *string* | :heavy_check_mark: | The name of the primary administrative subdivision. | Saint Thomas |
|
||||
|
||||
11
docs/models/operations/getactorslibrarydirectory.md
Normal file
11
docs/models/operations/getactorslibrarydirectory.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# GetActorsLibraryDirectory
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
|
||||
| `FastKey` | *string* | :heavy_check_mark: | A fast lookup key for the actor relative url. | /library/sections/2/all?actor=134671 |
|
||||
| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the actor. | https://metadata-static.plex.tv/e/people/e2a915b537ef720252b6d408bc1f91b3.jpg |
|
||||
| `Key` | *string* | :heavy_check_mark: | A unique key representing the actor. | 134671 |
|
||||
| `Title` | *string* | :heavy_check_mark: | The name of the actor. | Aaron Paul |
|
||||
20
docs/models/operations/getactorslibrarymediacontainer.md
Normal file
20
docs/models/operations/getactorslibrarymediacontainer.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# GetActorsLibraryMediaContainer
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
||||
| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
|
||||
| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false |
|
||||
| `Art` | *string* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg |
|
||||
| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library |
|
||||
| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ |
|
||||
| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 |
|
||||
| `Nocache` | *bool* | :heavy_check_mark: | Specifies whether caching is disabled. | true |
|
||||
| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png |
|
||||
| `Title1` | *string* | :heavy_check_mark: | The primary title of the media container. | TV Series |
|
||||
| `Title2` | *string* | :heavy_check_mark: | The secondary title of the media container. | By Starring Actor |
|
||||
| `ViewGroup` | *string* | :heavy_check_mark: | Identifier for the view group layout. | secondary |
|
||||
| `ViewMode` | *string* | :heavy_check_mark: | Identifier for the view mode. | 131131 |
|
||||
| `Directory` | [][operations.GetActorsLibraryDirectory](../../models/operations/getactorslibrarydirectory.md) | :heavy_minus_sign: | An array of actor entries for media items. | |
|
||||
22
docs/models/operations/getactorslibraryqueryparamtype.md
Normal file
22
docs/models/operations/getactorslibraryqueryparamtype.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# GetActorsLibraryQueryParamType
|
||||
|
||||
The type of media to retrieve or filter by.
|
||||
1 = movie
|
||||
2 = show
|
||||
3 = season
|
||||
4 = episode
|
||||
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
||||
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------------------------------------- | --------------------------------------- |
|
||||
| `GetActorsLibraryQueryParamTypeMovie` | 1 |
|
||||
| `GetActorsLibraryQueryParamTypeTvShow` | 2 |
|
||||
| `GetActorsLibraryQueryParamTypeSeason` | 3 |
|
||||
| `GetActorsLibraryQueryParamTypeEpisode` | 4 |
|
||||
| `GetActorsLibraryQueryParamTypeAudio` | 8 |
|
||||
| `GetActorsLibraryQueryParamTypeAlbum` | 9 |
|
||||
| `GetActorsLibraryQueryParamTypeTrack` | 10 |
|
||||
9
docs/models/operations/getactorslibraryrequest.md
Normal file
9
docs/models/operations/getactorslibraryrequest.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# GetActorsLibraryRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
|
||||
| `Type` | [operations.GetActorsLibraryQueryParamType](../../models/operations/getactorslibraryqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.<br/>1 = movie<br/>2 = show<br/>3 = season<br/>4 = episode<br/>E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/> | 2 |
|
||||
11
docs/models/operations/getactorslibraryresponse.md
Normal file
11
docs/models/operations/getactorslibraryresponse.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# GetActorsLibraryResponse
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
||||
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||
| `Object` | [*operations.GetActorsLibraryResponseBody](../../models/operations/getactorslibraryresponsebody.md) | :heavy_minus_sign: | Successful response containing media container data. |
|
||||
10
docs/models/operations/getactorslibraryresponsebody.md
Normal file
10
docs/models/operations/getactorslibraryresponsebody.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# GetActorsLibraryResponseBody
|
||||
|
||||
Successful response containing media container data.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
||||
| `MediaContainer` | [*operations.GetActorsLibraryMediaContainer](../../models/operations/getactorslibrarymediacontainer.md) | :heavy_minus_sign: | N/A |
|
||||
@@ -3,26 +3,26 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
|
||||
| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | true |
|
||||
| `Art` | **string* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg |
|
||||
| `Composite` | **string* | :heavy_minus_sign: | N/A | /library/sections/1/composite/1705615584 |
|
||||
| `Filters` | **bool* | :heavy_minus_sign: | N/A | true |
|
||||
| `Refreshing` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||
| `Thumb` | **string* | :heavy_minus_sign: | N/A | /:/resources/movie.png |
|
||||
| `Key` | **string* | :heavy_minus_sign: | N/A | 1 |
|
||||
| `Type` | **string* | :heavy_minus_sign: | N/A | movie |
|
||||
| `Title` | **string* | :heavy_minus_sign: | N/A | Movies |
|
||||
| `Agent` | **string* | :heavy_minus_sign: | N/A | tv.plex.agents.movie |
|
||||
| `Scanner` | **string* | :heavy_minus_sign: | N/A | Plex Movie |
|
||||
| `Language` | **string* | :heavy_minus_sign: | N/A | en-US |
|
||||
| `UUID` | **string* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 |
|
||||
| `UpdatedAt` | **int64* | :heavy_minus_sign: | Unix epoch datetime | 1556281940 |
|
||||
| `CreatedAt` | **int64* | :heavy_minus_sign: | Unix epoch datetime | 1556281940 |
|
||||
| `ScannedAt` | **int64* | :heavy_minus_sign: | Unix epoch datetime | 1556281940 |
|
||||
| `Content` | **bool* | :heavy_minus_sign: | N/A | true |
|
||||
| `Directory` | **bool* | :heavy_minus_sign: | N/A | true |
|
||||
| `ContentChangedAt` | **int* | :heavy_minus_sign: | N/A | 3192854 |
|
||||
| `Hidden` | **int* | :heavy_minus_sign: | N/A | 0 |
|
||||
| `Location` | [][operations.Location](../../models/operations/location.md) | :heavy_minus_sign: | N/A | |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false |
|
||||
| `Art` | *string* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg |
|
||||
| `Composite` | *string* | :heavy_check_mark: | The relative path to the composite media item. | /library/sections/1/composite/1743824484 |
|
||||
| `Filters` | *bool* | :heavy_check_mark: | UNKNOWN | true |
|
||||
| `Refreshing` | *bool* | :heavy_check_mark: | Indicates whether the library is currently being refreshed or updated | true |
|
||||
| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png |
|
||||
| `Key` | *string* | :heavy_check_mark: | The library key representing the unique identifier | 1 |
|
||||
| `Type` | [operations.GetAllLibrariesType](../../models/operations/getalllibrariestype.md) | :heavy_check_mark: | N/A | movie |
|
||||
| `Title` | *string* | :heavy_check_mark: | The title of the library | Movies |
|
||||
| `Agent` | *string* | :heavy_check_mark: | The Plex agent used to match and retrieve media metadata. | tv.plex.agents.movie |
|
||||
| `Scanner` | *string* | :heavy_check_mark: | UNKNOWN | Plex Movie |
|
||||
| `Language` | *string* | :heavy_check_mark: | The Plex library language that has been set | en-US |
|
||||
| `UUID` | *string* | :heavy_check_mark: | The universally unique identifier for the library. | e69655a2-ef48-4aba-bb19-01e7d3cc34d6 |
|
||||
| `UpdatedAt` | *int64* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
|
||||
| `CreatedAt` | **int64* | :heavy_minus_sign: | N/A | 1556281940 |
|
||||
| `ScannedAt` | *int64* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
|
||||
| `Content` | *bool* | :heavy_check_mark: | UNKNOWN | true |
|
||||
| `Directory` | *bool* | :heavy_check_mark: | UNKNOWN | true |
|
||||
| `ContentChangedAt` | *int64* | :heavy_check_mark: | Timestamp (in seconds) representing the last time the content was modified.<br/>NOTE: Some Plex server have some absurd values for this field, like 8457612157633039800 so it should be int64<br/> | 9173960 |
|
||||
| `Hidden` | [*operations.Hidden](../../models/operations/hidden.md) | :heavy_minus_sign: | The Plex library visibility setting | 1 |
|
||||
| `Location` | [][operations.GetAllLibrariesLocation](../../models/operations/getalllibrarieslocation.md) | :heavy_check_mark: | N/A | |
|
||||
9
docs/models/operations/getalllibrarieslocation.md
Normal file
9
docs/models/operations/getalllibrarieslocation.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# GetAllLibrariesLocation
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------- | --------------------------- | --------------------------- | --------------------------- | --------------------------- |
|
||||
| `ID` | *int* | :heavy_check_mark: | The ID of the location. | 1 |
|
||||
| `Path` | *string* | :heavy_check_mark: | The path to the media item. | /Movies |
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
||||
| `Size` | *int* | :heavy_check_mark: | N/A | 5 |
|
||||
| `AllowSync` | *bool* | :heavy_check_mark: | N/A | false |
|
||||
| `Title1` | *string* | :heavy_check_mark: | N/A | Plex Library |
|
||||
| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
|
||||
| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false |
|
||||
| `Title1` | *string* | :heavy_check_mark: | The primary title of the media container. | TV Series |
|
||||
| `Directory` | [][operations.GetAllLibrariesDirectory](../../models/operations/getalllibrariesdirectory.md) | :heavy_minus_sign: | N/A | |
|
||||
15
docs/models/operations/getalllibrariestype.md
Normal file
15
docs/models/operations/getalllibrariestype.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# GetAllLibrariesType
|
||||
|
||||
The library type
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ---------------------------- | ---------------------------- |
|
||||
| `GetAllLibrariesTypeMovie` | movie |
|
||||
| `GetAllLibrariesTypeTvShow` | show |
|
||||
| `GetAllLibrariesTypeSeason` | season |
|
||||
| `GetAllLibrariesTypeEpisode` | episode |
|
||||
| `GetAllLibrariesTypeArtist` | artist |
|
||||
| `GetAllLibrariesTypeAlbum` | album |
|
||||
12
docs/models/operations/getallmedialibraryactivedirection.md
Normal file
12
docs/models/operations/getallmedialibraryactivedirection.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# GetAllMediaLibraryActiveDirection
|
||||
|
||||
The direction of the sort. Can be either `asc` or `desc`.
|
||||
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------------------------------------------- | --------------------------------------------- |
|
||||
| `GetAllMediaLibraryActiveDirectionAscending` | asc |
|
||||
| `GetAllMediaLibraryActiveDirectionDescending` | desc |
|
||||
8
docs/models/operations/getallmedialibrarycollection.md
Normal file
8
docs/models/operations/getallmedialibrarycollection.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# GetAllMediaLibraryCollection
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- |
|
||||
| `Tag` | *string* | :heavy_check_mark: | The user-made collection this media item belongs to | My Awesome Collection |
|
||||
8
docs/models/operations/getallmedialibrarycountry.md
Normal file
8
docs/models/operations/getallmedialibrarycountry.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# GetAllMediaLibraryCountry
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
||||
| `Tag` | *string* | :heavy_check_mark: | The country of origin of this media item | United States of America |
|
||||
12
docs/models/operations/getallmedialibrarydefaultdirection.md
Normal file
12
docs/models/operations/getallmedialibrarydefaultdirection.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# GetAllMediaLibraryDefaultDirection
|
||||
|
||||
The direction of the sort. Can be either `asc` or `desc`.
|
||||
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ---------------------------------------------- | ---------------------------------------------- |
|
||||
| `GetAllMediaLibraryDefaultDirectionAscending` | asc |
|
||||
| `GetAllMediaLibraryDefaultDirectionDescending` | desc |
|
||||
8
docs/models/operations/getallmedialibrarydirector.md
Normal file
8
docs/models/operations/getallmedialibrarydirector.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# GetAllMediaLibraryDirector
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------- | -------------------- | -------------------- | -------------------- | -------------------- |
|
||||
| `Tag` | *string* | :heavy_check_mark: | The role of Director | Danny Boyle |
|
||||
11
docs/models/operations/getallmedialibraryfield.md
Normal file
11
docs/models/operations/getallmedialibraryfield.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# GetAllMediaLibraryField
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `Key` | *string* | :heavy_check_mark: | N/A | show.title |
|
||||
| `Title` | *string* | :heavy_check_mark: | N/A | Show Title |
|
||||
| `Type` | *string* | :heavy_check_mark: | N/A | string |
|
||||
| `SubType` | **string* | :heavy_minus_sign: | N/A | rating |
|
||||
9
docs/models/operations/getallmedialibraryfieldtype.md
Normal file
9
docs/models/operations/getallmedialibraryfieldtype.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# GetAllMediaLibraryFieldType
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||
| `Type` | *string* | :heavy_check_mark: | N/A | tag |
|
||||
| `Operator` | [][operations.GetAllMediaLibraryOperator](../../models/operations/getallmedialibraryoperator.md) | :heavy_check_mark: | N/A | |
|
||||
13
docs/models/operations/getallmedialibraryfilter.md
Normal file
13
docs/models/operations/getallmedialibraryfilter.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# GetAllMediaLibraryFilter
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- |
|
||||
| `Filter` | *string* | :heavy_check_mark: | N/A | genre |
|
||||
| `FilterType` | *string* | :heavy_check_mark: | N/A | string |
|
||||
| `Key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/genre?type=2 |
|
||||
| `Title` | *string* | :heavy_check_mark: | N/A | Genre |
|
||||
| `Type` | *string* | :heavy_check_mark: | N/A | filter |
|
||||
| `Advanced` | **bool* | :heavy_minus_sign: | N/A | true |
|
||||
8
docs/models/operations/getallmedialibrarygenre.md
Normal file
8
docs/models/operations/getallmedialibrarygenre.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# GetAllMediaLibraryGenre
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- |
|
||||
| `Tag` | *string* | :heavy_check_mark: | The genre name of this media-item<br/> | Crime |
|
||||
8
docs/models/operations/getallmedialibraryguids.md
Normal file
8
docs/models/operations/getallmedialibraryguids.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# GetAllMediaLibraryGuids
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
||||
| `ID` | **string* | :heavy_minus_sign: | The unique identifier for the Guid. Can be imdb://tt0286347, tmdb://1763, tvdb://2337<br/> | tvdb://2337 |
|
||||
11
docs/models/operations/getallmedialibraryhasthumbnail.md
Normal file
11
docs/models/operations/getallmedialibraryhasthumbnail.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# GetAllMediaLibraryHasThumbnail
|
||||
|
||||
Indicates if the part has a thumbnail.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------------------------------- | ------------------------------------- |
|
||||
| `GetAllMediaLibraryHasThumbnailFalse` | 0 |
|
||||
| `GetAllMediaLibraryHasThumbnailTrue` | 1 |
|
||||
10
docs/models/operations/getallmedialibraryimage.md
Normal file
10
docs/models/operations/getallmedialibraryimage.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# GetAllMediaLibraryImage
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
||||
| `Alt` | *string* | :heavy_check_mark: | N/A | Episode 1 |
|
||||
| `Type` | [operations.GetAllMediaLibraryLibraryResponseType](../../models/operations/getallmedialibrarylibraryresponsetype.md) | :heavy_check_mark: | N/A | background |
|
||||
| `URL` | *string* | :heavy_check_mark: | N/A | /library/metadata/45521/thumb/1644710589 |
|
||||
@@ -0,0 +1,19 @@
|
||||
# GetAllMediaLibraryLibraryOptimizedForStreaming
|
||||
|
||||
Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### GetAllMediaLibraryOptimizedForStreaming1
|
||||
|
||||
```go
|
||||
getAllMediaLibraryLibraryOptimizedForStreaming := operations.CreateGetAllMediaLibraryLibraryOptimizedForStreamingGetAllMediaLibraryOptimizedForStreaming1(operations.GetAllMediaLibraryOptimizedForStreaming1{/* values here */})
|
||||
```
|
||||
|
||||
###
|
||||
|
||||
```go
|
||||
getAllMediaLibraryLibraryOptimizedForStreaming := operations.CreateGetAllMediaLibraryLibraryOptimizedForStreamingBoolean(bool{/* values here */})
|
||||
```
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# GetAllMediaLibraryLibraryResponseType
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| -------------------------------------------------- | -------------------------------------------------- |
|
||||
| `GetAllMediaLibraryLibraryResponseTypeCoverPoster` | coverPoster |
|
||||
| `GetAllMediaLibraryLibraryResponseTypeBackground` | background |
|
||||
| `GetAllMediaLibraryLibraryResponseTypeSnapshot` | snapshot |
|
||||
| `GetAllMediaLibraryLibraryResponseTypeClearLogo` | clearLogo |
|
||||
16
docs/models/operations/getallmedialibrarylibrarytype.md
Normal file
16
docs/models/operations/getallmedialibrarylibrarytype.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# GetAllMediaLibraryLibraryType
|
||||
|
||||
The type of media content
|
||||
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| -------------------------------------- | -------------------------------------- |
|
||||
| `GetAllMediaLibraryLibraryTypeMovie` | movie |
|
||||
| `GetAllMediaLibraryLibraryTypeTvShow` | show |
|
||||
| `GetAllMediaLibraryLibraryTypeSeason` | season |
|
||||
| `GetAllMediaLibraryLibraryTypeEpisode` | episode |
|
||||
| `GetAllMediaLibraryLibraryTypeArtist` | artist |
|
||||
| `GetAllMediaLibraryLibraryTypeAlbum` | album |
|
||||
26
docs/models/operations/getallmedialibrarymedia.md
Normal file
26
docs/models/operations/getallmedialibrarymedia.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# GetAllMediaLibraryMedia
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `ID` | *int64* | :heavy_check_mark: | Unique media identifier. | 387322 |
|
||||
| `Duration` | **int* | :heavy_minus_sign: | Duration of the media in milliseconds. | 9610350 |
|
||||
| `Bitrate` | **int* | :heavy_minus_sign: | Bitrate in bits per second. | 25512 |
|
||||
| `Width` | **int* | :heavy_minus_sign: | Video width in pixels. | 3840 |
|
||||
| `Height` | **int* | :heavy_minus_sign: | Video height in pixels. | 1602 |
|
||||
| `AspectRatio` | **float32* | :heavy_minus_sign: | Aspect ratio of the video. | 2.35 |
|
||||
| `AudioChannels` | **int* | :heavy_minus_sign: | Number of audio channels. | 6 |
|
||||
| `DisplayOffset` | **int* | :heavy_minus_sign: | N/A | 50 |
|
||||
| `AudioCodec` | **string* | :heavy_minus_sign: | Audio codec used. | eac3 |
|
||||
| `VideoCodec` | **string* | :heavy_minus_sign: | Video codec used. | hevc |
|
||||
| `VideoResolution` | **string* | :heavy_minus_sign: | Video resolution (e.g., 4k). | 4k |
|
||||
| `Container` | **string* | :heavy_minus_sign: | File container type. | mkv |
|
||||
| `VideoFrameRate` | **string* | :heavy_minus_sign: | Frame rate of the video. Values found include NTSC, PAL, 24p<br/> | 24p |
|
||||
| `VideoProfile` | **string* | :heavy_minus_sign: | Video profile (e.g., main 10). | main 10 |
|
||||
| `HasVoiceActivity` | **bool* | :heavy_minus_sign: | Indicates whether voice activity is detected. | false |
|
||||
| `AudioProfile` | **string* | :heavy_minus_sign: | The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). | dts |
|
||||
| `OptimizedForStreaming` | [*operations.GetAllMediaLibraryOptimizedForStreaming](../../models/operations/getallmedialibraryoptimizedforstreaming.md) | :heavy_minus_sign: | Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true | |
|
||||
| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||
| `Part` | [][operations.GetAllMediaLibraryPart](../../models/operations/getallmedialibrarypart.md) | :heavy_minus_sign: | An array of parts for this media item. | |
|
||||
26
docs/models/operations/getallmedialibrarymediacontainer.md
Normal file
26
docs/models/operations/getallmedialibrarymediacontainer.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# GetAllMediaLibraryMediaContainer
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||
| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
|
||||
| `TotalSize` | *int* | :heavy_check_mark: | Total number of media items in the library. | 50 |
|
||||
| `Offset` | *int64* | :heavy_check_mark: | Offset value for pagination. | 0 |
|
||||
| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false |
|
||||
| `Art` | *string* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg |
|
||||
| `Content` | *string* | :heavy_check_mark: | The content type or mode. | secondary |
|
||||
| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library |
|
||||
| `LibrarySectionID` | *int64* | :heavy_check_mark: | The unique identifier for the library section. | 2 |
|
||||
| `LibrarySectionTitle` | *string* | :heavy_check_mark: | The title of the library section. | TV Series |
|
||||
| `LibrarySectionUUID` | **string* | :heavy_minus_sign: | The universally unique identifier for the library section. | e69655a2-ef48-4aba-bb19-0cc34d1e7d36 |
|
||||
| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ |
|
||||
| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 |
|
||||
| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png |
|
||||
| `Nocache` | *bool* | :heavy_check_mark: | Specifies whether caching is disabled. | true |
|
||||
| `Title1` | *string* | :heavy_check_mark: | The primary title of the media container. | TV Series |
|
||||
| `Title2` | *string* | :heavy_check_mark: | The secondary title of the media container. | By Starring Actor |
|
||||
| `ViewGroup` | *string* | :heavy_check_mark: | Identifier for the view group layout. | secondary |
|
||||
| `Meta` | [*operations.GetAllMediaLibraryMeta](../../models/operations/getallmedialibrarymeta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.<br/> | |
|
||||
| `Metadata` | [][operations.GetAllMediaLibraryMetadata](../../models/operations/getallmedialibrarymetadata.md) | :heavy_minus_sign: | An array of metadata items. | |
|
||||
12
docs/models/operations/getallmedialibrarymeta.md
Normal file
12
docs/models/operations/getallmedialibrarymeta.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# GetAllMediaLibraryMeta
|
||||
|
||||
The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
|
||||
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
||||
| `Type` | [][operations.GetAllMediaLibraryType](../../models/operations/getallmedialibrarytype.md) | :heavy_minus_sign: | N/A |
|
||||
| `FieldType` | [][operations.GetAllMediaLibraryFieldType](../../models/operations/getallmedialibraryfieldtype.md) | :heavy_minus_sign: | N/A |
|
||||
File diff suppressed because one or more lines are too long
9
docs/models/operations/getallmedialibraryoperator.md
Normal file
9
docs/models/operations/getallmedialibraryoperator.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# GetAllMediaLibraryOperator
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `Key` | *string* | :heavy_check_mark: | N/A | = |
|
||||
| `Title` | *string* | :heavy_check_mark: | N/A | is |
|
||||
@@ -0,0 +1,19 @@
|
||||
# GetAllMediaLibraryOptimizedForStreaming
|
||||
|
||||
Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### OptimizedForStreaming1
|
||||
|
||||
```go
|
||||
getAllMediaLibraryOptimizedForStreaming := operations.CreateGetAllMediaLibraryOptimizedForStreamingOptimizedForStreaming1(operations.OptimizedForStreaming1{/* values here */})
|
||||
```
|
||||
|
||||
###
|
||||
|
||||
```go
|
||||
getAllMediaLibraryOptimizedForStreaming := operations.CreateGetAllMediaLibraryOptimizedForStreamingBoolean(bool{/* values here */})
|
||||
```
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# GetAllMediaLibraryOptimizedForStreaming1
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ---------------------------------------------- | ---------------------------------------------- |
|
||||
| `GetAllMediaLibraryOptimizedForStreaming1Zero` | 0 |
|
||||
| `GetAllMediaLibraryOptimizedForStreaming1One` | 1 |
|
||||
23
docs/models/operations/getallmedialibrarypart.md
Normal file
23
docs/models/operations/getallmedialibrarypart.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# GetAllMediaLibraryPart
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `Accessible` | **bool* | :heavy_minus_sign: | Indicates if the part is accessible. | true |
|
||||
| `Exists` | **bool* | :heavy_minus_sign: | Indicates if the part exists. | true |
|
||||
| `ID` | *int64* | :heavy_check_mark: | Unique part identifier. | 418385 |
|
||||
| `Key` | *string* | :heavy_check_mark: | Key to access this part. | /library/parts/418385/1735864239/file.mkv |
|
||||
| `Indexes` | **string* | :heavy_minus_sign: | N/A | sd |
|
||||
| `Duration` | **int* | :heavy_minus_sign: | Duration of the part in milliseconds. | 9610350 |
|
||||
| `File` | *string* | :heavy_check_mark: | File path for the part. | /mnt/Movies_1/W/Wicked (2024).mkv |
|
||||
| `Size` | *int64* | :heavy_check_mark: | File size in bytes. | 30649952104 |
|
||||
| `PacketLength` | **int* | :heavy_minus_sign: | N/A | 188 |
|
||||
| `Container` | **string* | :heavy_minus_sign: | Container format of the part. | mkv |
|
||||
| `VideoProfile` | **string* | :heavy_minus_sign: | Video profile for the part. | main 10 |
|
||||
| `AudioProfile` | **string* | :heavy_minus_sign: | The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). | dts |
|
||||
| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||
| `OptimizedForStreaming` | [*operations.GetAllMediaLibraryLibraryOptimizedForStreaming](../../models/operations/getallmedialibrarylibraryoptimizedforstreaming.md) | :heavy_minus_sign: | Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true | |
|
||||
| `HasThumbnail` | [*operations.GetAllMediaLibraryHasThumbnail](../../models/operations/getallmedialibraryhasthumbnail.md) | :heavy_minus_sign: | N/A | 1 |
|
||||
| `Stream` | [][operations.GetAllMediaLibraryStream](../../models/operations/getallmedialibrarystream.md) | :heavy_minus_sign: | An array of streams for this part. | |
|
||||
@@ -0,0 +1,12 @@
|
||||
# GetAllMediaLibraryQueryParamIncludeMeta
|
||||
|
||||
Adds the Meta object to the response
|
||||
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------------------------------------------ | ------------------------------------------------ |
|
||||
| `GetAllMediaLibraryQueryParamIncludeMetaDisable` | 0 |
|
||||
| `GetAllMediaLibraryQueryParamIncludeMetaEnable` | 1 |
|
||||
22
docs/models/operations/getallmedialibraryqueryparamtype.md
Normal file
22
docs/models/operations/getallmedialibraryqueryparamtype.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# GetAllMediaLibraryQueryParamType
|
||||
|
||||
The type of media to retrieve or filter by.
|
||||
1 = movie
|
||||
2 = show
|
||||
3 = season
|
||||
4 = episode
|
||||
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
||||
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ----------------------------------------- | ----------------------------------------- |
|
||||
| `GetAllMediaLibraryQueryParamTypeMovie` | 1 |
|
||||
| `GetAllMediaLibraryQueryParamTypeTvShow` | 2 |
|
||||
| `GetAllMediaLibraryQueryParamTypeSeason` | 3 |
|
||||
| `GetAllMediaLibraryQueryParamTypeEpisode` | 4 |
|
||||
| `GetAllMediaLibraryQueryParamTypeAudio` | 8 |
|
||||
| `GetAllMediaLibraryQueryParamTypeAlbum` | 9 |
|
||||
| `GetAllMediaLibraryQueryParamTypeTrack` | 10 |
|
||||
16
docs/models/operations/getallmedialibraryrequest.md
Normal file
16
docs/models/operations/getallmedialibraryrequest.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# GetAllMediaLibraryRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
|
||||
| `Type` | [operations.GetAllMediaLibraryQueryParamType](../../models/operations/getallmedialibraryqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.<br/>1 = movie<br/>2 = show<br/>3 = season<br/>4 = episode<br/>E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/> | 2 |
|
||||
| `IncludeMeta` | [*operations.GetAllMediaLibraryQueryParamIncludeMeta](../../models/operations/getallmedialibraryqueryparamincludemeta.md) | :heavy_minus_sign: | Adds the Meta object to the response<br/> | 1 |
|
||||
| `IncludeGuids` | [*operations.QueryParamIncludeGuids](../../models/operations/queryparamincludeguids.md) | :heavy_minus_sign: | Adds the Guid object to the response<br/> | 1 |
|
||||
| `IncludeAdvanced` | [*operations.IncludeAdvanced](../../models/operations/includeadvanced.md) | :heavy_minus_sign: | N/A | 1 |
|
||||
| `IncludeCollections` | [*operations.QueryParamIncludeCollections](../../models/operations/queryparamincludecollections.md) | :heavy_minus_sign: | N/A | 1 |
|
||||
| `IncludeExternalMedia` | [*operations.QueryParamIncludeExternalMedia](../../models/operations/queryparamincludeexternalmedia.md) | :heavy_minus_sign: | N/A | 1 |
|
||||
| `XPlexContainerStart` | **int* | :heavy_minus_sign: | The index of the first item to return. If not specified, the first item will be returned.<br/>If the number of items exceeds the limit, the response will be paginated.<br/>By default this is 0<br/> | 0 |
|
||||
| `XPlexContainerSize` | **int* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.<br/>If the number of items exceeds the limit, the response will be paginated.<br/>By default this is 50<br/> | 50 |
|
||||
11
docs/models/operations/getallmedialibraryresponse.md
Normal file
11
docs/models/operations/getallmedialibraryresponse.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# GetAllMediaLibraryResponse
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
||||
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||
| `Object` | [*operations.GetAllMediaLibraryResponseBody](../../models/operations/getallmedialibraryresponsebody.md) | :heavy_minus_sign: | Successful response containing media container data. |
|
||||
10
docs/models/operations/getallmedialibraryresponsebody.md
Normal file
10
docs/models/operations/getallmedialibraryresponsebody.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# GetAllMediaLibraryResponseBody
|
||||
|
||||
Successful response containing media container data.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
||||
| `MediaContainer` | [*operations.GetAllMediaLibraryMediaContainer](../../models/operations/getallmedialibrarymediacontainer.md) | :heavy_minus_sign: | N/A |
|
||||
8
docs/models/operations/getallmedialibraryrole.md
Normal file
8
docs/models/operations/getallmedialibraryrole.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# GetAllMediaLibraryRole
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
|
||||
| `Tag` | *string* | :heavy_check_mark: | The display tag for the actor (typically the actor's name). | Teller |
|
||||
15
docs/models/operations/getallmedialibrarysort.md
Normal file
15
docs/models/operations/getallmedialibrarysort.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# GetAllMediaLibrarySort
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
||||
| `Default` | **string* | :heavy_minus_sign: | N/A | asc |
|
||||
| `Active` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||
| `ActiveDirection` | [*operations.GetAllMediaLibraryActiveDirection](../../models/operations/getallmedialibraryactivedirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.<br/> | asc |
|
||||
| `DefaultDirection` | [*operations.GetAllMediaLibraryDefaultDirection](../../models/operations/getallmedialibrarydefaultdirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.<br/> | asc |
|
||||
| `DescKey` | **string* | :heavy_minus_sign: | N/A | titleSort:desc |
|
||||
| `FirstCharacterKey` | **string* | :heavy_minus_sign: | N/A | /library/sections/2/firstCharacter |
|
||||
| `Key` | *string* | :heavy_check_mark: | N/A | titleSort |
|
||||
| `Title` | *string* | :heavy_check_mark: | N/A | Title |
|
||||
58
docs/models/operations/getallmedialibrarystream.md
Normal file
58
docs/models/operations/getallmedialibrarystream.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# GetAllMediaLibraryStream
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
||||
| `ID` | *int64* | :heavy_check_mark: | Unique stream identifier. | 1002625 |
|
||||
| `StreamType` | [operations.GetAllMediaLibraryStreamType](../../models/operations/getallmedialibrarystreamtype.md) | :heavy_check_mark: | Stream type:<br/> - 1 = video<br/> - 2 = audio<br/> - 3 = subtitle<br/> | 1 |
|
||||
| `Format` | **string* | :heavy_minus_sign: | Format of the stream (e.g., srt). | srt |
|
||||
| `Default` | **bool* | :heavy_minus_sign: | Indicates if this stream is default. | true |
|
||||
| `Codec` | *string* | :heavy_check_mark: | Codec used by the stream. | hevc |
|
||||
| `Index` | **int* | :heavy_minus_sign: | Index of the stream. | 0 |
|
||||
| `Bitrate` | **int* | :heavy_minus_sign: | Bitrate of the stream. | 24743 |
|
||||
| `Language` | **string* | :heavy_minus_sign: | Language of the stream. | English |
|
||||
| `LanguageTag` | **string* | :heavy_minus_sign: | Language tag (e.g., en). | en |
|
||||
| `LanguageCode` | **string* | :heavy_minus_sign: | ISO language code. | eng |
|
||||
| `HeaderCompression` | **bool* | :heavy_minus_sign: | Indicates whether header compression is enabled. | true |
|
||||
| `DOVIBLCompatID` | **int* | :heavy_minus_sign: | Dolby Vision BL compatibility ID. | 1 |
|
||||
| `DOVIBLPresent` | **bool* | :heavy_minus_sign: | Indicates if Dolby Vision BL is present. | true |
|
||||
| `DOVIELPresent` | **bool* | :heavy_minus_sign: | Indicates if Dolby Vision EL is present. | false |
|
||||
| `DOVILevel` | **int* | :heavy_minus_sign: | Dolby Vision level. | 6 |
|
||||
| `DOVIPresent` | **bool* | :heavy_minus_sign: | Indicates if Dolby Vision is present. | true |
|
||||
| `DOVIProfile` | **int* | :heavy_minus_sign: | Dolby Vision profile. | 8 |
|
||||
| `DOVIRPUPresent` | **bool* | :heavy_minus_sign: | Indicates if Dolby Vision RPU is present. | true |
|
||||
| `DOVIVersion` | **string* | :heavy_minus_sign: | Dolby Vision version. | 1.0 |
|
||||
| `BitDepth` | **int* | :heavy_minus_sign: | Bit depth of the video stream. | 10 |
|
||||
| `ChromaLocation` | **string* | :heavy_minus_sign: | Chroma sample location. | topleft |
|
||||
| `ChromaSubsampling` | **string* | :heavy_minus_sign: | Chroma subsampling format. | 4:2:0 |
|
||||
| `CodedHeight` | **int* | :heavy_minus_sign: | Coded video height. | 1608 |
|
||||
| `CodedWidth` | **int* | :heavy_minus_sign: | Coded video width. | 3840 |
|
||||
| `ClosedCaptions` | **bool* | :heavy_minus_sign: | N/A | true |
|
||||
| `ColorPrimaries` | **string* | :heavy_minus_sign: | Color primaries used. | bt2020 |
|
||||
| `ColorRange` | **string* | :heavy_minus_sign: | Color range (e.g., tv). | tv |
|
||||
| `ColorSpace` | **string* | :heavy_minus_sign: | Color space. | bt2020nc |
|
||||
| `ColorTrc` | **string* | :heavy_minus_sign: | Color transfer characteristics. | smpte2084 |
|
||||
| `FrameRate` | **float32* | :heavy_minus_sign: | Frame rate of the stream. | 23.976 |
|
||||
| `Key` | **string* | :heavy_minus_sign: | Key to access this stream part. | /library/streams/216389 |
|
||||
| `Height` | **int* | :heavy_minus_sign: | Height of the video stream. | 1602 |
|
||||
| `Level` | **int* | :heavy_minus_sign: | Video level. | 150 |
|
||||
| `Original` | **bool* | :heavy_minus_sign: | Indicates if this is the original stream. | true |
|
||||
| `HasScalingMatrix` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||
| `Profile` | **string* | :heavy_minus_sign: | Video profile. | main 10 |
|
||||
| `ScanType` | **string* | :heavy_minus_sign: | N/A | progressive |
|
||||
| `EmbeddedInVideo` | **string* | :heavy_minus_sign: | N/A | progressive |
|
||||
| `RefFrames` | **int* | :heavy_minus_sign: | Number of reference frames. | 1 |
|
||||
| `Width` | **int* | :heavy_minus_sign: | Width of the video stream. | 3840 |
|
||||
| `DisplayTitle` | *string* | :heavy_check_mark: | Display title for the stream. | 4K DoVi/HDR10 (HEVC Main 10) |
|
||||
| `ExtendedDisplayTitle` | *string* | :heavy_check_mark: | Extended display title for the stream. | 4K DoVi/HDR10 (HEVC Main 10) |
|
||||
| `Selected` | **bool* | :heavy_minus_sign: | Indicates if this stream is selected (applicable for audio streams). | true |
|
||||
| `Forced` | **bool* | :heavy_minus_sign: | N/A | true |
|
||||
| `Channels` | **int* | :heavy_minus_sign: | Number of audio channels (for audio streams). | 6 |
|
||||
| `AudioChannelLayout` | **string* | :heavy_minus_sign: | Audio channel layout. | 5.1(side) |
|
||||
| `SamplingRate` | **int* | :heavy_minus_sign: | Sampling rate for the audio stream. | 48000 |
|
||||
| `CanAutoSync` | **bool* | :heavy_minus_sign: | Indicates if the stream can auto-sync. | false |
|
||||
| `HearingImpaired` | **bool* | :heavy_minus_sign: | Indicates if the stream is for the hearing impaired. | true |
|
||||
| `Dub` | **bool* | :heavy_minus_sign: | Indicates if the stream is a dub. | true |
|
||||
| `Title` | **string* | :heavy_minus_sign: | Optional title for the stream (e.g., language variant). | SDH |
|
||||
16
docs/models/operations/getallmedialibrarystreamtype.md
Normal file
16
docs/models/operations/getallmedialibrarystreamtype.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# GetAllMediaLibraryStreamType
|
||||
|
||||
Stream type:
|
||||
- 1 = video
|
||||
- 2 = audio
|
||||
- 3 = subtitle
|
||||
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| -------------------------------------- | -------------------------------------- |
|
||||
| `GetAllMediaLibraryStreamTypeVideo` | 1 |
|
||||
| `GetAllMediaLibraryStreamTypeAudio` | 2 |
|
||||
| `GetAllMediaLibraryStreamTypeSubtitle` | 3 |
|
||||
15
docs/models/operations/getallmedialibrarytype.md
Normal file
15
docs/models/operations/getallmedialibrarytype.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# GetAllMediaLibraryType
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
||||
| `Key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/all?type=2 |
|
||||
| `Type` | *string* | :heavy_check_mark: | N/A | filter |
|
||||
| `Subtype` | **string* | :heavy_minus_sign: | N/A | clip |
|
||||
| `Title` | *string* | :heavy_check_mark: | N/A | TV Shows |
|
||||
| `Active` | *bool* | :heavy_check_mark: | N/A | false |
|
||||
| `Filter` | [][operations.GetAllMediaLibraryFilter](../../models/operations/getallmedialibraryfilter.md) | :heavy_minus_sign: | N/A | |
|
||||
| `Sort` | [][operations.GetAllMediaLibrarySort](../../models/operations/getallmedialibrarysort.md) | :heavy_minus_sign: | N/A | |
|
||||
| `Field` | [][operations.GetAllMediaLibraryField](../../models/operations/getallmedialibraryfield.md) | :heavy_minus_sign: | N/A | |
|
||||
11
docs/models/operations/getallmedialibraryultrablurcolors.md
Normal file
11
docs/models/operations/getallmedialibraryultrablurcolors.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# GetAllMediaLibraryUltraBlurColors
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `TopLeft` | *string* | :heavy_check_mark: | N/A | 11333b |
|
||||
| `TopRight` | *string* | :heavy_check_mark: | N/A | 0a232d |
|
||||
| `BottomRight` | *string* | :heavy_check_mark: | N/A | 73958 |
|
||||
| `BottomLeft` | *string* | :heavy_check_mark: | N/A | 1f5066 |
|
||||
8
docs/models/operations/getallmedialibrarywriter.md
Normal file
8
docs/models/operations/getallmedialibrarywriter.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# GetAllMediaLibraryWriter
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `Tag` | *string* | :heavy_check_mark: | The role of Writer | Jamie P. Hanson |
|
||||
@@ -10,4 +10,4 @@
|
||||
| `Height` | *int64* | :heavy_check_mark: | N/A | 396 |
|
||||
| `MinSize` | *int64* | :heavy_check_mark: | N/A | 1 |
|
||||
| `Upscale` | *int64* | :heavy_check_mark: | N/A | 1 |
|
||||
| `XPlexToken` | *string* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf |
|
||||
| `XPlexToken` | *string* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf |
|
||||
10
docs/models/operations/getcountrieslibrarydirectory.md
Normal file
10
docs/models/operations/getcountrieslibrarydirectory.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# GetCountriesLibraryDirectory
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- |
|
||||
| `FastKey` | *string* | :heavy_check_mark: | N/A | /library/sections/2/all?country=15491 |
|
||||
| `Key` | *string* | :heavy_check_mark: | N/A | 15491 |
|
||||
| `Title` | *string* | :heavy_check_mark: | N/A | Japan |
|
||||
20
docs/models/operations/getcountrieslibrarymediacontainer.md
Normal file
20
docs/models/operations/getcountrieslibrarymediacontainer.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# GetCountriesLibraryMediaContainer
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||
| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
|
||||
| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false |
|
||||
| `Art` | *string* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg |
|
||||
| `Content` | *string* | :heavy_check_mark: | The content type or mode. | secondary |
|
||||
| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library |
|
||||
| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ |
|
||||
| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 |
|
||||
| `Nocache` | *bool* | :heavy_check_mark: | Specifies whether caching is disabled. | true |
|
||||
| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png |
|
||||
| `Title1` | *string* | :heavy_check_mark: | The primary title of the media container. | TV Series |
|
||||
| `Title2` | *string* | :heavy_check_mark: | The secondary title of the media container. | By Starring Actor |
|
||||
| `ViewGroup` | *string* | :heavy_check_mark: | Identifier for the view group layout. | secondary |
|
||||
| `Directory` | [][operations.GetCountriesLibraryDirectory](../../models/operations/getcountrieslibrarydirectory.md) | :heavy_minus_sign: | N/A | |
|
||||
22
docs/models/operations/getcountrieslibraryqueryparamtype.md
Normal file
22
docs/models/operations/getcountrieslibraryqueryparamtype.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# GetCountriesLibraryQueryParamType
|
||||
|
||||
The type of media to retrieve or filter by.
|
||||
1 = movie
|
||||
2 = show
|
||||
3 = season
|
||||
4 = episode
|
||||
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
||||
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------------------------------------ | ------------------------------------------ |
|
||||
| `GetCountriesLibraryQueryParamTypeMovie` | 1 |
|
||||
| `GetCountriesLibraryQueryParamTypeTvShow` | 2 |
|
||||
| `GetCountriesLibraryQueryParamTypeSeason` | 3 |
|
||||
| `GetCountriesLibraryQueryParamTypeEpisode` | 4 |
|
||||
| `GetCountriesLibraryQueryParamTypeAudio` | 8 |
|
||||
| `GetCountriesLibraryQueryParamTypeAlbum` | 9 |
|
||||
| `GetCountriesLibraryQueryParamTypeTrack` | 10 |
|
||||
9
docs/models/operations/getcountrieslibraryrequest.md
Normal file
9
docs/models/operations/getcountrieslibraryrequest.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# GetCountriesLibraryRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
|
||||
| `Type` | [operations.GetCountriesLibraryQueryParamType](../../models/operations/getcountrieslibraryqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.<br/>1 = movie<br/>2 = show<br/>3 = season<br/>4 = episode<br/>E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/> | 2 |
|
||||
11
docs/models/operations/getcountrieslibraryresponse.md
Normal file
11
docs/models/operations/getcountrieslibraryresponse.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# GetCountriesLibraryResponse
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
|
||||
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||
| `Object` | [*operations.GetCountriesLibraryResponseBody](../../models/operations/getcountrieslibraryresponsebody.md) | :heavy_minus_sign: | Successful response containing media container data. |
|
||||
10
docs/models/operations/getcountrieslibraryresponsebody.md
Normal file
10
docs/models/operations/getcountrieslibraryresponsebody.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# GetCountriesLibraryResponseBody
|
||||
|
||||
Successful response containing media container data.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
||||
| `MediaContainer` | [*operations.GetCountriesLibraryMediaContainer](../../models/operations/getcountrieslibrarymediacontainer.md) | :heavy_minus_sign: | N/A |
|
||||
11
docs/models/operations/getgenreslibrarydirectory.md
Normal file
11
docs/models/operations/getgenreslibrarydirectory.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# GetGenresLibraryDirectory
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- |
|
||||
| `FastKey` | *string* | :heavy_check_mark: | N/A | /library/sections/10/all?genre=89 |
|
||||
| `Key` | *string* | :heavy_check_mark: | N/A | 89 |
|
||||
| `Title` | *string* | :heavy_check_mark: | N/A | Action |
|
||||
| `Type` | *string* | :heavy_check_mark: | N/A | genre |
|
||||
20
docs/models/operations/getgenreslibrarymediacontainer.md
Normal file
20
docs/models/operations/getgenreslibrarymediacontainer.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# GetGenresLibraryMediaContainer
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
||||
| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
|
||||
| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false |
|
||||
| `Art` | *string* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg |
|
||||
| `Content` | *string* | :heavy_check_mark: | The content type or mode. | secondary |
|
||||
| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library |
|
||||
| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ |
|
||||
| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 |
|
||||
| `Nocache` | *bool* | :heavy_check_mark: | Specifies whether caching is disabled. | true |
|
||||
| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png |
|
||||
| `Title1` | *string* | :heavy_check_mark: | The primary title of the media container. | TV Series |
|
||||
| `Title2` | *string* | :heavy_check_mark: | The secondary title of the media container. | By Starring Actor |
|
||||
| `ViewGroup` | *string* | :heavy_check_mark: | Identifier for the view group layout. | secondary |
|
||||
| `Directory` | [][operations.GetGenresLibraryDirectory](../../models/operations/getgenreslibrarydirectory.md) | :heavy_minus_sign: | N/A | |
|
||||
22
docs/models/operations/getgenreslibraryqueryparamtype.md
Normal file
22
docs/models/operations/getgenreslibraryqueryparamtype.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# GetGenresLibraryQueryParamType
|
||||
|
||||
The type of media to retrieve or filter by.
|
||||
1 = movie
|
||||
2 = show
|
||||
3 = season
|
||||
4 = episode
|
||||
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
||||
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------------------------------------- | --------------------------------------- |
|
||||
| `GetGenresLibraryQueryParamTypeMovie` | 1 |
|
||||
| `GetGenresLibraryQueryParamTypeTvShow` | 2 |
|
||||
| `GetGenresLibraryQueryParamTypeSeason` | 3 |
|
||||
| `GetGenresLibraryQueryParamTypeEpisode` | 4 |
|
||||
| `GetGenresLibraryQueryParamTypeAudio` | 8 |
|
||||
| `GetGenresLibraryQueryParamTypeAlbum` | 9 |
|
||||
| `GetGenresLibraryQueryParamTypeTrack` | 10 |
|
||||
9
docs/models/operations/getgenreslibraryrequest.md
Normal file
9
docs/models/operations/getgenreslibraryrequest.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# GetGenresLibraryRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
|
||||
| `Type` | [operations.GetGenresLibraryQueryParamType](../../models/operations/getgenreslibraryqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.<br/>1 = movie<br/>2 = show<br/>3 = season<br/>4 = episode<br/>E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/> | 2 |
|
||||
11
docs/models/operations/getgenreslibraryresponse.md
Normal file
11
docs/models/operations/getgenreslibraryresponse.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# GetGenresLibraryResponse
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
||||
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||
| `Object` | [*operations.GetGenresLibraryResponseBody](../../models/operations/getgenreslibraryresponsebody.md) | :heavy_minus_sign: | Successful response containing media container data. |
|
||||
10
docs/models/operations/getgenreslibraryresponsebody.md
Normal file
10
docs/models/operations/getgenreslibraryresponsebody.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# GetGenresLibraryResponseBody
|
||||
|
||||
Successful response containing media container data.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
||||
| `MediaContainer` | [*operations.GetGenresLibraryMediaContainer](../../models/operations/getgenreslibrarymediacontainer.md) | :heavy_minus_sign: | N/A |
|
||||
@@ -13,7 +13,7 @@ Geo location data
|
||||
| `City` | *string* | :heavy_check_mark: | The name of the city. | Amsterdam |
|
||||
| `EuropeanUnionMember` | **bool* | :heavy_minus_sign: | Indicates if the country is a member of the European Union. | true |
|
||||
| `TimeZone` | *string* | :heavy_check_mark: | The time zone of the country. | America/St_Thomas |
|
||||
| `PostalCode` | *int64* | :heavy_check_mark: | The postal code of the location. | 802 |
|
||||
| `PostalCode` | *string* | :heavy_check_mark: | The postal code of the location. | 802 |
|
||||
| `InPrivacyRestrictedCountry` | **bool* | :heavy_minus_sign: | Indicates if the country has privacy restrictions. | true |
|
||||
| `InPrivacyRestrictedRegion` | **bool* | :heavy_minus_sign: | Indicates if the region has privacy restrictions. | true |
|
||||
| `Subdivisions` | *string* | :heavy_check_mark: | The name of the primary administrative subdivision. | Saint Thomas |
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user