mirror of
https://github.com/LukeHagar/plexjava.git
synced 2025-12-06 04:20:46 +00:00
2838 lines
114 KiB
YAML
2838 lines
114 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.GetServerCapabilitiesBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetServerCapabilitiesUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetServerPreferencesBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetServerPreferencesUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetServerPreferencesResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetServerPreferencesBadRequest, GetServerPreferencesUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.UpdatePlayProgressBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.UpdatePlayProgressUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.UpdatePlayProgressResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws UpdatePlayProgressBadRequest, UpdatePlayProgressUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.MarkPlayedBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.MarkPlayedUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.MarkPlayedResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws MarkPlayedBadRequest, MarkPlayedUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.GetTimelineBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetTimelineUnauthorized;
|
|
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 GetTimelineBadRequest, GetTimelineUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.MarkUnplayedBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.MarkUnplayedUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.MarkUnplayedResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws MarkUnplayedBadRequest, MarkUnplayedUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.GetServerActivitiesBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetServerActivitiesUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetServerActivitiesResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetServerActivitiesBadRequest, GetServerActivitiesUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.CancelServerActivitiesBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.CancelServerActivitiesUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.CancelServerActivitiesResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws CancelServerActivitiesBadRequest, CancelServerActivitiesUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.StopAllTasksBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.StopAllTasksUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.StopAllTasksResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws StopAllTasksBadRequest, StopAllTasksUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.GetButlerTasksBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetButlerTasksUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetButlerTasksResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetButlerTasksBadRequest, GetButlerTasksUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.StartAllTasksBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.StartAllTasksUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.StartAllTasksResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws StartAllTasksBadRequest, StartAllTasksUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.StopTaskBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.StopTaskUnauthorized;
|
|
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 StopTaskBadRequest, StopTaskUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.StartTaskBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.StartTaskUnauthorized;
|
|
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 StartTaskBadRequest, StartTaskUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.GetAvailableClientsBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetAvailableClientsUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetAvailableClientsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetAvailableClientsBadRequest, GetAvailableClientsUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetCompanionsDataBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetCompanionsDataUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetCompanionsDataResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetCompanionsDataBadRequest, GetCompanionsDataUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetDevicesBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetDevicesUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetDevicesResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetDevicesBadRequest, GetDevicesUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetUserFriendsBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetUserFriendsUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetUserFriendsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetUserFriendsBadRequest, GetUserFriendsUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetGeoDataBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetGeoDataUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetGeoDataResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetGeoDataBadRequest, GetGeoDataUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetHomeDataBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetHomeDataUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetHomeDataResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetHomeDataBadRequest, GetHomeDataUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetGlobalHubsBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetGlobalHubsUnauthorized;
|
|
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 GetGlobalHubsBadRequest, GetGlobalHubsUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- target: $["paths"]["/hubs/home/recentlyAdded"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: added
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.operations.GetRecentlyAddedRequest;
|
|
import dev.plexapi.plexapi.models.operations.GetRecentlyAddedResponse;
|
|
import dev.plexapi.plexapi.models.operations.IncludeMeta;
|
|
import dev.plexapi.plexapi.models.operations.Type;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.clientID("gcgzw5rz2xovp84b4vha3a40")
|
|
.clientName("Plex Web")
|
|
.clientVersion("4.133.0")
|
|
.clientPlatform("Chrome")
|
|
.deviceName("Linux")
|
|
.build();
|
|
|
|
GetRecentlyAddedRequest req = GetRecentlyAddedRequest.builder()
|
|
.contentDirectoryID(470161L)
|
|
.type(Type.TvShow)
|
|
.sectionID(2L)
|
|
.includeMeta(IncludeMeta.Enable)
|
|
.xPlexContainerStart(0)
|
|
.xPlexContainerSize(50)
|
|
.build();
|
|
|
|
GetRecentlyAddedResponse res = sdk.hubs().getRecentlyAdded()
|
|
.request(req)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
}
|
|
}
|
|
- 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.PerformSearchBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.PerformSearchUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.PerformSearchResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws PerformSearchBadRequest, PerformSearchUnauthorized, Exception {
|
|
|
|
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("dylan")
|
|
.sectionId(9372.69d)
|
|
.limit(5d)
|
|
.call();
|
|
|
|
// handle response
|
|
}
|
|
}
|
|
- 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.PerformVoiceSearchBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.PerformVoiceSearchUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.PerformVoiceSearchResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws PerformVoiceSearchBadRequest, PerformVoiceSearchUnauthorized, Exception {
|
|
|
|
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.80d)
|
|
.limit(5d)
|
|
.call();
|
|
|
|
// handle response
|
|
}
|
|
}
|
|
- 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.GetLibraryHubsBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetLibraryHubsUnauthorized;
|
|
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 GetLibraryHubsBadRequest, GetLibraryHubsUnauthorized, Exception {
|
|
|
|
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(639.24d)
|
|
.onlyTransient(QueryParamOnlyTransient.ONE)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
}
|
|
}
|
|
- 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.GetServerIdentityRequestTimeout;
|
|
import dev.plexapi.plexapi.models.operations.GetServerIdentityResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetServerIdentityRequestTimeout, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetTopWatchedContentBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetTopWatchedContentUnauthorized;
|
|
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 GetTopWatchedContentBadRequest, GetTopWatchedContentUnauthorized, Exception {
|
|
|
|
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.TvShow)
|
|
.includeGuids(1L)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
}
|
|
}
|
|
- 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.GetFileHashBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetFileHashUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetFileHashResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetFileHashBadRequest, GetFileHashUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.GetMetaDataByRatingKeyBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetMetaDataByRatingKeyUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetMetaDataByRatingKeyResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetMetaDataByRatingKeyBadRequest, GetMetaDataByRatingKeyUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetBannerImageBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetBannerImageUnauthorized;
|
|
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 GetBannerImageBadRequest, GetBannerImageUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetMetadataChildrenBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetMetadataChildrenUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetMetadataChildrenResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetMetadataChildrenBadRequest, GetMetadataChildrenUnauthorized, Exception {
|
|
|
|
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.15d)
|
|
.includeElements("<value>")
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
}
|
|
}
|
|
- 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.GetThumbImageBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetThumbImageUnauthorized;
|
|
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 GetThumbImageBadRequest, GetThumbImageUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetOnDeckBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetOnDeckUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetOnDeckResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetOnDeckBadRequest, GetOnDeckUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/recentlyAdded"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: java
|
|
label: library
|
|
source: |-
|
|
package hello.world;
|
|
|
|
import dev.plexapi.plexapi.PlexAPI;
|
|
import dev.plexapi.plexapi.models.errors.GetRecentlyAddedLibraryBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetRecentlyAddedLibraryUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetRecentlyAddedLibraryRequest;
|
|
import dev.plexapi.plexapi.models.operations.GetRecentlyAddedLibraryResponse;
|
|
import dev.plexapi.plexapi.models.operations.QueryParamIncludeMeta;
|
|
import dev.plexapi.plexapi.models.operations.QueryParamType;
|
|
import java.lang.Exception;
|
|
import java.util.List;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetRecentlyAddedLibraryBadRequest, GetRecentlyAddedLibraryUnauthorized, Exception {
|
|
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.clientID("gcgzw5rz2xovp84b4vha3a40")
|
|
.clientName("Plex Web")
|
|
.clientVersion("4.133.0")
|
|
.clientPlatform("Chrome")
|
|
.deviceName("Linux")
|
|
.build();
|
|
|
|
GetRecentlyAddedLibraryRequest req = GetRecentlyAddedLibraryRequest.builder()
|
|
.type(QueryParamType.TvShow)
|
|
.contentDirectoryID(2L)
|
|
.pinnedContentDirectoryID(List.of(
|
|
3L,
|
|
5L,
|
|
7L,
|
|
13L,
|
|
12L,
|
|
1L,
|
|
6L,
|
|
14L,
|
|
2L,
|
|
10L,
|
|
16L,
|
|
17L))
|
|
.sectionID(2L)
|
|
.includeMeta(QueryParamIncludeMeta.Enable)
|
|
.xPlexContainerStart(0)
|
|
.xPlexContainerSize(50)
|
|
.build();
|
|
|
|
GetRecentlyAddedLibraryResponse res = sdk.library().getRecentlyAddedLibrary()
|
|
.request(req)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
}
|
|
}
|
|
- 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.GetAllLibrariesBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetAllLibrariesUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetAllLibrariesResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetAllLibrariesBadRequest, GetAllLibrariesUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetWatchListBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetWatchListUnauthorized;
|
|
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 GetWatchListBadRequest, GetWatchListUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.DeleteLibraryBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.DeleteLibraryUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.DeleteLibraryResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws DeleteLibraryBadRequest, DeleteLibraryUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.GetLibraryDetailsBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetLibraryDetailsUnauthorized;
|
|
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 GetLibraryDetailsBadRequest, GetLibraryDetailsUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetRefreshLibraryMetadataBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetRefreshLibraryMetadataUnauthorized;
|
|
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 GetRefreshLibraryMetadataBadRequest, GetRefreshLibraryMetadataUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.GetSearchLibraryBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetSearchLibraryUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetSearchLibraryQueryParamType;
|
|
import dev.plexapi.plexapi.models.operations.GetSearchLibraryResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetSearchLibraryBadRequest, GetSearchLibraryUnauthorized, Exception {
|
|
|
|
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(GetSearchLibraryQueryParamType.TvShow)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
}
|
|
}
|
|
- 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.GetLibraryItemsBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetLibraryItemsUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetLibraryItemsQueryParamIncludeMeta;
|
|
import dev.plexapi.plexapi.models.operations.GetLibraryItemsQueryParamType;
|
|
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.Tag;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetLibraryItemsBadRequest, GetLibraryItemsUnauthorized, Exception {
|
|
|
|
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)
|
|
.includeGuids(IncludeGuids.Enable)
|
|
.type(GetLibraryItemsQueryParamType.TvShow)
|
|
.includeMeta(GetLibraryItemsQueryParamIncludeMeta.Enable)
|
|
.xPlexContainerStart(0)
|
|
.xPlexContainerSize(50)
|
|
.build();
|
|
|
|
GetLibraryItemsResponse res = sdk.library().getLibraryItems()
|
|
.request(req)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
}
|
|
}
|
|
- 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.LogLineBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.LogLineUnauthorized;
|
|
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 LogLineBadRequest, LogLineUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.LogMultiLineBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.LogMultiLineUnauthorized;
|
|
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 LogMultiLineBadRequest, LogMultiLineUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.EnablePaperTrailBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.EnablePaperTrailUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.EnablePaperTrailResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws EnablePaperTrailBadRequest, EnablePaperTrailUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.GetMediaProvidersBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetMediaProvidersUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetMediaProvidersResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetMediaProvidersBadRequest, GetMediaProvidersUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetMyPlexAccountBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetMyPlexAccountUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetMyPlexAccountResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetMyPlexAccountBadRequest, GetMyPlexAccountUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetResizedPhotoBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetResizedPhotoUnauthorized;
|
|
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 GetResizedPhotoBadRequest, GetResizedPhotoUnauthorized, Exception {
|
|
|
|
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(20d)
|
|
.minSize(MinSize.ZERO)
|
|
.upscale(Upscale.ONE)
|
|
.url("/library/metadata/49564/thumb/1654258204")
|
|
.build();
|
|
|
|
GetResizedPhotoResponse res = sdk.server().getResizedPhoto()
|
|
.request(req)
|
|
.call();
|
|
|
|
// handle response
|
|
}
|
|
}
|
|
- 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.GetPinBadRequest;
|
|
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 GetPinBadRequest, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetTokenByPinIdBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetTokenByPinIdResponseBody;
|
|
import dev.plexapi.plexapi.models.operations.GetTokenByPinIdRequest;
|
|
import dev.plexapi.plexapi.models.operations.GetTokenByPinIdResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetTokenByPinIdBadRequest, GetTokenByPinIdResponseBody, Exception {
|
|
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.clientID("gcgzw5rz2xovp84b4vha3a40")
|
|
.clientName("Plex Web")
|
|
.clientVersion("4.133.0")
|
|
.clientPlatform("Chrome")
|
|
.deviceName("Linux")
|
|
.build();
|
|
|
|
GetTokenByPinIdRequest req = GetTokenByPinIdRequest.builder()
|
|
.pinID(408895L)
|
|
.build();
|
|
|
|
GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId()
|
|
.request(req)
|
|
.call();
|
|
|
|
if (res.authPinContainer().isPresent()) {
|
|
// handle response
|
|
}
|
|
}
|
|
}
|
|
- 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.GetPlaylistsBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetPlaylistsUnauthorized;
|
|
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 GetPlaylistsBadRequest, GetPlaylistsUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.CreatePlaylistBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.CreatePlaylistUnauthorized;
|
|
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 CreatePlaylistBadRequest, CreatePlaylistUnauthorized, Exception {
|
|
|
|
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://hoarse-testing.info/")
|
|
.build();
|
|
|
|
CreatePlaylistResponse res = sdk.playlists().createPlaylist()
|
|
.request(req)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
}
|
|
}
|
|
- 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.UploadPlaylistBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.UploadPlaylistUnauthorized;
|
|
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 UploadPlaylistBadRequest, UploadPlaylistUnauthorized, Exception {
|
|
|
|
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)
|
|
.sectionID(1L)
|
|
.call();
|
|
|
|
// handle response
|
|
}
|
|
}
|
|
- 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.DeletePlaylistBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.DeletePlaylistUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.DeletePlaylistResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws DeletePlaylistBadRequest, DeletePlaylistUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.GetPlaylistBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetPlaylistUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetPlaylistResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetPlaylistBadRequest, GetPlaylistUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.UpdatePlaylistBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.UpdatePlaylistUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.UpdatePlaylistResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws UpdatePlaylistBadRequest, UpdatePlaylistUnauthorized, Exception {
|
|
|
|
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(3915.00d)
|
|
.title("<value>")
|
|
.summary("<value>")
|
|
.call();
|
|
|
|
// handle response
|
|
}
|
|
}
|
|
- 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.ClearPlaylistContentsBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.ClearPlaylistContentsUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.ClearPlaylistContentsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws ClearPlaylistContentsBadRequest, ClearPlaylistContentsUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.GetPlaylistContentsBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetPlaylistContentsUnauthorized;
|
|
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 GetPlaylistContentsBadRequest, GetPlaylistContentsUnauthorized, Exception {
|
|
|
|
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.TvShow)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
}
|
|
}
|
|
- 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.AddPlaylistContentsBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.AddPlaylistContentsUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.AddPlaylistContentsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws AddPlaylistContentsBadRequest, AddPlaylistContentsUnauthorized, Exception {
|
|
|
|
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.00d)
|
|
.uri("server://12345/com.plexapp.plugins.library/library/metadata/1")
|
|
.playQueueID(123d)
|
|
.call();
|
|
|
|
if (res.object().isPresent()) {
|
|
// handle response
|
|
}
|
|
}
|
|
}
|
|
- 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.GetServerResourcesBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetServerResourcesUnauthorized;
|
|
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 GetServerResourcesBadRequest, GetServerResourcesUnauthorized, Exception {
|
|
|
|
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()
|
|
.includeHttps(IncludeHttps.Enable)
|
|
.includeRelay(IncludeRelay.Enable)
|
|
.includeIPv6(IncludeIPv6.Enable)
|
|
.clientID("gcgzw5rz2xovp84b4vha3a40")
|
|
.call();
|
|
|
|
if (res.plexDevices().isPresent()) {
|
|
// handle response
|
|
}
|
|
}
|
|
}
|
|
- 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.GetSearchResultsBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetSearchResultsUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetSearchResultsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetSearchResultsBadRequest, GetSearchResultsUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetSourceConnectionInformationBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetSourceConnectionInformationUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetSourceConnectionInformationBadRequest, GetSourceConnectionInformationUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.GetTransientTokenBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetTransientTokenUnauthorized;
|
|
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 GetTransientTokenBadRequest, GetTransientTokenUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.GetServerListBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetServerListUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetServerListResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetServerListBadRequest, GetServerListUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetBandwidthStatisticsBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetBandwidthStatisticsUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetBandwidthStatisticsBadRequest, GetBandwidthStatisticsUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetStatisticsBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetStatisticsUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetStatisticsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetStatisticsBadRequest, GetStatisticsUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetResourcesStatisticsBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetResourcesStatisticsUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetResourcesStatisticsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetResourcesStatisticsBadRequest, GetResourcesStatisticsUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetSessionsBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetSessionsUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetSessionsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetSessionsBadRequest, GetSessionsUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetSessionHistoryBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetSessionHistoryUnauthorized;
|
|
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 GetSessionHistoryBadRequest, GetSessionHistoryUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetTranscodeSessionsBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetTranscodeSessionsUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetTranscodeSessionsBadRequest, GetTranscodeSessionsUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.StopTranscodeSessionBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.StopTranscodeSessionUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.StopTranscodeSessionResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws StopTranscodeSessionBadRequest, StopTranscodeSessionUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.ApplyUpdatesBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.ApplyUpdatesUnauthorized;
|
|
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 ApplyUpdatesBadRequest, ApplyUpdatesUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.CheckForUpdatesBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.CheckForUpdatesUnauthorized;
|
|
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 CheckForUpdatesBadRequest, CheckForUpdatesUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
- 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.GetUpdateStatusBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetUpdateStatusUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetUpdateStatusResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetUpdateStatusBadRequest, GetUpdateStatusUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.GetTokenDetailsBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.GetTokenDetailsUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.GetTokenDetailsResponse;
|
|
import java.lang.Exception;
|
|
|
|
public class Application {
|
|
|
|
public static void main(String[] args) throws GetTokenDetailsBadRequest, GetTokenDetailsUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
- 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.PostUsersSignInDataBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.PostUsersSignInDataUnauthorized;
|
|
import dev.plexapi.plexapi.models.operations.PostUsersSignInDataRequest;
|
|
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 PostUsersSignInDataBadRequest, PostUsersSignInDataUnauthorized, Exception {
|
|
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.clientID("gcgzw5rz2xovp84b4vha3a40")
|
|
.clientName("Plex Web")
|
|
.clientVersion("4.133.0")
|
|
.clientPlatform("Chrome")
|
|
.deviceName("Linux")
|
|
.build();
|
|
|
|
PostUsersSignInDataRequest req = PostUsersSignInDataRequest.builder()
|
|
.requestBody(PostUsersSignInDataRequestBody.builder()
|
|
.login("username@email.com")
|
|
.password("password123")
|
|
.verificationCode("123456")
|
|
.build())
|
|
.build();
|
|
|
|
PostUsersSignInDataResponse res = sdk.authentication().postUsersSignInData()
|
|
.request(req)
|
|
.call();
|
|
|
|
if (res.userPlexAccount().isPresent()) {
|
|
// handle response
|
|
}
|
|
}
|
|
}
|
|
- 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.StartUniversalTranscodeBadRequest;
|
|
import dev.plexapi.plexapi.models.errors.StartUniversalTranscodeUnauthorized;
|
|
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 StartUniversalTranscodeBadRequest, StartUniversalTranscodeUnauthorized, Exception {
|
|
|
|
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
|
|
}
|
|
}
|