mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 20:47:48 +00:00
Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c4caee48d | ||
|
|
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 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1 +1,5 @@
|
|||||||
|
.DS_Store
|
||||||
|
**/.speakeasy/temp/
|
||||||
|
**/.speakeasy/logs/
|
||||||
|
.speakeasy/reports
|
||||||
# .gitignore
|
# .gitignore
|
||||||
|
|||||||
1079
.speakeasy/gen.lock
1079
.speakeasy/gen.lock
File diff suppressed because one or more lines are too long
@@ -4,18 +4,24 @@ generation:
|
|||||||
maintainOpenAPIOrder: true
|
maintainOpenAPIOrder: true
|
||||||
usageSnippets:
|
usageSnippets:
|
||||||
optionalPropertyRendering: withExample
|
optionalPropertyRendering: withExample
|
||||||
|
sdkInitStyle: constructor
|
||||||
useClassNamesForArrayFields: true
|
useClassNamesForArrayFields: true
|
||||||
fixes:
|
fixes:
|
||||||
nameResolutionDec2023: true
|
nameResolutionDec2023: true
|
||||||
|
nameResolutionFeb2025: false
|
||||||
parameterOrderingFeb2024: true
|
parameterOrderingFeb2024: true
|
||||||
requestResponseComponentNamesFeb2024: true
|
requestResponseComponentNamesFeb2024: true
|
||||||
|
securityFeb2025: false
|
||||||
|
sharedErrorComponentsApr2025: false
|
||||||
auth:
|
auth:
|
||||||
oAuth2ClientCredentialsEnabled: true
|
oAuth2ClientCredentialsEnabled: true
|
||||||
|
oAuth2PasswordEnabled: false
|
||||||
go:
|
go:
|
||||||
version: 0.12.0
|
version: 0.22.0
|
||||||
additionalDependencies: {}
|
additionalDependencies: {}
|
||||||
allowUnknownFieldsInWeakUnions: false
|
allowUnknownFieldsInWeakUnions: false
|
||||||
clientServerStatusCodesAsErrors: true
|
clientServerStatusCodesAsErrors: true
|
||||||
|
defaultErrorName: SDKError
|
||||||
flattenGlobalSecurity: true
|
flattenGlobalSecurity: true
|
||||||
imports:
|
imports:
|
||||||
option: openapi
|
option: openapi
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
speakeasyVersion: 1.401.2
|
speakeasyVersion: 1.555.3
|
||||||
sources:
|
sources:
|
||||||
my-source:
|
my-source:
|
||||||
sourceNamespace: my-source
|
sourceNamespace: my-source
|
||||||
@@ -9,19 +9,19 @@ sources:
|
|||||||
- main
|
- main
|
||||||
plexapi:
|
plexapi:
|
||||||
sourceNamespace: plexapi
|
sourceNamespace: plexapi
|
||||||
sourceRevisionDigest: sha256:5aa71ad96ca6de91143ee513c9880e08e555e7748fb4b5f8d069c6ab0c8f3069
|
sourceRevisionDigest: sha256:78d07ad78ff60d0e9918696208d8c68a562e170d4e9c431797c02995fb8816d0
|
||||||
sourceBlobDigest: sha256:1cbef844e2856c2eabba4bd6d677d96c572fed13b27978d0d953aa06b224c02f
|
sourceBlobDigest: sha256:d38dd2a36c1b2fd73409267f7b30c2d5d45d709616141803ea01db424ec68ae4
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- main
|
- speakeasy-sdk-regen-1749082259
|
||||||
targets:
|
targets:
|
||||||
plexgo:
|
plexgo:
|
||||||
source: plexapi
|
source: plexapi
|
||||||
sourceNamespace: plexapi
|
sourceNamespace: plexapi
|
||||||
sourceRevisionDigest: sha256:5aa71ad96ca6de91143ee513c9880e08e555e7748fb4b5f8d069c6ab0c8f3069
|
sourceRevisionDigest: sha256:78d07ad78ff60d0e9918696208d8c68a562e170d4e9c431797c02995fb8816d0
|
||||||
sourceBlobDigest: sha256:1cbef844e2856c2eabba4bd6d677d96c572fed13b27978d0d953aa06b224c02f
|
sourceBlobDigest: sha256:d38dd2a36c1b2fd73409267f7b30c2d5d45d709616141803ea01db424ec68ae4
|
||||||
codeSamplesNamespace: code-samples-go-plexgo
|
codeSamplesNamespace: code-samples-go-plexgo
|
||||||
codeSamplesRevisionDigest: sha256:366a4aca940e2161009b4efe3c83407ecf0d02ac6a9e3420964c593aa24e3a34
|
codeSamplesRevisionDigest: sha256:92b1cc82ef36c033e0829db07006a9d1fd240244dd846ed236c51115a902001a
|
||||||
workflow:
|
workflow:
|
||||||
workflowVersion: 1.0.0
|
workflowVersion: 1.0.0
|
||||||
speakeasyVersion: latest
|
speakeasyVersion: latest
|
||||||
@@ -37,3 +37,5 @@ workflow:
|
|||||||
output: codeSamples.yaml
|
output: codeSamples.yaml
|
||||||
registry:
|
registry:
|
||||||
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-go-plexgo
|
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-go-plexgo
|
||||||
|
labelOverride:
|
||||||
|
fixedValue: PlexGO
|
||||||
|
|||||||
@@ -12,3 +12,5 @@ targets:
|
|||||||
output: codeSamples.yaml
|
output: codeSamples.yaml
|
||||||
registry:
|
registry:
|
||||||
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-go-plexgo
|
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-go-plexgo
|
||||||
|
labelOverride:
|
||||||
|
fixedValue: PlexGO
|
||||||
|
|||||||
244
README.md
244
README.md
@@ -11,21 +11,53 @@
|
|||||||
## Summary
|
## Summary
|
||||||
|
|
||||||
Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
|
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] -->
|
<!-- End Summary [summary] -->
|
||||||
|
|
||||||
<!-- Start Table of Contents [toc] -->
|
<!-- Start Table of Contents [toc] -->
|
||||||
## Table of Contents
|
## 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] -->
|
<!-- End Table of Contents [toc] -->
|
||||||
|
|
||||||
<!-- Start SDK Installation [installation] -->
|
<!-- Start SDK Installation [installation] -->
|
||||||
@@ -52,16 +84,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
s := plexgo.New(
|
s := plexgo.New(
|
||||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
||||||
plexgo.WithClientName("Plex Web"),
|
|
||||||
plexgo.WithClientVersion("4.133.0"),
|
|
||||||
plexgo.WithClientPlatform("Chrome"),
|
|
||||||
plexgo.WithDeviceName("Linux"),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
ctx := context.Background()
|
|
||||||
res, err := s.Server.GetServerCapabilities(ctx)
|
res, err := s.Server.GetServerCapabilities(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
@@ -103,22 +131,31 @@ func main() {
|
|||||||
### [Hubs](docs/sdks/hubs/README.md)
|
### [Hubs](docs/sdks/hubs/README.md)
|
||||||
|
|
||||||
* [GetGlobalHubs](docs/sdks/hubs/README.md#getglobalhubs) - Get Global Hubs
|
* [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
|
* [GetLibraryHubs](docs/sdks/hubs/README.md#getlibraryhubs) - Get library specific hubs
|
||||||
|
|
||||||
### [Library](docs/sdks/library/README.md)
|
### [Library](docs/sdks/library/README.md)
|
||||||
|
|
||||||
* [GetFileHash](docs/sdks/library/README.md#getfilehash) - Get Hash Value
|
* [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
|
* [GetAllLibraries](docs/sdks/library/README.md#getalllibraries) - Get All Libraries
|
||||||
* [GetLibraryDetails](docs/sdks/library/README.md#getlibrarydetails) - Get Library Details
|
* [GetLibraryDetails](docs/sdks/library/README.md#getlibrarydetails) - Get Library Details
|
||||||
* [DeleteLibrary](docs/sdks/library/README.md#deletelibrary) - Delete Library Section
|
* [DeleteLibrary](docs/sdks/library/README.md#deletelibrary) - Delete Library Section
|
||||||
* [GetLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items
|
* [GetLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items
|
||||||
|
* [GetLibrarySectionsAll](docs/sdks/library/README.md#getlibrarysectionsall) - Get Library section media by tag ALL
|
||||||
* [GetRefreshLibraryMetadata](docs/sdks/library/README.md#getrefreshlibrarymetadata) - Refresh Metadata Of The Library
|
* [GetRefreshLibraryMetadata](docs/sdks/library/README.md#getrefreshlibrarymetadata) - Refresh Metadata Of The Library
|
||||||
* [GetSearchLibrary](docs/sdks/library/README.md#getsearchlibrary) - Search Library
|
* [GetSearchLibrary](docs/sdks/library/README.md#getsearchlibrary) - Search Library
|
||||||
* [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
|
* [GetMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children
|
||||||
* [GetTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content
|
* [GetTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content
|
||||||
* [GetOnDeck](docs/sdks/library/README.md#getondeck) - Get On Deck
|
|
||||||
|
|
||||||
### [Log](docs/sdks/log/README.md)
|
### [Log](docs/sdks/log/README.md)
|
||||||
|
|
||||||
@@ -194,6 +231,10 @@ func main() {
|
|||||||
* [CheckForUpdates](docs/sdks/updater/README.md#checkforupdates) - Checking for updates
|
* [CheckForUpdates](docs/sdks/updater/README.md#checkforupdates) - Checking for updates
|
||||||
* [ApplyUpdates](docs/sdks/updater/README.md#applyupdates) - Apply 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)
|
### [Video](docs/sdks/video/README.md)
|
||||||
|
|
||||||
* [GetTimeline](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item
|
* [GetTimeline](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item
|
||||||
@@ -224,16 +265,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
s := plexgo.New(
|
s := plexgo.New(
|
||||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
||||||
plexgo.WithClientName("Plex Web"),
|
|
||||||
plexgo.WithClientVersion("4.133.0"),
|
|
||||||
plexgo.WithClientPlatform("Chrome"),
|
|
||||||
plexgo.WithDeviceName("Linux"),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
ctx := context.Background()
|
|
||||||
res, err := s.Server.GetServerCapabilities(ctx, operations.WithRetries(
|
res, err := s.Server.GetServerCapabilities(ctx, operations.WithRetries(
|
||||||
retry.Config{
|
retry.Config{
|
||||||
Strategy: "backoff",
|
Strategy: "backoff",
|
||||||
@@ -267,6 +304,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
s := plexgo.New(
|
s := plexgo.New(
|
||||||
plexgo.WithRetryConfig(
|
plexgo.WithRetryConfig(
|
||||||
retry.Config{
|
retry.Config{
|
||||||
@@ -280,14 +319,8 @@ func main() {
|
|||||||
RetryConnectionErrors: false,
|
RetryConnectionErrors: false,
|
||||||
}),
|
}),
|
||||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
||||||
plexgo.WithClientName("Plex Web"),
|
|
||||||
plexgo.WithClientVersion("4.133.0"),
|
|
||||||
plexgo.WithClientPlatform("Chrome"),
|
|
||||||
plexgo.WithDeviceName("Linux"),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
ctx := context.Background()
|
|
||||||
res, err := s.Server.GetServerCapabilities(ctx)
|
res, err := s.Server.GetServerCapabilities(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
@@ -303,13 +336,17 @@ func main() {
|
|||||||
<!-- Start Error Handling [errors] -->
|
<!-- Start Error Handling [errors] -->
|
||||||
## Error Handling
|
## 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 |
|
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.
|
||||||
| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- |
|
|
||||||
| sdkerrors.GetServerCapabilitiesBadRequest | 400 | application/json |
|
For example, the `GetServerCapabilities` function may return the following errors:
|
||||||
| sdkerrors.GetServerCapabilitiesUnauthorized | 401 | application/json |
|
|
||||||
| sdkerrors.SDKError | 4xx-5xx | */* |
|
| Error Type | Status Code | Content Type |
|
||||||
|
| ------------------------------------------- | ----------- | ---------------- |
|
||||||
|
| sdkerrors.GetServerCapabilitiesBadRequest | 400 | application/json |
|
||||||
|
| sdkerrors.GetServerCapabilitiesUnauthorized | 401 | application/json |
|
||||||
|
| sdkerrors.SDKError | 4XX, 5XX | \*/\* |
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
@@ -325,16 +362,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
s := plexgo.New(
|
s := plexgo.New(
|
||||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
||||||
plexgo.WithClientName("Plex Web"),
|
|
||||||
plexgo.WithClientVersion("4.133.0"),
|
|
||||||
plexgo.WithClientPlatform("Chrome"),
|
|
||||||
plexgo.WithDeviceName("Linux"),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
ctx := context.Background()
|
|
||||||
res, err := s.Server.GetServerCapabilities(ctx)
|
res, err := s.Server.GetServerCapabilities(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
||||||
@@ -364,13 +397,15 @@ func main() {
|
|||||||
<!-- Start Server Selection [server] -->
|
<!-- Start Server Selection [server] -->
|
||||||
## Server Selection
|
## 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 |
|
| Variable | Option | Supported Values | Default | Description |
|
||||||
| - | ------ | --------- |
|
| ---------- | --------------------------------------- | -------------------------- | --------------- | ---------------------------------------------- |
|
||||||
| 0 | `{protocol}://{ip}:{port}` | `protocol` (default is `https`), `ip` (default is `10.10.10.47`), `port` (default is `32400`) |
|
| `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
|
#### Example
|
||||||
|
|
||||||
@@ -384,17 +419,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
s := plexgo.New(
|
s := plexgo.New(
|
||||||
plexgo.WithServerIndex(0),
|
plexgo.WithProtocol("https"),
|
||||||
|
plexgo.WithIP("4982:bc2a:b4f8:efb5:2394:5bc3:ab4f:0e6d"),
|
||||||
|
plexgo.WithPort("44765"),
|
||||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
||||||
plexgo.WithClientName("Plex Web"),
|
|
||||||
plexgo.WithClientVersion("4.133.0"),
|
|
||||||
plexgo.WithClientPlatform("Chrome"),
|
|
||||||
plexgo.WithDeviceName("Linux"),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
ctx := context.Background()
|
|
||||||
res, err := s.Server.GetServerCapabilities(ctx)
|
res, err := s.Server.GetServerCapabilities(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
@@ -406,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
|
### 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
|
```go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -426,17 +452,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
s := plexgo.New(
|
s := plexgo.New(
|
||||||
plexgo.WithServerURL("{protocol}://{ip}:{port}"),
|
plexgo.WithServerURL("https://10.10.10.47:32400"),
|
||||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
||||||
plexgo.WithClientName("Plex Web"),
|
|
||||||
plexgo.WithClientVersion("4.133.0"),
|
|
||||||
plexgo.WithClientPlatform("Chrome"),
|
|
||||||
plexgo.WithDeviceName("Linux"),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
ctx := context.Background()
|
|
||||||
res, err := s.Server.GetServerCapabilities(ctx)
|
res, err := s.Server.GetServerCapabilities(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
@@ -462,17 +484,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
s := plexgo.New(
|
s := plexgo.New(
|
||||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
||||||
plexgo.WithClientName("Plex Web"),
|
|
||||||
plexgo.WithClientVersion("4.133.0"),
|
|
||||||
plexgo.WithClientPlatform("Chrome"),
|
|
||||||
plexgo.WithDeviceName("Linux"),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
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 {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -520,9 +538,9 @@ This can be a convenient way to configure timeouts, cookies, proxies, custom hea
|
|||||||
|
|
||||||
This SDK supports the following security scheme globally:
|
This SDK supports the following security scheme globally:
|
||||||
|
|
||||||
| Name | Type | Scheme |
|
| Name | Type | Scheme |
|
||||||
| ------------- | ------------- | ------------- |
|
| ------------- | ------ | ------- |
|
||||||
| `AccessToken` | apiKey | API key |
|
| `AccessToken` | apiKey | API key |
|
||||||
|
|
||||||
You can configure it using the `WithSecurity` option when initializing the SDK client instance. For example:
|
You can configure it using the `WithSecurity` option when initializing the SDK client instance. For example:
|
||||||
```go
|
```go
|
||||||
@@ -535,16 +553,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
s := plexgo.New(
|
s := plexgo.New(
|
||||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
||||||
plexgo.WithClientName("Plex Web"),
|
|
||||||
plexgo.WithClientVersion("4.133.0"),
|
|
||||||
plexgo.WithClientPlatform("Chrome"),
|
|
||||||
plexgo.WithDeviceName("Linux"),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
ctx := context.Background()
|
|
||||||
res, err := s.Server.GetServerCapabilities(ctx)
|
res, err := s.Server.GetServerCapabilities(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
@@ -583,64 +597,6 @@ d6 := types.MustDateFromString("2019-01-01") // returns types.Date and panics on
|
|||||||
```
|
```
|
||||||
<!-- End Special Types [types] -->
|
<!-- End Special Types [types] -->
|
||||||
|
|
||||||
<!-- Start Global Parameters [global-parameters] -->
|
|
||||||
## Global Parameters
|
|
||||||
|
|
||||||
Certain parameters are configured globally. These parameters may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, These global values will be used as defaults on the operations that use them. When such operations are called, there is a place in each to override the global value, if needed.
|
|
||||||
|
|
||||||
For example, you can set `ClientID` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `GetPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
|
|
||||||
|
|
||||||
|
|
||||||
### Available Globals
|
|
||||||
|
|
||||||
The following global parameters are available.
|
|
||||||
|
|
||||||
| Name | Type | Required | Description |
|
|
||||||
| ---- | ---- |:--------:| ----------- |
|
|
||||||
| ClientID | 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)
|
|
||||||
|
|
|
||||||
| ClientName | string | | The ClientName parameter. |
|
|
||||||
| ClientVersion | string | | The ClientVersion parameter. |
|
|
||||||
| ClientPlatform | string | | The ClientPlatform parameter. |
|
|
||||||
| DeviceName | string | | The DeviceName parameter. |
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"github.com/LukeHagar/plexgo"
|
|
||||||
"github.com/LukeHagar/plexgo/models/operations"
|
|
||||||
"log"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
s := plexgo.New(
|
|
||||||
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
||||||
plexgo.WithClientName("Plex Web"),
|
|
||||||
plexgo.WithClientVersion("4.133.0"),
|
|
||||||
plexgo.WithClientPlatform("Chrome"),
|
|
||||||
plexgo.WithDeviceName("Linux"),
|
|
||||||
)
|
|
||||||
|
|
||||||
ctx := context.Background()
|
|
||||||
res, err := s.Plex.GetPin(ctx, operations.GetPinRequest{})
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
if res.AuthPinContainer != nil {
|
|
||||||
// handle response
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
```
|
|
||||||
<!-- End Global Parameters [global-parameters] -->
|
|
||||||
|
|
||||||
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
||||||
|
|
||||||
# Development
|
# Development
|
||||||
|
|||||||
262
RELEASES.md
262
RELEASES.md
@@ -902,4 +902,264 @@ Based on:
|
|||||||
### Generated
|
### Generated
|
||||||
- [go v0.12.0] .
|
- [go v0.12.0] .
|
||||||
### Releases
|
### Releases
|
||||||
- [Go v0.12.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.12.0 - .
|
- [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 - .
|
||||||
|
|
||||||
|
## 2025-06-05 00:10:42
|
||||||
|
### Changes
|
||||||
|
Based on:
|
||||||
|
- OpenAPI Doc
|
||||||
|
- Speakeasy CLI 1.555.3 (2.620.2) https://github.com/speakeasy-api/speakeasy
|
||||||
|
### Generated
|
||||||
|
- [go v0.22.0] .
|
||||||
|
### Releases
|
||||||
|
- [Go v0.22.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.22.0 - .
|
||||||
8
USAGE.md
8
USAGE.md
@@ -9,16 +9,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
s := plexgo.New(
|
s := plexgo.New(
|
||||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
||||||
plexgo.WithClientName("Plex Web"),
|
|
||||||
plexgo.WithClientVersion("4.133.0"),
|
|
||||||
plexgo.WithClientPlatform("Chrome"),
|
|
||||||
plexgo.WithDeviceName("Linux"),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
ctx := context.Background()
|
|
||||||
res, err := s.Server.GetServerCapabilities(ctx)
|
res, err := s.Server.GetServerCapabilities(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
|||||||
189
activities.go
189
activities.go
@@ -6,12 +6,12 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/LukeHagar/plexgo/internal/config"
|
||||||
"github.com/LukeHagar/plexgo/internal/hooks"
|
"github.com/LukeHagar/plexgo/internal/hooks"
|
||||||
"github.com/LukeHagar/plexgo/internal/utils"
|
"github.com/LukeHagar/plexgo/internal/utils"
|
||||||
"github.com/LukeHagar/plexgo/models/operations"
|
"github.com/LukeHagar/plexgo/models/operations"
|
||||||
"github.com/LukeHagar/plexgo/models/sdkerrors"
|
"github.com/LukeHagar/plexgo/models/sdkerrors"
|
||||||
"github.com/cenkalti/backoff/v4"
|
"github.com/LukeHagar/plexgo/retry"
|
||||||
"io"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
)
|
)
|
||||||
@@ -24,25 +24,22 @@ import (
|
|||||||
// - They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.)
|
// - They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.)
|
||||||
// - The may contain a `Response` object which attributes which represent the result of the asynchronous operation.
|
// - The may contain a `Response` object which attributes which represent the result of the asynchronous operation.
|
||||||
type Activities struct {
|
type Activities struct {
|
||||||
sdkConfiguration sdkConfiguration
|
rootSDK *PlexAPI
|
||||||
|
sdkConfiguration config.SDKConfiguration
|
||||||
|
hooks *hooks.Hooks
|
||||||
}
|
}
|
||||||
|
|
||||||
func newActivities(sdkConfig sdkConfiguration) *Activities {
|
func newActivities(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Activities {
|
||||||
return &Activities{
|
return &Activities{
|
||||||
|
rootSDK: rootSDK,
|
||||||
sdkConfiguration: sdkConfig,
|
sdkConfiguration: sdkConfig,
|
||||||
|
hooks: hooks,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetServerActivities - Get Server Activities
|
// GetServerActivities - Get Server Activities
|
||||||
// Get Server Activities
|
// Get Server Activities
|
||||||
func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations.Option) (*operations.GetServerActivitiesResponse, error) {
|
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{}
|
o := operations.Options{}
|
||||||
supportedOptions := []string{
|
supportedOptions := []string{
|
||||||
operations.SupportedOptionRetries,
|
operations.SupportedOptionRetries,
|
||||||
@@ -55,12 +52,27 @@ 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")
|
opURL, err := url.JoinPath(baseURL, "/activities")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hookCtx := hooks.HookContext{
|
||||||
|
SDK: s.rootSDK,
|
||||||
|
SDKConfiguration: s.sdkConfiguration,
|
||||||
|
BaseURL: baseURL,
|
||||||
|
Context: ctx,
|
||||||
|
OperationID: "getServerActivities",
|
||||||
|
OAuth2Scopes: []string{},
|
||||||
|
SecuritySource: s.sdkConfiguration.Security,
|
||||||
|
}
|
||||||
|
|
||||||
timeout := o.Timeout
|
timeout := o.Timeout
|
||||||
if timeout == nil {
|
if timeout == nil {
|
||||||
timeout = s.sdkConfiguration.Timeout
|
timeout = s.sdkConfiguration.Timeout
|
||||||
@@ -83,6 +95,10 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for k, v := range o.SetHeaders {
|
||||||
|
req.Header.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||||
retryConfig := o.Retries
|
retryConfig := o.Retries
|
||||||
if retryConfig == nil {
|
if retryConfig == nil {
|
||||||
@@ -103,17 +119,23 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
|||||||
"504",
|
"504",
|
||||||
},
|
},
|
||||||
}, func() (*http.Response, error) {
|
}, func() (*http.Response, error) {
|
||||||
if req.Body != nil {
|
if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil {
|
||||||
copyBody, err := req.GetBody()
|
copyBody, err := req.GetBody()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
req.Body = copyBody
|
req.Body = copyBody
|
||||||
}
|
}
|
||||||
|
|
||||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
if err != nil {
|
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)
|
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||||
@@ -124,7 +146,7 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
|||||||
err = fmt.Errorf("error sending request: no response")
|
err = fmt.Errorf("error sending request: no response")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
}
|
}
|
||||||
return httpRes, err
|
return httpRes, err
|
||||||
})
|
})
|
||||||
@@ -132,13 +154,13 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -151,17 +173,17 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
|||||||
err = fmt.Errorf("error sending request: no response")
|
err = fmt.Errorf("error sending request: no response")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
||||||
_httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
_httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if _httpRes != nil {
|
} else if _httpRes != nil {
|
||||||
httpRes = _httpRes
|
httpRes = _httpRes
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -174,21 +196,11 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
|||||||
RawResponse: httpRes,
|
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 {
|
switch {
|
||||||
case httpRes.StatusCode == 200:
|
case httpRes.StatusCode == 200:
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -200,17 +212,16 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
|||||||
|
|
||||||
res.Object = &out
|
res.Object = &out
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
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:
|
case httpRes.StatusCode == 400:
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -223,17 +234,16 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
|||||||
out.RawResponse = httpRes
|
out.RawResponse = httpRes
|
||||||
return nil, &out
|
return nil, &out
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
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:
|
case httpRes.StatusCode == 401:
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -246,28 +256,29 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
|||||||
out.RawResponse = httpRes
|
out.RawResponse = httpRes
|
||||||
return nil, &out
|
return nil, &out
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
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:
|
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||||
fallthrough
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
if err != nil {
|
||||||
rawBody, err := getRawBody()
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,13 +289,6 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
|||||||
// CancelServerActivities - Cancel Server Activities
|
// CancelServerActivities - Cancel Server Activities
|
||||||
// Cancel Server Activities
|
// Cancel Server Activities
|
||||||
func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID string, opts ...operations.Option) (*operations.CancelServerActivitiesResponse, error) {
|
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{
|
request := operations.CancelServerActivitiesRequest{
|
||||||
ActivityUUID: activityUUID,
|
ActivityUUID: activityUUID,
|
||||||
}
|
}
|
||||||
@@ -301,12 +305,27 @@ 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)
|
opURL, err := utils.GenerateURL(ctx, baseURL, "/activities/{activityUUID}", request, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hookCtx := hooks.HookContext{
|
||||||
|
SDK: s.rootSDK,
|
||||||
|
SDKConfiguration: s.sdkConfiguration,
|
||||||
|
BaseURL: baseURL,
|
||||||
|
Context: ctx,
|
||||||
|
OperationID: "cancelServerActivities",
|
||||||
|
OAuth2Scopes: []string{},
|
||||||
|
SecuritySource: s.sdkConfiguration.Security,
|
||||||
|
}
|
||||||
|
|
||||||
timeout := o.Timeout
|
timeout := o.Timeout
|
||||||
if timeout == nil {
|
if timeout == nil {
|
||||||
timeout = s.sdkConfiguration.Timeout
|
timeout = s.sdkConfiguration.Timeout
|
||||||
@@ -329,6 +348,10 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for k, v := range o.SetHeaders {
|
||||||
|
req.Header.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||||
retryConfig := o.Retries
|
retryConfig := o.Retries
|
||||||
if retryConfig == nil {
|
if retryConfig == nil {
|
||||||
@@ -349,17 +372,23 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st
|
|||||||
"504",
|
"504",
|
||||||
},
|
},
|
||||||
}, func() (*http.Response, error) {
|
}, func() (*http.Response, error) {
|
||||||
if req.Body != nil {
|
if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil {
|
||||||
copyBody, err := req.GetBody()
|
copyBody, err := req.GetBody()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
req.Body = copyBody
|
req.Body = copyBody
|
||||||
}
|
}
|
||||||
|
|
||||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
if err != nil {
|
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)
|
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||||
@@ -370,7 +399,7 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st
|
|||||||
err = fmt.Errorf("error sending request: no response")
|
err = fmt.Errorf("error sending request: no response")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
}
|
}
|
||||||
return httpRes, err
|
return httpRes, err
|
||||||
})
|
})
|
||||||
@@ -378,13 +407,13 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -397,17 +426,17 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st
|
|||||||
err = fmt.Errorf("error sending request: no response")
|
err = fmt.Errorf("error sending request: no response")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
||||||
_httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
_httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if _httpRes != nil {
|
} else if _httpRes != nil {
|
||||||
httpRes = _httpRes
|
httpRes = _httpRes
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -420,22 +449,12 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st
|
|||||||
RawResponse: httpRes,
|
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 {
|
switch {
|
||||||
case httpRes.StatusCode == 200:
|
case httpRes.StatusCode == 200:
|
||||||
case httpRes.StatusCode == 400:
|
case httpRes.StatusCode == 400:
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -448,17 +467,16 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st
|
|||||||
out.RawResponse = httpRes
|
out.RawResponse = httpRes
|
||||||
return nil, &out
|
return nil, &out
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
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:
|
case httpRes.StatusCode == 401:
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -471,28 +489,29 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st
|
|||||||
out.RawResponse = httpRes
|
out.RawResponse = httpRes
|
||||||
return nil, &out
|
return nil, &out
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
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:
|
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||||
fallthrough
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
if err != nil {
|
||||||
rawBody, err := getRawBody()
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,37 +6,34 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/LukeHagar/plexgo/internal/config"
|
||||||
"github.com/LukeHagar/plexgo/internal/hooks"
|
"github.com/LukeHagar/plexgo/internal/hooks"
|
||||||
"github.com/LukeHagar/plexgo/internal/utils"
|
"github.com/LukeHagar/plexgo/internal/utils"
|
||||||
"github.com/LukeHagar/plexgo/models/operations"
|
"github.com/LukeHagar/plexgo/models/operations"
|
||||||
"github.com/LukeHagar/plexgo/models/sdkerrors"
|
"github.com/LukeHagar/plexgo/models/sdkerrors"
|
||||||
"github.com/cenkalti/backoff/v4"
|
"github.com/LukeHagar/plexgo/retry"
|
||||||
"io"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Authentication - API Calls regarding authentication for Plex Media Server
|
// Authentication - API Calls regarding authentication for Plex Media Server
|
||||||
type Authentication struct {
|
type Authentication struct {
|
||||||
sdkConfiguration sdkConfiguration
|
rootSDK *PlexAPI
|
||||||
|
sdkConfiguration config.SDKConfiguration
|
||||||
|
hooks *hooks.Hooks
|
||||||
}
|
}
|
||||||
|
|
||||||
func newAuthentication(sdkConfig sdkConfiguration) *Authentication {
|
func newAuthentication(rootSDK *PlexAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Authentication {
|
||||||
return &Authentication{
|
return &Authentication{
|
||||||
|
rootSDK: rootSDK,
|
||||||
sdkConfiguration: sdkConfig,
|
sdkConfiguration: sdkConfig,
|
||||||
|
hooks: hooks,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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.
|
// 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) {
|
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{
|
request := operations.GetTransientTokenRequest{
|
||||||
Type: type_,
|
Type: type_,
|
||||||
Scope: scope,
|
Scope: scope,
|
||||||
@@ -54,12 +51,27 @@ 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")
|
opURL, err := url.JoinPath(baseURL, "/security/token")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hookCtx := hooks.HookContext{
|
||||||
|
SDK: s.rootSDK,
|
||||||
|
SDKConfiguration: s.sdkConfiguration,
|
||||||
|
BaseURL: baseURL,
|
||||||
|
Context: ctx,
|
||||||
|
OperationID: "getTransientToken",
|
||||||
|
OAuth2Scopes: []string{},
|
||||||
|
SecuritySource: s.sdkConfiguration.Security,
|
||||||
|
}
|
||||||
|
|
||||||
timeout := o.Timeout
|
timeout := o.Timeout
|
||||||
if timeout == nil {
|
if timeout == nil {
|
||||||
timeout = s.sdkConfiguration.Timeout
|
timeout = s.sdkConfiguration.Timeout
|
||||||
@@ -86,6 +98,10 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for k, v := range o.SetHeaders {
|
||||||
|
req.Header.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||||
retryConfig := o.Retries
|
retryConfig := o.Retries
|
||||||
if retryConfig == nil {
|
if retryConfig == nil {
|
||||||
@@ -106,17 +122,23 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
|
|||||||
"504",
|
"504",
|
||||||
},
|
},
|
||||||
}, func() (*http.Response, error) {
|
}, func() (*http.Response, error) {
|
||||||
if req.Body != nil {
|
if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil {
|
||||||
copyBody, err := req.GetBody()
|
copyBody, err := req.GetBody()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
req.Body = copyBody
|
req.Body = copyBody
|
||||||
}
|
}
|
||||||
|
|
||||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
if err != nil {
|
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)
|
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||||
@@ -127,7 +149,7 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
|
|||||||
err = fmt.Errorf("error sending request: no response")
|
err = fmt.Errorf("error sending request: no response")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
}
|
}
|
||||||
return httpRes, err
|
return httpRes, err
|
||||||
})
|
})
|
||||||
@@ -135,13 +157,13 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -154,17 +176,17 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
|
|||||||
err = fmt.Errorf("error sending request: no response")
|
err = fmt.Errorf("error sending request: no response")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
||||||
_httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
_httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if _httpRes != nil {
|
} else if _httpRes != nil {
|
||||||
httpRes = _httpRes
|
httpRes = _httpRes
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -177,22 +199,12 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
|
|||||||
RawResponse: httpRes,
|
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 {
|
switch {
|
||||||
case httpRes.StatusCode == 200:
|
case httpRes.StatusCode == 200:
|
||||||
case httpRes.StatusCode == 400:
|
case httpRes.StatusCode == 400:
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -205,17 +217,16 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
|
|||||||
out.RawResponse = httpRes
|
out.RawResponse = httpRes
|
||||||
return nil, &out
|
return nil, &out
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
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:
|
case httpRes.StatusCode == 401:
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -228,28 +239,29 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
|
|||||||
out.RawResponse = httpRes
|
out.RawResponse = httpRes
|
||||||
return nil, &out
|
return nil, &out
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
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:
|
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||||
fallthrough
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
if err != nil {
|
||||||
rawBody, err := getRawBody()
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,13 +273,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.
|
// 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.
|
// Note: requires Plex Media Server >= 1.15.4.
|
||||||
func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, source string, opts ...operations.Option) (*operations.GetSourceConnectionInformationResponse, error) {
|
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{
|
request := operations.GetSourceConnectionInformationRequest{
|
||||||
Source: source,
|
Source: source,
|
||||||
}
|
}
|
||||||
@@ -284,12 +289,27 @@ 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")
|
opURL, err := url.JoinPath(baseURL, "/security/resources")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hookCtx := hooks.HookContext{
|
||||||
|
SDK: s.rootSDK,
|
||||||
|
SDKConfiguration: s.sdkConfiguration,
|
||||||
|
BaseURL: baseURL,
|
||||||
|
Context: ctx,
|
||||||
|
OperationID: "getSourceConnectionInformation",
|
||||||
|
OAuth2Scopes: []string{},
|
||||||
|
SecuritySource: s.sdkConfiguration.Security,
|
||||||
|
}
|
||||||
|
|
||||||
timeout := o.Timeout
|
timeout := o.Timeout
|
||||||
if timeout == nil {
|
if timeout == nil {
|
||||||
timeout = s.sdkConfiguration.Timeout
|
timeout = s.sdkConfiguration.Timeout
|
||||||
@@ -316,6 +336,10 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for k, v := range o.SetHeaders {
|
||||||
|
req.Header.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||||
retryConfig := o.Retries
|
retryConfig := o.Retries
|
||||||
if retryConfig == nil {
|
if retryConfig == nil {
|
||||||
@@ -336,17 +360,23 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
|
|||||||
"504",
|
"504",
|
||||||
},
|
},
|
||||||
}, func() (*http.Response, error) {
|
}, func() (*http.Response, error) {
|
||||||
if req.Body != nil {
|
if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil {
|
||||||
copyBody, err := req.GetBody()
|
copyBody, err := req.GetBody()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
req.Body = copyBody
|
req.Body = copyBody
|
||||||
}
|
}
|
||||||
|
|
||||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
if err != nil {
|
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)
|
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||||
@@ -357,7 +387,7 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
|
|||||||
err = fmt.Errorf("error sending request: no response")
|
err = fmt.Errorf("error sending request: no response")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
}
|
}
|
||||||
return httpRes, err
|
return httpRes, err
|
||||||
})
|
})
|
||||||
@@ -365,13 +395,13 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -384,17 +414,17 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
|
|||||||
err = fmt.Errorf("error sending request: no response")
|
err = fmt.Errorf("error sending request: no response")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
||||||
_httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
_httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if _httpRes != nil {
|
} else if _httpRes != nil {
|
||||||
httpRes = _httpRes
|
httpRes = _httpRes
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -407,22 +437,12 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
|
|||||||
RawResponse: httpRes,
|
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 {
|
switch {
|
||||||
case httpRes.StatusCode == 200:
|
case httpRes.StatusCode == 200:
|
||||||
case httpRes.StatusCode == 400:
|
case httpRes.StatusCode == 400:
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -435,17 +455,16 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
|
|||||||
out.RawResponse = httpRes
|
out.RawResponse = httpRes
|
||||||
return nil, &out
|
return nil, &out
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
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:
|
case httpRes.StatusCode == 401:
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -458,28 +477,29 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
|
|||||||
out.RawResponse = httpRes
|
out.RawResponse = httpRes
|
||||||
return nil, &out
|
return nil, &out
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
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:
|
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||||
fallthrough
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
if err != nil {
|
||||||
rawBody, err := getRawBody()
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -490,16 +510,8 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
|
|||||||
// GetTokenDetails - Get Token Details
|
// GetTokenDetails - Get Token Details
|
||||||
// Get the User data from the provided X-Plex-Token
|
// Get the User data from the provided X-Plex-Token
|
||||||
func (s *Authentication) GetTokenDetails(ctx context.Context, opts ...operations.Option) (*operations.GetTokenDetailsResponse, error) {
|
func (s *Authentication) GetTokenDetails(ctx context.Context, opts ...operations.Option) (*operations.GetTokenDetailsResponse, error) {
|
||||||
hookCtx := hooks.HookContext{
|
|
||||||
Context: ctx,
|
|
||||||
OperationID: "getTokenDetails",
|
|
||||||
OAuth2Scopes: []string{},
|
|
||||||
SecuritySource: s.sdkConfiguration.Security,
|
|
||||||
}
|
|
||||||
|
|
||||||
o := operations.Options{}
|
o := operations.Options{}
|
||||||
supportedOptions := []string{
|
supportedOptions := []string{
|
||||||
operations.SupportedOptionServerURL,
|
|
||||||
operations.SupportedOptionRetries,
|
operations.SupportedOptionRetries,
|
||||||
operations.SupportedOptionTimeout,
|
operations.SupportedOptionTimeout,
|
||||||
}
|
}
|
||||||
@@ -520,6 +532,16 @@ func (s *Authentication) GetTokenDetails(ctx context.Context, opts ...operations
|
|||||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hookCtx := hooks.HookContext{
|
||||||
|
SDK: s.rootSDK,
|
||||||
|
SDKConfiguration: s.sdkConfiguration,
|
||||||
|
BaseURL: baseURL,
|
||||||
|
Context: ctx,
|
||||||
|
OperationID: "getTokenDetails",
|
||||||
|
OAuth2Scopes: []string{},
|
||||||
|
SecuritySource: s.sdkConfiguration.Security,
|
||||||
|
}
|
||||||
|
|
||||||
timeout := o.Timeout
|
timeout := o.Timeout
|
||||||
if timeout == nil {
|
if timeout == nil {
|
||||||
timeout = s.sdkConfiguration.Timeout
|
timeout = s.sdkConfiguration.Timeout
|
||||||
@@ -542,6 +564,10 @@ func (s *Authentication) GetTokenDetails(ctx context.Context, opts ...operations
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for k, v := range o.SetHeaders {
|
||||||
|
req.Header.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||||
retryConfig := o.Retries
|
retryConfig := o.Retries
|
||||||
if retryConfig == nil {
|
if retryConfig == nil {
|
||||||
@@ -562,17 +588,23 @@ func (s *Authentication) GetTokenDetails(ctx context.Context, opts ...operations
|
|||||||
"504",
|
"504",
|
||||||
},
|
},
|
||||||
}, func() (*http.Response, error) {
|
}, func() (*http.Response, error) {
|
||||||
if req.Body != nil {
|
if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil {
|
||||||
copyBody, err := req.GetBody()
|
copyBody, err := req.GetBody()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
req.Body = copyBody
|
req.Body = copyBody
|
||||||
}
|
}
|
||||||
|
|
||||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
if err != nil {
|
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)
|
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||||
@@ -583,7 +615,7 @@ func (s *Authentication) GetTokenDetails(ctx context.Context, opts ...operations
|
|||||||
err = fmt.Errorf("error sending request: no response")
|
err = fmt.Errorf("error sending request: no response")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
}
|
}
|
||||||
return httpRes, err
|
return httpRes, err
|
||||||
})
|
})
|
||||||
@@ -591,13 +623,13 @@ func (s *Authentication) GetTokenDetails(ctx context.Context, opts ...operations
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -610,17 +642,17 @@ func (s *Authentication) GetTokenDetails(ctx context.Context, opts ...operations
|
|||||||
err = fmt.Errorf("error sending request: no response")
|
err = fmt.Errorf("error sending request: no response")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
||||||
_httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
_httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if _httpRes != nil {
|
} else if _httpRes != nil {
|
||||||
httpRes = _httpRes
|
httpRes = _httpRes
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -633,21 +665,11 @@ func (s *Authentication) GetTokenDetails(ctx context.Context, opts ...operations
|
|||||||
RawResponse: httpRes,
|
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 {
|
switch {
|
||||||
case httpRes.StatusCode == 200:
|
case httpRes.StatusCode == 200:
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -659,17 +681,16 @@ func (s *Authentication) GetTokenDetails(ctx context.Context, opts ...operations
|
|||||||
|
|
||||||
res.UserPlexAccount = &out
|
res.UserPlexAccount = &out
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
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:
|
case httpRes.StatusCode == 400:
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -682,17 +703,16 @@ func (s *Authentication) GetTokenDetails(ctx context.Context, opts ...operations
|
|||||||
out.RawResponse = httpRes
|
out.RawResponse = httpRes
|
||||||
return nil, &out
|
return nil, &out
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
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:
|
case httpRes.StatusCode == 401:
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -705,28 +725,29 @@ func (s *Authentication) GetTokenDetails(ctx context.Context, opts ...operations
|
|||||||
out.RawResponse = httpRes
|
out.RawResponse = httpRes
|
||||||
return nil, &out
|
return nil, &out
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
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:
|
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||||
fallthrough
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
if err != nil {
|
||||||
rawBody, err := getRawBody()
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -736,17 +757,9 @@ func (s *Authentication) GetTokenDetails(ctx context.Context, opts ...operations
|
|||||||
|
|
||||||
// PostUsersSignInData - Get User Sign In Data
|
// PostUsersSignInData - Get User Sign In Data
|
||||||
// Sign in user with username and password and return user data with Plex authentication token
|
// Sign in user with username and password and return user data with Plex authentication token
|
||||||
func (s *Authentication) PostUsersSignInData(ctx context.Context, request *operations.PostUsersSignInDataRequestBody, opts ...operations.Option) (*operations.PostUsersSignInDataResponse, error) {
|
func (s *Authentication) PostUsersSignInData(ctx context.Context, request operations.PostUsersSignInDataRequest, opts ...operations.Option) (*operations.PostUsersSignInDataResponse, error) {
|
||||||
hookCtx := hooks.HookContext{
|
|
||||||
Context: ctx,
|
|
||||||
OperationID: "post-users-sign-in-data",
|
|
||||||
OAuth2Scopes: []string{},
|
|
||||||
SecuritySource: nil,
|
|
||||||
}
|
|
||||||
|
|
||||||
o := operations.Options{}
|
o := operations.Options{}
|
||||||
supportedOptions := []string{
|
supportedOptions := []string{
|
||||||
operations.SupportedOptionServerURL,
|
|
||||||
operations.SupportedOptionRetries,
|
operations.SupportedOptionRetries,
|
||||||
operations.SupportedOptionTimeout,
|
operations.SupportedOptionTimeout,
|
||||||
}
|
}
|
||||||
@@ -767,7 +780,16 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, request *opera
|
|||||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "form", `request:"mediaType=application/x-www-form-urlencoded"`)
|
hookCtx := hooks.HookContext{
|
||||||
|
SDK: s.rootSDK,
|
||||||
|
SDKConfiguration: s.sdkConfiguration,
|
||||||
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -789,7 +811,15 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, request *opera
|
|||||||
}
|
}
|
||||||
req.Header.Set("Accept", "application/json")
|
req.Header.Set("Accept", "application/json")
|
||||||
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
|
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
|
||||||
req.Header.Set("Content-Type", reqContentType)
|
if reqContentType != "" {
|
||||||
|
req.Header.Set("Content-Type", reqContentType)
|
||||||
|
}
|
||||||
|
|
||||||
|
utils.PopulateHeaders(ctx, req, request, nil)
|
||||||
|
|
||||||
|
for k, v := range o.SetHeaders {
|
||||||
|
req.Header.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||||
retryConfig := o.Retries
|
retryConfig := o.Retries
|
||||||
@@ -811,17 +841,23 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, request *opera
|
|||||||
"504",
|
"504",
|
||||||
},
|
},
|
||||||
}, func() (*http.Response, error) {
|
}, func() (*http.Response, error) {
|
||||||
if req.Body != nil {
|
if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil {
|
||||||
copyBody, err := req.GetBody()
|
copyBody, err := req.GetBody()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
req.Body = copyBody
|
req.Body = copyBody
|
||||||
}
|
}
|
||||||
|
|
||||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
if err != nil {
|
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)
|
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||||
@@ -832,7 +868,7 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, request *opera
|
|||||||
err = fmt.Errorf("error sending request: no response")
|
err = fmt.Errorf("error sending request: no response")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
}
|
}
|
||||||
return httpRes, err
|
return httpRes, err
|
||||||
})
|
})
|
||||||
@@ -840,13 +876,13 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, request *opera
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -859,17 +895,17 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, request *opera
|
|||||||
err = fmt.Errorf("error sending request: no response")
|
err = fmt.Errorf("error sending request: no response")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
||||||
_httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
_httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if _httpRes != nil {
|
} else if _httpRes != nil {
|
||||||
httpRes = _httpRes
|
httpRes = _httpRes
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -882,21 +918,11 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, request *opera
|
|||||||
RawResponse: httpRes,
|
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 {
|
switch {
|
||||||
case httpRes.StatusCode == 201:
|
case httpRes.StatusCode == 201:
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -908,17 +934,16 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, request *opera
|
|||||||
|
|
||||||
res.UserPlexAccount = &out
|
res.UserPlexAccount = &out
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
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:
|
case httpRes.StatusCode == 400:
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -931,17 +956,16 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, request *opera
|
|||||||
out.RawResponse = httpRes
|
out.RawResponse = httpRes
|
||||||
return nil, &out
|
return nil, &out
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
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:
|
case httpRes.StatusCode == 401:
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -954,28 +978,29 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, request *opera
|
|||||||
out.RawResponse = httpRes
|
out.RawResponse = httpRes
|
||||||
return nil, &out
|
return nil, &out
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
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:
|
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||||
fallthrough
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
if err != nil {
|
||||||
rawBody, err := getRawBody()
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
default:
|
default:
|
||||||
rawBody, err := getRawBody()
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1376
codeSamples.yaml
1376
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 |
|
||||||
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
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
|
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
|
||||||
| `Protocol` | [operations.Protocol](../../models/operations/protocol.md) | :heavy_check_mark: | The protocol used for the connection (http, https, etc) |
|
| `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 |
|
| `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 |
|
| `Port` | *int* | :heavy_check_mark: | The port used for the connection | |
|
||||||
| `URI` | *string* | :heavy_check_mark: | The full URI of the connection |
|
| `URI` | *string* | :heavy_check_mark: | The full URI of the connection | |
|
||||||
| `Local` | *bool* | :heavy_check_mark: | If the connection is local address |
|
| `Local` | *bool* | :heavy_check_mark: | If the connection is local address | |
|
||||||
| `Relay` | *bool* | :heavy_check_mark: | If the connection is relayed through plex.direct |
|
| `Relay` | *bool* | :heavy_check_mark: | If the connection is relayed through plex.direct | |
|
||||||
| `IPv6` | *bool* | :heavy_check_mark: | If the connection is using IPv6 |
|
| `IPv6` | *bool* | :heavy_check_mark: | If the connection is using IPv6 | |
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
# Country
|
# Country
|
||||||
|
|
||||||
|
The filter query string for country media items.
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ |
|
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
||||||
| `Tag` | **string* | :heavy_minus_sign: | N/A | United States of America |
|
| `ID` | *int* | :heavy_check_mark: | The unique identifier for the country.<br/>NOTE: This is different for each Plex server and is not globally unique.<br/> | 259 |
|
||||||
|
| `Tag` | *string* | :heavy_check_mark: | The country of origin of this media item | United States of America |
|
||||||
|
| `Filter` | *string* | :heavy_check_mark: | 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 |
|
||||||
@@ -3,6 +3,10 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
||||||
| `Tag` | **string* | :heavy_minus_sign: | N/A | Peyton Reed |
|
| `ID` | *int* | :heavy_check_mark: | Unique identifier for the director. | 126522 |
|
||||||
|
| `Filter` | *string* | :heavy_check_mark: | The filter string used to query this director. | director=235876 |
|
||||||
|
| `Tag` | *string* | :heavy_check_mark: | The role of Director | Danny Boyle |
|
||||||
|
| `TagKey` | *string* | :heavy_check_mark: | A unique 24-character hexadecimal key associated with the director's tag, used for internal identification. | 5d776831151a60001f24d031 |
|
||||||
|
| `Thumb` | **string* | :heavy_minus_sign: | The absolute URL of the thumbnail image for the director. | https://metadata-static.plex.tv/8/people/8d65fa96804802e08f2de09fe014408e.jpg |
|
||||||
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
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||||
| `Key` | **string* | :heavy_minus_sign: | N/A |
|
| `Key` | **string* | :heavy_minus_sign: | N/A | |
|
||||||
| `Type` | **string* | :heavy_minus_sign: | N/A |
|
| `Type` | *string* | :heavy_check_mark: | N/A | |
|
||||||
| `Directory` | [][operations.GetMediaProvidersDirectory](../../models/operations/getmediaprovidersdirectory.md) | :heavy_minus_sign: | 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 |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
| `Key` | **string* | :heavy_minus_sign: | N/A | label |
|
| `Key` | *string* | :heavy_check_mark: | N/A | show.title |
|
||||||
| `Title` | **string* | :heavy_minus_sign: | N/A | Label |
|
| `Title` | *string* | :heavy_check_mark: | N/A | Show Title |
|
||||||
| `Type` | **string* | :heavy_minus_sign: | N/A | tag |
|
| `Type` | *string* | :heavy_check_mark: | N/A | string |
|
||||||
| `SubType` | **string* | :heavy_minus_sign: | N/A | bitrate |
|
| `SubType` | **string* | :heavy_minus_sign: | N/A | rating |
|
||||||
@@ -5,5 +5,5 @@
|
|||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
|
||||||
| `Type` | **string* | :heavy_minus_sign: | N/A | resolution |
|
| `Type` | *string* | :heavy_check_mark: | N/A | tag |
|
||||||
| `Operator` | [][operations.Operator](../../models/operations/operator.md) | :heavy_minus_sign: | N/A | |
|
| `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
|
# Genre
|
||||||
|
|
||||||
|
The filter query string for similar items.
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
||||||
| `Tag` | **string* | :heavy_minus_sign: | N/A | Comedy |
|
| `ID` | *int* | :heavy_check_mark: | The unique identifier for the genre.<br/>NOTE: This is different for each Plex server and is not globally unique.<br/> | 259 |
|
||||||
|
| `Filter` | *string* | :heavy_check_mark: | N/A | genre=19 |
|
||||||
|
| `Tag` | *string* | :heavy_check_mark: | The genre name of this media-item<br/> | Crime |
|
||||||
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. | |
|
||||||
24
docs/models/operations/getactorslibraryqueryparamtype.md
Normal file
24
docs/models/operations/getactorslibraryqueryparamtype.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# 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 |
|
||||||
|
| `GetActorsLibraryQueryParamTypeArtist` | 5 |
|
||||||
|
| `GetActorsLibraryQueryParamTypeAlbum` | 6 |
|
||||||
|
| `GetActorsLibraryQueryParamTypeTrack` | 7 |
|
||||||
|
| `GetActorsLibraryQueryParamTypePhotoAlbum` | 8 |
|
||||||
|
| `GetActorsLibraryQueryParamTypePhoto` | 9 |
|
||||||
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
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
| `AllowSync` | *bool* | :heavy_check_mark: | N/A | true |
|
| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false |
|
||||||
| `Art` | *string* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg |
|
| `Art` | *string* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg |
|
||||||
| `Composite` | *string* | :heavy_check_mark: | N/A | /library/sections/1/composite/1705615584 |
|
| `Composite` | *string* | :heavy_check_mark: | The relative path to the composite media item. | /library/sections/1/composite/1743824484 |
|
||||||
| `Filters` | *bool* | :heavy_check_mark: | N/A | true |
|
| `Filters` | *bool* | :heavy_check_mark: | UNKNOWN | true |
|
||||||
| `Refreshing` | *bool* | :heavy_check_mark: | N/A | false |
|
| `Refreshing` | *bool* | :heavy_check_mark: | Indicates whether the library is currently being refreshed or updated | true |
|
||||||
| `Thumb` | *string* | :heavy_check_mark: | N/A | /:/resources/movie.png |
|
| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png |
|
||||||
| `Key` | *string* | :heavy_check_mark: | N/A | 1 |
|
| `Key` | *string* | :heavy_check_mark: | The library key representing the unique identifier | 1 |
|
||||||
| `Type` | *string* | :heavy_check_mark: | N/A | movie |
|
| `Type` | [operations.GetAllLibrariesType](../../models/operations/getalllibrariestype.md) | :heavy_check_mark: | N/A | movie |
|
||||||
| `Title` | *string* | :heavy_check_mark: | N/A | Movies |
|
| `Title` | *string* | :heavy_check_mark: | The title of the library | Movies |
|
||||||
| `Agent` | *string* | :heavy_check_mark: | N/A | tv.plex.agents.movie |
|
| `Agent` | *string* | :heavy_check_mark: | The Plex agent used to match and retrieve media metadata. | tv.plex.agents.movie |
|
||||||
| `Scanner` | *string* | :heavy_check_mark: | N/A | Plex Movie |
|
| `Scanner` | *string* | :heavy_check_mark: | UNKNOWN | Plex Movie |
|
||||||
| `Language` | *string* | :heavy_check_mark: | N/A | en-US |
|
| `Language` | *string* | :heavy_check_mark: | The Plex library language that has been set | en-US |
|
||||||
| `UUID` | *string* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 |
|
| `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 |
|
| `UpdatedAt` | *int64* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
|
||||||
| `CreatedAt` | *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 |
|
| `ScannedAt` | *int64* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
|
||||||
| `Content` | *bool* | :heavy_check_mark: | N/A | true |
|
| `Content` | *bool* | :heavy_check_mark: | UNKNOWN | true |
|
||||||
| `Directory` | *bool* | :heavy_check_mark: | N/A | true |
|
| `Directory` | *bool* | :heavy_check_mark: | UNKNOWN | true |
|
||||||
| `ContentChangedAt` | *int* | :heavy_check_mark: | N/A | 3192854 |
|
| `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` | *int* | :heavy_check_mark: | N/A | 0 |
|
| `Hidden` | [*operations.Hidden](../../models/operations/hidden.md) | :heavy_minus_sign: | The Plex library visibility setting | 1 |
|
||||||
| `Location` | [][operations.Location](../../models/operations/location.md) | :heavy_check_mark: | N/A | |
|
| `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 |
|
| Field | Type | Required | Description | Example |
|
||||||
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
||||||
| `Size` | *int* | :heavy_check_mark: | N/A | 5 |
|
| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
|
||||||
| `AllowSync` | *bool* | :heavy_check_mark: | N/A | false |
|
| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false |
|
||||||
| `Title1` | *string* | :heavy_check_mark: | N/A | Plex Library |
|
| `Title1` | *string* | :heavy_check_mark: | The primary title of the media container. | TV Series |
|
||||||
| `Directory` | [][operations.GetAllLibrariesDirectory](../../models/operations/getalllibrariesdirectory.md) | :heavy_check_mark: | N/A | |
|
| `Directory` | [][operations.GetAllLibrariesDirectory](../../models/operations/getalllibrariesdirectory.md) | :heavy_minus_sign: | N/A | |
|
||||||
@@ -5,6 +5,6 @@ The libraries available on the Server
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
|
||||||
| `MediaContainer` | [operations.GetAllLibrariesMediaContainer](../../models/operations/getalllibrariesmediacontainer.md) | :heavy_check_mark: | N/A |
|
| `MediaContainer` | [*operations.GetAllLibrariesMediaContainer](../../models/operations/getalllibrariesmediacontainer.md) | :heavy_minus_sign: | N/A |
|
||||||
19
docs/models/operations/getalllibrariestype.md
Normal file
19
docs/models/operations/getalllibrariestype.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# GetAllLibrariesType
|
||||||
|
|
||||||
|
The library type
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------------------------- | ------------------------------- |
|
||||||
|
| `GetAllLibrariesTypeMovie` | movie |
|
||||||
|
| `GetAllLibrariesTypeTvShow` | show |
|
||||||
|
| `GetAllLibrariesTypeSeason` | season |
|
||||||
|
| `GetAllLibrariesTypeEpisode` | episode |
|
||||||
|
| `GetAllLibrariesTypeArtist` | artist |
|
||||||
|
| `GetAllLibrariesTypeAlbum` | album |
|
||||||
|
| `GetAllLibrariesTypeTrack` | track |
|
||||||
|
| `GetAllLibrariesTypePhotoAlbum` | photoalbum |
|
||||||
|
| `GetAllLibrariesTypePhoto` | photo |
|
||||||
|
| `GetAllLibrariesTypeCollection` | collection |
|
||||||
@@ -10,4 +10,4 @@
|
|||||||
| `Height` | *int64* | :heavy_check_mark: | N/A | 396 |
|
| `Height` | *int64* | :heavy_check_mark: | N/A | 396 |
|
||||||
| `MinSize` | *int64* | :heavy_check_mark: | N/A | 1 |
|
| `MinSize` | *int64* | :heavy_check_mark: | N/A | 1 |
|
||||||
| `Upscale` | *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 | |
|
||||||
24
docs/models/operations/getcountrieslibraryqueryparamtype.md
Normal file
24
docs/models/operations/getcountrieslibraryqueryparamtype.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# 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 |
|
||||||
|
| `GetCountriesLibraryQueryParamTypeArtist` | 5 |
|
||||||
|
| `GetCountriesLibraryQueryParamTypeAlbum` | 6 |
|
||||||
|
| `GetCountriesLibraryQueryParamTypeTrack` | 7 |
|
||||||
|
| `GetCountriesLibraryQueryParamTypePhotoAlbum` | 8 |
|
||||||
|
| `GetCountriesLibraryQueryParamTypePhoto` | 9 |
|
||||||
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 | |
|
||||||
24
docs/models/operations/getgenreslibraryqueryparamtype.md
Normal file
24
docs/models/operations/getgenreslibraryqueryparamtype.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# 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 |
|
||||||
|
| `GetGenresLibraryQueryParamTypeArtist` | 5 |
|
||||||
|
| `GetGenresLibraryQueryParamTypeAlbum` | 6 |
|
||||||
|
| `GetGenresLibraryQueryParamTypeTrack` | 7 |
|
||||||
|
| `GetGenresLibraryQueryParamTypePhotoAlbum` | 8 |
|
||||||
|
| `GetGenresLibraryQueryParamTypePhoto` | 9 |
|
||||||
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 |
|
||||||
11
docs/models/operations/getlibrarydetailsfield.md
Normal file
11
docs/models/operations/getlibrarydetailsfield.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetLibraryDetailsField
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| 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 |
|
||||||
9
docs/models/operations/getlibrarydetailsfieldtype.md
Normal file
9
docs/models/operations/getlibrarydetailsfieldtype.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# GetLibraryDetailsFieldType
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
||||||
|
| `Type` | **string* | :heavy_minus_sign: | N/A | resolution |
|
||||||
|
| `Operator` | [][operations.GetLibraryDetailsOperator](../../models/operations/getlibrarydetailsoperator.md) | :heavy_minus_sign: | N/A | |
|
||||||
@@ -19,4 +19,4 @@
|
|||||||
| `ViewMode` | **int* | :heavy_minus_sign: | N/A | 65592 |
|
| `ViewMode` | **int* | :heavy_minus_sign: | N/A | 65592 |
|
||||||
| `Directory` | [][operations.GetLibraryDetailsDirectory](../../models/operations/getlibrarydetailsdirectory.md) | :heavy_minus_sign: | N/A | |
|
| `Directory` | [][operations.GetLibraryDetailsDirectory](../../models/operations/getlibrarydetailsdirectory.md) | :heavy_minus_sign: | N/A | |
|
||||||
| `Type` | [][operations.GetLibraryDetailsType](../../models/operations/getlibrarydetailstype.md) | :heavy_minus_sign: | N/A | |
|
| `Type` | [][operations.GetLibraryDetailsType](../../models/operations/getlibrarydetailstype.md) | :heavy_minus_sign: | N/A | |
|
||||||
| `FieldType` | [][operations.FieldType](../../models/operations/fieldtype.md) | :heavy_minus_sign: | N/A | |
|
| `FieldType` | [][operations.GetLibraryDetailsFieldType](../../models/operations/getlibrarydetailsfieldtype.md) | :heavy_minus_sign: | N/A | |
|
||||||
9
docs/models/operations/getlibrarydetailsoperator.md
Normal file
9
docs/models/operations/getlibrarydetailsoperator.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# GetLibraryDetailsOperator
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
|
| `Key` | **string* | :heavy_minus_sign: | N/A | = |
|
||||||
|
| `Title` | **string* | :heavy_minus_sign: | N/A | is |
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| 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 |
|
| `IncludeDetails` | [*operations.IncludeDetails](../../models/operations/includedetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts).<br/>Only exists for backwards compatibility, media providers other than the server libraries have it on always.<br/> | |
|
||||||
| `IncludeDetails` | [*operations.IncludeDetails](../../models/operations/includedetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts). <br/>Only exists for backwards compatibility, media providers other than the server libraries have it on always.<br/> | |
|
| `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 |
|
||||||
13
docs/models/operations/getlibrarydetailssort.md
Normal file
13
docs/models/operations/getlibrarydetailssort.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# GetLibraryDetailsSort
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- |
|
||||||
|
| `Default` | **string* | :heavy_minus_sign: | N/A | asc |
|
||||||
|
| `DefaultDirection` | **string* | :heavy_minus_sign: | N/A | desc |
|
||||||
|
| `DescKey` | **string* | :heavy_minus_sign: | N/A | random:desc |
|
||||||
|
| `FirstCharacterKey` | **string* | :heavy_minus_sign: | N/A | /library/sections/1/firstCharacter |
|
||||||
|
| `Key` | **string* | :heavy_minus_sign: | N/A | random |
|
||||||
|
| `Title` | **string* | :heavy_minus_sign: | N/A | Randomly |
|
||||||
@@ -10,5 +10,5 @@
|
|||||||
| `Title` | **string* | :heavy_minus_sign: | N/A | Movies |
|
| `Title` | **string* | :heavy_minus_sign: | N/A | Movies |
|
||||||
| `Active` | **bool* | :heavy_minus_sign: | N/A | false |
|
| `Active` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||||
| `Filter` | [][operations.GetLibraryDetailsFilter](../../models/operations/getlibrarydetailsfilter.md) | :heavy_minus_sign: | N/A | |
|
| `Filter` | [][operations.GetLibraryDetailsFilter](../../models/operations/getlibrarydetailsfilter.md) | :heavy_minus_sign: | N/A | |
|
||||||
| `Sort` | [][operations.Sort](../../models/operations/sort.md) | :heavy_minus_sign: | N/A | |
|
| `Sort` | [][operations.GetLibraryDetailsSort](../../models/operations/getlibrarydetailssort.md) | :heavy_minus_sign: | N/A | |
|
||||||
| `Field` | [][operations.Field](../../models/operations/field.md) | :heavy_minus_sign: | N/A | |
|
| `Field` | [][operations.GetLibraryDetailsField](../../models/operations/getlibrarydetailsfield.md) | :heavy_minus_sign: | N/A | |
|
||||||
12
docs/models/operations/getlibraryitemsactivedirection.md
Normal file
12
docs/models/operations/getlibraryitemsactivedirection.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# GetLibraryItemsActiveDirection
|
||||||
|
|
||||||
|
The direction of the sort. Can be either `asc` or `desc`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------------------------------------ | ------------------------------------------ |
|
||||||
|
| `GetLibraryItemsActiveDirectionAscending` | asc |
|
||||||
|
| `GetLibraryItemsActiveDirectionDescending` | desc |
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
# GetMetaDataByRatingKeyGenre
|
# GetLibraryItemsCollection
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
| `ID` | **int* | :heavy_minus_sign: | N/A | 184 |
|
| `Tag` | **string* | :heavy_minus_sign: | N/A | Working NL Subs |
|
||||||
| `Filter` | **string* | :heavy_minus_sign: | N/A | genre=184 |
|
|
||||||
| `Tag` | **string* | :heavy_minus_sign: | N/A | Thriller |
|
|
||||||
12
docs/models/operations/getlibraryitemsdefaultdirection.md
Normal file
12
docs/models/operations/getlibraryitemsdefaultdirection.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# GetLibraryItemsDefaultDirection
|
||||||
|
|
||||||
|
The direction of the sort. Can be either `asc` or `desc`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------------------------------------- | ------------------------------------------- |
|
||||||
|
| `GetLibraryItemsDefaultDirectionAscending` | asc |
|
||||||
|
| `GetLibraryItemsDefaultDirectionDescending` | desc |
|
||||||
@@ -9,4 +9,5 @@
|
|||||||
| `FilterType` | *string* | :heavy_check_mark: | N/A | string |
|
| `FilterType` | *string* | :heavy_check_mark: | N/A | string |
|
||||||
| `Key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/genre?type=2 |
|
| `Key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/genre?type=2 |
|
||||||
| `Title` | *string* | :heavy_check_mark: | N/A | Genre |
|
| `Title` | *string* | :heavy_check_mark: | N/A | Genre |
|
||||||
| `Type` | *string* | :heavy_check_mark: | N/A | filter |
|
| `Type` | *string* | :heavy_check_mark: | N/A | filter |
|
||||||
|
| `Advanced` | **bool* | :heavy_minus_sign: | N/A | true |
|
||||||
9
docs/models/operations/getlibraryitemshasthumbnail.md
Normal file
9
docs/models/operations/getlibraryitemshasthumbnail.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# GetLibraryItemsHasThumbnail
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ---------------------------------- | ---------------------------------- |
|
||||||
|
| `GetLibraryItemsHasThumbnailFalse` | 0 |
|
||||||
|
| `GetLibraryItemsHasThumbnailTrue` | 1 |
|
||||||
10
docs/models/operations/getlibraryitemsimage.md
Normal file
10
docs/models/operations/getlibraryitemsimage.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetLibraryItemsImage
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `Alt` | *string* | :heavy_check_mark: | N/A | Episode 1 |
|
||||||
|
| `Type` | [operations.GetLibraryItemsLibraryResponse200Type](../../models/operations/getlibraryitemslibraryresponse200type.md) | :heavy_check_mark: | N/A | background |
|
||||||
|
| `URL` | *string* | :heavy_check_mark: | N/A | /library/metadata/45521/thumb/1644710589 |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# GetLibraryItemsLibraryActiveDirection
|
||||||
|
|
||||||
|
The direction of the sort. Can be either `asc` or `desc`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------------------------------------------- | ------------------------------------------------- |
|
||||||
|
| `GetLibraryItemsLibraryActiveDirectionAscending` | asc |
|
||||||
|
| `GetLibraryItemsLibraryActiveDirectionDescending` | desc |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# GetLibraryItemsLibraryDefaultDirection
|
||||||
|
|
||||||
|
The direction of the sort. Can be either `asc` or `desc`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------------------------------------------------- | -------------------------------------------------- |
|
||||||
|
| `GetLibraryItemsLibraryDefaultDirectionAscending` | asc |
|
||||||
|
| `GetLibraryItemsLibraryDefaultDirectionDescending` | desc |
|
||||||
11
docs/models/operations/getlibraryitemslibraryfield.md
Normal file
11
docs/models/operations/getlibraryitemslibraryfield.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetLibraryItemsLibraryField
|
||||||
|
|
||||||
|
|
||||||
|
## 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 |
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# GetLibraryItemsLibraryFieldType
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `Type` | *string* | :heavy_check_mark: | N/A | tag |
|
||||||
|
| `Operator` | [][operations.GetLibraryItemsLibraryOperator](../../models/operations/getlibraryitemslibraryoperator.md) | :heavy_check_mark: | N/A | |
|
||||||
12
docs/models/operations/getlibraryitemslibraryfilter.md
Normal file
12
docs/models/operations/getlibraryitemslibraryfilter.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# GetLibraryItemsLibraryFilter
|
||||||
|
|
||||||
|
|
||||||
|
## 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 |
|
||||||
9
docs/models/operations/getlibraryitemslibraryoperator.md
Normal file
9
docs/models/operations/getlibraryitemslibraryoperator.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# GetLibraryItemsLibraryOperator
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
|
| `Key` | *string* | :heavy_check_mark: | N/A | = |
|
||||||
|
| `Title` | *string* | :heavy_check_mark: | N/A | is |
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# GetLibraryItemsLibraryResponse200Type
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------------------------------------------------- | -------------------------------------------------- |
|
||||||
|
| `GetLibraryItemsLibraryResponse200TypeCoverPoster` | coverPoster |
|
||||||
|
| `GetLibraryItemsLibraryResponse200TypeBackground` | background |
|
||||||
|
| `GetLibraryItemsLibraryResponse200TypeSnapshot` | snapshot |
|
||||||
|
| `GetLibraryItemsLibraryResponse200TypeClearLogo` | clearLogo |
|
||||||
14
docs/models/operations/getlibraryitemslibraryresponsetype.md
Normal file
14
docs/models/operations/getlibraryitemslibraryresponsetype.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# GetLibraryItemsLibraryResponseType
|
||||||
|
|
||||||
|
|
||||||
|
## 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 | show |
|
||||||
|
| `Title` | *string* | :heavy_check_mark: | N/A | TV Shows |
|
||||||
|
| `Active` | *bool* | :heavy_check_mark: | N/A | false |
|
||||||
|
| `Filter` | [][operations.GetLibraryItemsLibraryFilter](../../models/operations/getlibraryitemslibraryfilter.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Sort` | [][operations.GetLibraryItemsLibrarySort](../../models/operations/getlibraryitemslibrarysort.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Field` | [][operations.GetLibraryItemsLibraryField](../../models/operations/getlibraryitemslibraryfield.md) | :heavy_minus_sign: | N/A | |
|
||||||
15
docs/models/operations/getlibraryitemslibrarysort.md
Normal file
15
docs/models/operations/getlibraryitemslibrarysort.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# GetLibraryItemsLibrarySort
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `Default` | **string* | :heavy_minus_sign: | N/A | asc |
|
||||||
|
| `Active` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `ActiveDirection` | [*operations.GetLibraryItemsLibraryActiveDirection](../../models/operations/getlibraryitemslibraryactivedirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.<br/> | asc |
|
||||||
|
| `DefaultDirection` | [*operations.GetLibraryItemsLibraryDefaultDirection](../../models/operations/getlibraryitemslibrarydefaultdirection.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 |
|
||||||
20
docs/models/operations/getlibraryitemslibrarytype.md
Normal file
20
docs/models/operations/getlibraryitemslibrarytype.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# GetLibraryItemsLibraryType
|
||||||
|
|
||||||
|
The type of media content in the Plex library. This can represent videos, music, or photos.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------------------------------------- | -------------------------------------- |
|
||||||
|
| `GetLibraryItemsLibraryTypeMovie` | movie |
|
||||||
|
| `GetLibraryItemsLibraryTypeTvShow` | show |
|
||||||
|
| `GetLibraryItemsLibraryTypeSeason` | season |
|
||||||
|
| `GetLibraryItemsLibraryTypeEpisode` | episode |
|
||||||
|
| `GetLibraryItemsLibraryTypeArtist` | artist |
|
||||||
|
| `GetLibraryItemsLibraryTypeAlbum` | album |
|
||||||
|
| `GetLibraryItemsLibraryTypeTrack` | track |
|
||||||
|
| `GetLibraryItemsLibraryTypePhotoAlbum` | photoalbum |
|
||||||
|
| `GetLibraryItemsLibraryTypePhoto` | photo |
|
||||||
|
| `GetLibraryItemsLibraryTypeCollection` | collection |
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
# GetOnDeckGuids
|
# GetLibraryItemsLocation
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
| `ID` | **string* | :heavy_minus_sign: | N/A | imdb://tt13303712 |
|
| `Path` | **string* | :heavy_minus_sign: | N/A | /TV Shows/House |
|
||||||
@@ -3,19 +3,23 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `ID` | **int* | :heavy_minus_sign: | N/A | 119534 |
|
| `ID` | *int* | :heavy_check_mark: | N/A | 119534 |
|
||||||
| `Duration` | **int* | :heavy_minus_sign: | N/A | 11558112 |
|
| `Duration` | **int* | :heavy_minus_sign: | N/A | 11558112 |
|
||||||
| `Bitrate` | **int* | :heavy_minus_sign: | N/A | 25025 |
|
| `Bitrate` | **int* | :heavy_minus_sign: | N/A | 25025 |
|
||||||
| `Width` | **int* | :heavy_minus_sign: | N/A | 3840 |
|
| `Width` | **int* | :heavy_minus_sign: | N/A | 3840 |
|
||||||
| `Height` | **int* | :heavy_minus_sign: | N/A | 2072 |
|
| `Height` | **int* | :heavy_minus_sign: | N/A | 2072 |
|
||||||
| `AspectRatio` | **float64* | :heavy_minus_sign: | N/A | 1.85 |
|
| `AspectRatio` | **float64* | :heavy_minus_sign: | N/A | 1.85 |
|
||||||
| `AudioChannels` | **int* | :heavy_minus_sign: | N/A | 6 |
|
| `AudioProfile` | **string* | :heavy_minus_sign: | N/A | dts |
|
||||||
| `AudioCodec` | **string* | :heavy_minus_sign: | N/A | eac3 |
|
| `AudioChannels` | **int* | :heavy_minus_sign: | N/A | 6 |
|
||||||
| `VideoCodec` | **string* | :heavy_minus_sign: | N/A | hevc |
|
| `AudioCodec` | **string* | :heavy_minus_sign: | N/A | eac3 |
|
||||||
| `VideoResolution` | **string* | :heavy_minus_sign: | N/A | 4k |
|
| `VideoCodec` | **string* | :heavy_minus_sign: | N/A | hevc |
|
||||||
| `Container` | **string* | :heavy_minus_sign: | N/A | mkv |
|
| `VideoResolution` | **string* | :heavy_minus_sign: | N/A | 4k |
|
||||||
| `VideoFrameRate` | **string* | :heavy_minus_sign: | N/A | 24p |
|
| `Container` | *string* | :heavy_check_mark: | N/A | mkv |
|
||||||
| `VideoProfile` | **string* | :heavy_minus_sign: | N/A | main 10 |
|
| `VideoFrameRate` | **string* | :heavy_minus_sign: | N/A | 24p |
|
||||||
| `Part` | [][operations.GetLibraryItemsPart](../../models/operations/getlibraryitemspart.md) | :heavy_minus_sign: | N/A | |
|
| `VideoProfile` | **string* | :heavy_minus_sign: | N/A | main 10 |
|
||||||
|
| `HasVoiceActivity` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `OptimizedForStreaming` | [*operations.GetLibraryItemsOptimizedForStreaming](../../models/operations/getlibraryitemsoptimizedforstreaming.md) | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `Part` | [][operations.GetLibraryItemsPart](../../models/operations/getlibraryitemspart.md) | :heavy_check_mark: | N/A | |
|
||||||
@@ -1,15 +1,24 @@
|
|||||||
# GetLibraryItemsMediaContainer
|
# GetLibraryItemsMediaContainer
|
||||||
|
|
||||||
|
The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
||||||
|
| `Type` | [][operations.GetLibraryItemsType](../../models/operations/getlibraryitemstype.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `FieldType` | [][operations.GetLibraryItemsFieldType](../../models/operations/getlibraryitemsfieldtype.md) | :heavy_minus_sign: | N/A | |
|
||||||
| `Size` | *int* | :heavy_check_mark: | N/A | 70 |
|
| `Size` | *int* | :heavy_check_mark: | N/A | 70 |
|
||||||
|
| `TotalSize` | *int* | :heavy_check_mark: | N/A | 170 |
|
||||||
|
| `Offset` | *int* | :heavy_check_mark: | N/A | 0 |
|
||||||
|
| `Content` | *string* | :heavy_check_mark: | N/A | secondary |
|
||||||
| `AllowSync` | *bool* | :heavy_check_mark: | N/A | true |
|
| `AllowSync` | *bool* | :heavy_check_mark: | N/A | true |
|
||||||
|
| `Nocache` | **bool* | :heavy_minus_sign: | N/A | true |
|
||||||
| `Art` | *string* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg |
|
| `Art` | *string* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg |
|
||||||
| `Identifier` | *string* | :heavy_check_mark: | N/A | com.plexapp.plugins.library |
|
| `Identifier` | *string* | :heavy_check_mark: | N/A | com.plexapp.plugins.library |
|
||||||
| `LibrarySectionID` | [operations.LibrarySectionID](../../models/operations/librarysectionid.md) | :heavy_check_mark: | N/A | |
|
| `LibrarySectionID` | *int64* | :heavy_check_mark: | N/A | 1 |
|
||||||
| `LibrarySectionTitle` | *string* | :heavy_check_mark: | N/A | Movies |
|
| `LibrarySectionTitle` | *string* | :heavy_check_mark: | N/A | Movies |
|
||||||
| `LibrarySectionUUID` | *string* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 |
|
| `LibrarySectionUUID` | *string* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 |
|
||||||
| `MediaTagPrefix` | *string* | :heavy_check_mark: | N/A | /system/bundle/media/flags/ |
|
| `MediaTagPrefix` | *string* | :heavy_check_mark: | N/A | /system/bundle/media/flags/ |
|
||||||
@@ -21,4 +30,4 @@
|
|||||||
| `ViewMode` | **int* | :heavy_minus_sign: | N/A | 65592 |
|
| `ViewMode` | **int* | :heavy_minus_sign: | N/A | 65592 |
|
||||||
| `MixedParents` | **bool* | :heavy_minus_sign: | N/A | true |
|
| `MixedParents` | **bool* | :heavy_minus_sign: | N/A | true |
|
||||||
| `Metadata` | [][operations.GetLibraryItemsMetadata](../../models/operations/getlibraryitemsmetadata.md) | :heavy_minus_sign: | N/A | |
|
| `Metadata` | [][operations.GetLibraryItemsMetadata](../../models/operations/getlibraryitemsmetadata.md) | :heavy_minus_sign: | N/A | |
|
||||||
| `Meta` | [*operations.Meta](../../models/operations/meta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.<br/> | |
|
| `Meta` | [*operations.GetLibraryItemsMeta](../../models/operations/getlibraryitemsmeta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.<br/> | |
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
# GetMetaDataByRatingKeyUnauthorized
|
# GetLibraryItemsMeta
|
||||||
|
|
||||||
|
The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
|
||||||
|
|
||||||
Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
||||||
| `Errors` | [][sdkerrors.GetMetaDataByRatingKeyLibraryErrors](../../models/sdkerrors/getmetadatabyratingkeylibraryerrors.md) | :heavy_minus_sign: | N/A |
|
| `Type` | [][operations.GetLibraryItemsLibraryResponseType](../../models/operations/getlibraryitemslibraryresponsetype.md) | :heavy_minus_sign: | N/A |
|
||||||
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing |
|
| `FieldType` | [][operations.GetLibraryItemsLibraryFieldType](../../models/operations/getlibraryitemslibraryfieldtype.md) | :heavy_minus_sign: | N/A |
|
||||||
@@ -5,24 +5,35 @@
|
|||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `RatingKey` | *string* | :heavy_check_mark: | N/A | 58683 |
|
| `RatingKey` | *string* | :heavy_check_mark: | The rating key (Media ID) of this media item.<br/>Note: This is always an integer, but is represented as a string in the API.<br/> | 58683 |
|
||||||
| `Key` | *string* | :heavy_check_mark: | N/A | /library/metadata/58683 |
|
| `Key` | *string* | :heavy_check_mark: | N/A | /library/metadata/58683 |
|
||||||
| `GUID` | *string* | :heavy_check_mark: | N/A | plex://movie/5d7768ba96b655001fdc0408 |
|
| `GUID` | *string* | :heavy_check_mark: | N/A | plex://movie/5d7768ba96b655001fdc0408 |
|
||||||
| `Studio` | **string* | :heavy_minus_sign: | N/A | 20th Century Studios |
|
| `Studio` | **string* | :heavy_minus_sign: | N/A | 20th Century Studios |
|
||||||
| `Type` | *string* | :heavy_check_mark: | N/A | movie |
|
| `SkipChildren` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `LibrarySectionID` | **int64* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | N/A | Movies |
|
||||||
|
| `LibrarySectionKey` | **string* | :heavy_minus_sign: | N/A | /library/sections/1 |
|
||||||
|
| `Type` | [operations.GetLibraryItemsLibraryType](../../models/operations/getlibraryitemslibrarytype.md) | :heavy_check_mark: | The type of media content in the Plex library. This can represent videos, music, or photos.<br/> | movie |
|
||||||
| `Title` | *string* | :heavy_check_mark: | N/A | Avatar: The Way of Water |
|
| `Title` | *string* | :heavy_check_mark: | N/A | Avatar: The Way of Water |
|
||||||
|
| `Slug` | **string* | :heavy_minus_sign: | N/A | 4-for-texas |
|
||||||
| `ContentRating` | **string* | :heavy_minus_sign: | N/A | PG-13 |
|
| `ContentRating` | **string* | :heavy_minus_sign: | N/A | PG-13 |
|
||||||
| `Summary` | **string* | :heavy_minus_sign: | N/A | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home. |
|
| `Summary` | *string* | :heavy_check_mark: | N/A | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home. |
|
||||||
| `Rating` | **float64* | :heavy_minus_sign: | N/A | 7.6 |
|
| `Rating` | **float64* | :heavy_minus_sign: | N/A | 7.6 |
|
||||||
| `AudienceRating` | **float64* | :heavy_minus_sign: | N/A | 9.2 |
|
| `AudienceRating` | **float64* | :heavy_minus_sign: | N/A | 9.2 |
|
||||||
| `Year` | *int* | :heavy_check_mark: | N/A | 2022 |
|
| `Year` | **int* | :heavy_minus_sign: | N/A | 2022 |
|
||||||
|
| `SeasonCount` | **int* | :heavy_minus_sign: | N/A | 2022 |
|
||||||
| `Tagline` | **string* | :heavy_minus_sign: | N/A | Return to Pandora. |
|
| `Tagline` | **string* | :heavy_minus_sign: | N/A | Return to Pandora. |
|
||||||
|
| `FlattenSeasons` | [*operations.FlattenSeasons](../../models/operations/flattenseasons.md) | :heavy_minus_sign: | Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). | 1 |
|
||||||
|
| `EpisodeSort` | [*operations.EpisodeSort](../../models/operations/episodesort.md) | :heavy_minus_sign: | Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first). | 0 |
|
||||||
|
| `EnableCreditsMarkerGeneration` | [*operations.EnableCreditsMarkerGeneration](../../models/operations/enablecreditsmarkergeneration.md) | :heavy_minus_sign: | Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled). | -1 |
|
||||||
|
| `ShowOrdering` | [*operations.ShowOrdering](../../models/operations/showordering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show.<br/>None = Library default,<br/>tmdbAiring = The Movie Database (Aired),<br/>aired = TheTVDB (Aired),<br/>dvd = TheTVDB (DVD),<br/>absolute = TheTVDB (Absolute)).<br/> | absolute |
|
||||||
| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 |
|
| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 |
|
||||||
| `Art` | **string* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 |
|
| `Art` | **string* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 |
|
||||||
| `Duration` | *int* | :heavy_check_mark: | N/A | 11558112 |
|
| `Banner` | **string* | :heavy_minus_sign: | N/A | /library/metadata/58683/banner/1703239236 |
|
||||||
|
| `Duration` | **int* | :heavy_minus_sign: | N/A | 11558112 |
|
||||||
| `OriginallyAvailableAt` | [*types.Date](../../types/date.md) | :heavy_minus_sign: | N/A | 2022-12-14 00:00:00 +0000 UTC |
|
| `OriginallyAvailableAt` | [*types.Date](../../types/date.md) | :heavy_minus_sign: | N/A | 2022-12-14 00:00:00 +0000 UTC |
|
||||||
| `AddedAt` | **int* | :heavy_minus_sign: | N/A | 1680457607 |
|
| `AddedAt` | *int64* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
|
||||||
| `UpdatedAt` | **int* | :heavy_minus_sign: | N/A | 1703239236 |
|
| `UpdatedAt` | **int64* | :heavy_minus_sign: | Unix epoch datetime in seconds | 1556281940 |
|
||||||
| `AudienceRatingImage` | **string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright |
|
| `AudienceRatingImage` | **string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright |
|
||||||
| `ChapterSource` | **string* | :heavy_minus_sign: | N/A | media |
|
| `ChapterSource` | **string* | :heavy_minus_sign: | N/A | media |
|
||||||
| `PrimaryExtraKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/58684 |
|
| `PrimaryExtraKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/58684 |
|
||||||
@@ -32,15 +43,22 @@
|
|||||||
| `GrandparentKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66 |
|
| `GrandparentKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66 |
|
||||||
| `GrandparentTitle` | **string* | :heavy_minus_sign: | N/A | Caprica |
|
| `GrandparentTitle` | **string* | :heavy_minus_sign: | N/A | Caprica |
|
||||||
| `GrandparentThumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 |
|
| `GrandparentThumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 |
|
||||||
|
| `ParentSlug` | **string* | :heavy_minus_sign: | N/A | alice-in-borderland-2020 |
|
||||||
|
| `GrandparentSlug` | **string* | :heavy_minus_sign: | N/A | alice-in-borderland-2020 |
|
||||||
| `GrandparentArt` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66/art/1705716261 |
|
| `GrandparentArt` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66/art/1705716261 |
|
||||||
| `GrandparentTheme` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 |
|
| `GrandparentTheme` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 |
|
||||||
| `Media` | [][operations.GetLibraryItemsMedia](../../models/operations/getlibraryitemsmedia.md) | :heavy_check_mark: | N/A | |
|
| `Media` | [][operations.GetLibraryItemsMedia](../../models/operations/getlibraryitemsmedia.md) | :heavy_minus_sign: | The Media object is only included when type query is `4` or higher.<br/> | |
|
||||||
| `Genre` | [][operations.GetLibraryItemsGenre](../../models/operations/getlibraryitemsgenre.md) | :heavy_minus_sign: | N/A | |
|
| `Genre` | [][operations.GetLibraryItemsGenre](../../models/operations/getlibraryitemsgenre.md) | :heavy_minus_sign: | N/A | |
|
||||||
| `Country` | [][operations.GetLibraryItemsCountry](../../models/operations/getlibraryitemscountry.md) | :heavy_minus_sign: | N/A | |
|
| `Country` | [][operations.GetLibraryItemsCountry](../../models/operations/getlibraryitemscountry.md) | :heavy_minus_sign: | N/A | |
|
||||||
| `Director` | [][operations.GetLibraryItemsDirector](../../models/operations/getlibraryitemsdirector.md) | :heavy_minus_sign: | N/A | |
|
| `Director` | [][operations.GetLibraryItemsDirector](../../models/operations/getlibraryitemsdirector.md) | :heavy_minus_sign: | N/A | |
|
||||||
| `Writer` | [][operations.GetLibraryItemsWriter](../../models/operations/getlibraryitemswriter.md) | :heavy_minus_sign: | N/A | |
|
| `Writer` | [][operations.GetLibraryItemsWriter](../../models/operations/getlibraryitemswriter.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Collection` | [][operations.GetLibraryItemsCollection](../../models/operations/getlibraryitemscollection.md) | :heavy_minus_sign: | N/A | |
|
||||||
| `Role` | [][operations.GetLibraryItemsRole](../../models/operations/getlibraryitemsrole.md) | :heavy_minus_sign: | N/A | |
|
| `Role` | [][operations.GetLibraryItemsRole](../../models/operations/getlibraryitemsrole.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Location` | [][operations.GetLibraryItemsLocation](../../models/operations/getlibraryitemslocation.md) | :heavy_minus_sign: | N/A | |
|
||||||
| `MediaGUID` | [][operations.MediaGUID](../../models/operations/mediaguid.md) | :heavy_minus_sign: | The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.<br/> | |
|
| `MediaGUID` | [][operations.MediaGUID](../../models/operations/mediaguid.md) | :heavy_minus_sign: | The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.<br/> | |
|
||||||
|
| `UltraBlurColors` | [*operations.GetLibraryItemsUltraBlurColors](../../models/operations/getlibraryitemsultrablurcolors.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `MetaDataRating` | [][operations.MetaDataRating](../../models/operations/metadatarating.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Image` | [][operations.GetLibraryItemsImage](../../models/operations/getlibraryitemsimage.md) | :heavy_minus_sign: | N/A | |
|
||||||
| `TitleSort` | **string* | :heavy_minus_sign: | N/A | Whale |
|
| `TitleSort` | **string* | :heavy_minus_sign: | N/A | Whale |
|
||||||
| `ViewCount` | **int* | :heavy_minus_sign: | N/A | 1 |
|
| `ViewCount` | **int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
| `LastViewedAt` | **int* | :heavy_minus_sign: | N/A | 1682752242 |
|
| `LastViewedAt` | **int* | :heavy_minus_sign: | N/A | 1682752242 |
|
||||||
@@ -54,7 +72,7 @@
|
|||||||
| `ChildCount` | **int* | :heavy_minus_sign: | N/A | 1 |
|
| `ChildCount` | **int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
| `HasPremiumExtras` | **string* | :heavy_minus_sign: | N/A | 1 |
|
| `HasPremiumExtras` | **string* | :heavy_minus_sign: | N/A | 1 |
|
||||||
| `HasPremiumPrimaryExtra` | **string* | :heavy_minus_sign: | N/A | 1 |
|
| `HasPremiumPrimaryExtra` | **string* | :heavy_minus_sign: | N/A | 1 |
|
||||||
| `ParentRatingKey` | **string* | :heavy_minus_sign: | N/A | 66 |
|
| `ParentRatingKey` | **string* | :heavy_minus_sign: | The rating key of the parent item.<br/> | 66 |
|
||||||
| `ParentGUID` | **string* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 |
|
| `ParentGUID` | **string* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 |
|
||||||
| `ParentStudio` | **string* | :heavy_minus_sign: | N/A | UCP |
|
| `ParentStudio` | **string* | :heavy_minus_sign: | N/A | UCP |
|
||||||
| `ParentKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66 |
|
| `ParentKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66 |
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# GetLibraryItemsOptimizedForStreaming
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| --------------------------------------------- | --------------------------------------------- |
|
||||||
|
| `GetLibraryItemsOptimizedForStreamingDisable` | 0 |
|
||||||
|
| `GetLibraryItemsOptimizedForStreamingEnable` | 1 |
|
||||||
@@ -5,10 +5,16 @@
|
|||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `ID` | **int* | :heavy_minus_sign: | N/A | 119542 |
|
| `ID` | *int* | :heavy_check_mark: | N/A | 119542 |
|
||||||
| `Key` | **string* | :heavy_minus_sign: | N/A | /library/parts/119542/1680457526/file.mkv |
|
| `Key` | *string* | :heavy_check_mark: | N/A | /library/parts/119542/1680457526/file.mkv |
|
||||||
| `Duration` | **int* | :heavy_minus_sign: | N/A | 11558112 |
|
| `Duration` | **int* | :heavy_minus_sign: | N/A | 11558112 |
|
||||||
| `File` | **string* | :heavy_minus_sign: | N/A | /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv |
|
| `File` | *string* | :heavy_check_mark: | N/A | /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv |
|
||||||
| `Size` | **int64* | :heavy_minus_sign: | N/A | 36158371307 |
|
| `Size` | *int64* | :heavy_check_mark: | N/A | 36158371307 |
|
||||||
| `Container` | **string* | :heavy_minus_sign: | N/A | mkv |
|
| `Container` | *string* | :heavy_check_mark: | The container format of the media file.<br/> | mkv |
|
||||||
| `VideoProfile` | **string* | :heavy_minus_sign: | N/A | main 10 |
|
| `AudioProfile` | **string* | :heavy_minus_sign: | N/A | dts |
|
||||||
|
| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `OptimizedForStreaming` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `VideoProfile` | **string* | :heavy_minus_sign: | N/A | main 10 |
|
||||||
|
| `Indexes` | **string* | :heavy_minus_sign: | N/A | sd |
|
||||||
|
| `HasThumbnail` | [*operations.GetLibraryItemsHasThumbnail](../../models/operations/getlibraryitemshasthumbnail.md) | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `Stream` | [][operations.GetLibraryItemsStream](../../models/operations/getlibraryitemsstream.md) | :heavy_minus_sign: | N/A | |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# GetLibraryItemsQueryParamIncludeMeta
|
||||||
|
|
||||||
|
Adds the Meta object to the response
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| --------------------------------------------- | --------------------------------------------- |
|
||||||
|
| `GetLibraryItemsQueryParamIncludeMetaDisable` | 0 |
|
||||||
|
| `GetLibraryItemsQueryParamIncludeMetaEnable` | 1 |
|
||||||
24
docs/models/operations/getlibraryitemsqueryparamtype.md
Normal file
24
docs/models/operations/getlibraryitemsqueryparamtype.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# GetLibraryItemsQueryParamType
|
||||||
|
|
||||||
|
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 |
|
||||||
|
| ----------------------------------------- | ----------------------------------------- |
|
||||||
|
| `GetLibraryItemsQueryParamTypeMovie` | 1 |
|
||||||
|
| `GetLibraryItemsQueryParamTypeTvShow` | 2 |
|
||||||
|
| `GetLibraryItemsQueryParamTypeSeason` | 3 |
|
||||||
|
| `GetLibraryItemsQueryParamTypeEpisode` | 4 |
|
||||||
|
| `GetLibraryItemsQueryParamTypeArtist` | 5 |
|
||||||
|
| `GetLibraryItemsQueryParamTypeAlbum` | 6 |
|
||||||
|
| `GetLibraryItemsQueryParamTypeTrack` | 7 |
|
||||||
|
| `GetLibraryItemsQueryParamTypePhotoAlbum` | 8 |
|
||||||
|
| `GetLibraryItemsQueryParamTypePhoto` | 9 |
|
||||||
@@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| 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 |
|
| `Tag` | [operations.Tag](../../models/operations/tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | |
|
||||||
| `Tag` | [operations.Tag](../../models/operations/tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | |
|
| `IncludeGuids` | [*operations.IncludeGuids](../../models/operations/includeguids.md) | :heavy_minus_sign: | Adds the Guids object to the response<br/> | 1 |
|
||||||
| `IncludeGuids` | [*operations.IncludeGuids](../../models/operations/includeguids.md) | :heavy_minus_sign: | Adds the Guids object to the response<br/> | 1 |
|
| `Type` | [operations.GetLibraryItemsQueryParamType](../../models/operations/getlibraryitemsqueryparamtype.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.IncludeMeta](../../models/operations/includemeta.md) | :heavy_minus_sign: | Adds the Meta object to the response<br/> | 1 |
|
| `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.Type](../../models/operations/type.md) | :heavy_check_mark: | The type of media to retrieve.<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.GetLibraryItemsQueryParamIncludeMeta](../../models/operations/getlibraryitemsqueryparamincludemeta.md) | :heavy_minus_sign: | Adds the Meta object to the response<br/> | 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 |
|
| `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 |
|
| `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 |
|
||||||
@@ -3,6 +3,11 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
|
||||||
| `Tag` | **string* | :heavy_minus_sign: | N/A | Sigourney Weaver |
|
| `ID` | **int64* | :heavy_minus_sign: | The ID of the tag or actor. | 294129 |
|
||||||
|
| `Filter` | **string* | :heavy_minus_sign: | The filter used to find the actor or tag. | actor=294129 |
|
||||||
|
| `Thumb` | **string* | :heavy_minus_sign: | The thumbnail of the actor | https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg |
|
||||||
|
| `Tag` | **string* | :heavy_minus_sign: | The name of the tag or actor. | Mike Smith |
|
||||||
|
| `TagKey` | **string* | :heavy_minus_sign: | Unique identifier for the tag. | 668e7e7b22bcad9064350c91 |
|
||||||
|
| `Role` | **string* | :heavy_minus_sign: | The role of the actor or tag in the media. | Self |
|
||||||
@@ -3,11 +3,13 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- |
|
| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
|
||||||
| `Default` | **string* | :heavy_minus_sign: | N/A | asc |
|
| `Default` | **string* | :heavy_minus_sign: | N/A | asc |
|
||||||
| `DefaultDirection` | *string* | :heavy_check_mark: | N/A | asc |
|
| `Active` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||||
| `DescKey` | **string* | :heavy_minus_sign: | N/A | titleSort:desc |
|
| `ActiveDirection` | [*operations.GetLibraryItemsActiveDirection](../../models/operations/getlibraryitemsactivedirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.<br/> | asc |
|
||||||
| `FirstCharacterKey` | **string* | :heavy_minus_sign: | N/A | /library/sections/2/firstCharacter |
|
| `DefaultDirection` | [*operations.GetLibraryItemsDefaultDirection](../../models/operations/getlibraryitemsdefaultdirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.<br/> | asc |
|
||||||
| `Key` | *string* | :heavy_check_mark: | N/A | titleSort |
|
| `DescKey` | **string* | :heavy_minus_sign: | N/A | titleSort:desc |
|
||||||
| `Title` | *string* | :heavy_check_mark: | N/A | Title |
|
| `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 |
|
||||||
45
docs/models/operations/getlibraryitemsstream.md
Normal file
45
docs/models/operations/getlibraryitemsstream.md
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# GetLibraryItemsStream
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
|
||||||
|
| `ID` | *int64* | :heavy_check_mark: | N/A | 272796 |
|
||||||
|
| `StreamType` | *int64* | :heavy_check_mark: | Type of stream (1 = video, 2 = audio, 3 = subtitle) | 1 |
|
||||||
|
| `Default` | **bool* | :heavy_minus_sign: | Indicates if this is the default stream | true |
|
||||||
|
| `Selected` | **bool* | :heavy_minus_sign: | Indicates if the stream is selected | true |
|
||||||
|
| `Codec` | *string* | :heavy_check_mark: | Codec used by the stream | h264 |
|
||||||
|
| `Index` | *int64* | :heavy_check_mark: | The index of the stream | 0 |
|
||||||
|
| `Bitrate` | **int64* | :heavy_minus_sign: | The bitrate of the stream in kbps | 6273 |
|
||||||
|
| `ColorPrimaries` | **string* | :heavy_minus_sign: | The color primaries of the video stream | bt709 |
|
||||||
|
| `ColorRange` | **string* | :heavy_minus_sign: | The color range of the video stream | tv |
|
||||||
|
| `ColorSpace` | **string* | :heavy_minus_sign: | The color space of the video stream | bt709 |
|
||||||
|
| `ColorTrc` | **string* | :heavy_minus_sign: | The transfer characteristics (TRC) of the video stream | bt709 |
|
||||||
|
| `BitDepth` | **int64* | :heavy_minus_sign: | The bit depth of the video stream | 8 |
|
||||||
|
| `ChromaLocation` | **string* | :heavy_minus_sign: | The chroma location of the video stream | left |
|
||||||
|
| `StreamIdentifier` | **string* | :heavy_minus_sign: | The identifier of the video stream | 2 |
|
||||||
|
| `ChromaSubsampling` | **string* | :heavy_minus_sign: | The chroma subsampling format | 4:2:0 |
|
||||||
|
| `CodedHeight` | **int64* | :heavy_minus_sign: | The coded height of the video stream | 1088 |
|
||||||
|
| `CodedWidth` | **int64* | :heavy_minus_sign: | The coded width of the video stream | 1920 |
|
||||||
|
| `FrameRate` | **float64* | :heavy_minus_sign: | The frame rate of the video stream | 29.97 |
|
||||||
|
| `HasScalingMatrix` | **bool* | :heavy_minus_sign: | Indicates if the stream has a scaling matrix | false |
|
||||||
|
| `HearingImpaired` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `ClosedCaptions` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `EmbeddedInVideo` | **string* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `Height` | **int64* | :heavy_minus_sign: | The height of the video stream | 1080 |
|
||||||
|
| `Level` | **int64* | :heavy_minus_sign: | The level of the video codec | 40 |
|
||||||
|
| `Profile` | **string* | :heavy_minus_sign: | The profile of the video codec | main |
|
||||||
|
| `RefFrames` | **int64* | :heavy_minus_sign: | Number of reference frames | 4 |
|
||||||
|
| `ScanType` | **string* | :heavy_minus_sign: | The scan type (progressive or interlaced) | progressive |
|
||||||
|
| `Width` | **int64* | :heavy_minus_sign: | The width of the video stream | 1920 |
|
||||||
|
| `DisplayTitle` | **string* | :heavy_minus_sign: | Display title of the stream | 1080p (H.264) |
|
||||||
|
| `ExtendedDisplayTitle` | **string* | :heavy_minus_sign: | Extended display title of the stream | 1080p (H.264) |
|
||||||
|
| `Channels` | **int64* | :heavy_minus_sign: | Number of audio channels (for audio streams) | 2 |
|
||||||
|
| `Language` | **string* | :heavy_minus_sign: | The language of the stream (for audio/subtitle streams) | English |
|
||||||
|
| `LanguageTag` | **string* | :heavy_minus_sign: | Language tag of the stream | en |
|
||||||
|
| `LanguageCode` | **string* | :heavy_minus_sign: | Language code of the stream | eng |
|
||||||
|
| `AudioChannelLayout` | **string* | :heavy_minus_sign: | The audio channel layout | stereo |
|
||||||
|
| `SamplingRate` | **int64* | :heavy_minus_sign: | Sampling rate of the audio stream in Hz | 48000 |
|
||||||
|
| `Title` | **string* | :heavy_minus_sign: | Title of the subtitle track (for subtitle streams) | English |
|
||||||
|
| `CanAutoSync` | **bool* | :heavy_minus_sign: | Indicates if the subtitle stream can auto-sync | false |
|
||||||
@@ -6,7 +6,8 @@
|
|||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
||||||
| `Key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/all?type=2 |
|
| `Key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/all?type=2 |
|
||||||
| `Type` | *string* | :heavy_check_mark: | N/A | show |
|
| `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 |
|
| `Title` | *string* | :heavy_check_mark: | N/A | TV Shows |
|
||||||
| `Active` | *bool* | :heavy_check_mark: | N/A | false |
|
| `Active` | *bool* | :heavy_check_mark: | N/A | false |
|
||||||
| `Filter` | [][operations.GetLibraryItemsFilter](../../models/operations/getlibraryitemsfilter.md) | :heavy_minus_sign: | N/A | |
|
| `Filter` | [][operations.GetLibraryItemsFilter](../../models/operations/getlibraryitemsfilter.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
|||||||
11
docs/models/operations/getlibraryitemsultrablurcolors.md
Normal file
11
docs/models/operations/getlibraryitemsultrablurcolors.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetLibraryItemsUltraBlurColors
|
||||||
|
|
||||||
|
|
||||||
|
## 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 |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# GetLibrarySectionsAllActiveDirection
|
||||||
|
|
||||||
|
The direction of the sort. Can be either `asc` or `desc`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------------------------------------------ | ------------------------------------------------ |
|
||||||
|
| `GetLibrarySectionsAllActiveDirectionAscending` | asc |
|
||||||
|
| `GetLibrarySectionsAllActiveDirectionDescending` | desc |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# GetLibrarySectionsAllCollection
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- |
|
||||||
|
| `Tag` | *string* | :heavy_check_mark: | The user-made collection this media item belongs to | My Awesome Collection |
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user