mirror of
https://github.com/LukeHagar/plex-sdk-docs.git
synced 2025-12-09 20:47:47 +00:00
ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.209.2
This commit is contained in:
@@ -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](/go/authentication/get_transient_token) - Get a Transient Token.
|
||||
* [Get Source Connection Information](/go/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.
|
||||
@@ -3,8 +3,8 @@
|
||||
The context to use for the request.
|
||||
|
||||
---
|
||||
##### `timespan` *{`*int64`}*
|
||||
The timespan to retrieve statistics for
|
||||
the exact meaning of this parameter is not known
|
||||
|
||||
##### `source` *{`string`}*
|
||||
The source identifier with an included prefix.
|
||||
<br/>
|
||||
**Example:** `server://client-identifier`
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import GetStatisticsResponse from "/content/types/models/operations/get_statistics_response/go.mdx"
|
||||
import GetSourceConnectionInformationResponse from "/content/types/models/operations/get_source_connection_information_response/go.mdx"
|
||||
import Collapsible from "/src/components/Collapsible";
|
||||
import Labels from "/src/lib/labels";
|
||||
|
||||
##### *{`*operations.GetStatisticsResponse`}*
|
||||
##### *{`*operations.GetSourceConnectionInformationResponse`}*
|
||||
|
||||
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
|
||||
<GetStatisticsResponse />
|
||||
<GetSourceConnectionInformationResponse />
|
||||
</Collapsible>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
<CH.Code>
|
||||
```go GetToken.go
|
||||
```go GetSourceConnectionInformation.go
|
||||
package main
|
||||
|
||||
import(
|
||||
@@ -8,7 +8,6 @@ import(
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -17,17 +16,14 @@ func main() {
|
||||
)
|
||||
|
||||
|
||||
var pinID string = "<value>"
|
||||
|
||||
var xPlexClientIdentifier string = "<value>"
|
||||
var source string = "server://client-identifier"
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Plex.GetToken(ctx, pinID, xPlexClientIdentifier)
|
||||
res, err := s.Authentication.GetSourceConnectionInformation(ctx, source)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusOK {
|
||||
if res != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
@@ -38,11 +34,12 @@ func main() {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"code": 1000,
|
||||
"message": "X-Plex-Client-Identifier is missing",
|
||||
"status": 400
|
||||
"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,25 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import GetTransientTokenQueryParamType from "/content/types/models/operations/get_transient_token_query_param_type/go.mdx"
|
||||
import Scope from "/content/types/models/operations/scope/go.mdx"
|
||||
import Collapsible from "/src/components/Collapsible";
|
||||
import Labels from "/src/lib/labels";
|
||||
|
||||
##### `ctx` [*{ `context.Context` }*](https://pkg.go.dev/context#Context)
|
||||
The context to use for the request.
|
||||
|
||||
---
|
||||
##### `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/go.mdx"
|
||||
import GetTransientTokenResponse from "/content/types/models/operations/get_transient_token_response/go.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,48 @@
|
||||
|
||||
<CH.Code>
|
||||
```go GetTransientToken.go
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"github.com/LukeHagar/plexgo/models/operations"
|
||||
"context"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
)
|
||||
|
||||
|
||||
var type_ operations.GetTransientTokenQueryParamType = operations.GetTransientTokenQueryParamTypeDelegation
|
||||
|
||||
var scope operations.Scope = operations.ScopeAll
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Authentication.GetTransientToken(ctx, type_, scope)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if res != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
```
|
||||
---
|
||||
|
||||
```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,22 +0,0 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
##### `ctx` [*{ `context.Context` }*](https://pkg.go.dev/context#Context)
|
||||
The context to use for the request.
|
||||
|
||||
---
|
||||
##### `xPlexClientIdentifier` *{`string`}*
|
||||
The unique identifier for the client application
|
||||
This is used to track the client application and its usage
|
||||
(UUID, serial number, or other number unique per device)
|
||||
|
||||
|
||||
---
|
||||
##### `strong` *{`*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`
|
||||
|
||||
|
||||
---
|
||||
##### `opts` *{`[]operations.Option`}*
|
||||
The options for this request.
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import GetPinResponse from "/content/types/models/operations/get_pin_response/go.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>
|
||||
|
||||
|
||||
---
|
||||
##### *{`error`}*
|
||||
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
|
||||
<CH.Code>
|
||||
```go GetPin.go
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
)
|
||||
|
||||
|
||||
var xPlexClientIdentifier string = "<value>"
|
||||
|
||||
var strong *bool = plexgo.Bool(false)
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Plex.GetPin(ctx, xPlexClientIdentifier, strong)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
```
|
||||
---
|
||||
|
||||
```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,19 +0,0 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
##### `ctx` [*{ `context.Context` }*](https://pkg.go.dev/context#Context)
|
||||
The context to use for the request.
|
||||
|
||||
---
|
||||
##### `pinID` *{`string`}*
|
||||
The PinID to retrieve an access token for
|
||||
|
||||
---
|
||||
##### `xPlexClientIdentifier` *{`string`}*
|
||||
The unique identifier for the client application
|
||||
This is used to track the client application and its usage
|
||||
(UUID, serial number, or other number unique per device)
|
||||
|
||||
|
||||
---
|
||||
##### `opts` *{`[]operations.Option`}*
|
||||
The options for this request.
|
||||
|
||||
@@ -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,44 +0,0 @@
|
||||
|
||||
<CH.Code>
|
||||
```go GetStatistics.go
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
)
|
||||
|
||||
|
||||
var timespan *int64 = plexgo.Int64(944669)
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Statistics.GetStatistics(ctx, timespan)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
```
|
||||
---
|
||||
|
||||
```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](/go/statistics/get_statistics) - Get Media Statistics
|
||||
|
||||
---
|
||||
<GetStatistics />
|
||||
@@ -25,7 +25,6 @@ func main() {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ func main() {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
@@ -68,7 +67,6 @@ func main() {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
@@ -85,14 +83,11 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
)
|
||||
s := plexgo.New()
|
||||
|
||||
var xPlexClientIdentifier string = "<value>"
|
||||
|
||||
@@ -103,7 +98,6 @@ func main() {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user