mirror of
https://github.com/LukeHagar/plexjava.git
synced 2025-12-06 12:37:47 +00:00
regerated and working on publishing
This commit is contained in:
@@ -8,9 +8,9 @@ API Calls that perform operations with Plex Media Server Watchlists
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [getWatchlist](#getwatchlist) - Get User Watchlist
|
||||
* [getWatchList](#getwatchlist) - Get User Watchlist
|
||||
|
||||
## getWatchlist
|
||||
## getWatchList
|
||||
|
||||
Get User Watchlist
|
||||
|
||||
@@ -19,19 +19,12 @@ Get User Watchlist
|
||||
```java
|
||||
package hello.world;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.Optional;
|
||||
import lukehagar.plexapi.plexapi.PlexAPI;
|
||||
import lukehagar.plexapi.plexapi.models.operations.*;
|
||||
import lukehagar.plexapi.plexapi.models.shared.*;
|
||||
import lukehagar.plexapi.plexapi.models.shared.Security;
|
||||
import lukehagar.plexapi.plexapi.utils.EventStream;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import static java.util.Map.entry;
|
||||
import dev.plexapi.sdk.PlexAPI;
|
||||
import dev.plexapi.sdk.models.errors.SDKError;
|
||||
import dev.plexapi.sdk.models.operations.Filter;
|
||||
import dev.plexapi.sdk.models.operations.GetWatchListRequest;
|
||||
import dev.plexapi.sdk.models.operations.GetWatchListResponse;
|
||||
import java.lang.Exception;
|
||||
|
||||
public class Application {
|
||||
|
||||
@@ -39,25 +32,27 @@ public class Application {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
||||
.build();
|
||||
|
||||
GetWatchlistRequest req = GetWatchlistRequest.builder()
|
||||
.filter(PathParamFilter.RELEASED)
|
||||
.xPlexToken("<value>")
|
||||
GetWatchListRequest req = GetWatchListRequest.builder()
|
||||
.filter(Filter.AVAILABLE)
|
||||
.xPlexToken("CV5xoxjTpFKUzBTShsaf")
|
||||
.xPlexContainerStart(0)
|
||||
.xPlexContainerSize(50)
|
||||
.build();
|
||||
|
||||
GetWatchlistResponse res = sdk.watchlist().getWatchlist()
|
||||
GetWatchListResponse res = sdk.watchlist().getWatchList()
|
||||
.request(req)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetWatchlistResponseBody e) {
|
||||
} catch (dev.plexapi.sdk.models.errors.GetWatchListResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
} catch (SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
@@ -71,18 +66,18 @@ public class Application {
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
||||
| `request` | [lukehagar.plexapi.plexapi.models.operations.GetWatchlistRequest](../../models/operations/GetWatchlistRequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
||||
| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. |
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
|
||||
| `request` | [GetWatchListRequest](../../models/operations/GetWatchListRequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
||||
| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. |
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetWatchlistResponse](../../models/operations/GetWatchlistResponse.md)**
|
||||
**[GetWatchListResponse](../../models/operations/GetWatchListResponse.md)**
|
||||
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
||||
| models/errors/GetWatchlistResponseBody | 401 | application/json |
|
||||
| models/errors/GetWatchListResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
Reference in New Issue
Block a user