mirror of
https://github.com/LukeHagar/plex-sdk-docs.git
synced 2025-12-10 04:20:57 +00:00
ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.161.0
This commit is contained in:
5
content/pages/01-reference/go/resources/plex/plex.mdx
Normal file
5
content/pages/01-reference/go/resources/plex/plex.mdx
Normal file
@@ -0,0 +1,5 @@
|
||||
import Tv from "./tv/tv.mdx";
|
||||
|
||||
## Plex
|
||||
|
||||
<Tv />
|
||||
@@ -0,0 +1,3 @@
|
||||
## Get Pin
|
||||
|
||||
Retrieve a Pin from Plex.tv for authentication flows
|
||||
@@ -0,0 +1,19 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
##### `ctx` [*{ `context.Context` }*](https://pkg.go.dev/context#Context)
|
||||
The context to use for the request.
|
||||
|
||||
---
|
||||
##### `xPlexClientIdentifier` *{`string`}*
|
||||
Plex Authentication Token
|
||||
|
||||
---
|
||||
##### `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.
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
{/* 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`}*
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
|
||||
<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 = "string"
|
||||
|
||||
var strong *bool = false
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Plex.Tv.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": "string",
|
||||
"newRegistration": "string"
|
||||
}
|
||||
```
|
||||
</CH.Code>
|
||||
@@ -0,0 +1,12 @@
|
||||
import CurlHeader from './_header.mdx';
|
||||
import SDKHeader from './_header.mdx';
|
||||
import OperationHeader from '/src/components/OperationHeader';
|
||||
|
||||
###### *Plex* / *Tv*
|
||||
|
||||
<OperationHeader
|
||||
sdkHeader={<SDKHeader />}
|
||||
curlHeader={<CurlHeader />}
|
||||
/>
|
||||
|
||||
{/* render operation */}
|
||||
@@ -0,0 +1,3 @@
|
||||
## Get Token
|
||||
|
||||
Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
|
||||
@@ -0,0 +1,16 @@
|
||||
{/* 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`}*
|
||||
Plex Authentication Token
|
||||
|
||||
---
|
||||
##### `opts` *{`[]operations.Option`}*
|
||||
The options for this request.
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import GetTokenResponse from "/content/types/models/operations/get_token_response/go.mdx"
|
||||
import Collapsible from "/src/components/Collapsible";
|
||||
import Labels from "/src/lib/labels";
|
||||
|
||||
##### *{`*operations.GetTokenResponse`}*
|
||||
|
||||
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
|
||||
<GetTokenResponse />
|
||||
</Collapsible>
|
||||
|
||||
|
||||
---
|
||||
##### *{`error`}*
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
|
||||
<CH.Code>
|
||||
```go GetToken.go
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
)
|
||||
|
||||
|
||||
var pinID string = "string"
|
||||
|
||||
var xPlexClientIdentifier string = "string"
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Plex.Tv.GetToken(ctx, pinID, xPlexClientIdentifier)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusOK {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
```
|
||||
---
|
||||
|
||||
```json Example Response
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"code": 1000,
|
||||
"message": "X-Plex-Client-Identifier is missing",
|
||||
"status": 400
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CH.Code>
|
||||
@@ -0,0 +1,12 @@
|
||||
import CurlHeader from './_header.mdx';
|
||||
import SDKHeader from './_header.mdx';
|
||||
import OperationHeader from '/src/components/OperationHeader';
|
||||
|
||||
###### *Plex* / *Tv*
|
||||
|
||||
<OperationHeader
|
||||
sdkHeader={<SDKHeader />}
|
||||
curlHeader={<CurlHeader />}
|
||||
/>
|
||||
|
||||
{/* render operation */}
|
||||
15
content/pages/01-reference/go/resources/plex/tv/tv.mdx
Normal file
15
content/pages/01-reference/go/resources/plex/tv/tv.mdx
Normal file
@@ -0,0 +1,15 @@
|
||||
import GetPin from "./get_pin/get_pin.mdx";
|
||||
import GetToken from "./get_token/get_token.mdx";
|
||||
|
||||
## Tv
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [Get Pin](/go/plex/tv/get_pin) - Get a Pin
|
||||
* [Get Token](/go/plex/tv/get_token) - Get Access Token
|
||||
|
||||
---
|
||||
<GetPin />
|
||||
|
||||
---
|
||||
<GetToken />
|
||||
@@ -10,6 +10,7 @@ import Hubs from "./hubs/hubs.mdx";
|
||||
import Search from "./search/search.mdx";
|
||||
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 Sessions from "./sessions/sessions.mdx";
|
||||
@@ -39,6 +40,9 @@ import Video from "./video/video.mdx";
|
||||
---
|
||||
<Log/>
|
||||
|
||||
---
|
||||
<Plex/>
|
||||
|
||||
---
|
||||
<Playlists/>
|
||||
|
||||
|
||||
@@ -74,5 +74,40 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### 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/components"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
)
|
||||
|
||||
var xPlexClientIdentifier string = "string"
|
||||
|
||||
var strong *bool = false
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Plex.Tv.GetPin(ctx, operations.WithServerURL("https://plex.tv/api/v2"), xPlexClientIdentifier, strong)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
{/* End Go Server Options */}
|
||||
|
||||
Reference in New Issue
Block a user