mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.308.1
This commit is contained in:
@@ -8,9 +8,57 @@ API Calls that perform operations directly against https://Plex.tv
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [GetHomeData](#gethomedata) - Get Plex Home Data
|
||||
* [GetPin](#getpin) - Get a Pin
|
||||
* [GetToken](#gettoken) - Get Access Token
|
||||
|
||||
## GetHomeData
|
||||
|
||||
Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status.
|
||||
|
||||
### Example Usage
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("Postman"),
|
||||
)
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Plex.GetHomeData(ctx)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
|
||||
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[*operations.GetHomeDataResponse](../../models/operations/gethomedataresponse.md), error**
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------------------------- | --------------------------------- | --------------------------------- |
|
||||
| sdkerrors.GetHomeDataResponseBody | 401 | application/json |
|
||||
| sdkerrors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## GetPin
|
||||
|
||||
Retrieve a Pin from Plex.tv for authentication flows
|
||||
@@ -30,11 +78,13 @@ func main() {
|
||||
s := plexgo.New(
|
||||
plexgo.WithXPlexClientIdentifier("Postman"),
|
||||
)
|
||||
var xPlexProduct string = "Postman"
|
||||
|
||||
var strong *bool = plexgo.Bool(false)
|
||||
|
||||
var xPlexClientIdentifier *string = plexgo.String("Postman")
|
||||
ctx := context.Background()
|
||||
res, err := s.Plex.GetPin(ctx, strong, xPlexClientIdentifier)
|
||||
res, err := s.Plex.GetPin(ctx, xPlexProduct, strong, xPlexClientIdentifier)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -49,6 +99,7 @@ func main() {
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
|
||||
| `xPlexProduct` | *string* | :heavy_check_mark: | Product name of the application shown in the list of devices<br/> | Postman |
|
||||
| `strong` | **bool* | :heavy_minus_sign: | Determines the kind of code returned by the API call<br/>Strong codes are used for Pin authentication flows<br/>Non-Strong codes are used for `Plex.tv/link`<br/> | |
|
||||
| `xPlexClientIdentifier` | **string* | :heavy_minus_sign: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | Postman |
|
||||
| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | |
|
||||
@@ -89,7 +140,7 @@ func main() {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if res != nil {
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user