mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
3.0 KiB
3.0 KiB
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(
"github.com/LukeHagar/plexgo"
"github.com/LukeHagar/plexgo/models/operations"
"context"
"log"
)
func main() {
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("Postman"),
)
request := operations.GetWatchlistRequest{
Filter: operations.PathParamFilterReleased,
XPlexToken: "<value>",
}
ctx := context.Background()
res, err := s.Watchlist.GetWatchlist(ctx, request)
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
| Error Object | Status Code | Content Type |
|---|---|---|
| sdkerrors.GetWatchlistResponseBody | 401 | application/json |
| sdkerrors.SDKError | 4xx-5xx | / |