mirror of
https://github.com/LukeHagar/plex-sdk-docs.git
synced 2025-12-06 20:47:46 +00:00
ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.303.0
This commit is contained in:
@@ -8,6 +8,6 @@ import requests
|
||||
|
||||
http_client = requests.Session()
|
||||
http_client.headers.update({'x-custom-header': 'someValue'})
|
||||
s = plex_api.PlexAPI(client: http_client)
|
||||
s = plex_api.PlexAPI(client=http_client)
|
||||
```
|
||||
{/* End Python Custom HTTP Client */}
|
||||
|
||||
@@ -11,12 +11,13 @@ from plex_api.models import errors
|
||||
|
||||
s = plex_api.PlexAPI(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
x_plex_client_identifier='Postman',
|
||||
)
|
||||
|
||||
|
||||
res = None
|
||||
try:
|
||||
res = s.server.get_server_capabilities()
|
||||
|
||||
except errors.GetServerCapabilitiesResponseBody as e:
|
||||
# handle exception
|
||||
raise(e)
|
||||
@@ -27,6 +28,7 @@ except errors.SDKError as e:
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
|
||||
```
|
||||
|
||||
{/* End Python Errors */}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
{/* Start Python Global Parameters */}
|
||||
A parameter is configured globally. This parameter must be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.
|
||||
|
||||
For example, you can set `X-Plex-Client-Identifier` to `'Postman'` at SDK initialization and then you do not have to pass the same value on calls to operations like `get_pin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
|
||||
|
||||
|
||||
|
||||
|
||||
```python
|
||||
import plex_api
|
||||
|
||||
s = plex_api.PlexAPI(
|
||||
x_plex_client_identifier='Postman',
|
||||
)
|
||||
|
||||
|
||||
res = s.plex.get_pin(strong=False, x_plex_client_identifier='Postman')
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
|
||||
```
|
||||
{/* End Python Global Parameters */}
|
||||
@@ -0,0 +1,6 @@
|
||||
import LanguageSelector from 'src/components/LanguageSelector';
|
||||
import { H2 } from "src/components/TextHeaderWrapper";
|
||||
|
||||
<H2>Global Parameters <LanguageSelector/></H2>
|
||||
|
||||
{/* render global_parameters */}
|
||||
@@ -6,6 +6,7 @@ import ClientSDKs from "./client_sdks/client_sdks.mdx";
|
||||
import Installation from "./installation/installation.mdx";
|
||||
import CustomClient from "./custom_http_client/custom_http_client.mdx";
|
||||
import SecurityOptions from "./security_options/security_options.mdx";
|
||||
import Globals from "./global_parameters/global_parameters.mdx";
|
||||
import Errors from "./errors/errors.mdx";
|
||||
import ServerOptions from "./server_options/server_options.mdx";
|
||||
import Resources from "./resources/resources.mdx";
|
||||
@@ -29,6 +30,10 @@ import Resources from "./resources/resources.mdx";
|
||||
|
||||
---
|
||||
|
||||
<Globals/>
|
||||
|
||||
---
|
||||
|
||||
<Errors/>
|
||||
|
||||
---
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import GetTransientToken from "./get_transient_token/get_transient_token.mdx";
|
||||
import GetSourceConnectionInformation from "./get_source_connection_information/get_source_connection_information.mdx";
|
||||
|
||||
## Authentication
|
||||
API Calls regarding authentication for Plex Media Server
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [Get Transient Token](/python/authentication/get_transient_token) - Get a Transient Token.
|
||||
* [Get Source Connection Information](/python/authentication/get_source_connection_information) - Get Source Connection Information
|
||||
|
||||
---
|
||||
<GetTransientToken />
|
||||
|
||||
---
|
||||
<GetSourceConnectionInformation />
|
||||
@@ -0,0 +1,4 @@
|
||||
## 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.
|
||||
@@ -0,0 +1,6 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
##### `source` *{`str`}*
|
||||
The source identifier with an included prefix.
|
||||
<br/>
|
||||
**Example:** `server://client-identifier`
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import GetSourceConnectionInformationResponse from "/content/types/models/operations/get_source_connection_information_response/python.mdx"
|
||||
import Collapsible from "/src/components/Collapsible";
|
||||
import Labels from "/src/lib/labels";
|
||||
|
||||
##### *{`operations.GetSourceConnectionInformationResponse`}*
|
||||
|
||||
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
|
||||
<GetSourceConnectionInformationResponse />
|
||||
</Collapsible>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
<CH.Code>
|
||||
```python GetSourceConnectionInformation.py
|
||||
import plex_api
|
||||
|
||||
s = plex_api.PlexAPI(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
x_plex_client_identifier='Postman',
|
||||
)
|
||||
|
||||
|
||||
res = s.authentication.get_source_connection_information(source='provider://provider-identifier')
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
|
||||
```
|
||||
---
|
||||
|
||||
```json Example Response
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"code": 1001,
|
||||
"message": "User could not be authenticated",
|
||||
"status": 401
|
||||
}
|
||||
],
|
||||
"HttpMeta": {}
|
||||
}
|
||||
```
|
||||
</CH.Code>
|
||||
@@ -2,7 +2,7 @@ import CurlHeader from './_header.mdx';
|
||||
import SDKHeader from './_header.mdx';
|
||||
import OperationHeader from '/src/components/OperationHeader';
|
||||
|
||||
###### *Plex*
|
||||
###### *Authentication*
|
||||
|
||||
<OperationHeader
|
||||
sdkHeader={<SDKHeader />}
|
||||
@@ -0,0 +1,3 @@
|
||||
## Get 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.
|
||||
@@ -0,0 +1,21 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import GetTransientTokenQueryParamType from "/content/types/models/operations/get_transient_token_query_param_type/python.mdx"
|
||||
import Scope from "/content/types/models/operations/scope/python.mdx"
|
||||
import Collapsible from "/src/components/Collapsible";
|
||||
import Labels from "/src/lib/labels";
|
||||
|
||||
##### `type` *{`operations.GetTransientTokenQueryParamType`}*
|
||||
`delegation` \- This is the only supported `type` parameter.
|
||||
|
||||
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
|
||||
<GetTransientTokenQueryParamType />
|
||||
</Collapsible>
|
||||
|
||||
---
|
||||
##### `scope` *{`operations.Scope`}*
|
||||
`all` \- This is the only supported `scope` parameter.
|
||||
|
||||
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
|
||||
<Scope />
|
||||
</Collapsible>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import GetTokenResponse from "/content/types/models/operations/get_token_response/python.mdx"
|
||||
import GetTransientTokenResponse from "/content/types/models/operations/get_transient_token_response/python.mdx"
|
||||
import Collapsible from "/src/components/Collapsible";
|
||||
import Labels from "/src/lib/labels";
|
||||
|
||||
##### *{`operations.GetTokenResponse`}*
|
||||
##### *{`operations.GetTransientTokenResponse`}*
|
||||
|
||||
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
|
||||
<GetTokenResponse />
|
||||
<GetTransientTokenResponse />
|
||||
</Collapsible>
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
<CH.Code>
|
||||
```python GetTransientToken.py
|
||||
import plex_api
|
||||
from plex_api.models import operations
|
||||
|
||||
s = plex_api.PlexAPI(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
x_plex_client_identifier='Postman',
|
||||
)
|
||||
|
||||
|
||||
res = s.authentication.get_transient_token(type=operations.GetTransientTokenQueryParamType.DELEGATION, scope=operations.Scope.ALL)
|
||||
|
||||
if res is not None:
|
||||
# handle response
|
||||
pass
|
||||
|
||||
```
|
||||
---
|
||||
|
||||
```json Example Response
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"code": 1001,
|
||||
"message": "User could not be authenticated",
|
||||
"status": 401
|
||||
}
|
||||
],
|
||||
"HttpMeta": {}
|
||||
}
|
||||
```
|
||||
</CH.Code>
|
||||
@@ -2,7 +2,7 @@ import CurlHeader from './_header.mdx';
|
||||
import SDKHeader from './_header.mdx';
|
||||
import OperationHeader from '/src/components/OperationHeader';
|
||||
|
||||
###### *Plex*
|
||||
###### *Authentication*
|
||||
|
||||
<OperationHeader
|
||||
sdkHeader={<SDKHeader />}
|
||||
@@ -1,3 +0,0 @@
|
||||
## Get Pin
|
||||
|
||||
Retrieve a Pin from Plex.tv for authentication flows
|
||||
@@ -1,18 +0,0 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
##### `x_plex_client_identifier` *{`str`}*
|
||||
The unique identifier for the client application
|
||||
This is used to track the client application and its usage
|
||||
(UUID, serial number, or other number unique per device)
|
||||
|
||||
|
||||
---
|
||||
##### `strong` *{`Optional[bool]`}*
|
||||
Determines the kind of code returned by the API call
|
||||
Strong codes are used for Pin authentication flows
|
||||
Non\-Strong codes are used for `Plex.tv/link`
|
||||
|
||||
|
||||
---
|
||||
##### `server_url` *{`Optional[str]`}*
|
||||
An optional server URL to use.
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import GetPinResponse from "/content/types/models/operations/get_pin_response/python.mdx"
|
||||
import Collapsible from "/src/components/Collapsible";
|
||||
import Labels from "/src/lib/labels";
|
||||
|
||||
##### *{`operations.GetPinResponse`}*
|
||||
|
||||
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
|
||||
<GetPinResponse />
|
||||
</Collapsible>
|
||||
|
||||
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
|
||||
<CH.Code>
|
||||
```python GetPin.py
|
||||
import plex_api
|
||||
|
||||
s = plex_api.PlexAPI(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
)
|
||||
|
||||
|
||||
res = s.plex.get_pin(x_plex_client_identifier='<value>', strong=False)
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
```
|
||||
---
|
||||
|
||||
```json Example Response
|
||||
{
|
||||
"id": 1272322473,
|
||||
"code": "3patfx1a78ukcbr7x0n9bl26t",
|
||||
"product": "Plex Web",
|
||||
"trusted": false,
|
||||
"qr": "https://plex.tv/api/v2/pins/qr/3patfx1a78ukcbr7x0n9bl26t",
|
||||
"clientIdentifier": "Postman",
|
||||
"location": {
|
||||
"code": "US",
|
||||
"european_union_member": false,
|
||||
"continent_code": "NA",
|
||||
"country": "United States",
|
||||
"city": "Austin",
|
||||
"time_zone": "America/Chicago",
|
||||
"postal_code": 78732,
|
||||
"in_privacy_restricted_country": false,
|
||||
"subdivisions": "Texas",
|
||||
"coordinates": "30.3768 -97.8935"
|
||||
},
|
||||
"expiresIn": 1800,
|
||||
"createdAt": "2023-04-12T17:00:03Z",
|
||||
"expiresAt": "2023-04-12T17:30:03Z",
|
||||
"authToken": "None",
|
||||
"newRegistration": "None"
|
||||
}
|
||||
```
|
||||
</CH.Code>
|
||||
@@ -1,3 +0,0 @@
|
||||
## Get Token
|
||||
|
||||
Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
|
||||
@@ -1,15 +0,0 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
##### `pin_id` *{`str`}*
|
||||
The PinID to retrieve an access token for
|
||||
|
||||
---
|
||||
##### `x_plex_client_identifier` *{`str`}*
|
||||
The unique identifier for the client application
|
||||
This is used to track the client application and its usage
|
||||
(UUID, serial number, or other number unique per device)
|
||||
|
||||
|
||||
---
|
||||
##### `server_url` *{`Optional[str]`}*
|
||||
An optional server URL to use.
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
|
||||
<CH.Code>
|
||||
```python GetToken.py
|
||||
import plex_api
|
||||
|
||||
s = plex_api.PlexAPI(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
)
|
||||
|
||||
|
||||
res = s.plex.get_token(pin_id='<value>', x_plex_client_identifier='<value>')
|
||||
|
||||
if res.status_code == 200:
|
||||
# handle response
|
||||
pass
|
||||
```
|
||||
---
|
||||
|
||||
```json Example Response
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"code": 1000,
|
||||
"message": "X-Plex-Client-Identifier is missing",
|
||||
"status": 400
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CH.Code>
|
||||
@@ -13,7 +13,7 @@ import Library from "./library/library.mdx";
|
||||
import Log from "./log/log.mdx";
|
||||
import Plex from "./plex/plex.mdx";
|
||||
import Playlists from "./playlists/playlists.mdx";
|
||||
import Security from "./security/security.mdx";
|
||||
import Authentication from "./authentication/authentication.mdx";
|
||||
import Statistics from "./statistics/statistics.mdx";
|
||||
import Sessions from "./sessions/sessions.mdx";
|
||||
import Updater from "./updater/updater.mdx";
|
||||
@@ -51,7 +51,7 @@ import Updater from "./updater/updater.mdx";
|
||||
<Playlists/>
|
||||
|
||||
---
|
||||
<Security/>
|
||||
<Authentication/>
|
||||
|
||||
---
|
||||
<Statistics/>
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
## Get Statistics
|
||||
|
||||
This will return the media statistics for the server
|
||||
@@ -1,6 +0,0 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
##### `timespan` *{`Optional[int]`}*
|
||||
The timespan to retrieve statistics for
|
||||
the exact meaning of this parameter is not known
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import GetStatisticsResponse from "/content/types/models/operations/get_statistics_response/python.mdx"
|
||||
import Collapsible from "/src/components/Collapsible";
|
||||
import Labels from "/src/lib/labels";
|
||||
|
||||
##### *{`operations.GetStatisticsResponse`}*
|
||||
|
||||
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
|
||||
<GetStatisticsResponse />
|
||||
</Collapsible>
|
||||
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
|
||||
<CH.Code>
|
||||
```python GetStatistics.py
|
||||
import plex_api
|
||||
|
||||
s = plex_api.PlexAPI(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
)
|
||||
|
||||
|
||||
res = s.statistics.get_statistics(timespan=944669)
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
```
|
||||
---
|
||||
|
||||
```json Example Response
|
||||
{
|
||||
"MediaContainer": {
|
||||
"size": 5497,
|
||||
"Device": [],
|
||||
"Account": [],
|
||||
"StatisticsMedia": []
|
||||
}
|
||||
}
|
||||
```
|
||||
</CH.Code>
|
||||
@@ -1,12 +0,0 @@
|
||||
import CurlHeader from './_header.mdx';
|
||||
import SDKHeader from './_header.mdx';
|
||||
import OperationHeader from '/src/components/OperationHeader';
|
||||
|
||||
###### *Statistics*
|
||||
|
||||
<OperationHeader
|
||||
sdkHeader={<SDKHeader />}
|
||||
curlHeader={<CurlHeader />}
|
||||
/>
|
||||
|
||||
{/* render operation */}
|
||||
@@ -1,12 +0,0 @@
|
||||
import GetStatistics from "./get_statistics/get_statistics.mdx";
|
||||
|
||||
## Statistics
|
||||
API Calls that perform operations with Plex Media Server Statistics
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [Get Statistics](/python/statistics/get_statistics) - Get Media Statistics
|
||||
|
||||
---
|
||||
<GetStatistics />
|
||||
@@ -11,6 +11,7 @@ import plex_api
|
||||
|
||||
s = plex_api.PlexAPI(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
x_plex_client_identifier='Postman',
|
||||
)
|
||||
|
||||
|
||||
@@ -19,5 +20,6 @@ res = s.server.get_server_capabilities()
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
|
||||
```
|
||||
{/* End Python Security Options */}
|
||||
|
||||
@@ -14,6 +14,7 @@ import plex_api
|
||||
s = plex_api.PlexAPI(
|
||||
server_idx=0,
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
x_plex_client_identifier='Postman',
|
||||
)
|
||||
|
||||
|
||||
@@ -22,6 +23,7 @@ res = s.server.get_server_capabilities()
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
|
||||
```
|
||||
|
||||
#### Variables
|
||||
@@ -40,6 +42,7 @@ import plex_api
|
||||
s = plex_api.PlexAPI(
|
||||
server_url="{protocol}://{ip}:{port}",
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
x_plex_client_identifier='Postman',
|
||||
)
|
||||
|
||||
|
||||
@@ -48,6 +51,7 @@ res = s.server.get_server_capabilities()
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
|
||||
```
|
||||
|
||||
### Override Server URL Per-Operation
|
||||
@@ -57,14 +61,15 @@ The server URL can also be overridden on a per-operation basis, provided a serve
|
||||
import plex_api
|
||||
|
||||
s = plex_api.PlexAPI(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
x_plex_client_identifier='Postman',
|
||||
)
|
||||
|
||||
|
||||
res = s.plex.get_pin(server_url="https://plex.tv/api/v2", x_plex_client_identifier='<value>', strong=False)
|
||||
res = s.plex.get_pin(strong=False, x_plex_client_identifier='Postman', server_url="https://plex.tv/api/v2")
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
|
||||
```
|
||||
{/* End Python Server Options */}
|
||||
|
||||
Reference in New Issue
Block a user