mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 20:47:48 +00:00
Compare commits
135 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33fe0755b5 | ||
|
|
1cfc2d604f | ||
|
|
ef0d39928c | ||
|
|
d2a1c188d5 | ||
|
|
6db5d8fb30 | ||
|
|
89fbd6238e | ||
|
|
7af7441ac7 | ||
|
|
d1945b544b | ||
|
|
16bb49d558 | ||
|
|
4bea7ae0d8 | ||
|
|
da5491e935 | ||
|
|
aeebf438e1 | ||
|
|
dc815780a6 | ||
|
|
636840a553 | ||
|
|
c65c9e0cae | ||
|
|
95df2396e7 | ||
|
|
f52d81d1f6 | ||
|
|
d83bd96c5f | ||
|
|
2289036c2b | ||
|
|
a7eedd3598 | ||
|
|
e579b8d23b | ||
|
|
fd429e38e0 | ||
|
|
2b4a59f67f | ||
|
|
6268a854c1 | ||
|
|
d061e9c253 | ||
|
|
fcfb68eec7 | ||
|
|
37dabea51a | ||
|
|
f47e4b689b | ||
|
|
04130d41d4 | ||
|
|
393db01a6c | ||
|
|
41621a4bbd | ||
|
|
05f0b1a99a | ||
|
|
f00090bddf | ||
|
|
d8bcbcc30c | ||
|
|
0ce63f1ceb | ||
|
|
da8b549711 | ||
|
|
3cfd677a46 | ||
|
|
e4db9f59ee | ||
|
|
79aced35cd | ||
|
|
2135733290 | ||
|
|
66d2bed79b | ||
|
|
42be0c1e5b | ||
|
|
4f8ae99d93 | ||
|
|
1802af77f6 | ||
|
|
d77dabeb98 | ||
|
|
7b82e1d5a3 | ||
|
|
f677adc9a9 | ||
|
|
9de12cb55c | ||
|
|
52e3fd977d | ||
|
|
88cd5f17cf | ||
|
|
6e9e5028bc | ||
|
|
5fc7421ebf | ||
|
|
caedf0fada | ||
|
|
2e6d62cc3d | ||
|
|
ee418c915d | ||
|
|
89eb756371 | ||
|
|
747f1cc472 | ||
|
|
3caad468dc | ||
|
|
135f07bb5b | ||
|
|
f713adaa5f | ||
|
|
afd7c86d0b | ||
|
|
a1c0bd593c | ||
|
|
7f62aa433e | ||
|
|
d6b4319cf2 | ||
|
|
c487a62f2c | ||
|
|
d2d4cd1c5a | ||
|
|
686079b3d5 | ||
|
|
8ebf35b969 | ||
|
|
8558402eae | ||
|
|
89b2332133 | ||
|
|
98cfef0ea2 | ||
|
|
cb95b7e9ac | ||
|
|
e290570ac9 | ||
|
|
764eb6c75a | ||
|
|
11f26917b7 | ||
|
|
a34f15746e | ||
|
|
12afbc6467 | ||
|
|
8267c3fcbd | ||
|
|
3f2fc4fe8c | ||
|
|
21517ca298 | ||
|
|
d7fe60ed91 | ||
|
|
b09c6ad37a | ||
|
|
6a5cd06342 | ||
|
|
9531527f23 | ||
|
|
db2b15241c | ||
|
|
344db7cbcb | ||
|
|
af9748433a | ||
|
|
8f332b739e | ||
|
|
c504a2d46e | ||
|
|
95d64024f2 | ||
|
|
457b36fb49 | ||
|
|
8691720920 | ||
|
|
205c454485 | ||
|
|
71b5f4f4b7 | ||
|
|
f3779b0079 | ||
|
|
0eaf609b40 | ||
|
|
b0931cba2e | ||
|
|
d09f9292ce | ||
|
|
9a382342e4 | ||
|
|
b8b984dc14 | ||
|
|
0de5991239 | ||
|
|
0ff88615e0 | ||
|
|
0eb6f2c692 | ||
|
|
0adacc0e13 | ||
|
|
ec6ef7db64 | ||
|
|
32a5beaae6 | ||
|
|
ea30334a95 | ||
|
|
f3eb760757 | ||
|
|
683823eab9 | ||
|
|
6942d6b905 | ||
|
|
1a7051235f | ||
|
|
68fedfa8fc | ||
|
|
5916d2ace5 | ||
|
|
417454ebb2 | ||
|
|
992291fe20 | ||
|
|
515f318f05 | ||
|
|
8b81bc5692 | ||
|
|
9dd356ea91 | ||
|
|
efe42104bc | ||
|
|
70001e1e72 | ||
|
|
0118475c63 | ||
|
|
f812f82747 | ||
|
|
7b38f4ba85 | ||
|
|
7caa38277c | ||
|
|
2cfb7aefac | ||
|
|
41ce744f6d | ||
|
|
2b4d612003 | ||
|
|
853bfe69d5 | ||
|
|
81cfd47570 | ||
|
|
44e551a11d | ||
|
|
264d228db7 | ||
|
|
c1bc2419c8 | ||
|
|
471d850f17 | ||
|
|
b3ac2d0c2e | ||
|
|
61283a5769 |
@@ -11,18 +11,18 @@ permissions:
|
|||||||
description: Force generation of SDKs
|
description: Force generation of SDKs
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
set_version:
|
||||||
|
description: optionally set a specific SDK version
|
||||||
|
type: string
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 0 0 * * *
|
- cron: 0 0 * * *
|
||||||
jobs:
|
jobs:
|
||||||
generate:
|
generate:
|
||||||
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-generation.yaml@v14
|
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
|
||||||
with:
|
with:
|
||||||
force: ${{ github.event.inputs.force }}
|
force: ${{ github.event.inputs.force }}
|
||||||
languages: |
|
|
||||||
- go
|
|
||||||
mode: direct
|
mode: direct
|
||||||
openapi_docs: |
|
set_version: ${{ github.event.inputs.set_version }}
|
||||||
- https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml
|
|
||||||
speakeasy_version: latest
|
speakeasy_version: latest
|
||||||
secrets:
|
secrets:
|
||||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
19
.github/workflows/sdk_publish.yaml
vendored
Normal file
19
.github/workflows/sdk_publish.yaml
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Publish
|
||||||
|
permissions:
|
||||||
|
checks: write
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
statuses: write
|
||||||
|
"on":
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- RELEASES.md
|
||||||
|
- '*/RELEASES.md'
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15
|
||||||
|
secrets:
|
||||||
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
|
.speakeasy/reports
|
||||||
# .gitignore
|
# .gitignore
|
||||||
|
|||||||
2706
.speakeasy/gen.lock
2706
.speakeasy/gen.lock
File diff suppressed because one or more lines are too long
@@ -6,10 +6,20 @@ generation:
|
|||||||
optionalPropertyRendering: withExample
|
optionalPropertyRendering: withExample
|
||||||
useClassNamesForArrayFields: true
|
useClassNamesForArrayFields: true
|
||||||
fixes:
|
fixes:
|
||||||
nameResolutionDec2023: false
|
nameResolutionDec2023: true
|
||||||
|
nameResolutionFeb2025: false
|
||||||
|
parameterOrderingFeb2024: true
|
||||||
|
requestResponseComponentNamesFeb2024: true
|
||||||
|
securityFeb2025: false
|
||||||
|
auth:
|
||||||
|
oAuth2ClientCredentialsEnabled: true
|
||||||
|
oAuth2PasswordEnabled: false
|
||||||
go:
|
go:
|
||||||
version: 0.1.0
|
version: 0.19.1
|
||||||
|
additionalDependencies: {}
|
||||||
|
allowUnknownFieldsInWeakUnions: false
|
||||||
clientServerStatusCodesAsErrors: true
|
clientServerStatusCodesAsErrors: true
|
||||||
|
defaultErrorName: SDKError
|
||||||
flattenGlobalSecurity: true
|
flattenGlobalSecurity: true
|
||||||
imports:
|
imports:
|
||||||
option: openapi
|
option: openapi
|
||||||
@@ -21,5 +31,7 @@ go:
|
|||||||
webhooks: models/webhooks
|
webhooks: models/webhooks
|
||||||
inputModelSuffix: input
|
inputModelSuffix: input
|
||||||
maxMethodParams: 4
|
maxMethodParams: 4
|
||||||
|
methodArguments: require-security-and-request
|
||||||
outputModelSuffix: output
|
outputModelSuffix: output
|
||||||
packageName: github.com/LukeHagar/plexgo
|
packageName: github.com/LukeHagar/plexgo
|
||||||
|
responseFormat: envelope
|
||||||
39
.speakeasy/workflow.lock
Normal file
39
.speakeasy/workflow.lock
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
speakeasyVersion: 1.513.4
|
||||||
|
sources:
|
||||||
|
my-source:
|
||||||
|
sourceNamespace: my-source
|
||||||
|
sourceRevisionDigest: sha256:92a2a2049bfbf67bea601a6b1b77d274e83a2d3b6968a0bc02dc290b21c7689d
|
||||||
|
sourceBlobDigest: sha256:f7e2709f52370dff16c1851a7a4e44a89f2e978e9cae335bffc10625950b3bd9
|
||||||
|
tags:
|
||||||
|
- latest
|
||||||
|
- main
|
||||||
|
plexapi:
|
||||||
|
sourceNamespace: plexapi
|
||||||
|
sourceRevisionDigest: sha256:bf7001af017ce5072c503bfbaf60793f94549163b517489dc53e4f7b685659c0
|
||||||
|
sourceBlobDigest: sha256:ed2b29043c84f32d2efa92a126083fd9a81644a7ce9c6ac86d9aeb3493cbd6f8
|
||||||
|
tags:
|
||||||
|
- latest
|
||||||
|
- speakeasy-sdk-regen-1741392494
|
||||||
|
targets:
|
||||||
|
plexgo:
|
||||||
|
source: plexapi
|
||||||
|
sourceNamespace: plexapi
|
||||||
|
sourceRevisionDigest: sha256:bf7001af017ce5072c503bfbaf60793f94549163b517489dc53e4f7b685659c0
|
||||||
|
sourceBlobDigest: sha256:ed2b29043c84f32d2efa92a126083fd9a81644a7ce9c6ac86d9aeb3493cbd6f8
|
||||||
|
codeSamplesNamespace: code-samples-go-plexgo
|
||||||
|
codeSamplesRevisionDigest: sha256:01609ce90e3ede4fb9713410186aab8747cf7992930126be0a0e4af56761e5e0
|
||||||
|
workflow:
|
||||||
|
workflowVersion: 1.0.0
|
||||||
|
speakeasyVersion: latest
|
||||||
|
sources:
|
||||||
|
plexapi:
|
||||||
|
inputs:
|
||||||
|
- location: registry.speakeasyapi.dev/plexapi/plexapi/plexapi:main
|
||||||
|
targets:
|
||||||
|
plexgo:
|
||||||
|
target: go
|
||||||
|
source: plexapi
|
||||||
|
codeSamples:
|
||||||
|
output: codeSamples.yaml
|
||||||
|
registry:
|
||||||
|
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-go-plexgo
|
||||||
14
.speakeasy/workflow.yaml
Normal file
14
.speakeasy/workflow.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
workflowVersion: 1.0.0
|
||||||
|
speakeasyVersion: latest
|
||||||
|
sources:
|
||||||
|
plexapi:
|
||||||
|
inputs:
|
||||||
|
- location: registry.speakeasyapi.dev/plexapi/plexapi/plexapi:main
|
||||||
|
targets:
|
||||||
|
plexgo:
|
||||||
|
target: go
|
||||||
|
source: plexapi
|
||||||
|
codeSamples:
|
||||||
|
output: codeSamples.yaml
|
||||||
|
registry:
|
||||||
|
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-go-plexgo
|
||||||
26
CONTRIBUTING.md
Normal file
26
CONTRIBUTING.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# Contributing to This Repository
|
||||||
|
|
||||||
|
Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements.
|
||||||
|
|
||||||
|
## How to Report Issues
|
||||||
|
|
||||||
|
If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes:
|
||||||
|
|
||||||
|
- A clear and descriptive title
|
||||||
|
- Steps to reproduce the issue
|
||||||
|
- Expected and actual behavior
|
||||||
|
- Any relevant logs, screenshots, or error messages
|
||||||
|
- Information about your environment (e.g., operating system, software versions)
|
||||||
|
- For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed
|
||||||
|
|
||||||
|
## Issue Triage and Upstream Fixes
|
||||||
|
|
||||||
|
We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code.
|
||||||
|
|
||||||
|
## Contact
|
||||||
|
|
||||||
|
If you have any questions or need further assistance, please feel free to reach out by opening an issue.
|
||||||
|
|
||||||
|
Thank you for your understanding and cooperation!
|
||||||
|
|
||||||
|
The Maintainers
|
||||||
22
LICENSE.md
22
LICENSE.md
@@ -1,21 +1,7 @@
|
|||||||
MIT License
|
Copyright 2024 Luke Hagar
|
||||||
|
|
||||||
Copyright (c) 2023 LukeHagar
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|||||||
373
README.md
373
README.md
@@ -7,9 +7,63 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Start Summary [summary] -->
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
|
||||||
|
|
||||||
|
# Plex Media Server OpenAPI Specification
|
||||||
|
|
||||||
|
An Open Source OpenAPI Specification for Plex Media Server
|
||||||
|
|
||||||
|
Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/)
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
[API Documentation](https://plexapi.dev)
|
||||||
|
|
||||||
|
## SDKs
|
||||||
|
|
||||||
|
The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the [main specification Repository](https://github.com/LukeHagar/plex-api-spec).
|
||||||
|
|
||||||
|
| Language | Repository | Releases | Other |
|
||||||
|
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
|
||||||
|
| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - |
|
||||||
|
| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - |
|
||||||
|
| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) |
|
||||||
|
| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - |
|
||||||
|
| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
|
||||||
|
| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
|
||||||
|
| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
|
||||||
|
| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
|
||||||
|
<!-- End Summary [summary] -->
|
||||||
|
|
||||||
|
<!-- Start Table of Contents [toc] -->
|
||||||
|
## Table of Contents
|
||||||
|
<!-- $toc-max-depth=2 -->
|
||||||
|
* [github.com/LukeHagar/plexgo](#githubcomlukehagarplexgo)
|
||||||
|
* [Plex Media Server OpenAPI Specification](#plex-media-server-openapi-specification)
|
||||||
|
* [Documentation](#documentation)
|
||||||
|
* [SDKs](#sdks)
|
||||||
|
* [SDK Installation](#sdk-installation)
|
||||||
|
* [SDK Example Usage](#sdk-example-usage)
|
||||||
|
* [Available Resources and Operations](#available-resources-and-operations)
|
||||||
|
* [Retries](#retries)
|
||||||
|
* [Error Handling](#error-handling)
|
||||||
|
* [Server Selection](#server-selection)
|
||||||
|
* [Custom HTTP Client](#custom-http-client)
|
||||||
|
* [Authentication](#authentication)
|
||||||
|
* [Special Types](#special-types)
|
||||||
|
* [Development](#development)
|
||||||
|
* [Maturity](#maturity)
|
||||||
|
* [Contributions](#contributions)
|
||||||
|
|
||||||
|
<!-- End Table of Contents [toc] -->
|
||||||
|
|
||||||
<!-- Start SDK Installation [installation] -->
|
<!-- Start SDK Installation [installation] -->
|
||||||
## SDK Installation
|
## SDK Installation
|
||||||
|
|
||||||
|
To add the SDK as a dependency to your project:
|
||||||
```bash
|
```bash
|
||||||
go get github.com/LukeHagar/plexgo
|
go get github.com/LukeHagar/plexgo
|
||||||
```
|
```
|
||||||
@@ -26,21 +80,20 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/LukeHagar/plexgo"
|
"github.com/LukeHagar/plexgo"
|
||||||
"github.com/LukeHagar/plexgo/models/components"
|
|
||||||
"log"
|
"log"
|
||||||
)
|
)
|
||||||
|
|
||||||
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>"),
|
||||||
)
|
)
|
||||||
|
|
||||||
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
if res.Object != nil {
|
if res.Object != nil {
|
||||||
// handle response
|
// handle response
|
||||||
}
|
}
|
||||||
@@ -52,28 +105,21 @@ func main() {
|
|||||||
<!-- Start Available Resources and Operations [operations] -->
|
<!-- Start Available Resources and Operations [operations] -->
|
||||||
## Available Resources and Operations
|
## Available Resources and Operations
|
||||||
|
|
||||||
### [Server](docs/sdks/server/README.md)
|
<details open>
|
||||||
|
<summary>Available methods</summary>
|
||||||
* [GetServerCapabilities](docs/sdks/server/README.md#getservercapabilities) - Server Capabilities
|
|
||||||
* [GetServerPreferences](docs/sdks/server/README.md#getserverpreferences) - Get Server Preferences
|
|
||||||
* [GetAvailableClients](docs/sdks/server/README.md#getavailableclients) - Get Available Clients
|
|
||||||
* [GetDevices](docs/sdks/server/README.md#getdevices) - Get Devices
|
|
||||||
* [GetServerIdentity](docs/sdks/server/README.md#getserveridentity) - Get Server Identity
|
|
||||||
* [GetMyPlexAccount](docs/sdks/server/README.md#getmyplexaccount) - Get MyPlex Account
|
|
||||||
* [GetResizedPhoto](docs/sdks/server/README.md#getresizedphoto) - Get a Resized Photo
|
|
||||||
* [GetServerList](docs/sdks/server/README.md#getserverlist) - Get Server List
|
|
||||||
|
|
||||||
### [Media](docs/sdks/media/README.md)
|
|
||||||
|
|
||||||
* [MarkPlayed](docs/sdks/media/README.md#markplayed) - Mark Media Played
|
|
||||||
* [MarkUnplayed](docs/sdks/media/README.md#markunplayed) - Mark Media Unplayed
|
|
||||||
* [UpdatePlayProgress](docs/sdks/media/README.md#updateplayprogress) - Update Media Play Progress
|
|
||||||
|
|
||||||
### [Activities](docs/sdks/activities/README.md)
|
### [Activities](docs/sdks/activities/README.md)
|
||||||
|
|
||||||
* [GetServerActivities](docs/sdks/activities/README.md#getserveractivities) - Get Server Activities
|
* [GetServerActivities](docs/sdks/activities/README.md#getserveractivities) - Get Server Activities
|
||||||
* [CancelServerActivities](docs/sdks/activities/README.md#cancelserveractivities) - Cancel Server Activities
|
* [CancelServerActivities](docs/sdks/activities/README.md#cancelserveractivities) - Cancel Server Activities
|
||||||
|
|
||||||
|
### [Authentication](docs/sdks/authentication/README.md)
|
||||||
|
|
||||||
|
* [GetTransientToken](docs/sdks/authentication/README.md#gettransienttoken) - Get a Transient Token
|
||||||
|
* [GetSourceConnectionInformation](docs/sdks/authentication/README.md#getsourceconnectioninformation) - Get Source Connection Information
|
||||||
|
* [GetTokenDetails](docs/sdks/authentication/README.md#gettokendetails) - Get Token Details
|
||||||
|
* [PostUsersSignInData](docs/sdks/authentication/README.md#postuserssignindata) - Get User Sign In Data
|
||||||
|
|
||||||
### [Butler](docs/sdks/butler/README.md)
|
### [Butler](docs/sdks/butler/README.md)
|
||||||
|
|
||||||
* [GetButlerTasks](docs/sdks/butler/README.md#getbutlertasks) - Get Butler tasks
|
* [GetButlerTasks](docs/sdks/butler/README.md#getbutlertasks) - Get Butler tasks
|
||||||
@@ -85,27 +131,27 @@ 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
|
||||||
|
|
||||||
### [Search](docs/sdks/search/README.md)
|
|
||||||
|
|
||||||
* [PerformSearch](docs/sdks/search/README.md#performsearch) - Perform a search
|
|
||||||
* [PerformVoiceSearch](docs/sdks/search/README.md#performvoicesearch) - Perform a voice search
|
|
||||||
* [GetSearchResults](docs/sdks/search/README.md#getsearchresults) - Get Search Results
|
|
||||||
|
|
||||||
### [Library](docs/sdks/library/README.md)
|
### [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
|
||||||
* [GetLibraries](docs/sdks/library/README.md#getlibraries) - Get All Libraries
|
* [GetAllLibraries](docs/sdks/library/README.md#getalllibraries) - Get All Libraries
|
||||||
* [GetLibrary](docs/sdks/library/README.md#getlibrary) - 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
|
||||||
* [RefreshLibrary](docs/sdks/library/README.md#refreshlibrary) - Refresh Library
|
* [GetAllMediaLibrary](docs/sdks/library/README.md#getallmedialibrary) - Get all media of library
|
||||||
* [GetLatestLibraryItems](docs/sdks/library/README.md#getlatestlibraryitems) - Get Latest Library Items
|
* [GetRefreshLibraryMetadata](docs/sdks/library/README.md#getrefreshlibrarymetadata) - Refresh Metadata Of The Library
|
||||||
* [GetCommonLibraryItems](docs/sdks/library/README.md#getcommonlibraryitems) - Get Common Library Items
|
* [GetSearchLibrary](docs/sdks/library/README.md#getsearchlibrary) - Search Library
|
||||||
* [GetMetadata](docs/sdks/library/README.md#getmetadata) - Get Items Metadata
|
* [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
|
||||||
* [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
|
||||||
* [GetOnDeck](docs/sdks/library/README.md#getondeck) - Get On Deck
|
* [GetOnDeck](docs/sdks/library/README.md#getondeck) - Get On Deck
|
||||||
|
|
||||||
### [Log](docs/sdks/log/README.md)
|
### [Log](docs/sdks/log/README.md)
|
||||||
@@ -114,6 +160,14 @@ func main() {
|
|||||||
* [LogMultiLine](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message
|
* [LogMultiLine](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message
|
||||||
* [EnablePaperTrail](docs/sdks/log/README.md#enablepapertrail) - Enabling Papertrail
|
* [EnablePaperTrail](docs/sdks/log/README.md#enablepapertrail) - Enabling Papertrail
|
||||||
|
|
||||||
|
### [Media](docs/sdks/media/README.md)
|
||||||
|
|
||||||
|
* [MarkPlayed](docs/sdks/media/README.md#markplayed) - Mark Media Played
|
||||||
|
* [MarkUnplayed](docs/sdks/media/README.md#markunplayed) - Mark Media Unplayed
|
||||||
|
* [UpdatePlayProgress](docs/sdks/media/README.md#updateplayprogress) - Update Media Play Progress
|
||||||
|
* [GetBannerImage](docs/sdks/media/README.md#getbannerimage) - Get Banner Image
|
||||||
|
* [GetThumbImage](docs/sdks/media/README.md#getthumbimage) - Get Thumb Image
|
||||||
|
|
||||||
### [Playlists](docs/sdks/playlists/README.md)
|
### [Playlists](docs/sdks/playlists/README.md)
|
||||||
|
|
||||||
* [CreatePlaylist](docs/sdks/playlists/README.md#createplaylist) - Create a Playlist
|
* [CreatePlaylist](docs/sdks/playlists/README.md#createplaylist) - Create a Playlist
|
||||||
@@ -126,10 +180,34 @@ func main() {
|
|||||||
* [AddPlaylistContents](docs/sdks/playlists/README.md#addplaylistcontents) - Adding to a Playlist
|
* [AddPlaylistContents](docs/sdks/playlists/README.md#addplaylistcontents) - Adding to a Playlist
|
||||||
* [UploadPlaylist](docs/sdks/playlists/README.md#uploadplaylist) - Upload Playlist
|
* [UploadPlaylist](docs/sdks/playlists/README.md#uploadplaylist) - Upload Playlist
|
||||||
|
|
||||||
### [Security](docs/sdks/security/README.md)
|
### [Plex](docs/sdks/plex/README.md)
|
||||||
|
|
||||||
* [GetTransientToken](docs/sdks/security/README.md#gettransienttoken) - Get a Transient Token.
|
* [GetCompanionsData](docs/sdks/plex/README.md#getcompanionsdata) - Get Companions Data
|
||||||
* [GetSourceConnectionInformation](docs/sdks/security/README.md#getsourceconnectioninformation) - Get Source Connection Information
|
* [GetUserFriends](docs/sdks/plex/README.md#getuserfriends) - Get list of friends of the user logged in
|
||||||
|
* [GetGeoData](docs/sdks/plex/README.md#getgeodata) - Get Geo Data
|
||||||
|
* [GetHomeData](docs/sdks/plex/README.md#gethomedata) - Get Plex Home Data
|
||||||
|
* [GetServerResources](docs/sdks/plex/README.md#getserverresources) - Get Server Resources
|
||||||
|
* [GetPin](docs/sdks/plex/README.md#getpin) - Get a Pin
|
||||||
|
* [GetTokenByPinID](docs/sdks/plex/README.md#gettokenbypinid) - Get Access Token by PinId
|
||||||
|
|
||||||
|
|
||||||
|
### [Search](docs/sdks/search/README.md)
|
||||||
|
|
||||||
|
* [PerformSearch](docs/sdks/search/README.md#performsearch) - Perform a search
|
||||||
|
* [PerformVoiceSearch](docs/sdks/search/README.md#performvoicesearch) - Perform a voice search
|
||||||
|
* [GetSearchResults](docs/sdks/search/README.md#getsearchresults) - Get Search Results
|
||||||
|
|
||||||
|
### [Server](docs/sdks/server/README.md)
|
||||||
|
|
||||||
|
* [GetServerCapabilities](docs/sdks/server/README.md#getservercapabilities) - Get Server Capabilities
|
||||||
|
* [GetServerPreferences](docs/sdks/server/README.md#getserverpreferences) - Get Server Preferences
|
||||||
|
* [GetAvailableClients](docs/sdks/server/README.md#getavailableclients) - Get Available Clients
|
||||||
|
* [GetDevices](docs/sdks/server/README.md#getdevices) - Get Devices
|
||||||
|
* [GetServerIdentity](docs/sdks/server/README.md#getserveridentity) - Get Server Identity
|
||||||
|
* [GetMyPlexAccount](docs/sdks/server/README.md#getmyplexaccount) - Get MyPlex Account
|
||||||
|
* [GetResizedPhoto](docs/sdks/server/README.md#getresizedphoto) - Get a Resized Photo
|
||||||
|
* [GetMediaProviders](docs/sdks/server/README.md#getmediaproviders) - Get Media Providers
|
||||||
|
* [GetServerList](docs/sdks/server/README.md#getserverlist) - Get Server List
|
||||||
|
|
||||||
### [Sessions](docs/sdks/sessions/README.md)
|
### [Sessions](docs/sdks/sessions/README.md)
|
||||||
|
|
||||||
@@ -138,27 +216,134 @@ func main() {
|
|||||||
* [GetTranscodeSessions](docs/sdks/sessions/README.md#gettranscodesessions) - Get Transcode Sessions
|
* [GetTranscodeSessions](docs/sdks/sessions/README.md#gettranscodesessions) - Get Transcode Sessions
|
||||||
* [StopTranscodeSession](docs/sdks/sessions/README.md#stoptranscodesession) - Stop a Transcode Session
|
* [StopTranscodeSession](docs/sdks/sessions/README.md#stoptranscodesession) - Stop a Transcode Session
|
||||||
|
|
||||||
|
### [Statistics](docs/sdks/statistics/README.md)
|
||||||
|
|
||||||
|
* [GetStatistics](docs/sdks/statistics/README.md#getstatistics) - Get Media Statistics
|
||||||
|
* [GetResourcesStatistics](docs/sdks/statistics/README.md#getresourcesstatistics) - Get Resources Statistics
|
||||||
|
* [GetBandwidthStatistics](docs/sdks/statistics/README.md#getbandwidthstatistics) - Get Bandwidth Statistics
|
||||||
|
|
||||||
### [Updater](docs/sdks/updater/README.md)
|
### [Updater](docs/sdks/updater/README.md)
|
||||||
|
|
||||||
* [GetUpdateStatus](docs/sdks/updater/README.md#getupdatestatus) - Querying status of updates
|
* [GetUpdateStatus](docs/sdks/updater/README.md#getupdatestatus) - Querying status of updates
|
||||||
* [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)
|
||||||
|
|
||||||
* [StartUniversalTranscode](docs/sdks/video/README.md#startuniversaltranscode) - Start Universal Transcode
|
|
||||||
* [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
|
||||||
|
* [StartUniversalTranscode](docs/sdks/video/README.md#startuniversaltranscode) - Start Universal Transcode
|
||||||
|
|
||||||
|
### [Watchlist](docs/sdks/watchlist/README.md)
|
||||||
|
|
||||||
|
* [GetWatchList](docs/sdks/watchlist/README.md#getwatchlist) - Get User Watchlist
|
||||||
|
|
||||||
|
</details>
|
||||||
<!-- End Available Resources and Operations [operations] -->
|
<!-- End Available Resources and Operations [operations] -->
|
||||||
|
|
||||||
|
<!-- Start Retries [retries] -->
|
||||||
|
## Retries
|
||||||
|
|
||||||
|
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
|
||||||
|
|
||||||
|
To change the default retry strategy for a single API call, simply provide a `retry.Config` object to the call by using the `WithRetries` option:
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/LukeHagar/plexgo"
|
||||||
|
"github.com/LukeHagar/plexgo/retry"
|
||||||
|
"log"
|
||||||
|
"models/operations"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
s := plexgo.New(
|
||||||
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
|
)
|
||||||
|
|
||||||
|
res, err := s.Server.GetServerCapabilities(ctx, operations.WithRetries(
|
||||||
|
retry.Config{
|
||||||
|
Strategy: "backoff",
|
||||||
|
Backoff: &retry.BackoffStrategy{
|
||||||
|
InitialInterval: 1,
|
||||||
|
MaxInterval: 50,
|
||||||
|
Exponent: 1.1,
|
||||||
|
MaxElapsedTime: 100,
|
||||||
|
},
|
||||||
|
RetryConnectionErrors: false,
|
||||||
|
}))
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
if res.Object != nil {
|
||||||
|
// handle response
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
If you'd like to override the default retry strategy for all operations that support retries, you can use the `WithRetryConfig` option at SDK initialization:
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/LukeHagar/plexgo"
|
||||||
|
"github.com/LukeHagar/plexgo/retry"
|
||||||
|
"log"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
s := plexgo.New(
|
||||||
|
plexgo.WithRetryConfig(
|
||||||
|
retry.Config{
|
||||||
|
Strategy: "backoff",
|
||||||
|
Backoff: &retry.BackoffStrategy{
|
||||||
|
InitialInterval: 1,
|
||||||
|
MaxInterval: 50,
|
||||||
|
Exponent: 1.1,
|
||||||
|
MaxElapsedTime: 100,
|
||||||
|
},
|
||||||
|
RetryConnectionErrors: false,
|
||||||
|
}),
|
||||||
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
|
)
|
||||||
|
|
||||||
|
res, err := s.Server.GetServerCapabilities(ctx)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
if res.Object != nil {
|
||||||
|
// handle response
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
<!-- End Retries [retries] -->
|
||||||
|
|
||||||
<!-- 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.GetServerCapabilitiesResponseBody | 401 | application/json |
|
For example, the `GetServerCapabilities` function may return the following errors:
|
||||||
| 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
|
||||||
|
|
||||||
@@ -169,21 +354,27 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/LukeHagar/plexgo"
|
"github.com/LukeHagar/plexgo"
|
||||||
"github.com/LukeHagar/plexgo/models/components"
|
|
||||||
"github.com/LukeHagar/plexgo/models/sdkerrors"
|
"github.com/LukeHagar/plexgo/models/sdkerrors"
|
||||||
"log"
|
"log"
|
||||||
)
|
)
|
||||||
|
|
||||||
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>"),
|
||||||
)
|
)
|
||||||
|
|
||||||
ctx := context.Background()
|
|
||||||
res, err := s.Server.GetServerCapabilities(ctx)
|
res, err := s.Server.GetServerCapabilities(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
||||||
var e *sdkerrors.GetServerCapabilitiesResponseBody
|
var e *sdkerrors.GetServerCapabilitiesBadRequest
|
||||||
|
if errors.As(err, &e) {
|
||||||
|
// handle error
|
||||||
|
log.Fatal(e.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
var e *sdkerrors.GetServerCapabilitiesUnauthorized
|
||||||
if errors.As(err, &e) {
|
if errors.As(err, &e) {
|
||||||
// handle error
|
// handle error
|
||||||
log.Fatal(e.Error())
|
log.Fatal(e.Error())
|
||||||
@@ -203,13 +394,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 `http`), `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
|
||||||
|
|
||||||
@@ -219,22 +412,23 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/LukeHagar/plexgo"
|
"github.com/LukeHagar/plexgo"
|
||||||
"github.com/LukeHagar/plexgo/models/components"
|
|
||||||
"log"
|
"log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
s := plexgo.New(
|
s := plexgo.New(
|
||||||
plexgo.WithServerIndex(0),
|
plexgo.WithProtocol("https"),
|
||||||
|
plexgo.WithIP("e0c3:bcc0:6bac:dccc:c4ec:34b1:ca98:4cb9"),
|
||||||
|
plexgo.WithPort("40311"),
|
||||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
)
|
)
|
||||||
|
|
||||||
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
if res.Object != nil {
|
if res.Object != nil {
|
||||||
// handle response
|
// handle response
|
||||||
}
|
}
|
||||||
@@ -242,43 +436,66 @@ 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
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/LukeHagar/plexgo"
|
"github.com/LukeHagar/plexgo"
|
||||||
"github.com/LukeHagar/plexgo/models/components"
|
|
||||||
"log"
|
"log"
|
||||||
)
|
)
|
||||||
|
|
||||||
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>"),
|
||||||
)
|
)
|
||||||
|
|
||||||
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
if res.Object != nil {
|
if res.Object != nil {
|
||||||
// handle response
|
// handle response
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Override Server URL Per-Operation
|
||||||
|
|
||||||
|
The server URL can also be overridden on a per-operation basis, provided a server list was specified for the operation. For example:
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/LukeHagar/plexgo"
|
||||||
|
"github.com/LukeHagar/plexgo/models/operations"
|
||||||
|
"log"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
s := plexgo.New(
|
||||||
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
|
)
|
||||||
|
|
||||||
|
res, err := s.Plex.GetCompanionsData(ctx, operations.WithServerURL("https://plex.tv/api/v2"))
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
if res.ResponseBodies != nil {
|
||||||
|
// handle response
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
<!-- End Server Selection [server] -->
|
<!-- End Server Selection [server] -->
|
||||||
|
|
||||||
@@ -319,7 +536,7 @@ 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:
|
||||||
@@ -333,16 +550,16 @@ 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>"),
|
||||||
)
|
)
|
||||||
|
|
||||||
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
if res.Object != nil {
|
if res.Object != nil {
|
||||||
// handle response
|
// handle response
|
||||||
}
|
}
|
||||||
@@ -354,7 +571,27 @@ func main() {
|
|||||||
<!-- Start Special Types [types] -->
|
<!-- Start Special Types [types] -->
|
||||||
## Special Types
|
## Special Types
|
||||||
|
|
||||||
|
This SDK defines the following custom types to assist with marshalling and unmarshalling data.
|
||||||
|
|
||||||
|
### Date
|
||||||
|
|
||||||
|
`types.Date` is a wrapper around time.Time that allows for JSON marshaling a date string formatted as "2006-01-02".
|
||||||
|
|
||||||
|
#### Usage
|
||||||
|
|
||||||
|
```go
|
||||||
|
d1 := types.NewDate(time.Now()) // returns *types.Date
|
||||||
|
|
||||||
|
d2 := types.DateFromTime(time.Now()) // returns types.Date
|
||||||
|
|
||||||
|
d3, err := types.NewDateFromString("2019-01-01") // returns *types.Date, error
|
||||||
|
|
||||||
|
d4, err := types.DateFromString("2019-01-01") // returns types.Date, error
|
||||||
|
|
||||||
|
d5 := types.MustNewDateFromString("2019-01-01") // returns *types.Date and panics on error
|
||||||
|
|
||||||
|
d6 := types.MustDateFromString("2019-01-01") // returns types.Date and panics on error
|
||||||
|
```
|
||||||
<!-- End Special Types [types] -->
|
<!-- End Special Types [types] -->
|
||||||
|
|
||||||
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
||||||
|
|||||||
1004
RELEASES.md
1004
RELEASES.md
File diff suppressed because it is too large
Load Diff
5
USAGE.md
5
USAGE.md
@@ -5,21 +5,20 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/LukeHagar/plexgo"
|
"github.com/LukeHagar/plexgo"
|
||||||
"github.com/LukeHagar/plexgo/models/components"
|
|
||||||
"log"
|
"log"
|
||||||
)
|
)
|
||||||
|
|
||||||
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>"),
|
||||||
)
|
)
|
||||||
|
|
||||||
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
if res.Object != nil {
|
if res.Object != nil {
|
||||||
// handle response
|
// handle response
|
||||||
}
|
}
|
||||||
|
|||||||
453
activities.go
453
activities.go
@@ -1,4 +1,4 @@
|
|||||||
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||||
|
|
||||||
package plexgo
|
package plexgo
|
||||||
|
|
||||||
@@ -6,12 +6,13 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"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"
|
||||||
"io"
|
"github.com/LukeHagar/plexgo/retry"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"net/url"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.
|
// Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.
|
||||||
@@ -33,45 +34,168 @@ func newActivities(sdkConfig sdkConfiguration) *Activities {
|
|||||||
|
|
||||||
// GetServerActivities - Get Server Activities
|
// GetServerActivities - Get Server Activities
|
||||||
// Get Server Activities
|
// Get Server Activities
|
||||||
func (s *Activities) GetServerActivities(ctx context.Context) (*operations.GetServerActivitiesResponse, error) {
|
func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations.Option) (*operations.GetServerActivitiesResponse, error) {
|
||||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
o := operations.Options{}
|
||||||
url := strings.TrimSuffix(baseURL, "/") + "/activities"
|
supportedOptions := []string{
|
||||||
|
operations.SupportedOptionRetries,
|
||||||
|
operations.SupportedOptionTimeout,
|
||||||
|
}
|
||||||
|
|
||||||
req, err := http.NewRequestWithContext(ctx, "GET", url, nil)
|
for _, opt := range opts {
|
||||||
|
if err := opt(&o, supportedOptions...); err != nil {
|
||||||
|
return nil, fmt.Errorf("error applying option: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var baseURL string
|
||||||
|
if o.ServerURL == nil {
|
||||||
|
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||||
|
} else {
|
||||||
|
baseURL = *o.ServerURL
|
||||||
|
}
|
||||||
|
opURL, err := url.JoinPath(baseURL, "/activities")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
hookCtx := hooks.HookContext{
|
||||||
|
BaseURL: baseURL,
|
||||||
|
Context: ctx,
|
||||||
|
OperationID: "getServerActivities",
|
||||||
|
OAuth2Scopes: []string{},
|
||||||
|
SecuritySource: s.sdkConfiguration.Security,
|
||||||
|
}
|
||||||
|
|
||||||
|
timeout := o.Timeout
|
||||||
|
if timeout == nil {
|
||||||
|
timeout = s.sdkConfiguration.Timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
if timeout != nil {
|
||||||
|
var cancel context.CancelFunc
|
||||||
|
ctx, cancel = context.WithTimeout(ctx, *timeout)
|
||||||
|
defer cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error creating request: %w", err)
|
return nil, fmt.Errorf("error creating request: %w", err)
|
||||||
}
|
}
|
||||||
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)
|
||||||
|
|
||||||
client := s.sdkConfiguration.SecurityClient
|
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
httpRes, err := client.Do(req)
|
for k, v := range o.SetHeaders {
|
||||||
|
req.Header.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||||
|
retryConfig := o.Retries
|
||||||
|
if retryConfig == nil {
|
||||||
|
if globalRetryConfig != nil {
|
||||||
|
retryConfig = globalRetryConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var httpRes *http.Response
|
||||||
|
if retryConfig != nil {
|
||||||
|
httpRes, err = utils.Retry(ctx, utils.Retries{
|
||||||
|
Config: retryConfig,
|
||||||
|
StatusCodes: []string{
|
||||||
|
"429",
|
||||||
|
"500",
|
||||||
|
"502",
|
||||||
|
"503",
|
||||||
|
"504",
|
||||||
|
},
|
||||||
|
}, func() (*http.Response, error) {
|
||||||
|
if req.Body != nil {
|
||||||
|
copyBody, err := req.GetBody()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error sending request: %w", err)
|
return nil, err
|
||||||
}
|
}
|
||||||
if httpRes == nil {
|
req.Body = copyBody
|
||||||
return nil, fmt.Errorf("error sending request: no response")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
contentType := httpRes.Header.Get("Content-Type")
|
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
|
if err != nil {
|
||||||
|
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, retry.Permanent(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||||
|
if err != nil || httpRes == nil {
|
||||||
|
if err != nil {
|
||||||
|
err = fmt.Errorf("error sending request: %w", err)
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("error sending request: no response")
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
|
}
|
||||||
|
return httpRes, err
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else {
|
||||||
|
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
httpRes, err = s.sdkConfiguration.Client.Do(req)
|
||||||
|
if err != nil || httpRes == nil {
|
||||||
|
if err != nil {
|
||||||
|
err = fmt.Errorf("error sending request: %w", err)
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("error sending request: no response")
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
|
return nil, err
|
||||||
|
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
||||||
|
_httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else if _httpRes != nil {
|
||||||
|
httpRes = _httpRes
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
res := &operations.GetServerActivitiesResponse{
|
res := &operations.GetServerActivitiesResponse{
|
||||||
StatusCode: httpRes.StatusCode,
|
StatusCode: httpRes.StatusCode,
|
||||||
ContentType: contentType,
|
ContentType: httpRes.Header.Get("Content-Type"),
|
||||||
RawResponse: httpRes,
|
RawResponse: httpRes,
|
||||||
}
|
}
|
||||||
|
|
||||||
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))
|
|
||||||
switch {
|
switch {
|
||||||
case httpRes.StatusCode == 200:
|
case httpRes.StatusCode == 200:
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(contentType, `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
var out operations.GetServerActivitiesResponseBody
|
var out operations.GetServerActivitiesResponseBody
|
||||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -79,98 +203,305 @@ func (s *Activities) GetServerActivities(ctx context.Context) (*operations.GetSe
|
|||||||
|
|
||||||
res.Object = &out
|
res.Object = &out
|
||||||
default:
|
default:
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes)
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
}
|
}
|
||||||
case httpRes.StatusCode == 400:
|
case httpRes.StatusCode == 400:
|
||||||
fallthrough
|
|
||||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
|
||||||
fallthrough
|
|
||||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
|
||||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
|
||||||
case httpRes.StatusCode == 401:
|
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(contentType, `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
var out sdkerrors.GetServerActivitiesResponseBody
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var out sdkerrors.GetServerActivitiesBadRequest
|
||||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
out.RawResponse = httpRes
|
|
||||||
|
|
||||||
|
out.RawResponse = httpRes
|
||||||
return nil, &out
|
return nil, &out
|
||||||
default:
|
default:
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes)
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
}
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
case httpRes.StatusCode == 401:
|
||||||
|
switch {
|
||||||
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var out sdkerrors.GetServerActivitiesUnauthorized
|
||||||
|
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
out.RawResponse = httpRes
|
||||||
|
return nil, &out
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
}
|
}
|
||||||
|
|
||||||
return res, nil
|
return res, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CancelServerActivities - Cancel Server Activities
|
// CancelServerActivities - Cancel Server Activities
|
||||||
// Cancel Server Activities
|
// Cancel Server Activities
|
||||||
func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID string) (*operations.CancelServerActivitiesResponse, error) {
|
func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID string, opts ...operations.Option) (*operations.CancelServerActivitiesResponse, error) {
|
||||||
request := operations.CancelServerActivitiesRequest{
|
request := operations.CancelServerActivitiesRequest{
|
||||||
ActivityUUID: activityUUID,
|
ActivityUUID: activityUUID,
|
||||||
}
|
}
|
||||||
|
|
||||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
o := operations.Options{}
|
||||||
url, err := utils.GenerateURL(ctx, baseURL, "/activities/{activityUUID}", request, nil)
|
supportedOptions := []string{
|
||||||
|
operations.SupportedOptionRetries,
|
||||||
|
operations.SupportedOptionTimeout,
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, opt := range opts {
|
||||||
|
if err := opt(&o, supportedOptions...); err != nil {
|
||||||
|
return nil, fmt.Errorf("error applying option: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var baseURL string
|
||||||
|
if o.ServerURL == nil {
|
||||||
|
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||||
|
} else {
|
||||||
|
baseURL = *o.ServerURL
|
||||||
|
}
|
||||||
|
opURL, err := utils.GenerateURL(ctx, baseURL, "/activities/{activityUUID}", request, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil)
|
hookCtx := hooks.HookContext{
|
||||||
|
BaseURL: baseURL,
|
||||||
|
Context: ctx,
|
||||||
|
OperationID: "cancelServerActivities",
|
||||||
|
OAuth2Scopes: []string{},
|
||||||
|
SecuritySource: s.sdkConfiguration.Security,
|
||||||
|
}
|
||||||
|
|
||||||
|
timeout := o.Timeout
|
||||||
|
if timeout == nil {
|
||||||
|
timeout = s.sdkConfiguration.Timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
if timeout != nil {
|
||||||
|
var cancel context.CancelFunc
|
||||||
|
ctx, cancel = context.WithTimeout(ctx, *timeout)
|
||||||
|
defer cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error creating request: %w", err)
|
return nil, fmt.Errorf("error creating request: %w", err)
|
||||||
}
|
}
|
||||||
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)
|
||||||
|
|
||||||
client := s.sdkConfiguration.SecurityClient
|
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
httpRes, err := client.Do(req)
|
for k, v := range o.SetHeaders {
|
||||||
|
req.Header.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||||
|
retryConfig := o.Retries
|
||||||
|
if retryConfig == nil {
|
||||||
|
if globalRetryConfig != nil {
|
||||||
|
retryConfig = globalRetryConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var httpRes *http.Response
|
||||||
|
if retryConfig != nil {
|
||||||
|
httpRes, err = utils.Retry(ctx, utils.Retries{
|
||||||
|
Config: retryConfig,
|
||||||
|
StatusCodes: []string{
|
||||||
|
"429",
|
||||||
|
"500",
|
||||||
|
"502",
|
||||||
|
"503",
|
||||||
|
"504",
|
||||||
|
},
|
||||||
|
}, func() (*http.Response, error) {
|
||||||
|
if req.Body != nil {
|
||||||
|
copyBody, err := req.GetBody()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error sending request: %w", err)
|
return nil, err
|
||||||
}
|
}
|
||||||
if httpRes == nil {
|
req.Body = copyBody
|
||||||
return nil, fmt.Errorf("error sending request: no response")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
contentType := httpRes.Header.Get("Content-Type")
|
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
|
if err != nil {
|
||||||
|
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, retry.Permanent(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||||
|
if err != nil || httpRes == nil {
|
||||||
|
if err != nil {
|
||||||
|
err = fmt.Errorf("error sending request: %w", err)
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("error sending request: no response")
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
|
}
|
||||||
|
return httpRes, err
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else {
|
||||||
|
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
httpRes, err = s.sdkConfiguration.Client.Do(req)
|
||||||
|
if err != nil || httpRes == nil {
|
||||||
|
if err != nil {
|
||||||
|
err = fmt.Errorf("error sending request: %w", err)
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("error sending request: no response")
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
|
return nil, err
|
||||||
|
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
||||||
|
_httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else if _httpRes != nil {
|
||||||
|
httpRes = _httpRes
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
res := &operations.CancelServerActivitiesResponse{
|
res := &operations.CancelServerActivitiesResponse{
|
||||||
StatusCode: httpRes.StatusCode,
|
StatusCode: httpRes.StatusCode,
|
||||||
ContentType: contentType,
|
ContentType: httpRes.Header.Get("Content-Type"),
|
||||||
RawResponse: httpRes,
|
RawResponse: httpRes,
|
||||||
}
|
}
|
||||||
|
|
||||||
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))
|
|
||||||
switch {
|
switch {
|
||||||
case httpRes.StatusCode == 200:
|
case httpRes.StatusCode == 200:
|
||||||
case httpRes.StatusCode == 400:
|
case httpRes.StatusCode == 400:
|
||||||
fallthrough
|
|
||||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
|
||||||
fallthrough
|
|
||||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
|
||||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
|
||||||
case httpRes.StatusCode == 401:
|
|
||||||
switch {
|
switch {
|
||||||
case utils.MatchContentType(contentType, `application/json`):
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
var out sdkerrors.CancelServerActivitiesResponseBody
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var out sdkerrors.CancelServerActivitiesBadRequest
|
||||||
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
out.RawResponse = httpRes
|
|
||||||
|
|
||||||
|
out.RawResponse = httpRes
|
||||||
return nil, &out
|
return nil, &out
|
||||||
default:
|
default:
|
||||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes)
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
}
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
case httpRes.StatusCode == 401:
|
||||||
|
switch {
|
||||||
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var out sdkerrors.CancelServerActivitiesUnauthorized
|
||||||
|
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
out.RawResponse = httpRes
|
||||||
|
return nil, &out
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
}
|
}
|
||||||
|
|
||||||
return res, nil
|
return res, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
988
authentication.go
Normal file
988
authentication.go
Normal file
@@ -0,0 +1,988 @@
|
|||||||
|
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||||
|
|
||||||
|
package plexgo
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"github.com/LukeHagar/plexgo/internal/hooks"
|
||||||
|
"github.com/LukeHagar/plexgo/internal/utils"
|
||||||
|
"github.com/LukeHagar/plexgo/models/operations"
|
||||||
|
"github.com/LukeHagar/plexgo/models/sdkerrors"
|
||||||
|
"github.com/LukeHagar/plexgo/retry"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Authentication - API Calls regarding authentication for Plex Media Server
|
||||||
|
type Authentication struct {
|
||||||
|
sdkConfiguration sdkConfiguration
|
||||||
|
}
|
||||||
|
|
||||||
|
func newAuthentication(sdkConfig sdkConfiguration) *Authentication {
|
||||||
|
return &Authentication{
|
||||||
|
sdkConfiguration: sdkConfig,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetTransientToken - Get a Transient Token
|
||||||
|
// This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted.
|
||||||
|
func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations.GetTransientTokenQueryParamType, scope operations.Scope, opts ...operations.Option) (*operations.GetTransientTokenResponse, error) {
|
||||||
|
request := operations.GetTransientTokenRequest{
|
||||||
|
Type: type_,
|
||||||
|
Scope: scope,
|
||||||
|
}
|
||||||
|
|
||||||
|
o := operations.Options{}
|
||||||
|
supportedOptions := []string{
|
||||||
|
operations.SupportedOptionRetries,
|
||||||
|
operations.SupportedOptionTimeout,
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, opt := range opts {
|
||||||
|
if err := opt(&o, supportedOptions...); err != nil {
|
||||||
|
return nil, fmt.Errorf("error applying option: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var baseURL string
|
||||||
|
if o.ServerURL == nil {
|
||||||
|
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||||
|
} else {
|
||||||
|
baseURL = *o.ServerURL
|
||||||
|
}
|
||||||
|
opURL, err := url.JoinPath(baseURL, "/security/token")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
hookCtx := hooks.HookContext{
|
||||||
|
BaseURL: baseURL,
|
||||||
|
Context: ctx,
|
||||||
|
OperationID: "getTransientToken",
|
||||||
|
OAuth2Scopes: []string{},
|
||||||
|
SecuritySource: s.sdkConfiguration.Security,
|
||||||
|
}
|
||||||
|
|
||||||
|
timeout := o.Timeout
|
||||||
|
if timeout == nil {
|
||||||
|
timeout = s.sdkConfiguration.Timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
if timeout != nil {
|
||||||
|
var cancel context.CancelFunc
|
||||||
|
ctx, cancel = context.WithTimeout(ctx, *timeout)
|
||||||
|
defer cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error creating request: %w", err)
|
||||||
|
}
|
||||||
|
req.Header.Set("Accept", "application/json")
|
||||||
|
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
|
||||||
|
|
||||||
|
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil {
|
||||||
|
return nil, fmt.Errorf("error populating query params: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
for k, v := range o.SetHeaders {
|
||||||
|
req.Header.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||||
|
retryConfig := o.Retries
|
||||||
|
if retryConfig == nil {
|
||||||
|
if globalRetryConfig != nil {
|
||||||
|
retryConfig = globalRetryConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var httpRes *http.Response
|
||||||
|
if retryConfig != nil {
|
||||||
|
httpRes, err = utils.Retry(ctx, utils.Retries{
|
||||||
|
Config: retryConfig,
|
||||||
|
StatusCodes: []string{
|
||||||
|
"429",
|
||||||
|
"500",
|
||||||
|
"502",
|
||||||
|
"503",
|
||||||
|
"504",
|
||||||
|
},
|
||||||
|
}, func() (*http.Response, error) {
|
||||||
|
if req.Body != nil {
|
||||||
|
copyBody, err := req.GetBody()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
req.Body = copyBody
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
|
if err != nil {
|
||||||
|
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, retry.Permanent(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||||
|
if err != nil || httpRes == nil {
|
||||||
|
if err != nil {
|
||||||
|
err = fmt.Errorf("error sending request: %w", err)
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("error sending request: no response")
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
|
}
|
||||||
|
return httpRes, err
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else {
|
||||||
|
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
httpRes, err = s.sdkConfiguration.Client.Do(req)
|
||||||
|
if err != nil || httpRes == nil {
|
||||||
|
if err != nil {
|
||||||
|
err = fmt.Errorf("error sending request: %w", err)
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("error sending request: no response")
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
|
return nil, err
|
||||||
|
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
||||||
|
_httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else if _httpRes != nil {
|
||||||
|
httpRes = _httpRes
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
res := &operations.GetTransientTokenResponse{
|
||||||
|
StatusCode: httpRes.StatusCode,
|
||||||
|
ContentType: httpRes.Header.Get("Content-Type"),
|
||||||
|
RawResponse: httpRes,
|
||||||
|
}
|
||||||
|
|
||||||
|
switch {
|
||||||
|
case httpRes.StatusCode == 200:
|
||||||
|
case httpRes.StatusCode == 400:
|
||||||
|
switch {
|
||||||
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var out sdkerrors.GetTransientTokenBadRequest
|
||||||
|
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
out.RawResponse = httpRes
|
||||||
|
return nil, &out
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
case httpRes.StatusCode == 401:
|
||||||
|
switch {
|
||||||
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var out sdkerrors.GetTransientTokenUnauthorized
|
||||||
|
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
out.RawResponse = httpRes
|
||||||
|
return nil, &out
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
|
||||||
|
return res, nil
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetSourceConnectionInformation - Get Source Connection Information
|
||||||
|
// If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token.
|
||||||
|
// Note: requires Plex Media Server >= 1.15.4.
|
||||||
|
func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, source string, opts ...operations.Option) (*operations.GetSourceConnectionInformationResponse, error) {
|
||||||
|
request := operations.GetSourceConnectionInformationRequest{
|
||||||
|
Source: source,
|
||||||
|
}
|
||||||
|
|
||||||
|
o := operations.Options{}
|
||||||
|
supportedOptions := []string{
|
||||||
|
operations.SupportedOptionRetries,
|
||||||
|
operations.SupportedOptionTimeout,
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, opt := range opts {
|
||||||
|
if err := opt(&o, supportedOptions...); err != nil {
|
||||||
|
return nil, fmt.Errorf("error applying option: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var baseURL string
|
||||||
|
if o.ServerURL == nil {
|
||||||
|
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||||
|
} else {
|
||||||
|
baseURL = *o.ServerURL
|
||||||
|
}
|
||||||
|
opURL, err := url.JoinPath(baseURL, "/security/resources")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
hookCtx := hooks.HookContext{
|
||||||
|
BaseURL: baseURL,
|
||||||
|
Context: ctx,
|
||||||
|
OperationID: "getSourceConnectionInformation",
|
||||||
|
OAuth2Scopes: []string{},
|
||||||
|
SecuritySource: s.sdkConfiguration.Security,
|
||||||
|
}
|
||||||
|
|
||||||
|
timeout := o.Timeout
|
||||||
|
if timeout == nil {
|
||||||
|
timeout = s.sdkConfiguration.Timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
if timeout != nil {
|
||||||
|
var cancel context.CancelFunc
|
||||||
|
ctx, cancel = context.WithTimeout(ctx, *timeout)
|
||||||
|
defer cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error creating request: %w", err)
|
||||||
|
}
|
||||||
|
req.Header.Set("Accept", "application/json")
|
||||||
|
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
|
||||||
|
|
||||||
|
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil {
|
||||||
|
return nil, fmt.Errorf("error populating query params: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
for k, v := range o.SetHeaders {
|
||||||
|
req.Header.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||||
|
retryConfig := o.Retries
|
||||||
|
if retryConfig == nil {
|
||||||
|
if globalRetryConfig != nil {
|
||||||
|
retryConfig = globalRetryConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var httpRes *http.Response
|
||||||
|
if retryConfig != nil {
|
||||||
|
httpRes, err = utils.Retry(ctx, utils.Retries{
|
||||||
|
Config: retryConfig,
|
||||||
|
StatusCodes: []string{
|
||||||
|
"429",
|
||||||
|
"500",
|
||||||
|
"502",
|
||||||
|
"503",
|
||||||
|
"504",
|
||||||
|
},
|
||||||
|
}, func() (*http.Response, error) {
|
||||||
|
if req.Body != nil {
|
||||||
|
copyBody, err := req.GetBody()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
req.Body = copyBody
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
|
if err != nil {
|
||||||
|
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, retry.Permanent(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||||
|
if err != nil || httpRes == nil {
|
||||||
|
if err != nil {
|
||||||
|
err = fmt.Errorf("error sending request: %w", err)
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("error sending request: no response")
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
|
}
|
||||||
|
return httpRes, err
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else {
|
||||||
|
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
httpRes, err = s.sdkConfiguration.Client.Do(req)
|
||||||
|
if err != nil || httpRes == nil {
|
||||||
|
if err != nil {
|
||||||
|
err = fmt.Errorf("error sending request: %w", err)
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("error sending request: no response")
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
|
return nil, err
|
||||||
|
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
||||||
|
_httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else if _httpRes != nil {
|
||||||
|
httpRes = _httpRes
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
res := &operations.GetSourceConnectionInformationResponse{
|
||||||
|
StatusCode: httpRes.StatusCode,
|
||||||
|
ContentType: httpRes.Header.Get("Content-Type"),
|
||||||
|
RawResponse: httpRes,
|
||||||
|
}
|
||||||
|
|
||||||
|
switch {
|
||||||
|
case httpRes.StatusCode == 200:
|
||||||
|
case httpRes.StatusCode == 400:
|
||||||
|
switch {
|
||||||
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var out sdkerrors.GetSourceConnectionInformationBadRequest
|
||||||
|
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
out.RawResponse = httpRes
|
||||||
|
return nil, &out
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
case httpRes.StatusCode == 401:
|
||||||
|
switch {
|
||||||
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var out sdkerrors.GetSourceConnectionInformationUnauthorized
|
||||||
|
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
out.RawResponse = httpRes
|
||||||
|
return nil, &out
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
|
||||||
|
return res, nil
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetTokenDetails - Get Token Details
|
||||||
|
// Get the User data from the provided X-Plex-Token
|
||||||
|
func (s *Authentication) GetTokenDetails(ctx context.Context, opts ...operations.Option) (*operations.GetTokenDetailsResponse, error) {
|
||||||
|
o := operations.Options{}
|
||||||
|
supportedOptions := []string{
|
||||||
|
operations.SupportedOptionRetries,
|
||||||
|
operations.SupportedOptionTimeout,
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, opt := range opts {
|
||||||
|
if err := opt(&o, supportedOptions...); err != nil {
|
||||||
|
return nil, fmt.Errorf("error applying option: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
baseURL := utils.ReplaceParameters(operations.GetTokenDetailsServerList[0], map[string]string{})
|
||||||
|
if o.ServerURL != nil {
|
||||||
|
baseURL = *o.ServerURL
|
||||||
|
}
|
||||||
|
|
||||||
|
opURL, err := url.JoinPath(baseURL, "/user")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
hookCtx := hooks.HookContext{
|
||||||
|
BaseURL: baseURL,
|
||||||
|
Context: ctx,
|
||||||
|
OperationID: "getTokenDetails",
|
||||||
|
OAuth2Scopes: []string{},
|
||||||
|
SecuritySource: s.sdkConfiguration.Security,
|
||||||
|
}
|
||||||
|
|
||||||
|
timeout := o.Timeout
|
||||||
|
if timeout == nil {
|
||||||
|
timeout = s.sdkConfiguration.Timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
if timeout != nil {
|
||||||
|
var cancel context.CancelFunc
|
||||||
|
ctx, cancel = context.WithTimeout(ctx, *timeout)
|
||||||
|
defer cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error creating request: %w", err)
|
||||||
|
}
|
||||||
|
req.Header.Set("Accept", "application/json")
|
||||||
|
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
|
||||||
|
|
||||||
|
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
for k, v := range o.SetHeaders {
|
||||||
|
req.Header.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||||
|
retryConfig := o.Retries
|
||||||
|
if retryConfig == nil {
|
||||||
|
if globalRetryConfig != nil {
|
||||||
|
retryConfig = globalRetryConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var httpRes *http.Response
|
||||||
|
if retryConfig != nil {
|
||||||
|
httpRes, err = utils.Retry(ctx, utils.Retries{
|
||||||
|
Config: retryConfig,
|
||||||
|
StatusCodes: []string{
|
||||||
|
"429",
|
||||||
|
"500",
|
||||||
|
"502",
|
||||||
|
"503",
|
||||||
|
"504",
|
||||||
|
},
|
||||||
|
}, func() (*http.Response, error) {
|
||||||
|
if req.Body != nil {
|
||||||
|
copyBody, err := req.GetBody()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
req.Body = copyBody
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
|
if err != nil {
|
||||||
|
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, retry.Permanent(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||||
|
if err != nil || httpRes == nil {
|
||||||
|
if err != nil {
|
||||||
|
err = fmt.Errorf("error sending request: %w", err)
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("error sending request: no response")
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
|
}
|
||||||
|
return httpRes, err
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else {
|
||||||
|
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
httpRes, err = s.sdkConfiguration.Client.Do(req)
|
||||||
|
if err != nil || httpRes == nil {
|
||||||
|
if err != nil {
|
||||||
|
err = fmt.Errorf("error sending request: %w", err)
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("error sending request: no response")
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
|
return nil, err
|
||||||
|
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
||||||
|
_httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else if _httpRes != nil {
|
||||||
|
httpRes = _httpRes
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
res := &operations.GetTokenDetailsResponse{
|
||||||
|
StatusCode: httpRes.StatusCode,
|
||||||
|
ContentType: httpRes.Header.Get("Content-Type"),
|
||||||
|
RawResponse: httpRes,
|
||||||
|
}
|
||||||
|
|
||||||
|
switch {
|
||||||
|
case httpRes.StatusCode == 200:
|
||||||
|
switch {
|
||||||
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var out operations.GetTokenDetailsUserPlexAccount
|
||||||
|
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
res.UserPlexAccount = &out
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
case httpRes.StatusCode == 400:
|
||||||
|
switch {
|
||||||
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var out sdkerrors.GetTokenDetailsBadRequest
|
||||||
|
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
out.RawResponse = httpRes
|
||||||
|
return nil, &out
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
case httpRes.StatusCode == 401:
|
||||||
|
switch {
|
||||||
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var out sdkerrors.GetTokenDetailsUnauthorized
|
||||||
|
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
out.RawResponse = httpRes
|
||||||
|
return nil, &out
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
|
||||||
|
return res, nil
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// PostUsersSignInData - Get User Sign In Data
|
||||||
|
// Sign in user with username and password and return user data with Plex authentication token
|
||||||
|
func (s *Authentication) PostUsersSignInData(ctx context.Context, request operations.PostUsersSignInDataRequest, opts ...operations.Option) (*operations.PostUsersSignInDataResponse, error) {
|
||||||
|
o := operations.Options{}
|
||||||
|
supportedOptions := []string{
|
||||||
|
operations.SupportedOptionRetries,
|
||||||
|
operations.SupportedOptionTimeout,
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, opt := range opts {
|
||||||
|
if err := opt(&o, supportedOptions...); err != nil {
|
||||||
|
return nil, fmt.Errorf("error applying option: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
baseURL := utils.ReplaceParameters(operations.PostUsersSignInDataServerList[0], map[string]string{})
|
||||||
|
if o.ServerURL != nil {
|
||||||
|
baseURL = *o.ServerURL
|
||||||
|
}
|
||||||
|
|
||||||
|
opURL, err := url.JoinPath(baseURL, "/users/signin")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
hookCtx := hooks.HookContext{
|
||||||
|
BaseURL: baseURL,
|
||||||
|
Context: ctx,
|
||||||
|
OperationID: "post-users-sign-in-data",
|
||||||
|
OAuth2Scopes: []string{},
|
||||||
|
SecuritySource: nil,
|
||||||
|
}
|
||||||
|
bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "form", `request:"mediaType=application/x-www-form-urlencoded"`)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
timeout := o.Timeout
|
||||||
|
if timeout == nil {
|
||||||
|
timeout = s.sdkConfiguration.Timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
if timeout != nil {
|
||||||
|
var cancel context.CancelFunc
|
||||||
|
ctx, cancel = context.WithTimeout(ctx, *timeout)
|
||||||
|
defer cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error creating request: %w", err)
|
||||||
|
}
|
||||||
|
req.Header.Set("Accept", "application/json")
|
||||||
|
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
|
||||||
|
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
|
||||||
|
retryConfig := o.Retries
|
||||||
|
if retryConfig == nil {
|
||||||
|
if globalRetryConfig != nil {
|
||||||
|
retryConfig = globalRetryConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var httpRes *http.Response
|
||||||
|
if retryConfig != nil {
|
||||||
|
httpRes, err = utils.Retry(ctx, utils.Retries{
|
||||||
|
Config: retryConfig,
|
||||||
|
StatusCodes: []string{
|
||||||
|
"429",
|
||||||
|
"500",
|
||||||
|
"502",
|
||||||
|
"503",
|
||||||
|
"504",
|
||||||
|
},
|
||||||
|
}, func() (*http.Response, error) {
|
||||||
|
if req.Body != nil {
|
||||||
|
copyBody, err := req.GetBody()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
req.Body = copyBody
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
|
if err != nil {
|
||||||
|
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, retry.Permanent(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||||
|
if err != nil || httpRes == nil {
|
||||||
|
if err != nil {
|
||||||
|
err = fmt.Errorf("error sending request: %w", err)
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("error sending request: no response")
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
|
}
|
||||||
|
return httpRes, err
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else {
|
||||||
|
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
httpRes, err = s.sdkConfiguration.Client.Do(req)
|
||||||
|
if err != nil || httpRes == nil {
|
||||||
|
if err != nil {
|
||||||
|
err = fmt.Errorf("error sending request: %w", err)
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("error sending request: no response")
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||||
|
return nil, err
|
||||||
|
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
|
||||||
|
_httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else if _httpRes != nil {
|
||||||
|
httpRes = _httpRes
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
res := &operations.PostUsersSignInDataResponse{
|
||||||
|
StatusCode: httpRes.StatusCode,
|
||||||
|
ContentType: httpRes.Header.Get("Content-Type"),
|
||||||
|
RawResponse: httpRes,
|
||||||
|
}
|
||||||
|
|
||||||
|
switch {
|
||||||
|
case httpRes.StatusCode == 201:
|
||||||
|
switch {
|
||||||
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var out operations.PostUsersSignInDataUserPlexAccount
|
||||||
|
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
res.UserPlexAccount = &out
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
case httpRes.StatusCode == 400:
|
||||||
|
switch {
|
||||||
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var out sdkerrors.PostUsersSignInDataBadRequest
|
||||||
|
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
out.RawResponse = httpRes
|
||||||
|
return nil, &out
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
case httpRes.StatusCode == 401:
|
||||||
|
switch {
|
||||||
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var out sdkerrors.PostUsersSignInDataUnauthorized
|
||||||
|
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
out.RawResponse = httpRes
|
||||||
|
return nil, &out
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
|
||||||
|
return res, nil
|
||||||
|
|
||||||
|
}
|
||||||
2522
codeSamples.yaml
Normal file
2522
codeSamples.yaml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -5,4 +5,4 @@
|
|||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
| `AccessToken` | *string* | :heavy_check_mark: | N/A |
|
| `AccessToken` | **string* | :heavy_minus_sign: | N/A |
|
||||||
15
docs/models/operations/account.md
Normal file
15
docs/models/operations/account.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Account
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
|
||||||
|
| `ID` | **int* | :heavy_minus_sign: | N/A | 238960586 |
|
||||||
|
| `Key` | **string* | :heavy_minus_sign: | N/A | /accounts/238960586 |
|
||||||
|
| `Name` | **string* | :heavy_minus_sign: | N/A | Diane |
|
||||||
|
| `DefaultAudioLanguage` | **string* | :heavy_minus_sign: | N/A | en |
|
||||||
|
| `AutoSelectAudio` | **bool* | :heavy_minus_sign: | N/A | true |
|
||||||
|
| `DefaultSubtitleLanguage` | **string* | :heavy_minus_sign: | N/A | en |
|
||||||
|
| `SubtitleMode` | **int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `Thumb` | **string* | :heavy_minus_sign: | N/A | https://plex.tv/users/50d83634246da1de/avatar?c=1707110967 |
|
||||||
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/addplaylistcontentsmediacontainer.md
Normal file
11
docs/models/operations/addplaylistcontentsmediacontainer.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# AddPlaylistContentsMediaContainer
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
||||||
|
| `Size` | **int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `LeafCountAdded` | **int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `LeafCountRequested` | **int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `Metadata` | [][operations.AddPlaylistContentsMetadata](../../models/operations/addplaylistcontentsmetadata.md) | :heavy_minus_sign: | N/A | |
|
||||||
20
docs/models/operations/addplaylistcontentsmetadata.md
Normal file
20
docs/models/operations/addplaylistcontentsmetadata.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# AddPlaylistContentsMetadata
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
|
||||||
|
| `RatingKey` | **string* | :heavy_minus_sign: | N/A | 94 |
|
||||||
|
| `Key` | **string* | :heavy_minus_sign: | N/A | /playlists/94/items |
|
||||||
|
| `GUID` | **string* | :heavy_minus_sign: | N/A | com.plexapp.agents.none://972e3047-83d6-4848-a000-261f0af26ba2 |
|
||||||
|
| `Type` | **string* | :heavy_minus_sign: | N/A | playlist |
|
||||||
|
| `Title` | **string* | :heavy_minus_sign: | N/A | A great playlist |
|
||||||
|
| `Summary` | **string* | :heavy_minus_sign: | N/A | One of my great playlists |
|
||||||
|
| `Smart` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `PlaylistType` | **string* | :heavy_minus_sign: | N/A | video |
|
||||||
|
| `Composite` | **string* | :heavy_minus_sign: | N/A | /playlists/94/composite/1705800070 |
|
||||||
|
| `Duration` | **int* | :heavy_minus_sign: | N/A | 423000 |
|
||||||
|
| `LeafCount` | **int* | :heavy_minus_sign: | N/A | 3 |
|
||||||
|
| `AddedAt` | **int* | :heavy_minus_sign: | N/A | 1705716458 |
|
||||||
|
| `UpdatedAt` | **int* | :heavy_minus_sign: | N/A | 1705800070 |
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
|
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
|
||||||
| `PlaylistID` | *float64* | :heavy_check_mark: | the ID of the playlist | |
|
| `PlaylistID` | *float64* | :heavy_check_mark: | the ID of the playlist | |
|
||||||
| `URI` | *string* | :heavy_check_mark: | the content URI for the playlist | library://.. |
|
| `URI` | *string* | :heavy_check_mark: | the content URI for the playlist | server://12345/com.plexapp.plugins.library/library/metadata/1 |
|
||||||
| `PlayQueueID` | *float64* | :heavy_check_mark: | the play queue to add to a playlist | 123 |
|
| `PlayQueueID` | **float64* | :heavy_minus_sign: | the play queue to add to a playlist | 123 |
|
||||||
@@ -4,7 +4,8 @@
|
|||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
|
| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
|
||||||
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||||
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code 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 |
|
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||||
|
| `Object` | [*operations.AddPlaylistContentsResponseBody](../../models/operations/addplaylistcontentsresponsebody.md) | :heavy_minus_sign: | Playlist Updated |
|
||||||
10
docs/models/operations/addplaylistcontentsresponsebody.md
Normal file
10
docs/models/operations/addplaylistcontentsresponsebody.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# AddPlaylistContentsResponseBody
|
||||||
|
|
||||||
|
Playlist Updated
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `MediaContainer` | [*operations.AddPlaylistContentsMediaContainer](../../models/operations/addplaylistcontentsmediacontainer.md) | :heavy_minus_sign: | N/A |
|
||||||
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 |
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `Tonight` | [*operations.Tonight](../../models/operations/tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install |
|
| `Tonight` | [*operations.Tonight](../../models/operations/tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install | 1 |
|
||||||
| `Skip` | [*operations.Skip](../../models/operations/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The <Release> entry for this version will have the `state` set to `skipped`. |
|
| `Skip` | [*operations.Skip](../../models/operations/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`. | 1 |
|
||||||
11
docs/models/operations/autoselectsubtitle.md
Normal file
11
docs/models/operations/autoselectsubtitle.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# AutoSelectSubtitle
|
||||||
|
|
||||||
|
The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| --------------------------- | --------------------------- |
|
||||||
|
| `AutoSelectSubtitleDisable` | 0 |
|
||||||
|
| `AutoSelectSubtitleEnable` | 1 |
|
||||||
9
docs/models/operations/billing.md
Normal file
9
docs/models/operations/billing.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# Billing
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
|
||||||
|
| `InternalPaymentMethod` | [operations.InternalPaymentMethod](../../models/operations/internalpaymentmethod.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `PaymentMethodID` | *int64* | :heavy_check_mark: | N/A |
|
||||||
@@ -3,6 +3,6 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
|
| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ |
|
||||||
| `ActivityUUID` | *string* | :heavy_check_mark: | The UUID of the activity to cancel. |
|
| `ActivityUUID` | *string* | :heavy_check_mark: | The UUID of the activity to cancel. | 25b71ed5-0f9d-461c-baa7-d404e9e10d3e |
|
||||||
@@ -3,6 +3,6 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
|
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
|
||||||
| `Download` | [*operations.Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. |
|
| `Download` | [*operations.Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | 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_minus_sign: | N/A | Working NL Subs |
|
||||||
14
docs/models/operations/connections.md
Normal file
14
docs/models/operations/connections.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# Connections
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
|
||||||
|
| `Protocol` | [operations.Protocol](../../models/operations/protocol.md) | :heavy_check_mark: | The protocol used for the connection (http, https, etc) | http |
|
||||||
|
| `Address` | *string* | :heavy_check_mark: | The (ip) address or domain name used for the connection | |
|
||||||
|
| `Port` | *int* | :heavy_check_mark: | The port used for the connection | |
|
||||||
|
| `URI` | *string* | :heavy_check_mark: | The full URI of the connection | |
|
||||||
|
| `Local` | *bool* | :heavy_check_mark: | If the connection is local address | |
|
||||||
|
| `Relay` | *bool* | :heavy_check_mark: | If the connection is relayed through plex.direct | |
|
||||||
|
| `IPv6` | *bool* | :heavy_check_mark: | If the connection is using IPv6 | |
|
||||||
9
docs/models/operations/createplaylistmediacontainer.md
Normal file
9
docs/models/operations/createplaylistmediacontainer.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# CreatePlaylistMediaContainer
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
||||||
|
| `Size` | **int* | :heavy_minus_sign: | N/A | 7 |
|
||||||
|
| `Metadata` | [][operations.CreatePlaylistMetadata](../../models/operations/createplaylistmetadata.md) | :heavy_minus_sign: | N/A | |
|
||||||
23
docs/models/operations/createplaylistmetadata.md
Normal file
23
docs/models/operations/createplaylistmetadata.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# CreatePlaylistMetadata
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
|
||||||
|
| `RatingKey` | **string* | :heavy_minus_sign: | N/A | 96 |
|
||||||
|
| `Key` | **string* | :heavy_minus_sign: | N/A | /playlists/96/items |
|
||||||
|
| `GUID` | **string* | :heavy_minus_sign: | N/A | com.plexapp.agents.none://a2f92937-1408-40e2-b022-63a8a9377e55 |
|
||||||
|
| `Type` | **string* | :heavy_minus_sign: | N/A | playlist |
|
||||||
|
| `Title` | **string* | :heavy_minus_sign: | N/A | A Great Playlist |
|
||||||
|
| `Summary` | **string* | :heavy_minus_sign: | N/A | What a great playlist |
|
||||||
|
| `Smart` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `PlaylistType` | **string* | :heavy_minus_sign: | N/A | video |
|
||||||
|
| `Icon` | **string* | :heavy_minus_sign: | N/A | playlist://image.smart |
|
||||||
|
| `ViewCount` | **int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `LastViewedAt` | **int* | :heavy_minus_sign: | N/A | 1705719589 |
|
||||||
|
| `LeafCount` | **int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `AddedAt` | **int* | :heavy_minus_sign: | N/A | 1705719589 |
|
||||||
|
| `UpdatedAt` | **int* | :heavy_minus_sign: | N/A | 1705724593 |
|
||||||
|
| `Composite` | **string* | :heavy_minus_sign: | N/A | /playlists/96/composite/1705724593 |
|
||||||
|
| `Duration` | **int* | :heavy_minus_sign: | N/A | 141000 |
|
||||||
12
docs/models/operations/createplaylistqueryparamtype.md
Normal file
12
docs/models/operations/createplaylistqueryparamtype.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# CreatePlaylistQueryParamType
|
||||||
|
|
||||||
|
type of playlist to create
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ----------------------------------- | ----------------------------------- |
|
||||||
|
| `CreatePlaylistQueryParamTypeAudio` | audio |
|
||||||
|
| `CreatePlaylistQueryParamTypeVideo` | video |
|
||||||
|
| `CreatePlaylistQueryParamTypePhoto` | photo |
|
||||||
@@ -4,9 +4,9 @@
|
|||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
|
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
||||||
| `Title` | *string* | :heavy_check_mark: | name of the playlist |
|
| `Title` | *string* | :heavy_check_mark: | name of the playlist |
|
||||||
| `Type` | [operations.Type](../../models/operations/type.md) | :heavy_check_mark: | type of playlist to create |
|
| `Type` | [operations.CreatePlaylistQueryParamType](../../models/operations/createplaylistqueryparamtype.md) | :heavy_check_mark: | type of playlist to create |
|
||||||
| `Smart` | [operations.Smart](../../models/operations/smart.md) | :heavy_check_mark: | whether the playlist is smart or not |
|
| `Smart` | [operations.Smart](../../models/operations/smart.md) | :heavy_check_mark: | whether the playlist is smart or not |
|
||||||
| `URI` | **string* | :heavy_minus_sign: | the content URI for the playlist |
|
| `URI` | *string* | :heavy_check_mark: | the content URI for the playlist |
|
||||||
| `PlayQueueID` | **float64* | :heavy_minus_sign: | the play queue to copy to a playlist |
|
| `PlayQueueID` | **float64* | :heavy_minus_sign: | the play queue to copy to a playlist |
|
||||||
@@ -4,7 +4,8 @@
|
|||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
|
| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
||||||
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||||
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code 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 |
|
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||||
|
| `Object` | [*operations.CreatePlaylistResponseBody](../../models/operations/createplaylistresponsebody.md) | :heavy_minus_sign: | returns all playlists |
|
||||||
10
docs/models/operations/createplaylistresponsebody.md
Normal file
10
docs/models/operations/createplaylistresponsebody.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# CreatePlaylistResponseBody
|
||||||
|
|
||||||
|
returns all playlists
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
||||||
|
| `MediaContainer` | [*operations.CreatePlaylistMediaContainer](../../models/operations/createplaylistmediacontainer.md) | :heavy_minus_sign: | N/A |
|
||||||
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 |
|
||||||
11
docs/models/operations/defaultsubtitleaccessibility.md
Normal file
11
docs/models/operations/defaultsubtitleaccessibility.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# DefaultSubtitleAccessibility
|
||||||
|
|
||||||
|
The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles)
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------------------------------- | ------------------------------------- |
|
||||||
|
| `DefaultSubtitleAccessibilityDisable` | 0 |
|
||||||
|
| `DefaultSubtitleAccessibilityEnable` | 1 |
|
||||||
11
docs/models/operations/defaultsubtitleforced.md
Normal file
11
docs/models/operations/defaultsubtitleforced.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# DefaultSubtitleForced
|
||||||
|
|
||||||
|
The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles)
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------------------------ | ------------------------------ |
|
||||||
|
| `DefaultSubtitleForcedDisable` | 0 |
|
||||||
|
| `DefaultSubtitleForcedEnable` | 1 |
|
||||||
@@ -4,5 +4,5 @@
|
|||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ |
|
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
||||||
| `SectionID` | *float64* | :heavy_check_mark: | the Id of the library to query | 1000 |
|
| `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 |
|
||||||
@@ -5,4 +5,4 @@
|
|||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
| `Tag` | **string* | :heavy_minus_sign: | N/A | Peyton Reed |
|
| `Tag` | **string* | :heavy_minus_sign: | N/A | James Cameron |
|
||||||
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 |
|
||||||
14
docs/models/operations/feature.md
Normal file
14
docs/models/operations/feature.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# Feature
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||||
|
| `Key` | **string* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Type` | *string* | :heavy_check_mark: | N/A | |
|
||||||
|
| `Flavor` | **string* | :heavy_minus_sign: | N/A | global |
|
||||||
|
| `ScrobbleKey` | **string* | :heavy_minus_sign: | N/A | /:/scrobble/new |
|
||||||
|
| `UnscrobbleKey` | **string* | :heavy_minus_sign: | N/A | /:/unscrobble/new |
|
||||||
|
| `Directory` | [][operations.GetMediaProvidersDirectory](../../models/operations/getmediaprovidersdirectory.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Action` | [][operations.Action](../../models/operations/action.md) | :heavy_minus_sign: | N/A | |
|
||||||
@@ -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 | [{"key":"=","title":"is"}] |
|
| `Operator` | [][operations.Operator](../../models/operations/operator.md) | :heavy_check_mark: | N/A | |
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
# Filter
|
# Filter
|
||||||
|
|
||||||
|
Filter
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
## Values
|
||||||
| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- |
|
|
||||||
| `Filter` | **string* | :heavy_minus_sign: | N/A | label |
|
| Name | Value |
|
||||||
| `FilterType` | **string* | :heavy_minus_sign: | N/A | string |
|
| ----------------- | ----------------- |
|
||||||
| `Key` | **string* | :heavy_minus_sign: | N/A | /library/sections/1/label |
|
| `FilterAll` | all |
|
||||||
| `Title` | **string* | :heavy_minus_sign: | N/A | Labels |
|
| `FilterAvailable` | available |
|
||||||
| `Type` | **string* | :heavy_minus_sign: | N/A | filter |
|
| `FilterReleased` | released |
|
||||||
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,6 @@
|
|||||||
# Force
|
# Force
|
||||||
|
|
||||||
force overwriting of duplicate playlists. By default, a playlist file uploaded with the same path will overwrite the existing playlist.
|
Force the refresh even if the library is already being refreshed.
|
||||||
The `force` argument is used to disable overwriting. If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Values
|
## Values
|
||||||
|
|||||||
19
docs/models/operations/friend.md
Normal file
19
docs/models/operations/friend.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Friend
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
|
||||||
|
| `Email` | *string* | :heavy_check_mark: | The account email address | username@email.com |
|
||||||
|
| `FriendlyName` | *string* | :heavy_check_mark: | The account full name | exampleUser |
|
||||||
|
| `Home` | *bool* | :heavy_check_mark: | If the account is a Plex Home user | |
|
||||||
|
| `ID` | *int* | :heavy_check_mark: | The Plex account ID | |
|
||||||
|
| `Restricted` | **bool* | :heavy_minus_sign: | If the account is a Plex Home managed user | |
|
||||||
|
| `SharedServers` | [][operations.SharedServers](../../models/operations/sharedservers.md) | :heavy_check_mark: | N/A | |
|
||||||
|
| `SharedSources` | [][operations.SharedSources](../../models/operations/sharedsources.md) | :heavy_check_mark: | N/A | |
|
||||||
|
| `Status` | [operations.Status](../../models/operations/status.md) | :heavy_check_mark: | Current friend request status | accepted |
|
||||||
|
| `Thumb` | *string* | :heavy_check_mark: | URL of the account thumbnail | https://plex.tv/users/7d1916e0d8f6e76b/avatar?c=1694481578 |
|
||||||
|
| `Title` | *string* | :heavy_check_mark: | The title of the account (username or friendly name) | username123 |
|
||||||
|
| `Username` | *string* | :heavy_check_mark: | The account username | username123 |
|
||||||
|
| `UUID` | *string* | :heavy_check_mark: | The account Universally Unique Identifier (UUID) | 7d1916e0d8f6e76b |
|
||||||
@@ -5,4 +5,4 @@
|
|||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
| `Tag` | **string* | :heavy_minus_sign: | N/A | Comedy |
|
| `Tag` | **string* | :heavy_minus_sign: | N/A | Adventure |
|
||||||
20
docs/models/operations/geodata.md
Normal file
20
docs/models/operations/geodata.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# GeoData
|
||||||
|
|
||||||
|
Geo location data
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
||||||
|
| `Code` | *string* | :heavy_check_mark: | The ISO 3166-1 alpha-2 code of the country. | VI |
|
||||||
|
| `ContinentCode` | *string* | :heavy_check_mark: | The continent code where the country is located. | NA |
|
||||||
|
| `Country` | *string* | :heavy_check_mark: | The official name of the country. | United States Virgin Islands |
|
||||||
|
| `City` | *string* | :heavy_check_mark: | The name of the city. | Amsterdam |
|
||||||
|
| `EuropeanUnionMember` | **bool* | :heavy_minus_sign: | Indicates if the country is a member of the European Union. | true |
|
||||||
|
| `TimeZone` | *string* | :heavy_check_mark: | The time zone of the country. | America/St_Thomas |
|
||||||
|
| `PostalCode` | *string* | :heavy_check_mark: | The postal code of the location. | 802 |
|
||||||
|
| `InPrivacyRestrictedCountry` | **bool* | :heavy_minus_sign: | Indicates if the country has privacy restrictions. | true |
|
||||||
|
| `InPrivacyRestrictedRegion` | **bool* | :heavy_minus_sign: | Indicates if the region has privacy restrictions. | true |
|
||||||
|
| `Subdivisions` | *string* | :heavy_check_mark: | The name of the primary administrative subdivision. | Saint Thomas |
|
||||||
|
| `Coordinates` | *string* | :heavy_check_mark: | The geographical coordinates (latitude, longitude) of the location. | 18.3381, -64.8941 |
|
||||||
11
docs/models/operations/getactorslibrarydirectory.md
Normal file
11
docs/models/operations/getactorslibrarydirectory.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetActorsLibraryDirectory
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
|
||||||
|
| `FastKey` | *string* | :heavy_check_mark: | A fast lookup key for the actor relative url. | /library/sections/2/all?actor=134671 |
|
||||||
|
| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the actor. | https://metadata-static.plex.tv/e/people/e2a915b537ef720252b6d408bc1f91b3.jpg |
|
||||||
|
| `Key` | *string* | :heavy_check_mark: | A unique key representing the actor. | 134671 |
|
||||||
|
| `Title` | *string* | :heavy_check_mark: | The name of the actor. | Aaron Paul |
|
||||||
20
docs/models/operations/getactorslibrarymediacontainer.md
Normal file
20
docs/models/operations/getactorslibrarymediacontainer.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# GetActorsLibraryMediaContainer
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
||||||
|
| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
|
||||||
|
| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false |
|
||||||
|
| `Art` | *string* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg |
|
||||||
|
| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library |
|
||||||
|
| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ |
|
||||||
|
| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 |
|
||||||
|
| `Nocache` | *bool* | :heavy_check_mark: | Specifies whether caching is disabled. | true |
|
||||||
|
| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png |
|
||||||
|
| `Title1` | *string* | :heavy_check_mark: | The primary title of the media container. | TV Series |
|
||||||
|
| `Title2` | *string* | :heavy_check_mark: | The secondary title of the media container. | By Starring Actor |
|
||||||
|
| `ViewGroup` | *string* | :heavy_check_mark: | Identifier for the view group layout. | secondary |
|
||||||
|
| `ViewMode` | *string* | :heavy_check_mark: | Identifier for the view mode. | 131131 |
|
||||||
|
| `Directory` | [][operations.GetActorsLibraryDirectory](../../models/operations/getactorslibrarydirectory.md) | :heavy_minus_sign: | An array of actor entries for media items. | |
|
||||||
22
docs/models/operations/getactorslibraryqueryparamtype.md
Normal file
22
docs/models/operations/getactorslibraryqueryparamtype.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# GetActorsLibraryQueryParamType
|
||||||
|
|
||||||
|
The type of media to retrieve or filter by.
|
||||||
|
1 = movie
|
||||||
|
2 = show
|
||||||
|
3 = season
|
||||||
|
4 = episode
|
||||||
|
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| --------------------------------------- | --------------------------------------- |
|
||||||
|
| `GetActorsLibraryQueryParamTypeMovie` | 1 |
|
||||||
|
| `GetActorsLibraryQueryParamTypeTvShow` | 2 |
|
||||||
|
| `GetActorsLibraryQueryParamTypeSeason` | 3 |
|
||||||
|
| `GetActorsLibraryQueryParamTypeEpisode` | 4 |
|
||||||
|
| `GetActorsLibraryQueryParamTypeAudio` | 8 |
|
||||||
|
| `GetActorsLibraryQueryParamTypeAlbum` | 9 |
|
||||||
|
| `GetActorsLibraryQueryParamTypeTrack` | 10 |
|
||||||
9
docs/models/operations/getactorslibraryrequest.md
Normal file
9
docs/models/operations/getactorslibraryrequest.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# GetActorsLibraryRequest
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
|
||||||
|
| `Type` | [operations.GetActorsLibraryQueryParamType](../../models/operations/getactorslibraryqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.<br/>1 = movie<br/>2 = show<br/>3 = season<br/>4 = episode<br/>E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/> | 2 |
|
||||||
11
docs/models/operations/getactorslibraryresponse.md
Normal file
11
docs/models/operations/getactorslibraryresponse.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetActorsLibraryResponse
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
||||||
|
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||||
|
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||||
|
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||||
|
| `Object` | [*operations.GetActorsLibraryResponseBody](../../models/operations/getactorslibraryresponsebody.md) | :heavy_minus_sign: | Successful response containing media container data. |
|
||||||
10
docs/models/operations/getactorslibraryresponsebody.md
Normal file
10
docs/models/operations/getactorslibraryresponsebody.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetActorsLibraryResponseBody
|
||||||
|
|
||||||
|
Successful response containing media container data.
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `MediaContainer` | [*operations.GetActorsLibraryMediaContainer](../../models/operations/getactorslibrarymediacontainer.md) | :heavy_minus_sign: | N/A |
|
||||||
28
docs/models/operations/getalllibrariesdirectory.md
Normal file
28
docs/models/operations/getalllibrariesdirectory.md
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# GetAllLibrariesDirectory
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
|
||||||
|
| `AllowSync` | *bool* | :heavy_check_mark: | N/A | true |
|
||||||
|
| `Art` | *string* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg |
|
||||||
|
| `Composite` | *string* | :heavy_check_mark: | N/A | /library/sections/1/composite/1705615584 |
|
||||||
|
| `Filters` | *bool* | :heavy_check_mark: | N/A | true |
|
||||||
|
| `Refreshing` | *bool* | :heavy_check_mark: | N/A | false |
|
||||||
|
| `Thumb` | *string* | :heavy_check_mark: | N/A | /:/resources/movie.png |
|
||||||
|
| `Key` | *string* | :heavy_check_mark: | N/A | 1 |
|
||||||
|
| `Type` | *string* | :heavy_check_mark: | N/A | movie |
|
||||||
|
| `Title` | *string* | :heavy_check_mark: | N/A | Movies |
|
||||||
|
| `Agent` | *string* | :heavy_check_mark: | N/A | tv.plex.agents.movie |
|
||||||
|
| `Scanner` | *string* | :heavy_check_mark: | N/A | Plex Movie |
|
||||||
|
| `Language` | *string* | :heavy_check_mark: | N/A | en-US |
|
||||||
|
| `UUID` | *string* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 |
|
||||||
|
| `UpdatedAt` | *int64* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
|
||||||
|
| `CreatedAt` | *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 |
|
||||||
|
| `Directory` | *bool* | :heavy_check_mark: | N/A | true |
|
||||||
|
| `ContentChangedAt` | *int64* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
|
||||||
|
| `Hidden` | *int* | :heavy_check_mark: | N/A | 0 |
|
||||||
|
| `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: | N/A | 1 |
|
||||||
|
| `Path` | *string* | :heavy_check_mark: | N/A | /movies |
|
||||||
11
docs/models/operations/getalllibrariesmediacontainer.md
Normal file
11
docs/models/operations/getalllibrariesmediacontainer.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetAllLibrariesMediaContainer
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
||||||
|
| `Size` | *int* | :heavy_check_mark: | N/A | 5 |
|
||||||
|
| `AllowSync` | *bool* | :heavy_check_mark: | N/A | false |
|
||||||
|
| `Title1` | *string* | :heavy_check_mark: | N/A | Plex Library |
|
||||||
|
| `Directory` | [][operations.GetAllLibrariesDirectory](../../models/operations/getalllibrariesdirectory.md) | :heavy_check_mark: | N/A | |
|
||||||
11
docs/models/operations/getalllibrariesresponse.md
Normal file
11
docs/models/operations/getalllibrariesresponse.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetAllLibrariesResponse
|
||||||
|
|
||||||
|
|
||||||
|
## 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.GetAllLibrariesResponseBody](../../models/operations/getalllibrariesresponsebody.md) | :heavy_minus_sign: | The libraries available on the Server |
|
||||||
10
docs/models/operations/getalllibrariesresponsebody.md
Normal file
10
docs/models/operations/getalllibrariesresponsebody.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetAllLibrariesResponseBody
|
||||||
|
|
||||||
|
The libraries available on the Server
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||||
|
| `MediaContainer` | [operations.GetAllLibrariesMediaContainer](../../models/operations/getalllibrariesmediacontainer.md) | :heavy_check_mark: | N/A |
|
||||||
12
docs/models/operations/getallmedialibraryactivedirection.md
Normal file
12
docs/models/operations/getallmedialibraryactivedirection.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# GetAllMediaLibraryActiveDirection
|
||||||
|
|
||||||
|
The direction of the sort. Can be either `asc` or `desc`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| --------------------------------------------- | --------------------------------------------- |
|
||||||
|
| `GetAllMediaLibraryActiveDirectionAscending` | asc |
|
||||||
|
| `GetAllMediaLibraryActiveDirectionDescending` | desc |
|
||||||
8
docs/models/operations/getallmedialibrarycollection.md
Normal file
8
docs/models/operations/getallmedialibrarycollection.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# GetAllMediaLibraryCollection
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- |
|
||||||
|
| `Tag` | *string* | :heavy_check_mark: | The user-made collection this media item belongs to | My Awesome Collection |
|
||||||
8
docs/models/operations/getallmedialibrarycountry.md
Normal file
8
docs/models/operations/getallmedialibrarycountry.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# GetAllMediaLibraryCountry
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
||||||
|
| `Tag` | *string* | :heavy_check_mark: | The country of origin of this media item | United States of America |
|
||||||
12
docs/models/operations/getallmedialibrarydefaultdirection.md
Normal file
12
docs/models/operations/getallmedialibrarydefaultdirection.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# GetAllMediaLibraryDefaultDirection
|
||||||
|
|
||||||
|
The direction of the sort. Can be either `asc` or `desc`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ---------------------------------------------- | ---------------------------------------------- |
|
||||||
|
| `GetAllMediaLibraryDefaultDirectionAscending` | asc |
|
||||||
|
| `GetAllMediaLibraryDefaultDirectionDescending` | desc |
|
||||||
8
docs/models/operations/getallmedialibrarydirector.md
Normal file
8
docs/models/operations/getallmedialibrarydirector.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# GetAllMediaLibraryDirector
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------- | -------------------- | -------------------- | -------------------- | -------------------- |
|
||||||
|
| `Tag` | *string* | :heavy_check_mark: | The role of Director | Danny Boyle |
|
||||||
11
docs/models/operations/getallmedialibraryfield.md
Normal file
11
docs/models/operations/getallmedialibraryfield.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetAllMediaLibraryField
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
|
| `Key` | *string* | :heavy_check_mark: | N/A | show.title |
|
||||||
|
| `Title` | *string* | :heavy_check_mark: | N/A | Show Title |
|
||||||
|
| `Type` | *string* | :heavy_check_mark: | N/A | string |
|
||||||
|
| `SubType` | **string* | :heavy_minus_sign: | N/A | rating |
|
||||||
9
docs/models/operations/getallmedialibraryfieldtype.md
Normal file
9
docs/models/operations/getallmedialibraryfieldtype.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# GetAllMediaLibraryFieldType
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||||
|
| `Type` | *string* | :heavy_check_mark: | N/A | tag |
|
||||||
|
| `Operator` | [][operations.GetAllMediaLibraryOperator](../../models/operations/getallmedialibraryoperator.md) | :heavy_check_mark: | N/A | |
|
||||||
13
docs/models/operations/getallmedialibraryfilter.md
Normal file
13
docs/models/operations/getallmedialibraryfilter.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# GetAllMediaLibraryFilter
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- |
|
||||||
|
| `Filter` | *string* | :heavy_check_mark: | N/A | genre |
|
||||||
|
| `FilterType` | *string* | :heavy_check_mark: | N/A | string |
|
||||||
|
| `Key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/genre?type=2 |
|
||||||
|
| `Title` | *string* | :heavy_check_mark: | N/A | Genre |
|
||||||
|
| `Type` | *string* | :heavy_check_mark: | N/A | filter |
|
||||||
|
| `Advanced` | **bool* | :heavy_minus_sign: | N/A | true |
|
||||||
8
docs/models/operations/getallmedialibrarygenre.md
Normal file
8
docs/models/operations/getallmedialibrarygenre.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# GetAllMediaLibraryGenre
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
||||||
|
| `Tag` | *string* | :heavy_check_mark: | The country of origin of this media item | United States of America |
|
||||||
11
docs/models/operations/getallmedialibraryhasthumbnail.md
Normal file
11
docs/models/operations/getallmedialibraryhasthumbnail.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetAllMediaLibraryHasThumbnail
|
||||||
|
|
||||||
|
Indicates if the part has a thumbnail.
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------------------------------- | ------------------------------------- |
|
||||||
|
| `GetAllMediaLibraryHasThumbnailFalse` | 0 |
|
||||||
|
| `GetAllMediaLibraryHasThumbnailTrue` | 1 |
|
||||||
10
docs/models/operations/getallmedialibraryimage.md
Normal file
10
docs/models/operations/getallmedialibraryimage.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetAllMediaLibraryImage
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `Alt` | *string* | :heavy_check_mark: | N/A | Episode 1 |
|
||||||
|
| `Type` | [operations.GetAllMediaLibraryLibraryResponseType](../../models/operations/getallmedialibrarylibraryresponsetype.md) | :heavy_check_mark: | N/A | background |
|
||||||
|
| `URL` | *string* | :heavy_check_mark: | N/A | /library/metadata/45521/thumb/1644710589 |
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# GetAllMediaLibraryLibraryOptimizedForStreaming
|
||||||
|
|
||||||
|
Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
|
||||||
|
|
||||||
|
|
||||||
|
## Supported Types
|
||||||
|
|
||||||
|
### GetAllMediaLibraryOptimizedForStreaming1
|
||||||
|
|
||||||
|
```go
|
||||||
|
getAllMediaLibraryLibraryOptimizedForStreaming := operations.CreateGetAllMediaLibraryLibraryOptimizedForStreamingGetAllMediaLibraryOptimizedForStreaming1(operations.GetAllMediaLibraryOptimizedForStreaming1{/* values here */})
|
||||||
|
```
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
```go
|
||||||
|
getAllMediaLibraryLibraryOptimizedForStreaming := operations.CreateGetAllMediaLibraryLibraryOptimizedForStreamingBoolean(bool{/* values here */})
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# GetAllMediaLibraryLibraryResponseType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------------------------------------------------- | -------------------------------------------------- |
|
||||||
|
| `GetAllMediaLibraryLibraryResponseTypeCoverPoster` | coverPoster |
|
||||||
|
| `GetAllMediaLibraryLibraryResponseTypeBackground` | background |
|
||||||
|
| `GetAllMediaLibraryLibraryResponseTypeSnapshot` | snapshot |
|
||||||
|
| `GetAllMediaLibraryLibraryResponseTypeClearLogo` | clearLogo |
|
||||||
16
docs/models/operations/getallmedialibrarylibrarytype.md
Normal file
16
docs/models/operations/getallmedialibrarylibrarytype.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# GetAllMediaLibraryLibraryType
|
||||||
|
|
||||||
|
The type of media content
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------------------------------------- | -------------------------------------- |
|
||||||
|
| `GetAllMediaLibraryLibraryTypeMovie` | movie |
|
||||||
|
| `GetAllMediaLibraryLibraryTypeTvShow` | show |
|
||||||
|
| `GetAllMediaLibraryLibraryTypeSeason` | season |
|
||||||
|
| `GetAllMediaLibraryLibraryTypeEpisode` | episode |
|
||||||
|
| `GetAllMediaLibraryLibraryTypeArtist` | artist |
|
||||||
|
| `GetAllMediaLibraryLibraryTypeAlbum` | album |
|
||||||
26
docs/models/operations/getallmedialibrarymedia.md
Normal file
26
docs/models/operations/getallmedialibrarymedia.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# GetAllMediaLibraryMedia
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `ID` | *int64* | :heavy_check_mark: | Unique media identifier. | 387322 |
|
||||||
|
| `Duration` | **int* | :heavy_minus_sign: | Duration of the media in milliseconds. | 9610350 |
|
||||||
|
| `Bitrate` | **int* | :heavy_minus_sign: | Bitrate in bits per second. | 25512 |
|
||||||
|
| `Width` | **int* | :heavy_minus_sign: | Video width in pixels. | 3840 |
|
||||||
|
| `Height` | **int* | :heavy_minus_sign: | Video height in pixels. | 1602 |
|
||||||
|
| `AspectRatio` | **float32* | :heavy_minus_sign: | Aspect ratio of the video. | 2.35 |
|
||||||
|
| `AudioChannels` | **int* | :heavy_minus_sign: | Number of audio channels. | 6 |
|
||||||
|
| `DisplayOffset` | **int* | :heavy_minus_sign: | N/A | 50 |
|
||||||
|
| `AudioCodec` | **string* | :heavy_minus_sign: | Audio codec used. | eac3 |
|
||||||
|
| `VideoCodec` | **string* | :heavy_minus_sign: | Video codec used. | hevc |
|
||||||
|
| `VideoResolution` | **string* | :heavy_minus_sign: | Video resolution (e.g., 4k). | 4k |
|
||||||
|
| `Container` | **string* | :heavy_minus_sign: | File container type. | mkv |
|
||||||
|
| `VideoFrameRate` | **string* | :heavy_minus_sign: | Frame rate of the video. Values found include NTSC, PAL, 24p<br/> | 24p |
|
||||||
|
| `VideoProfile` | **string* | :heavy_minus_sign: | Video profile (e.g., main 10). | main 10 |
|
||||||
|
| `HasVoiceActivity` | *bool* | :heavy_check_mark: | Indicates whether voice activity is detected. | false |
|
||||||
|
| `AudioProfile` | **string* | :heavy_minus_sign: | The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). | dts |
|
||||||
|
| `OptimizedForStreaming` | [*operations.GetAllMediaLibraryOptimizedForStreaming](../../models/operations/getallmedialibraryoptimizedforstreaming.md) | :heavy_minus_sign: | Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true | |
|
||||||
|
| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `Part` | [][operations.GetAllMediaLibraryPart](../../models/operations/getallmedialibrarypart.md) | :heavy_check_mark: | An array of parts for this media item. | |
|
||||||
26
docs/models/operations/getallmedialibrarymediacontainer.md
Normal file
26
docs/models/operations/getallmedialibrarymediacontainer.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# GetAllMediaLibraryMediaContainer
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||||
|
| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
|
||||||
|
| `TotalSize` | *int* | :heavy_check_mark: | Total number of media items in the library. | 50 |
|
||||||
|
| `Offset` | *int64* | :heavy_check_mark: | Offset value for pagination. | 0 |
|
||||||
|
| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false |
|
||||||
|
| `Art` | *string* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg |
|
||||||
|
| `Content` | *string* | :heavy_check_mark: | The content type or mode. | secondary |
|
||||||
|
| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library |
|
||||||
|
| `LibrarySectionID` | *int64* | :heavy_check_mark: | The unique identifier for the library section. | 2 |
|
||||||
|
| `LibrarySectionTitle` | *string* | :heavy_check_mark: | The title of the library section. | TV Series |
|
||||||
|
| `LibrarySectionUUID` | **string* | :heavy_minus_sign: | The universally unique identifier for the library section. | e69655a2-ef48-4aba-bb19-0cc34d1e7d36 |
|
||||||
|
| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ |
|
||||||
|
| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 |
|
||||||
|
| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png |
|
||||||
|
| `Nocache` | *bool* | :heavy_check_mark: | Specifies whether caching is disabled. | true |
|
||||||
|
| `Title1` | *string* | :heavy_check_mark: | The primary title of the media container. | TV Series |
|
||||||
|
| `Title2` | *string* | :heavy_check_mark: | The secondary title of the media container. | By Starring Actor |
|
||||||
|
| `ViewGroup` | *string* | :heavy_check_mark: | Identifier for the view group layout. | secondary |
|
||||||
|
| `Meta` | [*operations.GetAllMediaLibraryMeta](../../models/operations/getallmedialibrarymeta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.<br/> | |
|
||||||
|
| `Metadata` | [][operations.GetAllMediaLibraryMetadata](../../models/operations/getallmedialibrarymetadata.md) | :heavy_minus_sign: | An array of metadata items. | |
|
||||||
12
docs/models/operations/getallmedialibrarymeta.md
Normal file
12
docs/models/operations/getallmedialibrarymeta.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# GetAllMediaLibraryMeta
|
||||||
|
|
||||||
|
The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
||||||
|
| `Type` | [][operations.GetAllMediaLibraryType](../../models/operations/getallmedialibrarytype.md) | :heavy_minus_sign: | N/A |
|
||||||
|
| `FieldType` | [][operations.GetAllMediaLibraryFieldType](../../models/operations/getallmedialibraryfieldtype.md) | :heavy_minus_sign: | N/A |
|
||||||
74
docs/models/operations/getallmedialibrarymetadata.md
Normal file
74
docs/models/operations/getallmedialibrarymetadata.md
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
# GetAllMediaLibraryMetadata
|
||||||
|
|
||||||
|
Unknown
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `RatingKey` | *string* | :heavy_check_mark: | The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. | 58683 |
|
||||||
|
| `Key` | *string* | :heavy_check_mark: | The unique key for the media item. | /library/metadata/58683 |
|
||||||
|
| `GUID` | *string* | :heavy_check_mark: | The globally unique identifier for the media item. | plex://movie/5d7768ba96b655001fdc0408 |
|
||||||
|
| `Slug` | *string* | :heavy_check_mark: | A URL‐friendly version of the media title. | 4-for-texas |
|
||||||
|
| `Studio` | **string* | :heavy_minus_sign: | The studio that produced the media item. | 20th Century Studios |
|
||||||
|
| `Type` | [operations.GetAllMediaLibraryLibraryType](../../models/operations/getallmedialibrarylibrarytype.md) | :heavy_check_mark: | N/A | movie |
|
||||||
|
| `Title` | *string* | :heavy_check_mark: | The title of the media item. | Avatar: The Way of Water |
|
||||||
|
| `TitleSort` | *string* | :heavy_check_mark: | The sort title used for ordering media items. | Whale |
|
||||||
|
| `ContentRating` | **string* | :heavy_minus_sign: | The content rating for the media item. | PG-13 |
|
||||||
|
| `Summary` | *string* | :heavy_check_mark: | A synopsis of the media item. | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora.<br/>Once a familiar threat returns to finish what was previously started, Jake must<br/>work with Neytiri and the army of the Na'vi race to protect their home.<br/> |
|
||||||
|
| `Rating` | *float32* | :heavy_check_mark: | The critic rating for the media item. | 7.6 |
|
||||||
|
| `AudienceRating` | *float64* | :heavy_check_mark: | The audience rating for the media item. | 9.2 |
|
||||||
|
| `Year` | *int* | :heavy_check_mark: | The release year of the media item. | 2022 |
|
||||||
|
| `Tagline` | *string* | :heavy_check_mark: | A brief tagline for the media item. | Return to Pandora. |
|
||||||
|
| `Thumb` | *string* | :heavy_check_mark: | The thumbnail image URL for the media item. | /library/metadata/58683/thumb/1703239236 |
|
||||||
|
| `Art` | *string* | :heavy_check_mark: | The art image URL for the media item. | /library/metadata/58683/art/1703239236 |
|
||||||
|
| `Theme` | *string* | :heavy_check_mark: | The theme URL for the media item. | /library/metadata/1/theme/1705636920 |
|
||||||
|
| `Index` | *int* | :heavy_check_mark: | The index position of the media item. | 1 |
|
||||||
|
| `LeafCount` | **int* | :heavy_minus_sign: | The number of leaf items (end nodes) under this media item. | 14 |
|
||||||
|
| `ViewedLeafCount` | **int* | :heavy_minus_sign: | The number of leaf items that have been viewed. | 0 |
|
||||||
|
| `ChildCount` | *int* | :heavy_check_mark: | The number of child items associated with this media item. | 1 |
|
||||||
|
| `SeasonCount` | *int* | :heavy_check_mark: | The total number of seasons (for TV shows). | 2022 |
|
||||||
|
| `Duration` | *int* | :heavy_check_mark: | The duration of the media item in milliseconds. | 11558112 |
|
||||||
|
| `OriginallyAvailableAt` | [types.Date](../../types/date.md) | :heavy_check_mark: | The original release date of the media item. | 2022-12-14 |
|
||||||
|
| `AddedAt` | *int64* | :heavy_check_mark: | N/A | 1556281940 |
|
||||||
|
| `UpdatedAt` | **int64* | :heavy_minus_sign: | Unix epoch datetime in seconds | 1556281940 |
|
||||||
|
| `AudienceRatingImage` | **string* | :heavy_minus_sign: | The URL for the audience rating image. | rottentomatoes://image.rating.upright |
|
||||||
|
| `ChapterSource` | **string* | :heavy_minus_sign: | The source from which chapter data is derived. | media |
|
||||||
|
| `PrimaryExtraKey` | **string* | :heavy_minus_sign: | The primary extra key associated with this media item. | /library/metadata/58684 |
|
||||||
|
| `OriginalTitle` | **string* | :heavy_minus_sign: | The original title of the media item (if different). | 映画 ブラッククローバー 魔法帝の剣 |
|
||||||
|
| `ParentRatingKey` | **string* | :heavy_minus_sign: | The rating key of the parent media item. | 66 |
|
||||||
|
| `GrandparentRatingKey` | **string* | :heavy_minus_sign: | The rating key of the grandparent media item. | 66 |
|
||||||
|
| `ParentGUID` | **string* | :heavy_minus_sign: | The GUID of the parent media item. | plex://show/5d9c081b170e24001f2a7be4 |
|
||||||
|
| `GrandparentGUID` | **string* | :heavy_minus_sign: | The GUID of the grandparent media item. | plex://show/5d9c081b170e24001f2a7be4 |
|
||||||
|
| `GrandparentSlug` | **string* | :heavy_minus_sign: | The slug for the grandparent media item. | alice-in-borderland-2020 |
|
||||||
|
| `GrandparentKey` | **string* | :heavy_minus_sign: | The key of the grandparent media item. | /library/metadata/66 |
|
||||||
|
| `ParentKey` | **string* | :heavy_minus_sign: | The key of the parent media item. | /library/metadata/66 |
|
||||||
|
| `GrandparentTitle` | **string* | :heavy_minus_sign: | The title of the grandparent media item. | Caprica |
|
||||||
|
| `GrandparentThumb` | **string* | :heavy_minus_sign: | The thumbnail URL for the grandparent media item. | /library/metadata/66/thumb/1705716261 |
|
||||||
|
| `GrandparentTheme` | **string* | :heavy_minus_sign: | The theme URL for the grandparent media item. | /library/metadata/66/theme/1705716261 |
|
||||||
|
| `GrandparentArt` | **string* | :heavy_minus_sign: | The art URL for the grandparent media item. | /library/metadata/66/art/1705716261 |
|
||||||
|
| `ParentTitle` | **string* | :heavy_minus_sign: | The title of the parent media item. | Caprica |
|
||||||
|
| `ParentIndex` | **int* | :heavy_minus_sign: | The index position of the parent media item. | 1 |
|
||||||
|
| `ParentThumb` | **string* | :heavy_minus_sign: | The thumbnail URL for the parent media item. | /library/metadata/66/thumb/1705716261 |
|
||||||
|
| `RatingImage` | **string* | :heavy_minus_sign: | The URL for the rating image. | rottentomatoes://image.rating.ripe |
|
||||||
|
| `ViewCount` | **int* | :heavy_minus_sign: | The number of times this media item has been viewed. | 1 |
|
||||||
|
| `ViewOffset` | **int* | :heavy_minus_sign: | The current playback offset (in milliseconds). | 5222500 |
|
||||||
|
| `SkipCount` | **int* | :heavy_minus_sign: | The number of times this media item has been skipped. | 1 |
|
||||||
|
| `Subtype` | **string* | :heavy_minus_sign: | A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. | clip |
|
||||||
|
| `LastRatedAt` | **int64* | :heavy_minus_sign: | The Unix timestamp representing the last time the item was rated. | 1721813113 |
|
||||||
|
| `CreatedAtAccuracy` | **string* | :heavy_minus_sign: | The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). | epoch,local |
|
||||||
|
| `CreatedAtTZOffset` | **string* | :heavy_minus_sign: | The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. | 0 |
|
||||||
|
| `LastViewedAt` | **int* | :heavy_minus_sign: | Unix timestamp for when the media item was last viewed. | 1682752242 |
|
||||||
|
| `UserRating` | **float32* | :heavy_minus_sign: | The rating provided by a user for the item. This value is expressed as a decimal number. | 10 |
|
||||||
|
| `Image` | [][operations.GetAllMediaLibraryImage](../../models/operations/getallmedialibraryimage.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `UltraBlurColors` | [*operations.GetAllMediaLibraryUltraBlurColors](../../models/operations/getallmedialibraryultrablurcolors.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Media` | [][operations.GetAllMediaLibraryMedia](../../models/operations/getallmedialibrarymedia.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Genre` | [][operations.GetAllMediaLibraryGenre](../../models/operations/getallmedialibrarygenre.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Country` | [][operations.GetAllMediaLibraryCountry](../../models/operations/getallmedialibrarycountry.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Director` | [][operations.GetAllMediaLibraryDirector](../../models/operations/getallmedialibrarydirector.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Writer` | [][operations.GetAllMediaLibraryWriter](../../models/operations/getallmedialibrarywriter.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Role` | [][operations.GetAllMediaLibraryRole](../../models/operations/getallmedialibraryrole.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Guids` | [][operations.Guids](../../models/operations/guids.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Collection` | [][operations.GetAllMediaLibraryCollection](../../models/operations/getallmedialibrarycollection.md) | :heavy_minus_sign: | N/A | |
|
||||||
9
docs/models/operations/getallmedialibraryoperator.md
Normal file
9
docs/models/operations/getallmedialibraryoperator.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# GetAllMediaLibraryOperator
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
|
| `Key` | *string* | :heavy_check_mark: | N/A | = |
|
||||||
|
| `Title` | *string* | :heavy_check_mark: | N/A | is |
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# GetAllMediaLibraryOptimizedForStreaming
|
||||||
|
|
||||||
|
Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
|
||||||
|
|
||||||
|
|
||||||
|
## Supported Types
|
||||||
|
|
||||||
|
### One
|
||||||
|
|
||||||
|
```go
|
||||||
|
getAllMediaLibraryOptimizedForStreaming := operations.CreateGetAllMediaLibraryOptimizedForStreamingOne(operations.One{/* values here */})
|
||||||
|
```
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
```go
|
||||||
|
getAllMediaLibraryOptimizedForStreaming := operations.CreateGetAllMediaLibraryOptimizedForStreamingBoolean(bool{/* values here */})
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# GetAllMediaLibraryOptimizedForStreaming1
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ---------------------------------------------- | ---------------------------------------------- |
|
||||||
|
| `GetAllMediaLibraryOptimizedForStreaming1Zero` | 0 |
|
||||||
|
| `GetAllMediaLibraryOptimizedForStreaming1One` | 1 |
|
||||||
23
docs/models/operations/getallmedialibrarypart.md
Normal file
23
docs/models/operations/getallmedialibrarypart.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# GetAllMediaLibraryPart
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `Accessible` | **bool* | :heavy_minus_sign: | Indicates if the part is accessible. | true |
|
||||||
|
| `Exists` | **bool* | :heavy_minus_sign: | Indicates if the part exists. | true |
|
||||||
|
| `ID` | *int64* | :heavy_check_mark: | Unique part identifier. | 418385 |
|
||||||
|
| `Key` | *string* | :heavy_check_mark: | Key to access this part. | /library/parts/418385/1735864239/file.mkv |
|
||||||
|
| `Indexes` | **string* | :heavy_minus_sign: | N/A | sd |
|
||||||
|
| `Duration` | **int* | :heavy_minus_sign: | Duration of the part in milliseconds. | 9610350 |
|
||||||
|
| `File` | *string* | :heavy_check_mark: | File path for the part. | /mnt/Movies_1/W/Wicked (2024).mkv |
|
||||||
|
| `Size` | *int64* | :heavy_check_mark: | File size in bytes. | 30649952104 |
|
||||||
|
| `PacketLength` | **int* | :heavy_minus_sign: | N/A | 188 |
|
||||||
|
| `Container` | **string* | :heavy_minus_sign: | Container format of the part. | mkv |
|
||||||
|
| `VideoProfile` | **string* | :heavy_minus_sign: | Video profile for the part. | main 10 |
|
||||||
|
| `AudioProfile` | **string* | :heavy_minus_sign: | The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). | dts |
|
||||||
|
| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `OptimizedForStreaming` | [*operations.GetAllMediaLibraryLibraryOptimizedForStreaming](../../models/operations/getallmedialibrarylibraryoptimizedforstreaming.md) | :heavy_minus_sign: | Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true | |
|
||||||
|
| `HasThumbnail` | [*operations.GetAllMediaLibraryHasThumbnail](../../models/operations/getallmedialibraryhasthumbnail.md) | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `Stream` | [][operations.GetAllMediaLibraryStream](../../models/operations/getallmedialibrarystream.md) | :heavy_minus_sign: | An array of streams for this part. | |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# GetAllMediaLibraryQueryParamIncludeMeta
|
||||||
|
|
||||||
|
Adds the Meta object to the response
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------------------------------------------ | ------------------------------------------------ |
|
||||||
|
| `GetAllMediaLibraryQueryParamIncludeMetaDisable` | 0 |
|
||||||
|
| `GetAllMediaLibraryQueryParamIncludeMetaEnable` | 1 |
|
||||||
22
docs/models/operations/getallmedialibraryqueryparamtype.md
Normal file
22
docs/models/operations/getallmedialibraryqueryparamtype.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# GetAllMediaLibraryQueryParamType
|
||||||
|
|
||||||
|
The type of media to retrieve or filter by.
|
||||||
|
1 = movie
|
||||||
|
2 = show
|
||||||
|
3 = season
|
||||||
|
4 = episode
|
||||||
|
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ----------------------------------------- | ----------------------------------------- |
|
||||||
|
| `GetAllMediaLibraryQueryParamTypeMovie` | 1 |
|
||||||
|
| `GetAllMediaLibraryQueryParamTypeTvShow` | 2 |
|
||||||
|
| `GetAllMediaLibraryQueryParamTypeSeason` | 3 |
|
||||||
|
| `GetAllMediaLibraryQueryParamTypeEpisode` | 4 |
|
||||||
|
| `GetAllMediaLibraryQueryParamTypeAudio` | 8 |
|
||||||
|
| `GetAllMediaLibraryQueryParamTypeAlbum` | 9 |
|
||||||
|
| `GetAllMediaLibraryQueryParamTypeTrack` | 10 |
|
||||||
16
docs/models/operations/getallmedialibraryrequest.md
Normal file
16
docs/models/operations/getallmedialibraryrequest.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# GetAllMediaLibraryRequest
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
|
||||||
|
| `Type` | [operations.GetAllMediaLibraryQueryParamType](../../models/operations/getallmedialibraryqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve or filter by.<br/>1 = movie<br/>2 = show<br/>3 = season<br/>4 = episode<br/>E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/> | 2 |
|
||||||
|
| `IncludeMeta` | [*operations.GetAllMediaLibraryQueryParamIncludeMeta](../../models/operations/getallmedialibraryqueryparamincludemeta.md) | :heavy_minus_sign: | Adds the Meta object to the response<br/> | 1 |
|
||||||
|
| `IncludeGuids` | [*operations.QueryParamIncludeGuids](../../models/operations/queryparamincludeguids.md) | :heavy_minus_sign: | Adds the Guid object to the response<br/> | 1 |
|
||||||
|
| `IncludeAdvanced` | [*operations.IncludeAdvanced](../../models/operations/includeadvanced.md) | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `IncludeCollections` | [*operations.QueryParamIncludeCollections](../../models/operations/queryparamincludecollections.md) | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `IncludeExternalMedia` | [*operations.QueryParamIncludeExternalMedia](../../models/operations/queryparamincludeexternalmedia.md) | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `XPlexContainerStart` | **int* | :heavy_minus_sign: | The index of the first item to return. If not specified, the first item will be returned.<br/>If the number of items exceeds the limit, the response will be paginated.<br/>By default this is 0<br/> | 0 |
|
||||||
|
| `XPlexContainerSize` | **int* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.<br/>If the number of items exceeds the limit, the response will be paginated.<br/>By default this is 50<br/> | 50 |
|
||||||
11
docs/models/operations/getallmedialibraryresponse.md
Normal file
11
docs/models/operations/getallmedialibraryresponse.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetAllMediaLibraryResponse
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||||
|
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||||
|
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||||
|
| `Object` | [*operations.GetAllMediaLibraryResponseBody](../../models/operations/getallmedialibraryresponsebody.md) | :heavy_minus_sign: | Successful response containing media container data. |
|
||||||
10
docs/models/operations/getallmedialibraryresponsebody.md
Normal file
10
docs/models/operations/getallmedialibraryresponsebody.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetAllMediaLibraryResponseBody
|
||||||
|
|
||||||
|
Successful response containing media container data.
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `MediaContainer` | [*operations.GetAllMediaLibraryMediaContainer](../../models/operations/getallmedialibrarymediacontainer.md) | :heavy_minus_sign: | N/A |
|
||||||
8
docs/models/operations/getallmedialibraryrole.md
Normal file
8
docs/models/operations/getallmedialibraryrole.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# GetAllMediaLibraryRole
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
|
||||||
|
| `Tag` | *string* | :heavy_check_mark: | The name of the actor for this role | Danny Boyle |
|
||||||
15
docs/models/operations/getallmedialibrarysort.md
Normal file
15
docs/models/operations/getallmedialibrarysort.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# GetAllMediaLibrarySort
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `Default` | **string* | :heavy_minus_sign: | N/A | asc |
|
||||||
|
| `Active` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `ActiveDirection` | [*operations.GetAllMediaLibraryActiveDirection](../../models/operations/getallmedialibraryactivedirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.<br/> | asc |
|
||||||
|
| `DefaultDirection` | [*operations.GetAllMediaLibraryDefaultDirection](../../models/operations/getallmedialibrarydefaultdirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.<br/> | asc |
|
||||||
|
| `DescKey` | **string* | :heavy_minus_sign: | N/A | titleSort:desc |
|
||||||
|
| `FirstCharacterKey` | **string* | :heavy_minus_sign: | N/A | /library/sections/2/firstCharacter |
|
||||||
|
| `Key` | *string* | :heavy_check_mark: | N/A | titleSort |
|
||||||
|
| `Title` | *string* | :heavy_check_mark: | N/A | Title |
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user