Files
plexjava/codeSamples.yaml

3716 lines
146 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetServerCapabilitiesBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetServerCapabilitiesUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetServerPreferencesResponse res = sdk.server().getServerPreferences()
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetServerPreferencesBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetServerPreferencesUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
UpdatePlayProgressResponse res = sdk.media().updatePlayProgress()
.key("<key>")
.time(90000d)
.state("played")
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.UpdatePlayProgressBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.UpdatePlayProgressUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
MarkPlayedResponse res = sdk.media().markPlayed()
.key(59398d)
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.MarkPlayedBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.MarkPlayedUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.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.GetTimelineBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetTimelineUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
MarkUnplayedResponse res = sdk.media().markUnplayed()
.key(59398d)
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.MarkUnplayedBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.MarkUnplayedUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetServerActivitiesResponse res = sdk.activities().getServerActivities()
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetServerActivitiesBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetServerActivitiesUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities()
.activityUUID("25b71ed5-0f9d-461c-baa7-d404e9e10d3e")
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.CancelServerActivitiesBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.CancelServerActivitiesUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
StopAllTasksResponse res = sdk.butler().stopAllTasks()
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.StopAllTasksBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.StopAllTasksUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetButlerTasksResponse res = sdk.butler().getButlerTasks()
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetButlerTasksBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetButlerTasksUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
StartAllTasksResponse res = sdk.butler().startAllTasks()
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.StartAllTasksBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.StartAllTasksUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
StopTaskResponse res = sdk.butler().stopTask()
.taskName(PathParamTaskName.BACKUP_DATABASE)
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.StopTaskBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.StopTaskUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
StartTaskResponse res = sdk.butler().startTask()
.taskName(TaskName.CLEAN_OLD_BUNDLES)
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.StartTaskBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.StartTaskUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetAvailableClientsResponse res = sdk.server().getAvailableClients()
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetAvailableClientsBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetAvailableClientsUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetCompanionsDataResponse res = sdk.plex().getCompanionsData()
.call();
if (res.responseBodies().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetCompanionsDataBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetCompanionsDataUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetDevicesResponse res = sdk.server().getDevices()
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetDevicesBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetDevicesUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetUserFriendsResponse res = sdk.plex().getUserFriends()
.call();
if (res.friends().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetUserFriendsBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetUserFriendsUnauthorized 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()
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetGeoDataResponse res = sdk.plex().getGeoData()
.call();
if (res.geoData().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetGeoDataBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetGeoDataUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetHomeDataResponse res = sdk.plex().getHomeData()
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetHomeDataBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetHomeDataUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.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.GetGlobalHubsBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetGlobalHubsUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
PerformSearchResponse res = sdk.search().performSearch()
.query("arnold")
.sectionId(9372.7d)
.limit(5d)
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.PerformSearchBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.PerformSearchUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
PerformVoiceSearchResponse res = sdk.search().performVoiceSearch()
.query("dead+poop")
.sectionId(4094.8d)
.limit(5d)
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.PerformVoiceSearchBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.PerformVoiceSearchUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.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.GetLibraryHubsBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetLibraryHubsUnauthorized 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()
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetServerIdentityResponse res = sdk.server().getServerIdentity()
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetServerIdentityRequestTimeout 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent()
.type(GetTopWatchedContentQueryParamType.TWO)
.includeGuids(1L)
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetTopWatchedContentBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetTopWatchedContentUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.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.GetFileHashBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetFileHashUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetMetaDataByRatingKeyResponse res = sdk.library().getMetaDataByRatingKey()
.ratingKey(9518L)
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetMetaDataByRatingKeyBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetMetaDataByRatingKeyUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.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.GetBannerImageBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetBannerImageUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetMetadataChildrenResponse res = sdk.library().getMetadataChildren()
.ratingKey(1539.14d)
.includeElements("<value>")
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetMetadataChildrenBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetMetadataChildrenUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.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.GetThumbImageBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetThumbImageUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetOnDeckResponse res = sdk.library().getOnDeck()
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetOnDeckBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetOnDeckUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetRecentlyAddedResponse res = sdk.library().getRecentlyAdded()
.xPlexContainerStart(0)
.xPlexContainerSize(50)
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetRecentlyAddedBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetRecentlyAddedUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetAllLibrariesResponse res = sdk.library().getAllLibraries()
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetAllLibrariesBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetAllLibrariesUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.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.GetWatchListBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetWatchListUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
DeleteLibraryResponse res = sdk.library().deleteLibrary()
.sectionKey(9518)
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.DeleteLibraryBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.DeleteLibraryUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetLibraryDetailsResponse res = sdk.library().getLibraryDetails()
.sectionKey(9518)
.includeDetails(IncludeDetails.ZERO)
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetLibraryDetailsBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetLibraryDetailsUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata()
.sectionKey(9518)
.force(Force.ONE)
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.GetRefreshLibraryMetadataBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetRefreshLibraryMetadataUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetSearchLibraryResponse res = sdk.library().getSearchLibrary()
.sectionKey(9518)
.type(QueryParamType.TWO)
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetSearchLibraryBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetSearchLibraryUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.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.GetLibraryItemsBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetLibraryItemsUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
LogLineResponse res = sdk.log().logLine()
.level(Level.THREE)
.message("Test log message")
.source("Postman")
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.LogLineBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.LogLineUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.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.LogMultiLineBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.LogMultiLineUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
EnablePaperTrailResponse res = sdk.log().enablePaperTrail()
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.EnablePaperTrailBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.EnablePaperTrailUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetMediaProvidersResponse res = sdk.server().getMediaProviders()
.xPlexToken("CV5xoxjTpFKUzBTShsaf")
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetMediaProvidersBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetMediaProvidersUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount()
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetMyPlexAccountBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetMyPlexAccountUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetResizedPhotoRequest req = GetResizedPhotoRequest.builder()
.width(110d)
.height(165d)
.opacity(100L)
.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.GetResizedPhotoBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetResizedPhotoUnauthorized 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.GetPinRequest;
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()
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetPinRequest req = GetPinRequest.builder()
.build();
GetPinResponse res = sdk.plex().getPin()
.request(req)
.call();
if (res.authPinContainer().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetPinBadRequest 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()
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId()
.clientID("gcgzw5rz2xovp84b4vha3a40")
.pinID(408895L)
.call();
if (res.authPinContainer().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetTokenByPinIdBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetTokenByPinIdResponseBody 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.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.GetPlaylistsBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetPlaylistsUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
CreatePlaylistRequest req = CreatePlaylistRequest.builder()
.title("<value>")
.type(CreatePlaylistQueryParamType.PHOTO)
.smart(Smart.ONE)
.uri("https://inborn-brochure.biz")
.build();
CreatePlaylistResponse res = sdk.playlists().createPlaylist()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.CreatePlaylistBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.CreatePlaylistUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
UploadPlaylistResponse res = sdk.playlists().uploadPlaylist()
.path("/home/barkley/playlist.m3u")
.force(QueryParamForce.ZERO)
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.UploadPlaylistBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.UploadPlaylistUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
DeletePlaylistResponse res = sdk.playlists().deletePlaylist()
.playlistID(216.22d)
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.DeletePlaylistBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.DeletePlaylistUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetPlaylistResponse res = sdk.playlists().getPlaylist()
.playlistID(4109.48d)
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetPlaylistBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetPlaylistUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
UpdatePlaylistResponse res = sdk.playlists().updatePlaylist()
.playlistID(3915d)
.title("<value>")
.summary("<value>")
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.UpdatePlaylistBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.UpdatePlaylistUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents()
.playlistID(1893.18d)
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.ClearPlaylistContentsBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.ClearPlaylistContentsUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.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.GetPlaylistContentsBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetPlaylistContentsUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.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.AddPlaylistContentsBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.AddPlaylistContentsUnauthorized 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.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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetServerResourcesResponse res = sdk.plex().getServerResources()
.clientID("gcgzw5rz2xovp84b4vha3a40")
.includeHttps(IncludeHttps.ONE)
.includeRelay(IncludeRelay.ONE)
.includeIPv6(IncludeIPv6.ONE)
.call();
if (res.plexDevices().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetServerResourcesBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetServerResourcesUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetSearchResultsResponse res = sdk.search().getSearchResults()
.query("110")
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetSearchResultsBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetSearchResultsUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation()
.source("server://client-identifier")
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.GetSourceConnectionInformationBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetSourceConnectionInformationUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetTransientTokenResponse res = sdk.authentication().getTransientToken()
.type(GetTransientTokenQueryParamType.DELEGATION)
.scope(Scope.ALL)
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.GetTransientTokenBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetTransientTokenUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetServerListResponse res = sdk.server().getServerList()
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetServerListBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetServerListUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics()
.timespan(4L)
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetBandwidthStatisticsBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetBandwidthStatisticsUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetStatisticsResponse res = sdk.statistics().getStatistics()
.timespan(4L)
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetStatisticsBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetStatisticsUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics()
.timespan(4L)
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetResourcesStatisticsBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetResourcesStatisticsUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetSessionsResponse res = sdk.sessions().getSessions()
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetSessionsBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetSessionsUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.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.GetSessionHistoryBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetSessionHistoryUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions()
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetTranscodeSessionsBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetTranscodeSessionsUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession()
.sessionKey("zz7llzqlx8w9vnrsbnwhbmep")
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.StopTranscodeSessionBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.StopTranscodeSessionUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
ApplyUpdatesResponse res = sdk.updater().applyUpdates()
.tonight(Tonight.ONE)
.skip(Skip.ONE)
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.ApplyUpdatesBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.ApplyUpdatesUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
CheckForUpdatesResponse res = sdk.updater().checkForUpdates()
.download(Download.ONE)
.call();
// handle response
} catch (dev.plexapi.plexapi.models.errors.CheckForUpdatesBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.CheckForUpdatesUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetUpdateStatusResponse res = sdk.updater().getUpdateStatus()
.call();
if (res.object().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetUpdateStatusBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetUpdateStatusUnauthorized 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: getTokenDetails
source: |-
package hello.world;
import dev.plexapi.plexapi.PlexAPI;
import dev.plexapi.plexapi.models.errors.SDKError;
import dev.plexapi.plexapi.models.operations.GetTokenDetailsResponse;
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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
GetTokenDetailsResponse res = sdk.authentication().getTokenDetails()
.call();
if (res.userPlexAccount().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.GetTokenDetailsBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.GetTokenDetailsUnauthorized 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()
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.build();
PostUsersSignInDataResponse res = sdk.authentication().postUsersSignInData()
.clientID("gcgzw5rz2xovp84b4vha3a40")
.requestBody(PostUsersSignInDataRequestBody.builder()
.login("username@email.com")
.password("password123")
.verificationCode("123456")
.build())
.call();
if (res.userPlexAccount().isPresent()) {
// handle response
}
} catch (dev.plexapi.plexapi.models.errors.PostUsersSignInDataBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.PostUsersSignInDataUnauthorized 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>")
.clientID("gcgzw5rz2xovp84b4vha3a40")
.clientName("Plex Web")
.clientVersion("4.133.0")
.clientPlatform("Chrome")
.deviceName("Linux")
.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.StartUniversalTranscodeBadRequest e) {
// handle exception
throw e;
} catch (dev.plexapi.plexapi.models.errors.StartUniversalTranscodeUnauthorized e) {
// handle exception
throw e;
} catch (SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}