mirror of
https://github.com/LukeHagar/plexjava.git
synced 2025-12-06 04:20:46 +00:00
Regenerated with a mostly empty directory
This commit is contained in:
151
docs/sdks/activities/README.md
Normal file
151
docs/sdks/activities/README.md
Normal file
@@ -0,0 +1,151 @@
|
||||
# Activities
|
||||
(*activities()*)
|
||||
|
||||
## Overview
|
||||
|
||||
Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.
|
||||
Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity.
|
||||
Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details:
|
||||
- They can contain a `progress` (from 0 to 100) marking the percent completion of the activity.
|
||||
- They must contain an `type` which is used by clients to distinguish the specific activity.
|
||||
- They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.)
|
||||
- The may contain a `Response` object which attributes which represent the result of the asynchronous operation.
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [getServerActivities](#getserveractivities) - Get Server Activities
|
||||
* [cancelServerActivities](#cancelserveractivities) - Cancel Server Activities
|
||||
|
||||
## getServerActivities
|
||||
|
||||
Get Server Activities
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetServerActivitiesResponse res = sdk.activities().getServerActivities()
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetServerActivitiesResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponse](../../models/operations/GetServerActivitiesResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- |
|
||||
| models/errors/GetServerActivitiesResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## cancelServerActivities
|
||||
|
||||
Cancel Server Activities
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities()
|
||||
.activityUUID("25b71ed5-0f9d-461c-baa7-d404e9e10d3e")
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.CancelServerActivitiesResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ |
|
||||
| `activityUUID` | *String* | :heavy_check_mark: | The UUID of the activity to cancel. | 25b71ed5-0f9d-461c-baa7-d404e9e10d3e |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponse](../../models/operations/CancelServerActivitiesResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
|
||||
| models/errors/CancelServerActivitiesResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
155
docs/sdks/authentication/README.md
Normal file
155
docs/sdks/authentication/README.md
Normal file
@@ -0,0 +1,155 @@
|
||||
# Authentication
|
||||
(*authentication()*)
|
||||
|
||||
## Overview
|
||||
|
||||
API Calls regarding authentication for Plex Media Server
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [getTransientToken](#gettransienttoken) - Get a Transient Token.
|
||||
* [getSourceConnectionInformation](#getsourceconnectioninformation) - Get Source Connection Information
|
||||
|
||||
## getTransientToken
|
||||
|
||||
This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetTransientTokenResponse res = sdk.authentication().getTransientToken()
|
||||
.type(GetTransientTokenQueryParamType.DELEGATION)
|
||||
.scope(Scope.ALL)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetTransientTokenResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `type` | [lukehagar.plexapi.plexapi.models.operations.GetTransientTokenQueryParamType](../../models/operations/GetTransientTokenQueryParamType.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. |
|
||||
| `scope` | [lukehagar.plexapi.plexapi.models.operations.Scope](../../models/operations/Scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetTransientTokenResponse](../../models/operations/GetTransientTokenResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- |
|
||||
| models/errors/GetTransientTokenResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getSourceConnectionInformation
|
||||
|
||||
If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token.
|
||||
Note: requires Plex Media Server >= 1.15.4.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation()
|
||||
.source("server://client-identifier")
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetSourceConnectionInformationResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
|
||||
| `source` | *String* | :heavy_check_mark: | The source identifier with an included prefix. | server://client-identifier |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse](../../models/operations/GetSourceConnectionInformationResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
|
||||
| models/errors/GetSourceConnectionInformationResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
353
docs/sdks/butler/README.md
Normal file
353
docs/sdks/butler/README.md
Normal file
@@ -0,0 +1,353 @@
|
||||
# Butler
|
||||
(*butler()*)
|
||||
|
||||
## Overview
|
||||
|
||||
Butler is the task manager of the Plex Media Server Ecosystem.
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [getButlerTasks](#getbutlertasks) - Get Butler tasks
|
||||
* [startAllTasks](#startalltasks) - Start all Butler tasks
|
||||
* [stopAllTasks](#stopalltasks) - Stop all Butler tasks
|
||||
* [startTask](#starttask) - Start a single Butler task
|
||||
* [stopTask](#stoptask) - Stop a single Butler task
|
||||
|
||||
## getButlerTasks
|
||||
|
||||
Returns a list of butler tasks
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetButlerTasksResponse res = sdk.butler().getButlerTasks()
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetButlerTasksResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponse](../../models/operations/GetButlerTasksResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
||||
| models/errors/GetButlerTasksResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## startAllTasks
|
||||
|
||||
This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
|
||||
1. Any tasks not scheduled to run on the current day will be skipped.
|
||||
2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
|
||||
3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
|
||||
4. If we are outside the configured window, the task will start immediately.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
StartAllTasksResponse res = sdk.butler().startAllTasks()
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.StartAllTasksResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponse](../../models/operations/StartAllTasksResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------------------------------- | --------------------------------------- | --------------------------------------- |
|
||||
| models/errors/StartAllTasksResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## stopAllTasks
|
||||
|
||||
This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
StopAllTasksResponse res = sdk.butler().stopAllTasks()
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.StopAllTasksResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponse](../../models/operations/StopAllTasksResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
||||
| models/errors/StopAllTasksResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## startTask
|
||||
|
||||
This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
|
||||
1. Any tasks not scheduled to run on the current day will be skipped.
|
||||
2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
|
||||
3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
|
||||
4. If we are outside the configured window, the task will start immediately.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
StartTaskResponse res = sdk.butler().startTask()
|
||||
.taskName(TaskName.CLEAN_OLD_BUNDLES)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.StartTaskResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
||||
| `taskName` | [lukehagar.plexapi.plexapi.models.operations.TaskName](../../models/operations/TaskName.md) | :heavy_check_mark: | the name of the task to be started. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.StartTaskResponse](../../models/operations/StartTaskResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ----------------------------------- | ----------------------------------- | ----------------------------------- |
|
||||
| models/errors/StartTaskResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## stopTask
|
||||
|
||||
This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
StopTaskResponse res = sdk.butler().stopTask()
|
||||
.taskName(PathParamTaskName.BACKUP_DATABASE)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.StopTaskResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
||||
| `taskName` | [lukehagar.plexapi.plexapi.models.operations.PathParamTaskName](../../models/operations/PathParamTaskName.md) | :heavy_check_mark: | The name of the task to be started. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.StopTaskResponse](../../models/operations/StopTaskResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ---------------------------------- | ---------------------------------- | ---------------------------------- |
|
||||
| models/errors/StopTaskResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
161
docs/sdks/hubs/README.md
Normal file
161
docs/sdks/hubs/README.md
Normal file
@@ -0,0 +1,161 @@
|
||||
# Hubs
|
||||
(*hubs()*)
|
||||
|
||||
## Overview
|
||||
|
||||
Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [getGlobalHubs](#getglobalhubs) - Get Global Hubs
|
||||
* [getLibraryHubs](#getlibraryhubs) - Get library specific hubs
|
||||
|
||||
## getGlobalHubs
|
||||
|
||||
Get Global Hubs filtered by the parameters provided.
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs()
|
||||
.count(1262.49d)
|
||||
.onlyTransient(OnlyTransient.ONE)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetGlobalHubsResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `count` | *Optional<? extends Double>* | :heavy_minus_sign: | The number of items to return with each hub. |
|
||||
| `onlyTransient` | [Optional<? extends lukehagar.plexapi.plexapi.models.operations.OnlyTransient>](../../models/operations/OnlyTransient.md) | :heavy_minus_sign: | Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse](../../models/operations/GetGlobalHubsResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------------------------------- | --------------------------------------- | --------------------------------------- |
|
||||
| models/errors/GetGlobalHubsResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getLibraryHubs
|
||||
|
||||
This endpoint will return a list of library specific hubs
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs()
|
||||
.sectionId(6728.76d)
|
||||
.count(9010.22d)
|
||||
.onlyTransient(QueryParamOnlyTransient.ZERO)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetLibraryHubsResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `sectionId` | *double* | :heavy_check_mark: | the Id of the library to query |
|
||||
| `count` | *Optional<? extends Double>* | :heavy_minus_sign: | The number of items to return with each hub. |
|
||||
| `onlyTransient` | [Optional<? extends lukehagar.plexapi.plexapi.models.operations.QueryParamOnlyTransient>](../../models/operations/QueryParamOnlyTransient.md) | :heavy_minus_sign: | Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse](../../models/operations/GetLibraryHubsResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
||||
| models/errors/GetLibraryHubsResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
946
docs/sdks/library/README.md
Normal file
946
docs/sdks/library/README.md
Normal file
@@ -0,0 +1,946 @@
|
||||
# Library
|
||||
(*library()*)
|
||||
|
||||
## Overview
|
||||
|
||||
API Calls interacting with Plex Media Server Libraries
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [getFileHash](#getfilehash) - Get Hash Value
|
||||
* [getRecentlyAdded](#getrecentlyadded) - Get Recently Added
|
||||
* [getLibraries](#getlibraries) - Get All Libraries
|
||||
* [getLibrary](#getlibrary) - Get Library Details
|
||||
* [deleteLibrary](#deletelibrary) - Delete Library Section
|
||||
* [getLibraryItems](#getlibraryitems) - Get Library Items
|
||||
* [refreshLibrary](#refreshlibrary) - Refresh Library
|
||||
* [searchLibrary](#searchlibrary) - Search Library
|
||||
* [getMetadata](#getmetadata) - Get Items Metadata
|
||||
* [getMetadataChildren](#getmetadatachildren) - Get Items Children
|
||||
* [getTopWatchedContent](#gettopwatchedcontent) - Get Top Watched Content
|
||||
* [getOnDeck](#getondeck) - Get On Deck
|
||||
|
||||
## getFileHash
|
||||
|
||||
This resource returns hash values for local files
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetFileHashResponse res = sdk.library().getFileHash()
|
||||
.url("file://C:\Image.png&type=13")
|
||||
.type(4462.17d)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetFileHashResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
|
||||
| `url` | *String* | :heavy_check_mark: | This is the path to the local file, must be prefixed by `file://` | file://C:\Image.png&type=13 |
|
||||
| `type` | *Optional<? extends Double>* | :heavy_minus_sign: | Item type | |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetFileHashResponse](../../models/operations/GetFileHashResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------- | ------------------------------------- | ------------------------------------- |
|
||||
| models/errors/GetFileHashResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getRecentlyAdded
|
||||
|
||||
This endpoint will return the recently added content.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetRecentlyAddedResponse res = sdk.library().getRecentlyAdded()
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetRecentlyAddedResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetRecentlyAddedResponse](../../models/operations/GetRecentlyAddedResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ |
|
||||
| models/errors/GetRecentlyAddedResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getLibraries
|
||||
|
||||
A library section (commonly referred to as just a library) is a collection of media.
|
||||
Libraries are typed, and depending on their type provide either a flat or a hierarchical view of the media.
|
||||
For example, a music library has an artist > albums > tracks structure, whereas a movie library is flat.
|
||||
|
||||
Libraries have features beyond just being a collection of media; for starters, they include information about supported types, filters and sorts.
|
||||
This allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year).
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetLibrariesResponse res = sdk.library().getLibraries()
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetLibrariesResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetLibrariesResponse](../../models/operations/GetLibrariesResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
||||
| models/errors/GetLibrariesResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getLibrary
|
||||
|
||||
## Library Details Endpoint
|
||||
|
||||
This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself.
|
||||
|
||||
The details include:
|
||||
|
||||
### Directories
|
||||
Organized into three categories:
|
||||
|
||||
- **Primary Directories**:
|
||||
- Used in some clients for quick access to media subsets (e.g., "All", "On Deck").
|
||||
- Most can be replicated via media queries.
|
||||
- Customizable by users.
|
||||
|
||||
- **Secondary Directories**:
|
||||
- Marked with `secondary="1"`.
|
||||
- Used in older clients for structured navigation.
|
||||
|
||||
- **Special Directories**:
|
||||
- Includes a "By Folder" entry for filesystem-based browsing.
|
||||
- Contains an obsolete `search="1"` entry for on-the-fly search dialog creation.
|
||||
|
||||
### Types
|
||||
Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls:
|
||||
|
||||
- **Type Object Attributes**:
|
||||
- `key`: Endpoint for the media list of this type.
|
||||
- `type`: Metadata type (if standard Plex type).
|
||||
- `title`: Title for this content type (e.g., "Movies").
|
||||
|
||||
- **Filter Objects**:
|
||||
- Subset of the media query language.
|
||||
- Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`.
|
||||
|
||||
- **Sort Objects**:
|
||||
- Description of sort fields.
|
||||
- Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`.
|
||||
|
||||
> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetLibraryResponse res = sdk.library().getLibrary()
|
||||
.sectionId(1000d)
|
||||
.includeDetails(IncludeDetails.ZERO)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetLibraryResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `sectionId` | *double* | :heavy_check_mark: | the Id of the library to query | 1000 |
|
||||
| `includeDetails` | [Optional<? extends lukehagar.plexapi.plexapi.models.operations.IncludeDetails>](../../models/operations/IncludeDetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts). <br/>Only exists for backwards compatibility, media providers other than the server libraries have it on always.<br/> | |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetLibraryResponse](../../models/operations/GetLibraryResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------ | ------------------------------------ | ------------------------------------ |
|
||||
| models/errors/GetLibraryResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## deleteLibrary
|
||||
|
||||
Delate a library using a specific section
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
DeleteLibraryResponse res = sdk.library().deleteLibrary()
|
||||
.sectionId(1000d)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.DeleteLibraryResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ |
|
||||
| `sectionId` | *double* | :heavy_check_mark: | the Id of the library to query | 1000 |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.DeleteLibraryResponse](../../models/operations/DeleteLibraryResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------------------------------- | --------------------------------------- | --------------------------------------- |
|
||||
| models/errors/DeleteLibraryResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getLibraryItems
|
||||
|
||||
Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values:
|
||||
- `all`: All items in the section.
|
||||
- `unwatched`: Items that have not been played.
|
||||
- `newest`: Items that are recently released.
|
||||
- `recentlyAdded`: Items that are recently added to the library.
|
||||
- `recentlyViewed`: Items that were recently viewed.
|
||||
- `onDeck`: Items to continue watching.
|
||||
- `collection`: Items categorized by collection.
|
||||
- `edition`: Items categorized by edition.
|
||||
- `genre`: Items categorized by genre.
|
||||
- `year`: Items categorized by year of release.
|
||||
- `decade`: Items categorized by decade.
|
||||
- `director`: Items categorized by director.
|
||||
- `actor`: Items categorized by starring actor.
|
||||
- `country`: Items categorized by country of origin.
|
||||
- `contentRating`: Items categorized by content rating.
|
||||
- `rating`: Items categorized by rating.
|
||||
- `resolution`: Items categorized by resolution.
|
||||
- `firstCharacter`: Items categorized by the first letter.
|
||||
- `folder`: Items categorized by folder.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetLibraryItemsResponse res = sdk.library().getLibraryItems()
|
||||
.sectionId("<value>")
|
||||
.tag(Tag.GENRE)
|
||||
.includeGuids(1L)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetLibraryItemsResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
|
||||
| `sectionId` | *java.lang.Object* | :heavy_check_mark: | the Id of the library to query | |
|
||||
| `tag` | [lukehagar.plexapi.plexapi.models.operations.Tag](../../models/operations/Tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | |
|
||||
| `includeGuids` | *Optional<? extends Long>* | :heavy_minus_sign: | Adds the Guids object to the response<br/> | 1 |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsResponse](../../models/operations/GetLibraryItemsResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
|
||||
| models/errors/GetLibraryItemsResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## refreshLibrary
|
||||
|
||||
This endpoint Refreshes the library.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
RefreshLibraryResponse res = sdk.library().refreshLibrary()
|
||||
.sectionId(934.16d)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.RefreshLibraryResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- |
|
||||
| `sectionId` | *double* | :heavy_check_mark: | the Id of the library to refresh |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.RefreshLibraryResponse](../../models/operations/RefreshLibraryResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
||||
| models/errors/RefreshLibraryResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## searchLibrary
|
||||
|
||||
Search for content within a specific section of the library.
|
||||
|
||||
### Types
|
||||
Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls:
|
||||
|
||||
- **Type Object Attributes**:
|
||||
- `type`: Metadata type (if standard Plex type).
|
||||
- `title`: Title for this content type (e.g., "Movies").
|
||||
|
||||
- **Filter Objects**:
|
||||
- Subset of the media query language.
|
||||
- Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`.
|
||||
|
||||
- **Sort Objects**:
|
||||
- Description of sort fields.
|
||||
- Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`.
|
||||
|
||||
> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
SearchLibraryResponse res = sdk.library().searchLibrary()
|
||||
.sectionId(933505L)
|
||||
.type(Type.FOUR)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SearchLibraryResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
|
||||
| `sectionId` | *long* | :heavy_check_mark: | the Id of the library to query |
|
||||
| `type` | [lukehagar.plexapi.plexapi.models.operations.Type](../../models/operations/Type.md) | :heavy_check_mark: | Plex content type to search for |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.SearchLibraryResponse](../../models/operations/SearchLibraryResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------------------------------- | --------------------------------------- | --------------------------------------- |
|
||||
| models/errors/SearchLibraryResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getMetadata
|
||||
|
||||
This endpoint will return the metadata of a library item specified with the ratingKey.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetMetadataResponse res = sdk.library().getMetadata()
|
||||
.ratingKey(8382.31d)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetMetadataResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
|
||||
| `ratingKey` | *double* | :heavy_check_mark: | the id of the library item to return the children of. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetMetadataResponse](../../models/operations/GetMetadataResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------- | ------------------------------------- | ------------------------------------- |
|
||||
| models/errors/GetMetadataResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getMetadataChildren
|
||||
|
||||
This endpoint will return the children of of a library item specified with the ratingKey.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetMetadataChildrenResponse res = sdk.library().getMetadataChildren()
|
||||
.ratingKey(1539.14d)
|
||||
.includeElements("<value>")
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetMetadataChildrenResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- |
|
||||
| `ratingKey` | *double* | :heavy_check_mark: | the id of the library item to return the children of. |
|
||||
| `includeElements` | *Optional<? extends String>* | :heavy_minus_sign: | Adds additional elements to the response. Supported types are (Stream)<br/> |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenResponse](../../models/operations/GetMetadataChildrenResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- |
|
||||
| models/errors/GetMetadataChildrenResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getTopWatchedContent
|
||||
|
||||
This endpoint will return the top watched content from libraries of a certain type
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent()
|
||||
.type(505531L)
|
||||
.includeGuids(1L)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- |
|
||||
| `type` | *long* | :heavy_check_mark: | the library type (1 - movies, 2 - shows, 3 - music) | |
|
||||
| `includeGuids` | *Optional<? extends Long>* | :heavy_minus_sign: | Adds the Guids object to the response<br/> | 1 |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentResponse](../../models/operations/GetTopWatchedContentResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ---------------------- | ---------------------- | ---------------------- |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getOnDeck
|
||||
|
||||
This endpoint will return the on deck content.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetOnDeckResponse res = sdk.library().getOnDeck()
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetOnDeckResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetOnDeckResponse](../../models/operations/GetOnDeckResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ----------------------------------- | ----------------------------------- | ----------------------------------- |
|
||||
| models/errors/GetOnDeckResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
244
docs/sdks/log/README.md
Normal file
244
docs/sdks/log/README.md
Normal file
@@ -0,0 +1,244 @@
|
||||
# Log
|
||||
(*log()*)
|
||||
|
||||
## Overview
|
||||
|
||||
Submit logs to the Log Handler for Plex Media Server
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [logLine](#logline) - Logging a single line message.
|
||||
* [logMultiLine](#logmultiline) - Logging a multi-line message
|
||||
* [enablePaperTrail](#enablepapertrail) - Enabling Papertrail
|
||||
|
||||
## logLine
|
||||
|
||||
This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
LogLineResponse res = sdk.log().logLine()
|
||||
.level(Level.THREE)
|
||||
.message("Test log message")
|
||||
.source("Postman")
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.LogLineResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
||||
| `level` | [lukehagar.plexapi.plexapi.models.operations.Level](../../models/operations/Level.md) | :heavy_check_mark: | An integer log level to write to the PMS log with. <br/>0: Error <br/>1: Warning <br/>2: Info <br/>3: Debug <br/>4: Verbose<br/> | |
|
||||
| `message` | *String* | :heavy_check_mark: | The text of the message to write to the log. | Test log message |
|
||||
| `source` | *String* | :heavy_check_mark: | a string indicating the source of the message. | Postman |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.LogLineResponse](../../models/operations/LogLineResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------------------------- | --------------------------------- | --------------------------------- |
|
||||
| models/errors/LogLineResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## logMultiLine
|
||||
|
||||
This endpoint allows for the batch addition of log entries to the main Plex Media Server log.
|
||||
It accepts a text/plain request body, where each line represents a distinct log entry.
|
||||
Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'.
|
||||
|
||||
Log entries are separated by a newline character (`\n`).
|
||||
Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters.
|
||||
This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests.
|
||||
|
||||
The 'level' parameter specifies the log entry's severity or importance, with the following integer values:
|
||||
- `0`: Error - Critical issues that require immediate attention.
|
||||
- `1`: Warning - Important events that are not critical but may indicate potential issues.
|
||||
- `2`: Info - General informational messages about system operation.
|
||||
- `3`: Debug - Detailed information useful for debugging purposes.
|
||||
- `4`: Verbose - Highly detailed diagnostic information for in-depth analysis.
|
||||
|
||||
The 'message' parameter contains the log text, and 'source' identifies the log message's origin (e.g., an application name or module).
|
||||
|
||||
Example of a single log entry format:
|
||||
`level=4&message=Sample%20log%20entry&source=applicationName`
|
||||
|
||||
Ensure each parameter is properly URL-encoded to avoid interpretation issues.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
String req = "level=4&message=Test%20message%201&source=postman
|
||||
level=3&message=Test%20message%202&source=postman
|
||||
level=1&message=Test%20message%203&source=postman";
|
||||
|
||||
LogMultiLineResponse res = sdk.log().logMultiLine()
|
||||
.request(req)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.LogMultiLineResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ |
|
||||
| `request` | [String](../../models//.md) | :heavy_check_mark: | The request object to use for the request. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.LogMultiLineResponse](../../models/operations/LogMultiLineResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
||||
| models/errors/LogMultiLineResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## enablePaperTrail
|
||||
|
||||
This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
EnablePaperTrailResponse res = sdk.log().enablePaperTrail()
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.EnablePaperTrailResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponse](../../models/operations/EnablePaperTrailResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ |
|
||||
| models/errors/EnablePaperTrailResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
225
docs/sdks/media/README.md
Normal file
225
docs/sdks/media/README.md
Normal file
@@ -0,0 +1,225 @@
|
||||
# Media
|
||||
(*media()*)
|
||||
|
||||
## Overview
|
||||
|
||||
API Calls interacting with Plex Media Server Media
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [markPlayed](#markplayed) - Mark Media Played
|
||||
* [markUnplayed](#markunplayed) - Mark Media Unplayed
|
||||
* [updatePlayProgress](#updateplayprogress) - Update Media Play Progress
|
||||
|
||||
## markPlayed
|
||||
|
||||
This will mark the provided media key as Played.
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
MarkPlayedResponse res = sdk.media().markPlayed()
|
||||
.key(59398d)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.MarkPlayedResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- |
|
||||
| `key` | *double* | :heavy_check_mark: | The media key to mark as played | 59398 |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponse](../../models/operations/MarkPlayedResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------ | ------------------------------------ | ------------------------------------ |
|
||||
| models/errors/MarkPlayedResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## markUnplayed
|
||||
|
||||
This will mark the provided media key as Unplayed.
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
MarkUnplayedResponse res = sdk.media().markUnplayed()
|
||||
.key(59398d)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.MarkUnplayedResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- |
|
||||
| `key` | *double* | :heavy_check_mark: | The media key to mark as Unplayed | 59398 |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponse](../../models/operations/MarkUnplayedResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
||||
| models/errors/MarkUnplayedResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## updatePlayProgress
|
||||
|
||||
This API command can be used to update the play progress of a media item.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
UpdatePlayProgressResponse res = sdk.media().updatePlayProgress()
|
||||
.key("<value>")
|
||||
.time(90000d)
|
||||
.state("played")
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.UpdatePlayProgressResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
||||
| `key` | *String* | :heavy_check_mark: | the media key | |
|
||||
| `time` | *double* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | 90000 |
|
||||
| `state` | *String* | :heavy_check_mark: | The playback state of the media item. | played |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponse](../../models/operations/UpdatePlayProgressResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
|
||||
| models/errors/UpdatePlayProgressResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
689
docs/sdks/playlists/README.md
Normal file
689
docs/sdks/playlists/README.md
Normal file
@@ -0,0 +1,689 @@
|
||||
# Playlists
|
||||
(*playlists()*)
|
||||
|
||||
## Overview
|
||||
|
||||
Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017").
|
||||
They can be organized in (optionally nesting) folders.
|
||||
Retrieving a playlist, or its items, will trigger a refresh of its metadata.
|
||||
This may cause the duration and number of items to change.
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [createPlaylist](#createplaylist) - Create a Playlist
|
||||
* [getPlaylists](#getplaylists) - Get All Playlists
|
||||
* [getPlaylist](#getplaylist) - Retrieve Playlist
|
||||
* [deletePlaylist](#deleteplaylist) - Deletes a Playlist
|
||||
* [updatePlaylist](#updateplaylist) - Update a Playlist
|
||||
* [getPlaylistContents](#getplaylistcontents) - Retrieve Playlist Contents
|
||||
* [clearPlaylistContents](#clearplaylistcontents) - Delete Playlist Contents
|
||||
* [addPlaylistContents](#addplaylistcontents) - Adding to a Playlist
|
||||
* [uploadPlaylist](#uploadplaylist) - Upload Playlist
|
||||
|
||||
## createPlaylist
|
||||
|
||||
Create a new playlist. By default the playlist is blank. To create a playlist along with a first item, pass:
|
||||
- `uri` - The content URI for what we're playing (e.g. `server://1234/com.plexapp.plugins.library/library/metadata/1`).
|
||||
- `playQueueID` - To create a playlist from an existing play queue.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
CreatePlaylistRequest req = CreatePlaylistRequest.builder()
|
||||
.title("<value>")
|
||||
.type(QueryParamType.PHOTO)
|
||||
.smart(Smart.ONE)
|
||||
.uri("<value>")
|
||||
.build();
|
||||
|
||||
CreatePlaylistResponse res = sdk.playlists().createPlaylist()
|
||||
.request(req)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.CreatePlaylistResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
||||
| `request` | [lukehagar.plexapi.plexapi.models.operations.CreatePlaylistRequest](../../models/operations/CreatePlaylistRequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.CreatePlaylistResponse](../../models/operations/CreatePlaylistResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
||||
| models/errors/CreatePlaylistResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getPlaylists
|
||||
|
||||
Get All Playlists given the specified filters.
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetPlaylistsResponse res = sdk.playlists().getPlaylists()
|
||||
.playlistType(PlaylistType.AUDIO)
|
||||
.smart(QueryParamSmart.ZERO)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetPlaylistsResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `playlistType` | [Optional<? extends lukehagar.plexapi.plexapi.models.operations.PlaylistType>](../../models/operations/PlaylistType.md) | :heavy_minus_sign: | limit to a type of playlist. |
|
||||
| `smart` | [Optional<? extends lukehagar.plexapi.plexapi.models.operations.QueryParamSmart>](../../models/operations/QueryParamSmart.md) | :heavy_minus_sign: | type of playlists to return (default is all). |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetPlaylistsResponse](../../models/operations/GetPlaylistsResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
||||
| models/errors/GetPlaylistsResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getPlaylist
|
||||
|
||||
Gets detailed metadata for a playlist. A playlist for many purposes (rating, editing metadata, tagging), can be treated like a regular metadata item:
|
||||
Smart playlist details contain the `content` attribute. This is the content URI for the generator. This can then be parsed by a client to provide smart playlist editing.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetPlaylistResponse res = sdk.playlists().getPlaylist()
|
||||
.playlistID(4109.48d)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetPlaylistResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ---------------------- | ---------------------- | ---------------------- | ---------------------- |
|
||||
| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetPlaylistResponse](../../models/operations/GetPlaylistResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------- | ------------------------------------- | ------------------------------------- |
|
||||
| models/errors/GetPlaylistResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## deletePlaylist
|
||||
|
||||
This endpoint will delete a playlist
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
DeletePlaylistResponse res = sdk.playlists().deletePlaylist()
|
||||
.playlistID(216.22d)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.DeletePlaylistResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ---------------------- | ---------------------- | ---------------------- | ---------------------- |
|
||||
| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.DeletePlaylistResponse](../../models/operations/DeletePlaylistResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
||||
| models/errors/DeletePlaylistResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## updatePlaylist
|
||||
|
||||
From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via `PUT /library/metadata/{playlistID}`
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
UpdatePlaylistResponse res = sdk.playlists().updatePlaylist()
|
||||
.playlistID(3915d)
|
||||
.title("<value>")
|
||||
.summary("<value>")
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.UpdatePlaylistResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
|
||||
| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist |
|
||||
| `title` | *Optional<? extends String>* | :heavy_minus_sign: | name of the playlist |
|
||||
| `summary` | *Optional<? extends String>* | :heavy_minus_sign: | summary description of the playlist |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.UpdatePlaylistResponse](../../models/operations/UpdatePlaylistResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
||||
| models/errors/UpdatePlaylistResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getPlaylistContents
|
||||
|
||||
Gets the contents of a playlist. Should be paged by clients via standard mechanisms.
|
||||
By default leaves are returned (e.g. episodes, movies). In order to return other types you can use the `type` parameter.
|
||||
For example, you could use this to display a list of recently added albums vis a smart playlist.
|
||||
Note that for dumb playlists, items have a `playlistItemID` attribute which is used for deleting or moving items.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents()
|
||||
.playlistID(5004.46d)
|
||||
.type(9403.59d)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetPlaylistContentsResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- |
|
||||
| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist |
|
||||
| `type` | *double* | :heavy_check_mark: | the metadata type of the item to return |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsResponse](../../models/operations/GetPlaylistContentsResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- |
|
||||
| models/errors/GetPlaylistContentsResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## clearPlaylistContents
|
||||
|
||||
Clears a playlist, only works with dumb playlists. Returns the playlist.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents()
|
||||
.playlistID(1893.18d)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.ClearPlaylistContentsResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ---------------------- | ---------------------- | ---------------------- | ---------------------- |
|
||||
| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.ClearPlaylistContentsResponse](../../models/operations/ClearPlaylistContentsResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- |
|
||||
| models/errors/ClearPlaylistContentsResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## addPlaylistContents
|
||||
|
||||
Adds a generator to a playlist, same parameters as the POST to create. With a dumb playlist, this adds the specified items to the playlist.
|
||||
With a smart playlist, passing a new `uri` parameter replaces the rules for the playlist. Returns the playlist.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents()
|
||||
.playlistID(8502.01d)
|
||||
.uri("server://12345/com.plexapp.plugins.library/library/metadata/1")
|
||||
.playQueueID(123d)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.AddPlaylistContentsResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
|
||||
| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist | |
|
||||
| `uri` | *String* | :heavy_check_mark: | the content URI for the playlist | server://12345/com.plexapp.plugins.library/library/metadata/1 |
|
||||
| `playQueueID` | *Optional<? extends Double>* | :heavy_minus_sign: | the play queue to add to a playlist | 123 |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsResponse](../../models/operations/AddPlaylistContentsResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- |
|
||||
| models/errors/AddPlaylistContentsResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## uploadPlaylist
|
||||
|
||||
Imports m3u playlists by passing a path on the server to scan for m3u-formatted playlist files, or a path to a single playlist file.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
UploadPlaylistResponse res = sdk.playlists().uploadPlaylist()
|
||||
.path("/home/barkley/playlist.m3u")
|
||||
.force(Force.ZERO)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.UploadPlaylistResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `path` | *String* | :heavy_check_mark: | absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server. <br/>If the `path` argument is a directory, that path will be scanned for playlist files to be processed. <br/>Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it. <br/>The GUID of each playlist is based on the filename. <br/>If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it. <br/>The GUID of each playlist is based on the filename.<br/> | /home/barkley/playlist.m3u |
|
||||
| `force` | [lukehagar.plexapi.plexapi.models.operations.Force](../../models/operations/Force.md) | :heavy_check_mark: | Force overwriting of duplicate playlists. <br/>By default, a playlist file uploaded with the same path will overwrite the existing playlist. <br/>The `force` argument is used to disable overwriting. <br/>If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.<br/> | |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.UploadPlaylistResponse](../../models/operations/UploadPlaylistResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
||||
| models/errors/UploadPlaylistResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
223
docs/sdks/plex/README.md
Normal file
223
docs/sdks/plex/README.md
Normal file
@@ -0,0 +1,223 @@
|
||||
# Plex
|
||||
(*plex()*)
|
||||
|
||||
## Overview
|
||||
|
||||
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
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetHomeDataResponse res = sdk.plex().getHomeData()
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetHomeDataResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetHomeDataResponse](../../models/operations/GetHomeDataResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------- | ------------------------------------- | ------------------------------------- |
|
||||
| models/errors/GetHomeDataResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getPin
|
||||
|
||||
Retrieve a Pin from Plex.tv for authentication flows
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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.utils.EventStream;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import static java.util.Map.entry;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetPinResponse res = sdk.plex().getPin()
|
||||
.strong(false)
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.xPlexProduct("Postman")
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetPinResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `strong` | *Optional<? extends Boolean>* | :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` | *Optional<? extends 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 |
|
||||
| `xPlexProduct` | *String* | :heavy_check_mark: | Product name of the application shown in the list of devices<br/> | Postman |
|
||||
| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetPinResponse](../../models/operations/GetPinResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------------- | -------------------------------- | -------------------------------- |
|
||||
| models/errors/GetPinResponseBody | 400 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getToken
|
||||
|
||||
Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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.utils.EventStream;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import static java.util.Map.entry;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetTokenResponse res = sdk.plex().getToken()
|
||||
.pinID("<value>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetTokenResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `pinID` | *String* | :heavy_check_mark: | The PinID to retrieve an access token for | |
|
||||
| `xPlexClientIdentifier` | *Optional<? extends 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 |
|
||||
| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetTokenResponse](../../models/operations/GetTokenResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ---------------------------------- | ---------------------------------- | ---------------------------------- |
|
||||
| models/errors/GetTokenResponseBody | 400 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
9
docs/sdks/plexapi/README.md
Normal file
9
docs/sdks/plexapi/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# PlexAPI SDK
|
||||
|
||||
|
||||
## Overview
|
||||
|
||||
An Open API Spec for interacting with Plex.tv and Plex Servers
|
||||
|
||||
### Available Operations
|
||||
|
||||
246
docs/sdks/search/README.md
Normal file
246
docs/sdks/search/README.md
Normal file
@@ -0,0 +1,246 @@
|
||||
# Search
|
||||
(*search()*)
|
||||
|
||||
## Overview
|
||||
|
||||
API Calls that perform search operations with Plex Media Server
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [performSearch](#performsearch) - Perform a search
|
||||
* [performVoiceSearch](#performvoicesearch) - Perform a voice search
|
||||
* [getSearchResults](#getsearchresults) - Get Search Results
|
||||
|
||||
## performSearch
|
||||
|
||||
This endpoint performs a search across all library sections, or a single section, and returns matches as hubs, split up by type. It performs spell checking, looks for partial matches, and orders the hubs based on quality of results. In addition, based on matches, it will return other related matches (e.g. for a genre match, it may return movies in that genre, or for an actor match, movies with that actor).
|
||||
|
||||
In the response's items, the following extra attributes are returned to further describe or disambiguate the result:
|
||||
|
||||
- `reason`: The reason for the result, if not because of a direct search term match; can be either:
|
||||
- `section`: There are multiple identical results from different sections.
|
||||
- `originalTitle`: There was a search term match from the original title field (sometimes those can be very different or in a foreign language).
|
||||
- `<hub identifier>`: If the reason for the result is due to a result in another hub, the source hub identifier is returned. For example, if the search is for "dylan" then Bob Dylan may be returned as an artist result, an a few of his albums returned as album results with a reason code of `artist` (the identifier of that particular hub). Or if the search is for "arnold", there might be movie results returned with a reason of `actor`
|
||||
- `reasonTitle`: The string associated with the reason code. For a section reason, it'll be the section name; For a hub identifier, it'll be a string associated with the match (e.g. `Arnold Schwarzenegger` for movies which were returned because the search was for "arnold").
|
||||
- `reasonID`: The ID of the item associated with the reason for the result. This might be a section ID, a tag ID, an artist ID, or a show ID.
|
||||
|
||||
This request is intended to be very fast, and called as the user types.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
PerformSearchResponse res = sdk.search().performSearch()
|
||||
.query("dylan")
|
||||
.sectionId(1516.53d)
|
||||
.limit(5d)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.PerformSearchResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
||||
| `query` | *String* | :heavy_check_mark: | The query term | arnold |
|
||||
| `sectionId` | *Optional<? extends Double>* | :heavy_minus_sign: | This gives context to the search, and can result in re-ordering of search result hubs | |
|
||||
| `limit` | *Optional<? extends Double>* | :heavy_minus_sign: | The number of items to return per hub | 5 |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.PerformSearchResponse](../../models/operations/PerformSearchResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------------------------------- | --------------------------------------- | --------------------------------------- |
|
||||
| models/errors/PerformSearchResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## performVoiceSearch
|
||||
|
||||
This endpoint performs a search specifically tailored towards voice or other imprecise input which may work badly with the substring and spell-checking heuristics used by the `/hubs/search` endpoint.
|
||||
It uses a [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) heuristic to search titles, and as such is much slower than the other search endpoint.
|
||||
Whenever possible, clients should limit the search to the appropriate type.
|
||||
Results, as well as their containing per-type hubs, contain a `distance` attribute which can be used to judge result quality.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
PerformVoiceSearchResponse res = sdk.search().performVoiceSearch()
|
||||
.query("dead+poop")
|
||||
.sectionId(4094.8d)
|
||||
.limit(5d)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.PerformVoiceSearchResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
||||
| `query` | *String* | :heavy_check_mark: | The query term | dead+poop |
|
||||
| `sectionId` | *Optional<? extends Double>* | :heavy_minus_sign: | This gives context to the search, and can result in re-ordering of search result hubs | |
|
||||
| `limit` | *Optional<? extends Double>* | :heavy_minus_sign: | The number of items to return per hub | 5 |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponse](../../models/operations/PerformVoiceSearchResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
|
||||
| models/errors/PerformVoiceSearchResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getSearchResults
|
||||
|
||||
This will search the database for the string provided.
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetSearchResultsResponse res = sdk.search().getSearchResults()
|
||||
.query("110")
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetSearchResultsResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ |
|
||||
| `query` | *String* | :heavy_check_mark: | The search query string to use | 110 |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponse](../../models/operations/GetSearchResultsResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ |
|
||||
| models/errors/GetSearchResultsResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
546
docs/sdks/server/README.md
Normal file
546
docs/sdks/server/README.md
Normal file
@@ -0,0 +1,546 @@
|
||||
# Server
|
||||
(*server()*)
|
||||
|
||||
## Overview
|
||||
|
||||
Operations against the Plex Media Server System.
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [getServerCapabilities](#getservercapabilities) - Get Server Capabilities
|
||||
* [getServerPreferences](#getserverpreferences) - Get Server Preferences
|
||||
* [getAvailableClients](#getavailableclients) - Get Available Clients
|
||||
* [getDevices](#getdevices) - Get Devices
|
||||
* [getServerIdentity](#getserveridentity) - Get Server Identity
|
||||
* [getMyPlexAccount](#getmyplexaccount) - Get MyPlex Account
|
||||
* [getResizedPhoto](#getresizedphoto) - Get a Resized Photo
|
||||
* [getServerList](#getserverlist) - Get Server List
|
||||
|
||||
## getServerCapabilities
|
||||
|
||||
Get Server Capabilities
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetServerCapabilitiesResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse](../../models/operations/GetServerCapabilitiesResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- |
|
||||
| models/errors/GetServerCapabilitiesResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getServerPreferences
|
||||
|
||||
Get Server Preferences
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetServerPreferencesResponse res = sdk.server().getServerPreferences()
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetServerPreferencesResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesResponse](../../models/operations/GetServerPreferencesResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
|
||||
| models/errors/GetServerPreferencesResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getAvailableClients
|
||||
|
||||
Get Available Clients
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetAvailableClientsResponse res = sdk.server().getAvailableClients()
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetAvailableClientsResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsResponse](../../models/operations/GetAvailableClientsResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- |
|
||||
| models/errors/GetAvailableClientsResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getDevices
|
||||
|
||||
Get Devices
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetDevicesResponse res = sdk.server().getDevices()
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetDevicesResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetDevicesResponse](../../models/operations/GetDevicesResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------ | ------------------------------------ | ------------------------------------ |
|
||||
| models/errors/GetDevicesResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getServerIdentity
|
||||
|
||||
Get Server Identity
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetServerIdentityResponse res = sdk.server().getServerIdentity()
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetServerIdentityResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetServerIdentityResponse](../../models/operations/GetServerIdentityResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- |
|
||||
| models/errors/GetServerIdentityResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getMyPlexAccount
|
||||
|
||||
Returns MyPlex Account Information
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount()
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetMyPlexAccountResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountResponse](../../models/operations/GetMyPlexAccountResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ |
|
||||
| models/errors/GetMyPlexAccountResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getResizedPhoto
|
||||
|
||||
Plex's Photo transcoder is used throughout the service to serve images at specified sizes.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetResizedPhotoRequest req = GetResizedPhotoRequest.builder()
|
||||
.width(110d)
|
||||
.height(165d)
|
||||
.opacity(643869L)
|
||||
.blur(4000d)
|
||||
.minSize(MinSize.ZERO)
|
||||
.upscale(Upscale.ZERO)
|
||||
.url("/library/metadata/49564/thumb/1654258204")
|
||||
.build();
|
||||
|
||||
GetResizedPhotoResponse res = sdk.server().getResizedPhoto()
|
||||
.request(req)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetResizedPhotoResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
||||
| `request` | [lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoRequest](../../models/operations/GetResizedPhotoRequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoResponse](../../models/operations/GetResizedPhotoResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
|
||||
| models/errors/GetResizedPhotoResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getServerList
|
||||
|
||||
Get Server List
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetServerListResponse res = sdk.server().getServerList()
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetServerListResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetServerListResponse](../../models/operations/GetServerListResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------------------------------- | --------------------------------------- | --------------------------------------- |
|
||||
| models/errors/GetServerListResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
289
docs/sdks/sessions/README.md
Normal file
289
docs/sdks/sessions/README.md
Normal file
@@ -0,0 +1,289 @@
|
||||
# Sessions
|
||||
(*sessions()*)
|
||||
|
||||
## Overview
|
||||
|
||||
API Calls that perform search operations with Plex Media Server Sessions
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [getSessions](#getsessions) - Get Active Sessions
|
||||
* [getSessionHistory](#getsessionhistory) - Get Session History
|
||||
* [getTranscodeSessions](#gettranscodesessions) - Get Transcode Sessions
|
||||
* [stopTranscodeSession](#stoptranscodesession) - Stop a Transcode Session
|
||||
|
||||
## getSessions
|
||||
|
||||
This will retrieve the "Now Playing" Information of the PMS.
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetSessionsResponse res = sdk.sessions().getSessions()
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetSessionsResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetSessionsResponse](../../models/operations/GetSessionsResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------- | ------------------------------------- | ------------------------------------- |
|
||||
| models/errors/GetSessionsResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getSessionHistory
|
||||
|
||||
This will Retrieve a listing of all history views.
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetSessionHistoryResponse res = sdk.sessions().getSessionHistory()
|
||||
.sort("<value>")
|
||||
.accountId(1L)
|
||||
.filter(Filter.builder()
|
||||
.build())
|
||||
.librarySectionID(12L)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetSessionHistoryResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `sort` | *Optional<? extends String>* | :heavy_minus_sign: | Sorts the results by the specified field followed by the direction (asc, desc)<br/> | |
|
||||
| `accountId` | *Optional<? extends Long>* | :heavy_minus_sign: | Filter results by those that are related to a specific users id<br/> | 1 |
|
||||
| `filter` | [Optional<? extends lukehagar.plexapi.plexapi.models.operations.Filter>](../../models/operations/Filter.md) | :heavy_minus_sign: | Filters content by field and direction/equality<br/>(Unknown if viewedAt is the only supported column)<br/> | {<br/>"viewed-at-greater-than": {<br/>"value": "viewedAt\u003e"<br/>},<br/>"viewed-at-greater-than-or-equal-to": {<br/>"value": "viewedAt\u003e=\u003e"<br/>},<br/>"viewed-at-less-than": {<br/>"value": "viewedAt\u003c"<br/>}<br/>} |
|
||||
| `librarySectionID` | *Optional<? extends Long>* | :heavy_minus_sign: | Filters the results based on the id of a valid library section<br/> | 12 |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse](../../models/operations/GetSessionHistoryResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- |
|
||||
| models/errors/GetSessionHistoryResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getTranscodeSessions
|
||||
|
||||
Get Transcode Sessions
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions()
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetTranscodeSessionsResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse](../../models/operations/GetTranscodeSessionsResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
|
||||
| models/errors/GetTranscodeSessionsResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## stopTranscodeSession
|
||||
|
||||
Stop a Transcode Session
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession()
|
||||
.sessionKey("zz7llzqlx8w9vnrsbnwhbmep")
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.StopTranscodeSessionResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
||||
| `sessionKey` | *String* | :heavy_check_mark: | the Key of the transcode session to stop | zz7llzqlx8w9vnrsbnwhbmep |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponse](../../models/operations/StopTranscodeSessionResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
|
||||
| models/errors/StopTranscodeSessionResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
226
docs/sdks/statistics/README.md
Normal file
226
docs/sdks/statistics/README.md
Normal file
@@ -0,0 +1,226 @@
|
||||
# Statistics
|
||||
(*statistics()*)
|
||||
|
||||
## Overview
|
||||
|
||||
API Calls that perform operations with Plex Media Server Statistics
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [getStatistics](#getstatistics) - Get Media Statistics
|
||||
* [getResourcesStatistics](#getresourcesstatistics) - Get Resources Statistics
|
||||
* [getBandwidthStatistics](#getbandwidthstatistics) - Get Bandwidth Statistics
|
||||
|
||||
## getStatistics
|
||||
|
||||
This will return the media statistics for the server
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetStatisticsResponse res = sdk.statistics().getStatistics()
|
||||
.timespan(4L)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetStatisticsResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
||||
| `timespan` | *Optional<? extends Long>* | :heavy_minus_sign: | The timespan to retrieve statistics for<br/>the exact meaning of this parameter is not known<br/> | 4 |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponse](../../models/operations/GetStatisticsResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------------------------------- | --------------------------------------- | --------------------------------------- |
|
||||
| models/errors/GetStatisticsResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getResourcesStatistics
|
||||
|
||||
This will return the resources for the server
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics()
|
||||
.timespan(4L)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetResourcesStatisticsResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
||||
| `timespan` | *Optional<? extends Long>* | :heavy_minus_sign: | The timespan to retrieve statistics for<br/>the exact meaning of this parameter is not known<br/> | 4 |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsResponse](../../models/operations/GetResourcesStatisticsResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
|
||||
| models/errors/GetResourcesStatisticsResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## getBandwidthStatistics
|
||||
|
||||
This will return the bandwidth statistics for the server
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics()
|
||||
.timespan(4L)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetBandwidthStatisticsResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
||||
| `timespan` | *Optional<? extends Long>* | :heavy_minus_sign: | The timespan to retrieve statistics for<br/>the exact meaning of this parameter is not known<br/> | 4 |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponse](../../models/operations/GetBandwidthStatisticsResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
|
||||
| models/errors/GetBandwidthStatisticsResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
219
docs/sdks/updater/README.md
Normal file
219
docs/sdks/updater/README.md
Normal file
@@ -0,0 +1,219 @@
|
||||
# Updater
|
||||
(*updater()*)
|
||||
|
||||
## Overview
|
||||
|
||||
This describes the API for searching and applying updates to the Plex Media Server.
|
||||
Updates to the status can be observed via the Event API.
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [getUpdateStatus](#getupdatestatus) - Querying status of updates
|
||||
* [checkForUpdates](#checkforupdates) - Checking for updates
|
||||
* [applyUpdates](#applyupdates) - Apply Updates
|
||||
|
||||
## getUpdateStatus
|
||||
|
||||
Querying status of updates
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetUpdateStatusResponse res = sdk.updater().getUpdateStatus()
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetUpdateStatusResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponse](../../models/operations/GetUpdateStatusResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
|
||||
| models/errors/GetUpdateStatusResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## checkForUpdates
|
||||
|
||||
Checking for updates
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
CheckForUpdatesResponse res = sdk.updater().checkForUpdates()
|
||||
.download(Download.ONE)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.CheckForUpdatesResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
||||
| `download` | [Optional<? extends lukehagar.plexapi.plexapi.models.operations.Download>](../../models/operations/Download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | 1 |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponse](../../models/operations/CheckForUpdatesResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
|
||||
| models/errors/CheckForUpdatesResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## applyUpdates
|
||||
|
||||
Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
ApplyUpdatesResponse res = sdk.updater().applyUpdates()
|
||||
.tonight(Tonight.ONE)
|
||||
.skip(Skip.ONE)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.ApplyUpdatesResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `tonight` | [Optional<? extends lukehagar.plexapi.plexapi.models.operations.Tonight>](../../models/operations/Tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install | 1 |
|
||||
| `skip` | [Optional<? extends lukehagar.plexapi.plexapi.models.operations.Skip>](../../models/operations/Skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The <Release> entry for this version will have the `state` set to `skipped`. | 1 |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponse](../../models/operations/ApplyUpdatesResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
||||
| models/errors/ApplyUpdatesResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
182
docs/sdks/video/README.md
Normal file
182
docs/sdks/video/README.md
Normal file
@@ -0,0 +1,182 @@
|
||||
# Video
|
||||
(*video()*)
|
||||
|
||||
## Overview
|
||||
|
||||
API Calls that perform operations with Plex Media Server Videos
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [getTimeline](#gettimeline) - Get the timeline for a media item
|
||||
* [startUniversalTranscode](#startuniversaltranscode) - Start Universal Transcode
|
||||
|
||||
## getTimeline
|
||||
|
||||
Get the timeline for a media item
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetTimelineRequest req = GetTimelineRequest.builder()
|
||||
.ratingKey(23409d)
|
||||
.key("/library/metadata/23409")
|
||||
.state(State.PLAYING)
|
||||
.hasMDE(1d)
|
||||
.time(2000d)
|
||||
.duration(10000d)
|
||||
.context("home:hub.continueWatching")
|
||||
.playQueueItemID(1d)
|
||||
.playBackTime(2000d)
|
||||
.row(1d)
|
||||
.build();
|
||||
|
||||
GetTimelineResponse res = sdk.video().getTimeline()
|
||||
.request(req)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetTimelineResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
||||
| `request` | [lukehagar.plexapi.plexapi.models.operations.GetTimelineRequest](../../models/operations/GetTimelineRequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetTimelineResponse](../../models/operations/GetTimelineResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------- | ------------------------------------- | ------------------------------------- |
|
||||
| models/errors/GetTimelineResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
|
||||
## startUniversalTranscode
|
||||
|
||||
Begin a Universal Transcode Session
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder()
|
||||
.hasMDE(1d)
|
||||
.path("/library/metadata/23409")
|
||||
.mediaIndex(0d)
|
||||
.partIndex(0d)
|
||||
.protocol("hls")
|
||||
.fastSeek(0d)
|
||||
.directPlay(0d)
|
||||
.directStream(0d)
|
||||
.subtitleSize(100d)
|
||||
.subtites("burn")
|
||||
.audioBoost(100d)
|
||||
.location("lan")
|
||||
.mediaBufferSize(102400d)
|
||||
.session("zvcage8b7rkioqcm8f4uns4c")
|
||||
.addDebugOverlay(0d)
|
||||
.autoAdjustQuality(0d)
|
||||
.build();
|
||||
|
||||
StartUniversalTranscodeResponse res = sdk.video().startUniversalTranscode()
|
||||
.request(req)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.StartUniversalTranscodeResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `request` | [lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeRequest](../../models/operations/StartUniversalTranscodeRequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse](../../models/operations/StartUniversalTranscodeResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- |
|
||||
| models/errors/StartUniversalTranscodeResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
88
docs/sdks/watchlist/README.md
Normal file
88
docs/sdks/watchlist/README.md
Normal file
@@ -0,0 +1,88 @@
|
||||
# Watchlist
|
||||
(*watchlist()*)
|
||||
|
||||
## Overview
|
||||
|
||||
API Calls that perform operations with Plex Media Server Watchlists
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [getWatchlist](#getwatchlist) - Get User Watchlist
|
||||
|
||||
## getWatchlist
|
||||
|
||||
Get User Watchlist
|
||||
|
||||
### Example Usage
|
||||
|
||||
```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;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.xPlexClientIdentifier("Postman")
|
||||
.build();
|
||||
|
||||
GetWatchlistRequest req = GetWatchlistRequest.builder()
|
||||
.filter(PathParamFilter.RELEASED)
|
||||
.xPlexToken("<value>")
|
||||
.build();
|
||||
|
||||
GetWatchlistResponse res = sdk.watchlist().getWatchlist()
|
||||
.request(req)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.GetWatchlistResponseBody e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// handle exception
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 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. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[lukehagar.plexapi.plexapi.models.operations.GetWatchlistResponse](../../models/operations/GetWatchlistResponse.md)**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
||||
| models/errors/GetWatchlistResponseBody | 401 | application/json |
|
||||
| models/errors/SDKError | 4xx-5xx | \*\/* |
|
||||
Reference in New Issue
Block a user