mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
Watchlist
(Watchlist)
Overview
API Calls that perform operations with Plex Media Server Watchlists
Available Operations
- GetWatchList - Get User Watchlist
GetWatchList
Get User Watchlist
Example Usage
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.Watchlist.GetWatchList(ctx, operations.GetWatchListRequest{
Filter: operations.FilterAvailable,
XPlexToken: "CV5xoxjTpFKUzBTShsaf",
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetWatchListRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
Response
*operations.GetWatchListResponse, error
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.GetWatchListBadRequest | 400 | application/json |
| sdkerrors.GetWatchListUnauthorized | 401 | application/json |
| sdkerrors.SDKError | 4XX, 5XX | */* |