mirror of
https://github.com/LukeHagar/plexjava.git
synced 2025-12-06 12:37:47 +00:00
3210 lines
120 KiB
YAML
3210 lines
120 KiB
YAML
overlay: 1.0.0
|
|
info:
|
|
title: CodeSamples overlay for java target
|
|
version: 0.0.0
|
|
actions:
|
|
- target: $["paths"]["/"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getServerCapabilities
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetServerCapabilitiesResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/:/prefs"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getServerPreferences
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetServerPreferencesResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetServerPreferencesResponse res = sdk.server().getServerPreferences()
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetServerPreferencesResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/:/progress"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: updatePlayProgress
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.UpdatePlayProgressResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
UpdatePlayProgressResponse res = sdk.media().updatePlayProgress()
|
|
.key("<key>")
|
|
.time(90000d)
|
|
.state("played")
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.UpdatePlayProgressResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/:/scrobble"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: markPlayed
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.MarkPlayedResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
MarkPlayedResponse res = sdk.media().markPlayed()
|
|
.key(59398d)
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.MarkPlayedResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/:/timeline"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getTimeline
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetTimelineRequest;
|
|
import dev.plexapi.plexapi.models.operations.GetTimelineResponse;
|
|
import dev.plexapi.plexapi.models.operations.State;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.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 (dev.plexapi.plexapi.models.errors.GetTimelineResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/:/unscrobble"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: markUnplayed
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.MarkUnplayedResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
MarkUnplayedResponse res = sdk.media().markUnplayed()
|
|
.key(59398d)
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.MarkUnplayedResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/activities"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getServerActivities
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetServerActivitiesResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetServerActivitiesResponse res = sdk.activities().getServerActivities()
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetServerActivitiesResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/activities/{activityUUID}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: cancelServerActivities
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.CancelServerActivitiesResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities()
|
|
.activityUUID("25b71ed5-0f9d-461c-baa7-d404e9e10d3e")
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.CancelServerActivitiesResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/butler"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: stopAllTasks
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.StopAllTasksResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
StopAllTasksResponse res = sdk.butler().stopAllTasks()
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.StopAllTasksResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/butler"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getButlerTasks
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetButlerTasksResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetButlerTasksResponse res = sdk.butler().getButlerTasks()
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetButlerTasksResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/butler"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: startAllTasks
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.StartAllTasksResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
StartAllTasksResponse res = sdk.butler().startAllTasks()
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.StartAllTasksResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/butler/{taskName}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: stopTask
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.PathParamTaskName;
|
|
import dev.plexapi.plexapi.models.operations.StopTaskResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
StopTaskResponse res = sdk.butler().stopTask()
|
|
.taskName(PathParamTaskName.BACKUP_DATABASE)
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.StopTaskResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/butler/{taskName}"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: startTask
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.StartTaskResponse;
|
|
import dev.plexapi.plexapi.models.operations.TaskName;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
StartTaskResponse res = sdk.butler().startTask()
|
|
.taskName(TaskName.CLEAN_OLD_BUNDLES)
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.StartTaskResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/clients"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getAvailableClients
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetAvailableClientsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetAvailableClientsResponse res = sdk.server().getAvailableClients()
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetAvailableClientsResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/companions"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getCompanionsData
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetCompanionsDataResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetCompanionsDataResponse res = sdk.plex().getCompanionsData()
|
|
.call();
|
|
|
|
if (res.responseBodies().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetCompanionsDataResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/devices"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getDevices
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetDevicesResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetDevicesResponse res = sdk.server().getDevices()
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetDevicesResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/friends"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getUserFriends
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetUserFriendsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetUserFriendsResponse res = sdk.plex().getUserFriends()
|
|
.call();
|
|
|
|
if (res.friends().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetUserFriendsResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/geoip"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getGeoData
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetGeoDataResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetGeoDataResponse res = sdk.plex().getGeoData()
|
|
.call();
|
|
|
|
if (res.geoData().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetGeoDataResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/home"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getHomeData
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetHomeDataResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetHomeDataResponse res = sdk.plex().getHomeData()
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetHomeDataResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/hubs"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getGlobalHubs
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetGlobalHubsResponse;
|
|
import dev.plexapi.plexapi.models.operations.OnlyTransient;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs()
|
|
.count(1262.49d)
|
|
.onlyTransient(OnlyTransient.ONE)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetGlobalHubsResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/hubs/search"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: performSearch
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.PerformSearchResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
PerformSearchResponse res = sdk.search().performSearch()
|
|
.query("arnold")
|
|
.sectionId(9372.7d)
|
|
.limit(5d)
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.PerformSearchResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/hubs/search/voice"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: performVoiceSearch
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.PerformVoiceSearchResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
PerformVoiceSearchResponse res = sdk.search().performVoiceSearch()
|
|
.query("dead+poop")
|
|
.sectionId(4094.8d)
|
|
.limit(5d)
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.PerformVoiceSearchResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/hubs/sections/{sectionId}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getLibraryHubs
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetLibraryHubsResponse;
|
|
import dev.plexapi.plexapi.models.operations.QueryParamOnlyTransient;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs()
|
|
.sectionId(6728.76d)
|
|
.count(9010.22d)
|
|
.onlyTransient(QueryParamOnlyTransient.ZERO)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetLibraryHubsResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/identity"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: identity
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetServerIdentityResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetServerIdentityResponse res = sdk.server().getServerIdentity()
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetServerIdentityResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/all/top"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getTopWatchedContent
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetTopWatchedContentQueryParamType;
|
|
import dev.plexapi.plexapi.models.operations.GetTopWatchedContentResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent()
|
|
.type(GetTopWatchedContentQueryParamType.TWO)
|
|
.includeGuids(1L)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetTopWatchedContentResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/hashes"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getFileHash
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetFileHashResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetFileHashResponse res = sdk.library().getFileHash()
|
|
.url("file://C:\Image.png&type=13")
|
|
.type(4462.17d)
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.GetFileHashResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/metadata/{ratingKey}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: key
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetMetaDataByRatingKeyResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetMetaDataByRatingKeyResponse res = sdk.library().getMetaDataByRatingKey()
|
|
.ratingKey(9518L)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetMetaDataByRatingKeyResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/metadata/{ratingKey}/banner"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: image
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetBannerImageRequest;
|
|
import dev.plexapi.plexapi.models.operations.GetBannerImageResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetBannerImageRequest req = GetBannerImageRequest.builder()
|
|
.ratingKey(9518L)
|
|
.width(396L)
|
|
.height(396L)
|
|
.minSize(1L)
|
|
.upscale(1L)
|
|
.xPlexToken("CV5xoxjTpFKUzBTShsaf")
|
|
.build();
|
|
|
|
GetBannerImageResponse res = sdk.media().getBannerImage()
|
|
.request(req)
|
|
.call();
|
|
|
|
if (res.responseStream().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetBannerImageResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getMetadataChildren
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetMetadataChildrenResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetMetadataChildrenResponse res = sdk.library().getMetadataChildren()
|
|
.ratingKey(1539.14d)
|
|
.includeElements("<value>")
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetMetadataChildrenResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/metadata/{ratingKey}/thumb"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: image
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetThumbImageRequest;
|
|
import dev.plexapi.plexapi.models.operations.GetThumbImageResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetThumbImageRequest req = GetThumbImageRequest.builder()
|
|
.ratingKey(9518L)
|
|
.width(396L)
|
|
.height(396L)
|
|
.minSize(1L)
|
|
.upscale(1L)
|
|
.xPlexToken("CV5xoxjTpFKUzBTShsaf")
|
|
.build();
|
|
|
|
GetThumbImageResponse res = sdk.media().getThumbImage()
|
|
.request(req)
|
|
.call();
|
|
|
|
if (res.responseStream().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetThumbImageResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/onDeck"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getOnDeck
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetOnDeckResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetOnDeckResponse res = sdk.library().getOnDeck()
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetOnDeckResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/recentlyAdded"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getRecentlyAdded
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetRecentlyAddedResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetRecentlyAddedResponse res = sdk.library().getRecentlyAdded()
|
|
.xPlexContainerStart(0)
|
|
.xPlexContainerSize(50)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetRecentlyAddedResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/sections"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: libraries
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetAllLibrariesResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetAllLibrariesResponse res = sdk.library().getAllLibraries()
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetAllLibrariesResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/sections/watchlist/{filter}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: list
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.Filter;
|
|
import dev.plexapi.plexapi.models.operations.GetWatchListRequest;
|
|
import dev.plexapi.plexapi.models.operations.GetWatchListResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetWatchListRequest req = GetWatchListRequest.builder()
|
|
.filter(Filter.AVAILABLE)
|
|
.xPlexToken("CV5xoxjTpFKUzBTShsaf")
|
|
.xPlexContainerStart(0)
|
|
.xPlexContainerSize(50)
|
|
.build();
|
|
|
|
GetWatchListResponse res = sdk.watchlist().getWatchList()
|
|
.request(req)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetWatchListResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/sections/{sectionKey}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: deleteLibrary
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.DeleteLibraryResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
DeleteLibraryResponse res = sdk.library().deleteLibrary()
|
|
.sectionKey(9518)
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.DeleteLibraryResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/sections/{sectionKey}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: details
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetLibraryDetailsResponse;
|
|
import dev.plexapi.plexapi.models.operations.IncludeDetails;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetLibraryDetailsResponse res = sdk.library().getLibraryDetails()
|
|
.sectionKey(9518)
|
|
.includeDetails(IncludeDetails.ZERO)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetLibraryDetailsResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/sections/{sectionKey}/refresh"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: metadata
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.Force;
|
|
import dev.plexapi.plexapi.models.operations.GetRefreshLibraryMetadataResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata()
|
|
.sectionKey(9518)
|
|
.force(Force.ONE)
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.GetRefreshLibraryMetadataResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/sections/{sectionKey}/search"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: library
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetSearchLibraryResponse;
|
|
import dev.plexapi.plexapi.models.operations.QueryParamType;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetSearchLibraryResponse res = sdk.library().getSearchLibrary()
|
|
.sectionKey(9518)
|
|
.type(QueryParamType.TWO)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetSearchLibraryResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/sections/{sectionKey}/{tag}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: items
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetLibraryItemsRequest;
|
|
import dev.plexapi.plexapi.models.operations.GetLibraryItemsResponse;
|
|
import dev.plexapi.plexapi.models.operations.IncludeGuids;
|
|
import dev.plexapi.plexapi.models.operations.IncludeMeta;
|
|
import dev.plexapi.plexapi.models.operations.Tag;
|
|
import dev.plexapi.plexapi.models.operations.Type;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetLibraryItemsRequest req = GetLibraryItemsRequest.builder()
|
|
.sectionKey(9518)
|
|
.tag(Tag.EDITION)
|
|
.type(Type.TWO)
|
|
.includeGuids(IncludeGuids.ONE)
|
|
.includeMeta(IncludeMeta.ONE)
|
|
.xPlexContainerStart(0)
|
|
.xPlexContainerSize(50)
|
|
.build();
|
|
|
|
GetLibraryItemsResponse res = sdk.library().getLibraryItems()
|
|
.request(req)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetLibraryItemsResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/log"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: logLine
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.Level;
|
|
import dev.plexapi.plexapi.models.operations.LogLineResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
LogLineResponse res = sdk.log().logLine()
|
|
.level(Level.THREE)
|
|
.message("Test log message")
|
|
.source("Postman")
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.LogLineResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/log"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: logMultiLine
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.LogMultiLineResponse;
|
|
import java.lang.Exception;
|
|
import java.lang.String;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
String req = "level=4&message=Test%20message%201&source=postman\nlevel=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 (dev.plexapi.plexapi.models.errors.LogMultiLineResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/log/networked"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: enablePaperTrail
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.EnablePaperTrailResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
EnablePaperTrailResponse res = sdk.log().enablePaperTrail()
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.EnablePaperTrailResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/media/providers"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: providers
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetMediaProvidersResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetMediaProvidersResponse res = sdk.server().getMediaProviders()
|
|
.xPlexToken("CV5xoxjTpFKUzBTShsaf")
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetMediaProvidersResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/myplex/account"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getMyPlexAccount
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetMyPlexAccountResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount()
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetMyPlexAccountResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/photo/:/transcode"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getResizedPhoto
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetResizedPhotoRequest;
|
|
import dev.plexapi.plexapi.models.operations.GetResizedPhotoResponse;
|
|
import dev.plexapi.plexapi.models.operations.MinSize;
|
|
import dev.plexapi.plexapi.models.operations.Upscale;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.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 (dev.plexapi.plexapi.models.errors.GetResizedPhotoResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/pins"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getPin
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetPinResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetPinResponse res = sdk.plex().getPin()
|
|
.strong(false)
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.xPlexProduct("Plex Web")
|
|
.call();
|
|
|
|
if (res.authPinContainer().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetPinResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/pins/{pinID}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getTokenByPinId
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetTokenByPinIdResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId()
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.pinID(408895L)
|
|
.call();
|
|
|
|
if (res.authPinContainer().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetTokenByPinIdResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (dev.plexapi.plexapi.models.errors.GetTokenByPinIdPlexResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getPlaylists
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetPlaylistsResponse;
|
|
import dev.plexapi.plexapi.models.operations.PlaylistType;
|
|
import dev.plexapi.plexapi.models.operations.QueryParamSmart;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetPlaylistsResponse res = sdk.playlists().getPlaylists()
|
|
.playlistType(PlaylistType.AUDIO)
|
|
.smart(QueryParamSmart.ZERO)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetPlaylistsResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: createPlaylist
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.CreatePlaylistQueryParamType;
|
|
import dev.plexapi.plexapi.models.operations.CreatePlaylistRequest;
|
|
import dev.plexapi.plexapi.models.operations.CreatePlaylistResponse;
|
|
import dev.plexapi.plexapi.models.operations.Smart;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
CreatePlaylistRequest req = CreatePlaylistRequest.builder()
|
|
.title("<value>")
|
|
.type(CreatePlaylistQueryParamType.PHOTO)
|
|
.smart(Smart.ONE)
|
|
.uri("<value>")
|
|
.build();
|
|
|
|
CreatePlaylistResponse res = sdk.playlists().createPlaylist()
|
|
.request(req)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.CreatePlaylistResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists/upload"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: uploadPlaylist
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.QueryParamForce;
|
|
import dev.plexapi.plexapi.models.operations.UploadPlaylistResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
UploadPlaylistResponse res = sdk.playlists().uploadPlaylist()
|
|
.path("/home/barkley/playlist.m3u")
|
|
.force(QueryParamForce.ZERO)
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.UploadPlaylistResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists/{playlistID}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: deletePlaylist
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.DeletePlaylistResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
DeletePlaylistResponse res = sdk.playlists().deletePlaylist()
|
|
.playlistID(216.22d)
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.DeletePlaylistResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists/{playlistID}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getPlaylist
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetPlaylistResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetPlaylistResponse res = sdk.playlists().getPlaylist()
|
|
.playlistID(4109.48d)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetPlaylistResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists/{playlistID}"]["put"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: updatePlaylist
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.UpdatePlaylistResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
UpdatePlaylistResponse res = sdk.playlists().updatePlaylist()
|
|
.playlistID(3915d)
|
|
.title("<value>")
|
|
.summary("<value>")
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.UpdatePlaylistResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists/{playlistID}/items"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: clearPlaylistContents
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.ClearPlaylistContentsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents()
|
|
.playlistID(1893.18d)
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.ClearPlaylistContentsResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists/{playlistID}/items"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getPlaylistContents
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetPlaylistContentsQueryParamType;
|
|
import dev.plexapi.plexapi.models.operations.GetPlaylistContentsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents()
|
|
.playlistID(5004.46d)
|
|
.type(GetPlaylistContentsQueryParamType.TWO)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetPlaylistContentsResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists/{playlistID}/items"]["put"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: addPlaylistContents
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.AddPlaylistContentsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.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 (dev.plexapi.plexapi.models.errors.AddPlaylistContentsResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/resources"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: resources
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetServerResourcesRequest;
|
|
import dev.plexapi.plexapi.models.operations.GetServerResourcesResponse;
|
|
import dev.plexapi.plexapi.models.operations.IncludeHttps;
|
|
import dev.plexapi.plexapi.models.operations.IncludeIPv6;
|
|
import dev.plexapi.plexapi.models.operations.IncludeRelay;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetServerResourcesRequest req = GetServerResourcesRequest.builder()
|
|
.xPlexToken("CV5xoxjTpFKUzBTShsaf")
|
|
.includeHttps(IncludeHttps.ONE)
|
|
.includeRelay(IncludeRelay.ONE)
|
|
.includeIPv6(IncludeIPv6.ONE)
|
|
.build();
|
|
|
|
GetServerResourcesResponse res = sdk.plex().getServerResources()
|
|
.request(req)
|
|
.call();
|
|
|
|
if (res.plexDevices().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetServerResourcesResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/search"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getSearchResults
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetSearchResultsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetSearchResultsResponse res = sdk.search().getSearchResults()
|
|
.query("110")
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetSearchResultsResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/security/resources"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getSourceConnectionInformation
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation()
|
|
.source("server://client-identifier")
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.GetSourceConnectionInformationResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/security/token"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getTransientToken
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetTransientTokenQueryParamType;
|
|
import dev.plexapi.plexapi.models.operations.GetTransientTokenResponse;
|
|
import dev.plexapi.plexapi.models.operations.Scope;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetTransientTokenResponse res = sdk.authentication().getTransientToken()
|
|
.type(GetTransientTokenQueryParamType.DELEGATION)
|
|
.scope(Scope.ALL)
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.GetTransientTokenResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/servers"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getServerList
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetServerListResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetServerListResponse res = sdk.server().getServerList()
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetServerListResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/statistics/bandwidth"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getBandwidthStatistics
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics()
|
|
.timespan(4L)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetBandwidthStatisticsResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/statistics/media"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getStatistics
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetStatisticsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetStatisticsResponse res = sdk.statistics().getStatistics()
|
|
.timespan(4L)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetStatisticsResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/statistics/resources"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getResourcesStatistics
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetResourcesStatisticsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics()
|
|
.timespan(4L)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetResourcesStatisticsResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/status/sessions"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getSessions
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetSessionsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetSessionsResponse res = sdk.sessions().getSessions()
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetSessionsResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/status/sessions/history/all"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getSessionHistory
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetSessionHistoryResponse;
|
|
import dev.plexapi.plexapi.models.operations.QueryParamFilter;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetSessionHistoryResponse res = sdk.sessions().getSessionHistory()
|
|
.sort("<value>")
|
|
.accountId(1L)
|
|
.filter(QueryParamFilter.builder()
|
|
.build())
|
|
.librarySectionID(12L)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetSessionHistoryResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/transcode/sessions"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getTranscodeSessions
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions()
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetTranscodeSessionsResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: stopTranscodeSession
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.StopTranscodeSessionResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession()
|
|
.sessionKey("zz7llzqlx8w9vnrsbnwhbmep")
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.StopTranscodeSessionResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/updater/apply"]["put"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: applyUpdates
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.ApplyUpdatesResponse;
|
|
import dev.plexapi.plexapi.models.operations.Skip;
|
|
import dev.plexapi.plexapi.models.operations.Tonight;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
ApplyUpdatesResponse res = sdk.updater().applyUpdates()
|
|
.tonight(Tonight.ONE)
|
|
.skip(Skip.ONE)
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.ApplyUpdatesResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/updater/check"]["put"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: checkForUpdates
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.CheckForUpdatesResponse;
|
|
import dev.plexapi.plexapi.models.operations.Download;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
CheckForUpdatesResponse res = sdk.updater().checkForUpdates()
|
|
.download(Download.ONE)
|
|
.call();
|
|
|
|
// handle response
|
|
} catch (dev.plexapi.plexapi.models.errors.CheckForUpdatesResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/updater/status"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getUpdateStatus
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetUpdateStatusResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetUpdateStatusResponse res = sdk.updater().getUpdateStatus()
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetUpdateStatusResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/user"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: getUserDetails
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.GetUserDetailsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
GetUserDetailsResponse res = sdk.authentication().getUserDetails()
|
|
.xPlexToken("CV5xoxjTpFKUzBTShsaf")
|
|
.call();
|
|
|
|
if (res.userPlexAccount().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.GetUserDetailsResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/users/signin"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: data
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.PostUsersSignInDataRequestBody;
|
|
import dev.plexapi.plexapi.models.operations.PostUsersSignInDataResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.build();
|
|
|
|
PostUsersSignInDataResponse res = sdk.authentication().postUsersSignInData()
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.requestBody(PostUsersSignInDataRequestBody.builder()
|
|
.login("username@email.com")
|
|
.password("password123")
|
|
.build())
|
|
.call();
|
|
|
|
if (res.userPlexAccount().isPresent()) {
|
|
// handle response
|
|
}
|
|
} catch (dev.plexapi.plexapi.models.errors.PostUsersSignInDataResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|
|
- target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: startUniversalTranscode
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.SDKError;
|
|
import dev.plexapi.plexapi.models.operations.StartUniversalTranscodeRequest;
|
|
import dev.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
try {
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.xPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40")
|
|
.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 (dev.plexapi.plexapi.models.errors.StartUniversalTranscodeResponseBody e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (SDKError e) {
|
|
// handle exception
|
|
throw e;
|
|
} catch (Exception e) {
|
|
// handle exception
|
|
throw e;
|
|
}
|
|
|
|
}
|
|
}
|