## Java SDK Changes Detected:

* `plex-api.butler.startTask()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `error` **Changed** **Breaking** ⚠️
* `plex-api.butler.stopTask()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `error` **Changed** **Breaking** ⚠️
* `plex-api.updater.applyUpdates()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `error` **Changed** **Breaking** ⚠️
* `plex-api.general.getServerInfo()`: **Added**
* `plex-api.general.getIdentity()`: **Added**
* `plex-api.general.getSourceConnectionInformation()`: **Added**
* `plex-api.general.getTransientToken()`: **Added**
* `plex-api.events.getNotifications()`: **Added**
* `plex-api.events.connectWebSocket()`: **Added**
* `plex-api.preferences.getAllPreferences()`: **Added**
* `plex-api.preferences.setPreferences()`: **Added**
* `plex-api.preferences.getPreference()`: **Added**
* `plex-api.rate.setRating()`: **Added**
* `plex-api.timeline.markPlayed()`: **Added**
* `plex-api.timeline.report()`: **Added**
* `plex-api.timeline.unscrobble()`: **Added**
* `plex-api.activities.listActivities()`: **Added**
* `plex-api.activities.cancelActivity()`: **Added**
* `plex-api.butler.stopTasks()`: **Added**
* `plex-api.butler.getTasks()`: **Added**
* `plex-api.butler.startTasks()`: **Added**
* `plex-api.downloadQueue.createDownloadQueue()`: **Added**
* `plex-api.downloadQueue.getDownloadQueue()`: **Added**
* `plex-api.downloadQueue.addDownloadQueueItems()`: **Added**
* `plex-api.downloadQueue.listDownloadQueueItems()`: **Added**
* `plex-api.downloadQueue.getItemDecision()`: **Added**
* `plex-api.downloadQueue.getDownloadQueueMedia()`: **Added**
* `plex-api.downloadQueue.removeDownloadQueueItems()`: **Added**
* `plex-api.downloadQueue.getDownloadQueueItems()`: **Added**
* `plex-api.downloadQueue.restartProcessingDownloadQueueItems()`: **Added**
* `plex-api.hubs.getAllHubs()`: **Added**
* `plex-api.hubs.getContinueWatching()`: **Added**
* `plex-api.hubs.getHubItems()`: **Added**
* `plex-api.hubs.getPromotedHubs()`: **Added**
* `plex-api.hubs.getMetadataHubs()`: **Added**
* `plex-api.hubs.getPostplayHubs()`: **Added**
* `plex-api.hubs.getRelatedHubs()`: **Added**
* `plex-api.hubs.getSectionHubs()`: **Added**
* `plex-api.hubs.resetSectionDefaults()`: **Added**
* `plex-api.hubs.listHubs()`: **Added**
* `plex-api.hubs.createCustomHub()`: **Added**
* `plex-api.hubs.moveHub()`: **Added**
* `plex-api.hubs.deleteCustomHub()`: **Added**
* `plex-api.hubs.updateHubVisibility()`: **Added**
* `plex-api.search.searchHubs()`: **Added**
* `plex-api.search.voiceSearchHubs()`: **Added**
* `plex-api.library.getLibraryItems()`: **Added**
* `plex-api.library.deleteCaches()`: **Added**
* `plex-api.library.cleanBundles()`: **Added**
* `plex-api.library.ingestTransientItem()`: **Added**
* `plex-api.library.getLibraryMatches()`: **Added**
* `plex-api.library.optimizeDatabase()`: **Added**
* `plex-api.library.getRandomArtwork()`: **Added**
* `plex-api.library.getSections()`: **Added**
* `plex-api.library.addSection()`: **Added**
* `plex-api.library.stopAllRefreshes()`: **Added**
* `plex-api.library.getSectionsPrefs()`: **Added**
* `plex-api.library.refreshSectionsMetadata()`: **Added**
* `plex-api.library.getTags()`: **Added**
* `plex-api.library.deleteMetadataItem()`: **Added**
* `plex-api.library.editMetadataItem()`: **Added**
* `plex-api.library.detectAds()`: **Added**
* `plex-api.library.getAllItemLeaves()`: **Added**
* `plex-api.library.analyzeMetadata()`: **Added**
* `plex-api.library.generateThumbs()`: **Added**
* `plex-api.library.detectCredits()`: **Added**
* `plex-api.library.getExtras()`: **Added**
* `plex-api.library.addExtras()`: **Added**
* `plex-api.library.getFile()`: **Added**
* `plex-api.library.startBifGeneration()`: **Added**
* `plex-api.library.detectIntros()`: **Added**
* `plex-api.library.createMarker()`: **Added**
* `plex-api.library.matchItem()`: **Added**
* `plex-api.library.listMatches()`: **Added**
* `plex-api.library.mergeItems()`: **Added**
* `plex-api.library.listSonicallySimilar()`: **Added**
* `plex-api.library.setItemPreferences()`: **Added**
* `plex-api.library.refreshItemsMetadata()`: **Added**
* `plex-api.library.getRelatedItems()`: **Added**
* `plex-api.library.listSimilar()`: **Added**
* `plex-api.library.splitItem()`: **Added**
* `plex-api.library.addSubtitles()`: **Added**
* `plex-api.library.getItemTree()`: **Added**
* `plex-api.library.unmatch()`: **Added**
* `plex-api.library.listTopUsers()`: **Added**
* `plex-api.library.detectVoiceActivity()`: **Added**
* `plex-api.library.getAugmentationStatus()`: **Added**
* `plex-api.library.setStreamSelection()`: **Added**
* `plex-api.library.getPerson()`: **Added**
* `plex-api.library.listPersonMedia()`: **Added**
* `plex-api.library.deleteLibrarySection()`: **Added**
* `plex-api.library.getLibraryDetails()`: **Added**
* `plex-api.library.editSection()`: **Added**
* `plex-api.library.updateItems()`: **Added**
* `plex-api.library.startAnalysis()`: **Added**
* `plex-api.library.autocomplete()`: **Added**
* `plex-api.library.getCollections()`: **Added**
* `plex-api.library.getCommon()`: **Added**
* `plex-api.library.emptyTrash()`: **Added**
* `plex-api.library.getSectionFilters()`: **Added**
* `plex-api.library.getFirstCharacters()`: **Added**
* `plex-api.library.deleteIndexes()`: **Added**
* `plex-api.library.deleteIntros()`: **Added**
* `plex-api.library.getSectionPreferences()`: **Added**
* `plex-api.library.setSectionPreferences()`: **Added**
* `plex-api.library.cancelRefresh()`: **Added**
* `plex-api.library.refreshSection()`: **Added**
* `plex-api.library.getAvailableSorts()`: **Added**
* `plex-api.library.getStreamLevels()`: **Added**
* `plex-api.library.getStreamLoudness()`: **Added**
* `plex-api.library.getChapterImage()`: **Added**
* `plex-api.library.setItemArtwork()`: **Added**
* `plex-api.library.updateItemArtwork()`: **Added**
* `plex-api.library.deleteMarker()`: **Added**
* `plex-api.library.editMarker()`: **Added**
* `plex-api.library.deleteMediaItem()`: **Added**
* `plex-api.library.getPartIndex()`: **Added**
* `plex-api.library.deleteCollection()`: **Added**
* `plex-api.library.getSectionImage()`: **Added**
* `plex-api.library.deleteStream()`: **Added**
* `plex-api.library.getStream()`: **Added**
* `plex-api.library.setStreamOffset()`: **Added**
* `plex-api.library.getItemArtwork()`: **Added**
* `plex-api.library.getMediaPart()`: **Added**
* `plex-api.library.getImageFromBif()`: **Added**
* `plex-api.collections.createCollection()`: **Added**
* `plex-api.dvRs.listDvRs()`: **Added**
* `plex-api.dvRs.createDvr()`: **Added**
* `plex-api.dvRs.deleteDvr()`: **Added**
* `plex-api.dvRs.getDvr()`: **Added**
* `plex-api.dvRs.deleteLineup()`: **Added**
* `plex-api.dvRs.addLineup()`: **Added**
* `plex-api.dvRs.setDvrPreferences()`: **Added**
* `plex-api.dvRs.stopDvrReload()`: **Added**
* `plex-api.dvRs.reloadGuide()`: **Added**
* `plex-api.dvRs.tuneChannel()`: **Added**
* `plex-api.dvRs.removeDeviceFromDvr()`: **Added**
* `plex-api.dvRs.addDeviceToDvr()`: **Added**
* `plex-api.epg.computeChannelMap()`: **Added**
* `plex-api.epg.getChannels()`: **Added**
* `plex-api.epg.getCountries()`: **Added**
* `plex-api.epg.getAllLanguages()`: **Added**
* `plex-api.epg.getLineup()`: **Added**
* `plex-api.epg.getLineupChannels()`: **Added**
* `plex-api.epg.getCountriesLineups()`: **Added**
* `plex-api.epg.getCountryRegions()`: **Added**
* `plex-api.epg.listLineups()`: **Added**
* `plex-api.liveTv.getSessions()`: **Added**
* `plex-api.liveTv.getLiveTvSession()`: **Added**
* `plex-api.liveTv.getSessionPlaylistIndex()`: **Added**
* `plex-api.liveTv.getSessionSegment()`: **Added**
* `plex-api.log.writeLog()`: **Added**
* `plex-api.log.writeMessage()`: **Added**
* `plex-api.log.enablePapertrail()`: **Added**
* `plex-api.devices.getAvailableGrabbers()`: **Added**
* `plex-api.devices.listDevices()`: **Added**
* `plex-api.devices.addDevice()`: **Added**
* `plex-api.devices.discoverDevices()`: **Added**
* `plex-api.devices.removeDevice()`: **Added**
* `plex-api.devices.getDeviceDetails()`: **Added**
* `plex-api.devices.modifyDevice()`: **Added**
* `plex-api.devices.setChannelmap()`: **Added**
* `plex-api.devices.getDevicesChannels()`: **Added**
* `plex-api.devices.setDevicePreferences()`: **Added**
* `plex-api.devices.stopScan()`: **Added**
* `plex-api.devices.scan()`: **Added**
* `plex-api.devices.getThumb()`: **Added**
* `plex-api.provider.listProviders()`: **Added**
* `plex-api.provider.addProvider()`: **Added**
* `plex-api.provider.refreshProviders()`: **Added**
* `plex-api.provider.deleteMediaProvider()`: **Added**
* `plex-api.subscriptions.getAllSubscriptions()`: **Added**
* `plex-api.subscriptions.createSubscription()`: **Added**
* `plex-api.subscriptions.processSubscriptions()`: **Added**
* `plex-api.subscriptions.getScheduledRecordings()`: **Added**
* `plex-api.subscriptions.getTemplate()`: **Added**
* `plex-api.subscriptions.cancelGrab()`: **Added**
* `plex-api.subscriptions.deleteSubscription()`: **Added**
* `plex-api.subscriptions.getSubscription()`: **Added**
* `plex-api.subscriptions.editSubscriptionPreferences()`: **Added**
* `plex-api.subscriptions.reorderSubscription()`: **Added**
* `plex-api.transcoder.transcodeImage()`: **Added**
* `plex-api.transcoder.makeDecision()`: **Added**
* `plex-api.transcoder.triggerFallback()`: **Added**
* `plex-api.transcoder.transcodeSubtitles()`: **Added**
* `plex-api.transcoder.startTranscodeSession()`: **Added**
* `plex-api.playlist.listPlaylists()`: **Added**
* `plex-api.playlist.getPlaylist()`: **Added**
* `plex-api.playlist.getPlaylistItems()`: **Added**
* `plex-api.libraryPlaylists.createPlaylist()`: **Added**
* `plex-api.libraryPlaylists.uploadPlaylist()`: **Added**
* `plex-api.libraryPlaylists.deletePlaylist()`: **Added**
* `plex-api.libraryPlaylists.updatePlaylist()`: **Added**
* `plex-api.libraryPlaylists.getPlaylistGenerators()`: **Added**
* `plex-api.libraryPlaylists.clearPlaylistItems()`: **Added**
* `plex-api.libraryPlaylists.addPlaylistItems()`: **Added**
* `plex-api.libraryPlaylists.deletePlaylistItem()`: **Added**
* `plex-api.libraryPlaylists.getPlaylistGenerator()`: **Added**
* `plex-api.libraryPlaylists.getPlaylistGeneratorItems()`: **Added**
* `plex-api.libraryPlaylists.movePlaylistItem()`: **Added**
* `plex-api.libraryPlaylists.refreshPlaylist()`: **Added**
* `plex-api.playQueue.createPlayQueue()`: **Added**
* `plex-api.playQueue.getPlayQueue()`: **Added**
* `plex-api.playQueue.addToPlayQueue()`: **Added**
* `plex-api.playQueue.clearPlayQueue()`: **Added**
* `plex-api.playQueue.resetPlayQueue()`: **Added**
* `plex-api.playQueue.shuffle()`: **Added**
* `plex-api.playQueue.unshuffle()`: **Added**
* `plex-api.playQueue.deletePlayQueueItem()`: **Added**
* `plex-api.playQueue.movePlayQueueItem()`: **Added**
* `plex-api.ultraBlur.getColors()`: **Added**
* `plex-api.ultraBlur.getImage()`: **Added**
* `plex-api.status.listSessions()`: **Added**
* `plex-api.status.getBackgroundTasks()`: **Added**
* `plex-api.status.listPlaybackHistory()`: **Added**
* `plex-api.status.terminateSession()`: **Added**
* `plex-api.status.deleteHistory()`: **Added**
* `plex-api.status.getHistoryItem()`: **Added**
* `plex-api.updater.checkUpdates()`: **Added**
* `plex-api.updater.getUpdatesStatus()`: **Added**
* `plex-api.content.getCollectionItems()`: **Added**
* `plex-api.content.getMetadataItem()`: **Added**
* `plex-api.content.getAlbums()`: **Added**
* `plex-api.content.listContent()`: **Added**
* `plex-api.content.getAllLeaves()`: **Added**
* `plex-api.content.getArts()`: **Added**
* `plex-api.content.getCategories()`: **Added**
* `plex-api.content.getCluster()`: **Added**
* `plex-api.content.getSonicPath()`: **Added**
* `plex-api.content.getFolders()`: **Added**
* `plex-api.content.listMoments()`: **Added**
* `plex-api.content.getSonicallySimilar()`: **Added**
* `plex-api.content.getCollectionImage()`: **Added**
* `plex-api.libraryCollections.addCollectionItems()`: **Added**
* `plex-api.libraryCollections.deleteCollectionItem()`: **Added**
* `plex-api.libraryCollections.moveCollectionItem()`: **Added**
* `plex-api.server.getServerCapabilities()`: **Deleted** **Breaking** ⚠️
* `plex-api.server.getServerPreferences()`: **Deleted** **Breaking** ⚠️
* `plex-api.server.getAvailableClients()`: **Deleted** **Breaking** ⚠️
* `plex-api.server.getDevices()`: **Deleted** **Breaking** ⚠️
* `plex-api.server.getServerIdentity()`: **Deleted** **Breaking** ⚠️
* `plex-api.server.getMyPlexAccount()`: **Deleted** **Breaking** ⚠️
* `plex-api.server.getResizedPhoto()`: **Deleted** **Breaking** ⚠️
* `plex-api.server.getMediaProviders()`: **Deleted** **Breaking** ⚠️
* `plex-api.server.getServerList()`: **Deleted** **Breaking** ⚠️
* `plex-api.media.markPlayed()`: **Deleted** **Breaking** ⚠️
* `plex-api.media.markUnplayed()`: **Deleted** **Breaking** ⚠️
* `plex-api.media.updatePlayProgress()`: **Deleted** **Breaking** ⚠️
* `plex-api.media.getBannerImage()`: **Deleted** **Breaking** ⚠️
* `plex-api.media.getThumbImage()`: **Deleted** **Breaking** ⚠️
* `plex-api.video.getTimeline()`: **Deleted** **Breaking** ⚠️
* `plex-api.video.startUniversalTranscode()`: **Deleted** **Breaking** ⚠️
* `plex-api.activities.getServerActivities()`: **Deleted** **Breaking** ⚠️
* `plex-api.activities.cancelServerActivities()`: **Deleted** **Breaking** ⚠️
* `plex-api.butler.getButlerTasks()`: **Deleted** **Breaking** ⚠️
* `plex-api.butler.startAllTasks()`: **Deleted** **Breaking** ⚠️
* `plex-api.butler.stopAllTasks()`: **Deleted** **Breaking** ⚠️
* `plex-api.plex.getCompanionsData()`: **Deleted** **Breaking** ⚠️
* `plex-api.plex.getUserFriends()`: **Deleted** **Breaking** ⚠️
* `plex-api.plex.getGeoData()`: **Deleted** **Breaking** ⚠️
* `plex-api.plex.getHomeData()`: **Deleted** **Breaking** ⚠️
* `plex-api.plex.getServerResources()`: **Deleted** **Breaking** ⚠️
* `plex-api.plex.getPin()`: **Deleted** **Breaking** ⚠️
* `plex-api.plex.getTokenByPinId()`: **Deleted** **Breaking** ⚠️
* `plex-api.hubs.getGlobalHubs()`: **Deleted** **Breaking** ⚠️
* `plex-api.hubs.getRecentlyAdded()`: **Deleted** **Breaking** ⚠️
* `plex-api.hubs.getLibraryHubs()`: **Deleted** **Breaking** ⚠️
* `plex-api.search.performSearch()`: **Deleted** **Breaking** ⚠️
* `plex-api.search.performVoiceSearch()`: **Deleted** **Breaking** ⚠️
* `plex-api.search.getSearchResults()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.getFileHash()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.getRecentlyAddedLibrary()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.getAllLibraries()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.getLibraryDetails()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.deleteLibrary()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.getLibraryItems()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.getLibrarySectionsAll()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.getRefreshLibraryMetadata()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.getSearchLibrary()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.getGenresLibrary()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.getCountriesLibrary()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.getActorsLibrary()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.getSearchAllLibraries()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.getMediaMetaData()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.getMediaArts()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.postMediaArts()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.getMediaPosters()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.postMediaPoster()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.getMetadataChildren()`: **Deleted** **Breaking** ⚠️
* `plex-api.library.getTopWatchedContent()`: **Deleted** **Breaking** ⚠️
* `plex-api.watchlist.getWatchList()`: **Deleted** **Breaking** ⚠️
* `plex-api.log.logLine()`: **Deleted** **Breaking** ⚠️
* `plex-api.log.logMultiLine()`: **Deleted** **Breaking** ⚠️
* `plex-api.log.enablePaperTrail()`: **Deleted** **Breaking** ⚠️
* `plex-api.playlists.createPlaylist()`: **Deleted** **Breaking** ⚠️
* `plex-api.playlists.getPlaylists()`: **Deleted** **Breaking** ⚠️
* `plex-api.playlists.getPlaylist()`: **Deleted** **Breaking** ⚠️
* `plex-api.playlists.deletePlaylist()`: **Deleted** **Breaking** ⚠️
* `plex-api.playlists.updatePlaylist()`: **Deleted** **Breaking** ⚠️
* `plex-api.playlists.getPlaylistContents()`: **Deleted** **Breaking** ⚠️
* `plex-api.playlists.clearPlaylistContents()`: **Deleted** **Breaking** ⚠️
* `plex-api.playlists.addPlaylistContents()`: **Deleted** **Breaking** ⚠️
* `plex-api.playlists.uploadPlaylist()`: **Deleted** **Breaking** ⚠️
* `plex-api.authentication.getTransientToken()`: **Deleted** **Breaking** ⚠️
* `plex-api.authentication.getSourceConnectionInformation()`: **Deleted** **Breaking** ⚠️
* `plex-api.authentication.getTokenDetails()`: **Deleted** **Breaking** ⚠️
* `plex-api.authentication.postUsersSignInData()`: **Deleted** **Breaking** ⚠️
* `plex-api.statistics.getStatistics()`: **Deleted** **Breaking** ⚠️
* `plex-api.statistics.getResourcesStatistics()`: **Deleted** **Breaking** ⚠️
* `plex-api.statistics.getBandwidthStatistics()`: **Deleted** **Breaking** ⚠️
* `plex-api.sessions.getSessions()`: **Deleted** **Breaking** ⚠️
* `plex-api.sessions.getSessionHistory()`: **Deleted** **Breaking** ⚠️
* `plex-api.sessions.getTranscodeSessions()`: **Deleted** **Breaking** ⚠️
* `plex-api.sessions.stopTranscodeSession()`: **Deleted** **Breaking** ⚠️
* `plex-api.updater.getUpdateStatus()`: **Deleted** **Breaking** ⚠️
* `plex-api.updater.checkForUpdates()`: **Deleted** **Breaking** ⚠️
* `plex-api.users.getUsers()`: **Deleted** **Breaking** ⚠️
This commit is contained in:
speakeasybot
2025-10-12 06:53:30 +00:00
parent c7a69e0673
commit 81ecd024e7
4771 changed files with 543742 additions and 345399 deletions

View File

@@ -3,45 +3,41 @@
## Overview
Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.
Activities provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.
Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity.
Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details:
- They can contain a `progress` (from 0 to 100) marking the percent completion of the activity.
- They must contain an `type` which is used by clients to distinguish the specific activity.
- They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.)
- The may contain a `Response` object which attributes which represent the result of the asynchronous operation.
Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint.
### Available Operations
* [getServerActivities](#getserveractivities) - Get Server Activities
* [cancelServerActivities](#cancelserveractivities) - Cancel Server Activities
* [listActivities](#listactivities) - Get all activities
* [cancelActivity](#cancelactivity) - Cancel a running activity
## getServerActivities
## listActivities
Get Server Activities
List all activities on the server. Admins can see all activities but other users can only see their own
### Example Usage
<!-- UsageSnippet language="java" operationID="getServerActivities" method="get" path="/activities" -->
<!-- UsageSnippet language="java" operationID="listActivities" method="get" path="/activities" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetServerActivitiesBadRequest;
import dev.plexapi.sdk.models.errors.GetServerActivitiesUnauthorized;
import dev.plexapi.sdk.models.operations.GetServerActivitiesResponse;
import dev.plexapi.sdk.models.operations.ListActivitiesResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws GetServerActivitiesBadRequest, GetServerActivitiesUnauthorized, Exception {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetServerActivitiesResponse res = sdk.activities().getServerActivities()
ListActivitiesResponse res = sdk.activities().listActivities()
.call();
if (res.object().isPresent()) {
@@ -53,42 +49,55 @@ public class Application {
### Response
**[GetServerActivitiesResponse](../../models/operations/GetServerActivitiesResponse.md)**
**[ListActivitiesResponse](../../models/operations/ListActivitiesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- |
| models/errors/GetServerActivitiesBadRequest | 400 | application/json |
| models/errors/GetServerActivitiesUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## cancelServerActivities
## cancelActivity
Cancel Server Activities
Cancel a running activity. Admins can cancel all activities but other users can only cancel their own
### Example Usage
<!-- UsageSnippet language="java" operationID="cancelServerActivities" method="delete" path="/activities/{activityUUID}" -->
<!-- UsageSnippet language="java" operationID="cancelActivity" method="delete" path="/activities/{activityId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.CancelServerActivitiesBadRequest;
import dev.plexapi.sdk.models.errors.CancelServerActivitiesUnauthorized;
import dev.plexapi.sdk.models.operations.CancelServerActivitiesResponse;
import dev.plexapi.sdk.models.operations.CancelActivityRequest;
import dev.plexapi.sdk.models.operations.CancelActivityResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws CancelServerActivitiesBadRequest, CancelServerActivitiesUnauthorized, Exception {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities()
.activityUUID("25b71ed5-0f9d-461c-baa7-d404e9e10d3e")
CancelActivityRequest req = CancelActivityRequest.builder()
.activityId("d6199ba1-fb5e-4cae-bf17-1a5369c1cf1e")
.build();
CancelActivityResponse res = sdk.activities().cancelActivity()
.request(req)
.call();
// handle response
@@ -98,18 +107,16 @@ public class Application {
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ |
| `activityUUID` | *String* | :heavy_check_mark: | The UUID of the activity to cancel. | 25b71ed5-0f9d-461c-baa7-d404e9e10d3e |
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `request` | [CancelActivityRequest](../../models/operations/CancelActivityRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[CancelServerActivitiesResponse](../../models/operations/CancelServerActivitiesResponse.md)**
**[CancelActivityResponse](../../models/operations/CancelActivityResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
| models/errors/CancelServerActivitiesBadRequest | 400 | application/json |
| models/errors/CancelServerActivitiesUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -1,239 +0,0 @@
# Authentication
(*authentication()*)
## Overview
API Calls regarding authentication for Plex Media Server
### Available Operations
* [getTransientToken](#gettransienttoken) - Get a Transient Token
* [getSourceConnectionInformation](#getsourceconnectioninformation) - Get Source Connection Information
* [getTokenDetails](#gettokendetails) - Get Token Details
* [postUsersSignInData](#postuserssignindata) - Get User Sign In Data
## getTransientToken
This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted.
### Example Usage
<!-- UsageSnippet language="java" operationID="getTransientToken" method="get" path="/security/token" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetTransientTokenBadRequest;
import dev.plexapi.sdk.models.errors.GetTransientTokenUnauthorized;
import dev.plexapi.sdk.models.operations.*;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws GetTransientTokenBadRequest, GetTransientTokenUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetTransientTokenResponse res = sdk.authentication().getTransientToken()
.type(GetTransientTokenQueryParamType.DELEGATION)
.scope(Scope.ALL)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `type` | [GetTransientTokenQueryParamType](../../models/operations/GetTransientTokenQueryParamType.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. |
| `scope` | [Scope](../../models/operations/Scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. |
### Response
**[GetTransientTokenResponse](../../models/operations/GetTransientTokenResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- |
| models/errors/GetTransientTokenBadRequest | 400 | application/json |
| models/errors/GetTransientTokenUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getSourceConnectionInformation
If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token.
Note: requires Plex Media Server >= 1.15.4.
### Example Usage
<!-- UsageSnippet language="java" operationID="getSourceConnectionInformation" method="get" path="/security/resources" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetSourceConnectionInformationBadRequest;
import dev.plexapi.sdk.models.errors.GetSourceConnectionInformationUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation()
.source("server://client-identifier")
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
| `source` | *String* | :heavy_check_mark: | The source identifier with an included prefix. | server://client-identifier |
### Response
**[GetSourceConnectionInformationResponse](../../models/operations/GetSourceConnectionInformationResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
| models/errors/GetSourceConnectionInformationBadRequest | 400 | application/json |
| models/errors/GetSourceConnectionInformationUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getTokenDetails
Get the User data from the provided X-Plex-Token
### Example Usage
<!-- UsageSnippet language="java" operationID="getTokenDetails" method="get" path="/user" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetTokenDetailsBadRequest;
import dev.plexapi.sdk.models.errors.GetTokenDetailsUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetTokenDetailsResponse res = sdk.authentication().getTokenDetails()
.call();
if (res.userPlexAccount().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ |
| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**[GetTokenDetailsResponse](../../models/operations/GetTokenDetailsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
| models/errors/GetTokenDetailsBadRequest | 400 | application/json |
| models/errors/GetTokenDetailsUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## postUsersSignInData
Sign in user with username and password and return user data with Plex authentication token
### Example Usage
<!-- UsageSnippet language="java" operationID="post-users-sign-in-data" method="post" path="/users/signin" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.PostUsersSignInDataBadRequest;
import dev.plexapi.sdk.models.errors.PostUsersSignInDataUnauthorized;
import dev.plexapi.sdk.models.operations.*;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PostUsersSignInDataBadRequest, PostUsersSignInDataUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder()
.build();
PostUsersSignInDataRequest req = PostUsersSignInDataRequest.builder()
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.deviceNickname("Roku 3")
.clientVersion("2.4.1")
.platform("Roku")
.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
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `request` | [PostUsersSignInDataRequest](../../models/operations/PostUsersSignInDataRequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**[PostUsersSignInDataResponse](../../models/operations/PostUsersSignInDataResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- |
| models/errors/PostUsersSignInDataBadRequest | 400 | application/json |
| models/errors/PostUsersSignInDataUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -3,42 +3,80 @@
## Overview
Butler is the task manager of the Plex Media Server Ecosystem.
The butler is responsible for running periodic tasks. Some tasks run daily, others every few days, and some weekly. These includes database maintenance, metadata updating, thumbnail generation, media analysis, and other tasks.
### Available Operations
* [getButlerTasks](#getbutlertasks) - Get Butler tasks
* [startAllTasks](#startalltasks) - Start all Butler tasks
* [stopAllTasks](#stopalltasks) - Stop all Butler tasks
* [startTask](#starttask) - Start a single Butler task
* [stopTasks](#stoptasks) - Stop all Butler tasks
* [getTasks](#gettasks) - Get all Butler tasks
* [startTasks](#starttasks) - Start all Butler tasks
* [stopTask](#stoptask) - Stop a single Butler task
* [startTask](#starttask) - Start a single Butler task
## getButlerTasks
## stopTasks
Returns a list of butler tasks
This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
### Example Usage
<!-- UsageSnippet language="java" operationID="getButlerTasks" method="get" path="/butler" -->
<!-- UsageSnippet language="java" operationID="stopTasks" method="delete" path="/butler" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetButlerTasksBadRequest;
import dev.plexapi.sdk.models.errors.GetButlerTasksUnauthorized;
import dev.plexapi.sdk.models.operations.GetButlerTasksResponse;
import dev.plexapi.sdk.models.operations.StopTasksResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws GetButlerTasksBadRequest, GetButlerTasksUnauthorized, Exception {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetButlerTasksResponse res = sdk.butler().getButlerTasks()
StopTasksResponse res = sdk.butler().stopTasks()
.call();
// handle response
}
}
```
### Response
**[StopTasksResponse](../../models/operations/StopTasksResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getTasks
Get the list of butler tasks and their scheduling
### Example Usage
<!-- UsageSnippet language="java" operationID="getTasks" method="get" path="/butler" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetTasksResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetTasksResponse res = sdk.butler().getTasks()
.call();
if (res.object().isPresent()) {
@@ -50,46 +88,43 @@ public class Application {
### Response
**[GetButlerTasksResponse](../../models/operations/GetButlerTasksResponse.md)**
**[GetTasksResponse](../../models/operations/GetTasksResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
| models/errors/GetButlerTasksBadRequest | 400 | application/json |
| models/errors/GetButlerTasksUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## startAllTasks
## startTasks
This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
1. Any tasks not scheduled to run on the current day will be skipped.
2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
4. If we are outside the configured window, the task will start immediately.
1. Any tasks not scheduled to run on the current day will be skipped.
2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
4. If we are outside the configured window, the task will start immediately.
### Example Usage
<!-- UsageSnippet language="java" operationID="startAllTasks" method="post" path="/butler" -->
<!-- UsageSnippet language="java" operationID="startTasks" method="post" path="/butler" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.StartAllTasksBadRequest;
import dev.plexapi.sdk.models.errors.StartAllTasksUnauthorized;
import dev.plexapi.sdk.models.operations.StartAllTasksResponse;
import dev.plexapi.sdk.models.operations.StartTasksResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws StartAllTasksBadRequest, StartAllTasksUnauthorized, Exception {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
StartAllTasksResponse res = sdk.butler().startAllTasks()
StartTasksResponse res = sdk.butler().startTasks()
.call();
// handle response
@@ -99,146 +134,55 @@ public class Application {
### Response
**[StartAllTasksResponse](../../models/operations/StartAllTasksResponse.md)**
**[StartTasksResponse](../../models/operations/StartTasksResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------------------------------- | --------------------------------------- | --------------------------------------- |
| models/errors/StartAllTasksBadRequest | 400 | application/json |
| models/errors/StartAllTasksUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## stopAllTasks
This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
### Example Usage
<!-- UsageSnippet language="java" operationID="stopAllTasks" method="delete" path="/butler" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.StopAllTasksBadRequest;
import dev.plexapi.sdk.models.errors.StopAllTasksUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
StopAllTasksResponse res = sdk.butler().stopAllTasks()
.call();
// handle response
}
}
```
### Response
**[StopAllTasksResponse](../../models/operations/StopAllTasksResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
| models/errors/StopAllTasksBadRequest | 400 | application/json |
| models/errors/StopAllTasksUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## startTask
This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
1. Any tasks not scheduled to run on the current day will be skipped.
2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
4. If we are outside the configured window, the task will start immediately.
### Example Usage
<!-- UsageSnippet language="java" operationID="startTask" method="post" path="/butler/{taskName}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.StartTaskBadRequest;
import dev.plexapi.sdk.models.errors.StartTaskUnauthorized;
import dev.plexapi.sdk.models.operations.StartTaskResponse;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
StartTaskResponse res = sdk.butler().startTask()
.taskName(TaskName.REFRESH_PERIODIC_METADATA)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- |
| `taskName` | [TaskName](../../models/operations/TaskName.md) | :heavy_check_mark: | the name of the task to be started. |
### Response
**[StartTaskResponse](../../models/operations/StartTaskResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ----------------------------------- | ----------------------------------- | ----------------------------------- |
| models/errors/StartTaskBadRequest | 400 | application/json |
| models/errors/StartTaskUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## stopTask
This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint.
This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists
### Example Usage
<!-- UsageSnippet language="java" operationID="stopTask" method="delete" path="/butler/{taskName}" -->
<!-- UsageSnippet language="java" operationID="stopTask" method="delete" path="/butler/{task}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.StopTaskBadRequest;
import dev.plexapi.sdk.models.errors.StopTaskUnauthorized;
import dev.plexapi.sdk.models.operations.PathParamTaskName;
import dev.plexapi.sdk.models.operations.StopTaskResponse;
import dev.plexapi.sdk.models.operations.*;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws StopTaskBadRequest, StopTaskUnauthorized, Exception {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
StopTaskRequest req = StopTaskRequest.builder()
.task(Task.CLEAN_OLD_BUNDLES)
.build();
StopTaskResponse res = sdk.butler().stopTask()
.taskName(PathParamTaskName.CLEAN_OLD_CACHE_FILES)
.request(req)
.call();
// handle response
@@ -248,9 +192,9 @@ public class Application {
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
| `taskName` | [PathParamTaskName](../../models/operations/PathParamTaskName.md) | :heavy_check_mark: | The name of the task to be started. |
| Parameter | Type | Required | Description |
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
| `request` | [StopTaskRequest](../../models/operations/StopTaskRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
@@ -258,8 +202,70 @@ public class Application {
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------------- | ---------------------------------- | ---------------------------------- |
| models/errors/StopTaskBadRequest | 400 | application/json |
| models/errors/StopTaskUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## startTask
This endpoint will attempt to start a specific Butler task by name.
### Example Usage
<!-- UsageSnippet language="java" operationID="startTask" method="post" path="/butler/{task}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.*;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
StartTaskRequest req = StartTaskRequest.builder()
.task(PathParamTask.REFRESH_LOCAL_MEDIA)
.build();
StartTaskResponse res = sdk.butler().startTask()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| `request` | [StartTaskRequest](../../models/operations/StartTaskRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[StartTaskResponse](../../models/operations/StartTaskResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -0,0 +1,76 @@
# Collections
(*collections()*)
## Overview
API Operations against the Collections
### Available Operations
* [createCollection](#createcollection) - Create collection
## createCollection
Create a collection in the library
### Example Usage
<!-- UsageSnippet language="java" operationID="createCollection" method="post" path="/library/collections" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.CreateCollectionRequest;
import dev.plexapi.sdk.models.operations.CreateCollectionResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
CreateCollectionRequest req = CreateCollectionRequest.builder()
.sectionId("<id>")
.build();
CreateCollectionResponse res = sdk.collections().createCollection()
.request(req)
.call();
if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `request` | [CreateCollectionRequest](../../models/operations/CreateCollectionRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[CreateCollectionResponse](../../models/operations/CreateCollectionResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

895
docs/sdks/content/README.md Normal file
View File

@@ -0,0 +1,895 @@
# Content
(*content()*)
## Overview
The actual content of the media provider
### Available Operations
* [getCollectionItems](#getcollectionitems) - Get items in a collection
* [getMetadataItem](#getmetadataitem) - Get a metadata item
* [getAlbums](#getalbums) - Set section albums
* [listContent](#listcontent) - Get items in the section
* [getAllLeaves](#getallleaves) - Set section leaves
* [getArts](#getarts) - Set section artwork
* [getCategories](#getcategories) - Set section categories
* [getCluster](#getcluster) - Set section clusters
* [getSonicPath](#getsonicpath) - Similar tracks to transition from one to another
* [getFolders](#getfolders) - Get all folder locations
* [listMoments](#listmoments) - Set section moments
* [getSonicallySimilar](#getsonicallysimilar) - The nearest audio tracks
* [getCollectionImage](#getcollectionimage) - Get a collection's image
## getCollectionItems
Get items in a collection. Note if this collection contains more than 100 items, paging must be used.
### Example Usage
<!-- UsageSnippet language="java" operationID="getCollectionItems" method="get" path="/library/collections/{collectionId}/items" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetCollectionItemsRequest;
import dev.plexapi.sdk.models.operations.GetCollectionItemsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetCollectionItemsRequest req = GetCollectionItemsRequest.builder()
.collectionId(314585L)
.build();
GetCollectionItemsResponse res = sdk.content().getCollectionItems()
.request(req)
.call();
if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `request` | [GetCollectionItemsRequest](../../models/operations/GetCollectionItemsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetCollectionItemsResponse](../../models/operations/GetCollectionItemsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getMetadataItem
Get one or more metadata items.
### Example Usage
<!-- UsageSnippet language="java" operationID="getMetadataItem" method="get" path="/library/metadata/{ids}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetMetadataItemRequest;
import dev.plexapi.sdk.models.operations.GetMetadataItemResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetMetadataItemRequest req = GetMetadataItemRequest.builder()
.ids(List.of())
.asyncCheckFiles(BoolInt.ONE)
.asyncRefreshLocalMediaAgent(BoolInt.ONE)
.asyncRefreshAnalysis(BoolInt.ONE)
.checkFiles(BoolInt.ONE)
.skipRefresh(BoolInt.ONE)
.checkFileAvailability(BoolInt.ONE)
.asyncAugmentMetadata(BoolInt.ONE)
.augmentCount(BoolInt.ONE)
.build();
GetMetadataItemResponse res = sdk.content().getMetadataItem()
.request(req)
.call();
if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `request` | [GetMetadataItemRequest](../../models/operations/GetMetadataItemRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetMetadataItemResponse](../../models/operations/GetMetadataItemResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getAlbums
Get all albums in a music section
### Example Usage
<!-- UsageSnippet language="java" operationID="getAlbums" method="get" path="/library/sections/{sectionId}/albums" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetAlbumsRequest;
import dev.plexapi.sdk.models.operations.GetAlbumsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetAlbumsRequest req = GetAlbumsRequest.builder()
.sectionId(817133L)
.build();
GetAlbumsResponse res = sdk.content().getAlbums()
.request(req)
.call();
if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| `request` | [GetAlbumsRequest](../../models/operations/GetAlbumsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetAlbumsResponse](../../models/operations/GetAlbumsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## listContent
Get the items in a section, potentially filtering them
### Example Usage
<!-- UsageSnippet language="java" operationID="listContent" method="get" path="/library/sections/{sectionId}/all" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ListContentRequest;
import dev.plexapi.sdk.models.operations.ListContentResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ListContentRequest req = ListContentRequest.builder()
.sectionId("<id>")
.build();
ListContentResponse res = sdk.content().listContent()
.request(req)
.call();
if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `request` | [ListContentRequest](../../models/operations/ListContentRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ListContentResponse](../../models/operations/ListContentResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getAllLeaves
Get all leaves in a section (such as episodes in a show section)
### Example Usage
<!-- UsageSnippet language="java" operationID="getAllLeaves" method="get" path="/library/sections/{sectionId}/allLeaves" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetAllLeavesRequest;
import dev.plexapi.sdk.models.operations.GetAllLeavesResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetAllLeavesRequest req = GetAllLeavesRequest.builder()
.sectionId(633197L)
.build();
GetAllLeavesResponse res = sdk.content().getAllLeaves()
.request(req)
.call();
if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `request` | [GetAllLeavesRequest](../../models/operations/GetAllLeavesRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetAllLeavesResponse](../../models/operations/GetAllLeavesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getArts
Get artwork for a library section
### Example Usage
<!-- UsageSnippet language="java" operationID="getArts" method="get" path="/library/sections/{sectionId}/arts" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetArtsRequest;
import dev.plexapi.sdk.models.operations.GetArtsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetArtsRequest req = GetArtsRequest.builder()
.sectionId(859200L)
.build();
GetArtsResponse res = sdk.content().getArts()
.request(req)
.call();
if (res.mediaContainerWithArtwork().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| `request` | [GetArtsRequest](../../models/operations/GetArtsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetArtsResponse](../../models/operations/GetArtsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getCategories
Get categories in a library section
### Example Usage
<!-- UsageSnippet language="java" operationID="getCategories" method="get" path="/library/sections/{sectionId}/categories" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetCategoriesRequest;
import dev.plexapi.sdk.models.operations.GetCategoriesResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetCategoriesRequest req = GetCategoriesRequest.builder()
.sectionId(21841L)
.build();
GetCategoriesResponse res = sdk.content().getCategories()
.request(req)
.call();
if (res.mediaContainerWithArtwork().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `request` | [GetCategoriesRequest](../../models/operations/GetCategoriesRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetCategoriesResponse](../../models/operations/GetCategoriesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getCluster
Get clusters in a library section (typically for photos)
### Example Usage
<!-- UsageSnippet language="java" operationID="getCluster" method="get" path="/library/sections/{sectionId}/cluster" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetClusterRequest;
import dev.plexapi.sdk.models.operations.GetClusterResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetClusterRequest req = GetClusterRequest.builder()
.sectionId(138560L)
.build();
GetClusterResponse res = sdk.content().getCluster()
.request(req)
.call();
if (res.mediaContainerWithArtwork().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
| `request` | [GetClusterRequest](../../models/operations/GetClusterRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetClusterResponse](../../models/operations/GetClusterResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getSonicPath
Get a list of audio tracks starting at one and ending at another which are similar across the path
### Example Usage
<!-- UsageSnippet language="java" operationID="getSonicPath" method="get" path="/library/sections/{sectionId}/computePath" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetSonicPathRequest;
import dev.plexapi.sdk.models.operations.GetSonicPathResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetSonicPathRequest req = GetSonicPathRequest.builder()
.sectionId(914549L)
.startID(629990L)
.endID(687740L)
.build();
GetSonicPathResponse res = sdk.content().getSonicPath()
.request(req)
.call();
if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `request` | [GetSonicPathRequest](../../models/operations/GetSonicPathRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetSonicPathResponse](../../models/operations/GetSonicPathResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getFolders
Get all folder locations of the media in a section
### Example Usage
<!-- UsageSnippet language="java" operationID="getFolders" method="get" path="/library/sections/{sectionId}/location" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetFoldersRequest;
import dev.plexapi.sdk.models.operations.GetFoldersResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetFoldersRequest req = GetFoldersRequest.builder()
.sectionId(892532L)
.build();
GetFoldersResponse res = sdk.content().getFolders()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
| `request` | [GetFoldersRequest](../../models/operations/GetFoldersRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetFoldersResponse](../../models/operations/GetFoldersResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## listMoments
Get moments in a library section (typically for photos)
### Example Usage
<!-- UsageSnippet language="java" operationID="listMoments" method="get" path="/library/sections/{sectionId}/moment" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ListMomentsRequest;
import dev.plexapi.sdk.models.operations.ListMomentsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ListMomentsRequest req = ListMomentsRequest.builder()
.sectionId(403239L)
.build();
ListMomentsResponse res = sdk.content().listMoments()
.request(req)
.call();
if (res.mediaContainerWithArtwork().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `request` | [ListMomentsRequest](../../models/operations/ListMomentsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ListMomentsResponse](../../models/operations/ListMomentsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getSonicallySimilar
Get the nearest audio tracks to a particular analysis
### Example Usage
<!-- UsageSnippet language="java" operationID="getSonicallySimilar" method="get" path="/library/sections/{sectionId}/nearest" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetSonicallySimilarRequest;
import dev.plexapi.sdk.models.operations.GetSonicallySimilarResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetSonicallySimilarRequest req = GetSonicallySimilarRequest.builder()
.sectionId(525956L)
.values(List.of())
.build();
GetSonicallySimilarResponse res = sdk.content().getSonicallySimilar()
.request(req)
.call();
if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `request` | [GetSonicallySimilarRequest](../../models/operations/GetSonicallySimilarRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetSonicallySimilarResponse](../../models/operations/GetSonicallySimilarResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getCollectionImage
Get an image for the collection based on the items within
### Example Usage
<!-- UsageSnippet language="java" operationID="getCollectionImage" method="get" path="/library/collections/{collectionId}/composite/{updatedAt}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetCollectionImageRequest;
import dev.plexapi.sdk.models.operations.GetCollectionImageResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetCollectionImageRequest req = GetCollectionImageRequest.builder()
.collectionId(474227L)
.updatedAt(759379L)
.build();
GetCollectionImageResponse res = sdk.content().getCollectionImage()
.request(req)
.call();
if (res.responseStream().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `request` | [GetCollectionImageRequest](../../models/operations/GetCollectionImageRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetCollectionImageResponse](../../models/operations/GetCollectionImageResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

885
docs/sdks/devices/README.md Normal file
View File

@@ -0,0 +1,885 @@
# Devices
(*devices()*)
## Overview
Media grabbers provide ways for media to be obtained for a given protocol. The simplest ones are `stream` and `download`. More complex grabbers can have associated devices
Network tuners can present themselves on the network using the Simple Service Discovery Protocol and Plex Media Server will discover them. The following XML is an example of the data returned from SSDP. The `deviceType`, `serviceType`, and `serviceId` values must remain as they are in the example in order for PMS to properly discover the device. Other less-obvious fields are described in the parameters section below.
Example SSDP output
```
<root xmlns="urn:schemas-upnp-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<deviceType>urn:plex-tv:device:Media:1</deviceType>
<friendlyName>Turing Hopper 3000</friendlyName>
<manufacturer>Plex, Inc.</manufacturer>
<manufacturerURL>https://plex.tv/</manufacturerURL>
<modelDescription>Turing Hopper 3000 Media Grabber</modelDescription>
<modelName>Plex Media Grabber</modelName>
<modelNumber>1</modelNumber>
<modelURL>https://plex.tv</modelURL>
<UDN>uuid:42fde8e4-93b6-41e5-8a63-12d848655811</UDN>
<serviceList>
<service>
<URLBase>http://10.0.0.5:8088</URLBase>
<serviceType>urn:plex-tv:service:MediaGrabber:1</serviceType>
<serviceId>urn:plex-tv:serviceId:MediaGrabber</serviceId>
</service>
</serviceList>
</device>
</root>
```
- UDN: (string) A UUID for the device. This should be unique across models of a device at minimum.
- URLBase: (string) The base HTTP URL for the device from which all of the other endpoints are hosted.
### Available Operations
* [getAvailableGrabbers](#getavailablegrabbers) - Get available grabbers
* [listDevices](#listdevices) - Get all devices
* [addDevice](#adddevice) - Add a device
* [discoverDevices](#discoverdevices) - Tell grabbers to discover devices
* [removeDevice](#removedevice) - Remove a device
* [getDeviceDetails](#getdevicedetails) - Get device details
* [modifyDevice](#modifydevice) - Enable or disable a device
* [setChannelmap](#setchannelmap) - Set a device's channel mapping
* [getDevicesChannels](#getdeviceschannels) - Get a device's channels
* [setDevicePreferences](#setdevicepreferences) - Set device preferences
* [stopScan](#stopscan) - Tell a device to stop scanning for channels
* [scan](#scan) - Tell a device to scan for channels
* [getThumb](#getthumb) - Get device thumb
## getAvailableGrabbers
Get available grabbers visible to the server
### Example Usage
<!-- UsageSnippet language="java" operationID="getAvailableGrabbers" method="get" path="/media/grabbers" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetAvailableGrabbersRequest;
import dev.plexapi.sdk.models.operations.GetAvailableGrabbersResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetAvailableGrabbersRequest req = GetAvailableGrabbersRequest.builder()
.protocol("livetv")
.build();
GetAvailableGrabbersResponse res = sdk.devices().getAvailableGrabbers()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `request` | [GetAvailableGrabbersRequest](../../models/operations/GetAvailableGrabbersRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetAvailableGrabbersResponse](../../models/operations/GetAvailableGrabbersResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## listDevices
Get the list of all devices present
### Example Usage
<!-- UsageSnippet language="java" operationID="listDevices" method="get" path="/media/grabbers/devices" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ListDevicesResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ListDevicesResponse res = sdk.devices().listDevices()
.call();
if (res.mediaContainerWithDevice().isPresent()) {
// handle response
}
}
}
```
### Response
**[ListDevicesResponse](../../models/operations/ListDevicesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## addDevice
This endpoint adds a device to an existing grabber. The device is identified, and added to the correct grabber.
### Example Usage
<!-- UsageSnippet language="java" operationID="addDevice" method="post" path="/media/grabbers/devices" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.AddDeviceRequest;
import dev.plexapi.sdk.models.operations.AddDeviceResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
AddDeviceRequest req = AddDeviceRequest.builder()
.uri("http://10.0.0.5")
.build();
AddDeviceResponse res = sdk.devices().addDevice()
.request(req)
.call();
if (res.mediaContainerWithDevice().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| `request` | [AddDeviceRequest](../../models/operations/AddDeviceRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[AddDeviceResponse](../../models/operations/AddDeviceResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## discoverDevices
Tell grabbers to discover devices
### Example Usage
<!-- UsageSnippet language="java" operationID="discoverDevices" method="post" path="/media/grabbers/devices/discover" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.DiscoverDevicesResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
DiscoverDevicesResponse res = sdk.devices().discoverDevices()
.call();
if (res.mediaContainerWithDevice().isPresent()) {
// handle response
}
}
}
```
### Response
**[DiscoverDevicesResponse](../../models/operations/DiscoverDevicesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## removeDevice
Remove a devices by its id along with its channel mappings
### Example Usage
<!-- UsageSnippet language="java" operationID="removeDevice" method="delete" path="/media/grabbers/devices/{deviceId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.RemoveDeviceRequest;
import dev.plexapi.sdk.models.operations.RemoveDeviceResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
RemoveDeviceRequest req = RemoveDeviceRequest.builder()
.deviceId(685908L)
.build();
RemoveDeviceResponse res = sdk.devices().removeDevice()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `request` | [RemoveDeviceRequest](../../models/operations/RemoveDeviceRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[RemoveDeviceResponse](../../models/operations/RemoveDeviceResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getDeviceDetails
Get a device's details by its id
### Example Usage
<!-- UsageSnippet language="java" operationID="getDeviceDetails" method="get" path="/media/grabbers/devices/{deviceId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetDeviceDetailsRequest;
import dev.plexapi.sdk.models.operations.GetDeviceDetailsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetDeviceDetailsRequest req = GetDeviceDetailsRequest.builder()
.deviceId(170949L)
.build();
GetDeviceDetailsResponse res = sdk.devices().getDeviceDetails()
.request(req)
.call();
if (res.mediaContainerWithDevice().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `request` | [GetDeviceDetailsRequest](../../models/operations/GetDeviceDetailsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetDeviceDetailsResponse](../../models/operations/GetDeviceDetailsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## modifyDevice
Enable or disable a device by its id
### Example Usage
<!-- UsageSnippet language="java" operationID="modifyDevice" method="put" path="/media/grabbers/devices/{deviceId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ModifyDeviceRequest;
import dev.plexapi.sdk.models.operations.ModifyDeviceResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ModifyDeviceRequest req = ModifyDeviceRequest.builder()
.deviceId(879135L)
.enabled(BoolInt.ONE)
.build();
ModifyDeviceResponse res = sdk.devices().modifyDevice()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `request` | [ModifyDeviceRequest](../../models/operations/ModifyDeviceRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ModifyDeviceResponse](../../models/operations/ModifyDeviceResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## setChannelmap
Set a device's channel mapping
### Example Usage
<!-- UsageSnippet language="java" operationID="setChannelmap" method="put" path="/media/grabbers/devices/{deviceId}/channelmap" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.*;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
SetChannelmapRequest req = SetChannelmapRequest.builder()
.deviceId(937661L)
.channelMapping(ChannelMapping.builder()
.build())
.channelMappingByKey(ChannelMappingByKey.builder()
.build())
.channelsEnabled(List.of(
"4",
"6",
".",
"1",
",",
"4",
"4",
".",
"1",
",",
"4",
"5",
".",
"1"))
.build();
SetChannelmapResponse res = sdk.devices().setChannelmap()
.request(req)
.call();
if (res.mediaContainerWithDevice().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `request` | [SetChannelmapRequest](../../models/operations/SetChannelmapRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[SetChannelmapResponse](../../models/operations/SetChannelmapResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getDevicesChannels
Get a device's channels by its id
### Example Usage
<!-- UsageSnippet language="java" operationID="getDevicesChannels" method="get" path="/media/grabbers/devices/{deviceId}/channels" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetDevicesChannelsRequest;
import dev.plexapi.sdk.models.operations.GetDevicesChannelsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetDevicesChannelsRequest req = GetDevicesChannelsRequest.builder()
.deviceId(517209L)
.build();
GetDevicesChannelsResponse res = sdk.devices().getDevicesChannels()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `request` | [GetDevicesChannelsRequest](../../models/operations/GetDevicesChannelsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetDevicesChannelsResponse](../../models/operations/GetDevicesChannelsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## setDevicePreferences
Set device preferences by its id
### Example Usage
<!-- UsageSnippet language="java" operationID="setDevicePreferences" method="put" path="/media/grabbers/devices/{deviceId}/prefs" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.SetDevicePreferencesRequest;
import dev.plexapi.sdk.models.operations.SetDevicePreferencesResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
SetDevicePreferencesRequest req = SetDevicePreferencesRequest.builder()
.deviceId(420973L)
.build();
SetDevicePreferencesResponse res = sdk.devices().setDevicePreferences()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `request` | [SetDevicePreferencesRequest](../../models/operations/SetDevicePreferencesRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[SetDevicePreferencesResponse](../../models/operations/SetDevicePreferencesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## stopScan
Tell a device to stop scanning for channels
### Example Usage
<!-- UsageSnippet language="java" operationID="stopScan" method="delete" path="/media/grabbers/devices/{deviceId}/scan" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.StopScanRequest;
import dev.plexapi.sdk.models.operations.StopScanResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
StopScanRequest req = StopScanRequest.builder()
.deviceId(576494L)
.build();
StopScanResponse res = sdk.devices().stopScan()
.request(req)
.call();
if (res.mediaContainerWithDevice().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
| `request` | [StopScanRequest](../../models/operations/StopScanRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[StopScanResponse](../../models/operations/StopScanResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## scan
Tell a device to scan for channels
### Example Usage
<!-- UsageSnippet language="java" operationID="scan" method="post" path="/media/grabbers/devices/{deviceId}/scan" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ScanRequest;
import dev.plexapi.sdk.models.operations.ScanResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ScanRequest req = ScanRequest.builder()
.deviceId(57391L)
.source("Cable")
.build();
ScanResponse res = sdk.devices().scan()
.request(req)
.call();
if (res.mediaContainerWithDevice().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
| `request` | [ScanRequest](../../models/operations/ScanRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ScanResponse](../../models/operations/ScanResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getThumb
Get a device's thumb for display to the user
### Example Usage
<!-- UsageSnippet language="java" operationID="getThumb" method="get" path="/media/grabbers/devices/{deviceId}/thumb/{version}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetThumbRequest;
import dev.plexapi.sdk.models.operations.GetThumbResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetThumbRequest req = GetThumbRequest.builder()
.deviceId(960617L)
.versionPathParameter(1025L)
.build();
GetThumbResponse res = sdk.devices().getThumb()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
| `request` | [GetThumbRequest](../../models/operations/GetThumbRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetThumbResponse](../../models/operations/GetThumbResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -0,0 +1,652 @@
# DownloadQueue
(*downloadQueue()*)
## Overview
API Operations against the Download Queue
### Available Operations
* [createDownloadQueue](#createdownloadqueue) - Create download queue
* [getDownloadQueue](#getdownloadqueue) - Get a download queue
* [addDownloadQueueItems](#adddownloadqueueitems) - Add to download queue
* [listDownloadQueueItems](#listdownloadqueueitems) - Get download queue items
* [getItemDecision](#getitemdecision) - Grab download queue item decision
* [getDownloadQueueMedia](#getdownloadqueuemedia) - Grab download queue media
* [removeDownloadQueueItems](#removedownloadqueueitems) - Delete download queue items
* [getDownloadQueueItems](#getdownloadqueueitems) - Get download queue items
* [restartProcessingDownloadQueueItems](#restartprocessingdownloadqueueitems) - Restart processing of items from the decision
## createDownloadQueue
Available: 0.2.0
Creates a download queue for this client if one doesn't exist, or returns the existing queue for this client and user.
### Example Usage
<!-- UsageSnippet language="java" operationID="createDownloadQueue" method="post" path="/downloadQueue" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.CreateDownloadQueueResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
CreateDownloadQueueResponse res = sdk.downloadQueue().createDownloadQueue()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[CreateDownloadQueueResponse](../../models/operations/CreateDownloadQueueResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getDownloadQueue
Available: 0.2.0
Get a download queue by its id
### Example Usage
<!-- UsageSnippet language="java" operationID="getDownloadQueue" method="get" path="/downloadQueue/{queueId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetDownloadQueueRequest;
import dev.plexapi.sdk.models.operations.GetDownloadQueueResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetDownloadQueueRequest req = GetDownloadQueueRequest.builder()
.queueId(922802L)
.build();
GetDownloadQueueResponse res = sdk.downloadQueue().getDownloadQueue()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `request` | [GetDownloadQueueRequest](../../models/operations/GetDownloadQueueRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetDownloadQueueResponse](../../models/operations/GetDownloadQueueResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## addDownloadQueueItems
Available: 0.2.0
Add items to the download queue
### Example Usage
<!-- UsageSnippet language="java" operationID="addDownloadQueueItems" method="post" path="/downloadQueue/{queueId}/add" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.AddDownloadQueueItemsRequest;
import dev.plexapi.sdk.models.operations.AddDownloadQueueItemsResponse;
import dev.plexapi.sdk.models.shared.*;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
AddDownloadQueueItemsRequest req = AddDownloadQueueItemsRequest.builder()
.queueId(984925L)
.keys(List.of(
"/library/metadata/3",
"/library/metadata/6"))
.advancedSubtitles(AdvancedSubtitles.BURN)
.audioBoost(50L)
.audioChannelCount(5L)
.autoAdjustQuality(BoolInt.ONE)
.autoAdjustSubtitle(BoolInt.ONE)
.directPlay(BoolInt.ONE)
.directStream(BoolInt.ONE)
.directStreamAudio(BoolInt.ONE)
.disableResolutionRotation(BoolInt.ONE)
.hasMDE(BoolInt.ONE)
.location(Location.WAN)
.mediaBufferSize(102400L)
.mediaIndex(0L)
.musicBitrate(5000L)
.offset(90.5)
.partIndex(0L)
.path("/library/metadata/151671")
.peakBitrate(12000L)
.photoResolution("1080x1080")
.protocol(Protocol.DASH)
.secondsPerSegment(5L)
.subtitleSize(50L)
.videoBitrate(12000L)
.videoQuality(50L)
.videoResolution("1080x1080")
.build();
AddDownloadQueueItemsResponse res = sdk.downloadQueue().addDownloadQueueItems()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `request` | [AddDownloadQueueItemsRequest](../../models/operations/AddDownloadQueueItemsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[AddDownloadQueueItemsResponse](../../models/operations/AddDownloadQueueItemsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## listDownloadQueueItems
Available: 0.2.0
Get items from a download queue
### Example Usage
<!-- UsageSnippet language="java" operationID="listDownloadQueueItems" method="get" path="/downloadQueue/{queueId}/items" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ListDownloadQueueItemsRequest;
import dev.plexapi.sdk.models.operations.ListDownloadQueueItemsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ListDownloadQueueItemsRequest req = ListDownloadQueueItemsRequest.builder()
.queueId(524138L)
.build();
ListDownloadQueueItemsResponse res = sdk.downloadQueue().listDownloadQueueItems()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `request` | [ListDownloadQueueItemsRequest](../../models/operations/ListDownloadQueueItemsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ListDownloadQueueItemsResponse](../../models/operations/ListDownloadQueueItemsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getItemDecision
Available: 0.2.0
Grab the decision for a download queue item
### Example Usage
<!-- UsageSnippet language="java" operationID="getItemDecision" method="get" path="/downloadQueue/{queueId}/item/{itemId}/decision" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetItemDecisionRequest;
import dev.plexapi.sdk.models.operations.GetItemDecisionResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetItemDecisionRequest req = GetItemDecisionRequest.builder()
.queueId(231605L)
.itemId(32L)
.build();
GetItemDecisionResponse res = sdk.downloadQueue().getItemDecision()
.request(req)
.call();
if (res.mediaContainerWithDecision().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `request` | [GetItemDecisionRequest](../../models/operations/GetItemDecisionRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetItemDecisionResponse](../../models/operations/GetItemDecisionResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getDownloadQueueMedia
Available: 0.2.0
Grab the media for a download queue item
### Example Usage
<!-- UsageSnippet language="java" operationID="getDownloadQueueMedia" method="get" path="/downloadQueue/{queueId}/item/{itemId}/media" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetDownloadQueueMediaRequest;
import dev.plexapi.sdk.models.operations.GetDownloadQueueMediaResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetDownloadQueueMediaRequest req = GetDownloadQueueMediaRequest.builder()
.queueId(663184L)
.itemId(32L)
.build();
GetDownloadQueueMediaResponse res = sdk.downloadQueue().getDownloadQueueMedia()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `request` | [GetDownloadQueueMediaRequest](../../models/operations/GetDownloadQueueMediaRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetDownloadQueueMediaResponse](../../models/operations/GetDownloadQueueMediaResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## removeDownloadQueueItems
delete items from a download queue
### Example Usage
<!-- UsageSnippet language="java" operationID="removeDownloadQueueItems" method="delete" path="/downloadQueue/{queueId}/items/{itemId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.RemoveDownloadQueueItemsRequest;
import dev.plexapi.sdk.models.operations.RemoveDownloadQueueItemsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
RemoveDownloadQueueItemsRequest req = RemoveDownloadQueueItemsRequest.builder()
.queueId(946275L)
.itemId(List.of(
32L,
345L,
23L))
.build();
RemoveDownloadQueueItemsResponse res = sdk.downloadQueue().removeDownloadQueueItems()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `request` | [RemoveDownloadQueueItemsRequest](../../models/operations/RemoveDownloadQueueItemsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[RemoveDownloadQueueItemsResponse](../../models/operations/RemoveDownloadQueueItemsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getDownloadQueueItems
Available: 0.2.0
Get items from a download queue
### Example Usage
<!-- UsageSnippet language="java" operationID="getDownloadQueueItems" method="get" path="/downloadQueue/{queueId}/items/{itemId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetDownloadQueueItemsRequest;
import dev.plexapi.sdk.models.operations.GetDownloadQueueItemsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetDownloadQueueItemsRequest req = GetDownloadQueueItemsRequest.builder()
.queueId(809886L)
.itemId(List.of(
32L,
345L,
23L))
.build();
GetDownloadQueueItemsResponse res = sdk.downloadQueue().getDownloadQueueItems()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `request` | [GetDownloadQueueItemsRequest](../../models/operations/GetDownloadQueueItemsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetDownloadQueueItemsResponse](../../models/operations/GetDownloadQueueItemsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## restartProcessingDownloadQueueItems
Available: 0.2.0
Reprocess download queue items with previous decision parameters
### Example Usage
<!-- UsageSnippet language="java" operationID="restartProcessingDownloadQueueItems" method="post" path="/downloadQueue/{queueId}/items/{itemId}/restart" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.RestartProcessingDownloadQueueItemsRequest;
import dev.plexapi.sdk.models.operations.RestartProcessingDownloadQueueItemsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
RestartProcessingDownloadQueueItemsRequest req = RestartProcessingDownloadQueueItemsRequest.builder()
.queueId(713001L)
.itemId(List.of(
32L,
345L,
23L))
.build();
RestartProcessingDownloadQueueItemsResponse res = sdk.downloadQueue().restartProcessingDownloadQueueItems()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `request` | [RestartProcessingDownloadQueueItemsRequest](../../models/operations/RestartProcessingDownloadQueueItemsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[RestartProcessingDownloadQueueItemsResponse](../../models/operations/RestartProcessingDownloadQueueItemsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

845
docs/sdks/dvrs/README.md Normal file
View File

@@ -0,0 +1,845 @@
# DVRs
(*dvRs()*)
## Overview
The DVR provides means to watch and record live TV. This section of endpoints describes how to setup the DVR itself
### Available Operations
* [listDVRs](#listdvrs) - Get DVRs
* [createDVR](#createdvr) - Create a DVR
* [deleteDVR](#deletedvr) - Delete a single DVR
* [getDVR](#getdvr) - Get a single DVR
* [deleteLineup](#deletelineup) - Delete a DVR Lineup
* [addLineup](#addlineup) - Add a DVR Lineup
* [setDVRPreferences](#setdvrpreferences) - Set DVR preferences
* [stopDVRReload](#stopdvrreload) - Tell a DVR to stop reloading program guide
* [reloadGuide](#reloadguide) - Tell a DVR to reload program guide
* [tuneChannel](#tunechannel) - Tune a channel on a DVR
* [removeDeviceFromDVR](#removedevicefromdvr) - Remove a device from an existing DVR
* [addDeviceToDVR](#adddevicetodvr) - Add a device to an existing DVR
## listDVRs
Get the list of all available DVRs
### Example Usage
<!-- UsageSnippet language="java" operationID="listDVRs" method="get" path="/livetv/dvrs" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ListDVRsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ListDVRsResponse res = sdk.dvRs().listDVRs()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[ListDVRsResponse](../../models/operations/ListDVRsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## createDVR
Creation of a DVR, after creation of a devcie and a lineup is selected
### Example Usage
<!-- UsageSnippet language="java" operationID="createDVR" method="post" path="/livetv/dvrs" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.CreateDVRRequest;
import dev.plexapi.sdk.models.operations.CreateDVRResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
CreateDVRRequest req = CreateDVRRequest.builder()
.lineup("lineup://tv.plex.providers.epg.onconnect/USA-HI51418-DEFAULT")
.deviceQueryParameter(List.of(
"d",
"e",
"v",
"i",
"c",
"e",
"[",
"]",
"=",
"d",
"e",
"v",
"i",
"c",
"e",
":",
"/",
"/",
"t",
"v",
".",
"p",
"l",
"e",
"x",
".",
"g",
"r",
"a",
"b",
"b",
"e",
"r",
"s",
".",
"h",
"d",
"h",
"o",
"m",
"e",
"r",
"u",
"n",
"/",
"1",
"0",
"5",
"3",
"C",
"0",
"C",
"A"))
.language("eng")
.build();
CreateDVRResponse res = sdk.dvRs().createDVR()
.request(req)
.call();
if (res.dvrRequestHandlerSlashGetResponses200().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| `request` | [CreateDVRRequest](../../models/operations/CreateDVRRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[CreateDVRResponse](../../models/operations/CreateDVRResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## deleteDVR
Delete a single DVR by its id (key)
### Example Usage
<!-- UsageSnippet language="java" operationID="deleteDVR" method="delete" path="/livetv/dvrs/{dvrId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.DeleteDVRRequest;
import dev.plexapi.sdk.models.operations.DeleteDVRResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
DeleteDVRRequest req = DeleteDVRRequest.builder()
.dvrId(855088L)
.build();
DeleteDVRResponse res = sdk.dvRs().deleteDVR()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| `request` | [DeleteDVRRequest](../../models/operations/DeleteDVRRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[DeleteDVRResponse](../../models/operations/DeleteDVRResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getDVR
Get a single DVR by its id (key)
### Example Usage
<!-- UsageSnippet language="java" operationID="getDVR" method="get" path="/livetv/dvrs/{dvrId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetDVRRequest;
import dev.plexapi.sdk.models.operations.GetDVRResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetDVRRequest req = GetDVRRequest.builder()
.dvrId(973518L)
.build();
GetDVRResponse res = sdk.dvRs().getDVR()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- |
| `request` | [GetDVRRequest](../../models/operations/GetDVRRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetDVRResponse](../../models/operations/GetDVRResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## deleteLineup
Deletes a DVR device's lineup.
### Example Usage
<!-- UsageSnippet language="java" operationID="deleteLineup" method="delete" path="/livetv/dvrs/{dvrId}/lineups" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.DeleteLineupRequest;
import dev.plexapi.sdk.models.operations.DeleteLineupResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
DeleteLineupRequest req = DeleteLineupRequest.builder()
.dvrId(454470L)
.lineup("<value>")
.build();
DeleteLineupResponse res = sdk.dvRs().deleteLineup()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `request` | [DeleteLineupRequest](../../models/operations/DeleteLineupRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[DeleteLineupResponse](../../models/operations/DeleteLineupResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## addLineup
Add a lineup to a DVR device's set of lineups.
### Example Usage
<!-- UsageSnippet language="java" operationID="addLineup" method="put" path="/livetv/dvrs/{dvrId}/lineups" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.AddLineupRequest;
import dev.plexapi.sdk.models.operations.AddLineupResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
AddLineupRequest req = AddLineupRequest.builder()
.dvrId(945235L)
.lineup("<value>")
.build();
AddLineupResponse res = sdk.dvRs().addLineup()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| `request` | [AddLineupRequest](../../models/operations/AddLineupRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[AddLineupResponse](../../models/operations/AddLineupResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## setDVRPreferences
Set DVR preferences by name avd value
### Example Usage
<!-- UsageSnippet language="java" operationID="setDVRPreferences" method="put" path="/livetv/dvrs/{dvrId}/prefs" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.SetDVRPreferencesRequest;
import dev.plexapi.sdk.models.operations.SetDVRPreferencesResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
SetDVRPreferencesRequest req = SetDVRPreferencesRequest.builder()
.dvrId(116357L)
.build();
SetDVRPreferencesResponse res = sdk.dvRs().setDVRPreferences()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `request` | [SetDVRPreferencesRequest](../../models/operations/SetDVRPreferencesRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[SetDVRPreferencesResponse](../../models/operations/SetDVRPreferencesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## stopDVRReload
Tell a DVR to stop reloading program guide
### Example Usage
<!-- UsageSnippet language="java" operationID="stopDVRReload" method="delete" path="/livetv/dvrs/{dvrId}/reloadGuide" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.StopDVRReloadRequest;
import dev.plexapi.sdk.models.operations.StopDVRReloadResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
StopDVRReloadRequest req = StopDVRReloadRequest.builder()
.dvrId(348053L)
.build();
StopDVRReloadResponse res = sdk.dvRs().stopDVRReload()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `request` | [StopDVRReloadRequest](../../models/operations/StopDVRReloadRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[StopDVRReloadResponse](../../models/operations/StopDVRReloadResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## reloadGuide
Tell a DVR to reload program guide
### Example Usage
<!-- UsageSnippet language="java" operationID="reloadGuide" method="post" path="/livetv/dvrs/{dvrId}/reloadGuide" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ReloadGuideRequest;
import dev.plexapi.sdk.models.operations.ReloadGuideResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ReloadGuideRequest req = ReloadGuideRequest.builder()
.dvrId(140753L)
.build();
ReloadGuideResponse res = sdk.dvRs().reloadGuide()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `request` | [ReloadGuideRequest](../../models/operations/ReloadGuideRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ReloadGuideResponse](../../models/operations/ReloadGuideResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## tuneChannel
Tune a channel on a DVR to the provided channel
### Example Usage
<!-- UsageSnippet language="java" operationID="tuneChannel" method="post" path="/livetv/dvrs/{dvrId}/channels/{channel}/tune" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.TuneChannelRequest;
import dev.plexapi.sdk.models.operations.TuneChannelResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
TuneChannelRequest req = TuneChannelRequest.builder()
.dvrId(834281L)
.channel("2.1")
.build();
TuneChannelResponse res = sdk.dvRs().tuneChannel()
.request(req)
.call();
if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `request` | [TuneChannelRequest](../../models/operations/TuneChannelRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[TuneChannelResponse](../../models/operations/TuneChannelResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## removeDeviceFromDVR
Remove a device from an existing DVR
### Example Usage
<!-- UsageSnippet language="java" operationID="removeDeviceFromDVR" method="delete" path="/livetv/dvrs/{dvrId}/devices/{deviceId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.RemoveDeviceFromDVRRequest;
import dev.plexapi.sdk.models.operations.RemoveDeviceFromDVRResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
RemoveDeviceFromDVRRequest req = RemoveDeviceFromDVRRequest.builder()
.dvrId(945416L)
.deviceId(260761L)
.build();
RemoveDeviceFromDVRResponse res = sdk.dvRs().removeDeviceFromDVR()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `request` | [RemoveDeviceFromDVRRequest](../../models/operations/RemoveDeviceFromDVRRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[RemoveDeviceFromDVRResponse](../../models/operations/RemoveDeviceFromDVRResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## addDeviceToDVR
Add a device to an existing DVR
### Example Usage
<!-- UsageSnippet language="java" operationID="addDeviceToDVR" method="put" path="/livetv/dvrs/{dvrId}/devices/{deviceId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.AddDeviceToDVRRequest;
import dev.plexapi.sdk.models.operations.AddDeviceToDVRResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
AddDeviceToDVRRequest req = AddDeviceToDVRRequest.builder()
.dvrId(334755L)
.deviceId(852930L)
.build();
AddDeviceToDVRResponse res = sdk.dvRs().addDeviceToDVR()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `request` | [AddDeviceToDVRRequest](../../models/operations/AddDeviceToDVRRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[AddDeviceToDVRResponse](../../models/operations/AddDeviceToDVRResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

572
docs/sdks/epg/README.md Normal file
View File

@@ -0,0 +1,572 @@
# Epg
(*epg()*)
## Overview
The EPG (Electronic Program Guide) is responsible for obtaining metadata for what is airing on each channel and when
### Available Operations
* [computeChannelMap](#computechannelmap) - Compute the best channel map
* [getChannels](#getchannels) - Get channels for a lineup
* [getCountries](#getcountries) - Get all countries
* [getAllLanguages](#getalllanguages) - Get all languages
* [getLineup](#getlineup) - Compute the best lineup
* [getLineupChannels](#getlineupchannels) - Get the channels for mulitple lineups
* [getCountriesLineups](#getcountrieslineups) - Get lineups for a country via postal code
* [getCountryRegions](#getcountryregions) - Get regions for a country
* [listLineups](#listlineups) - Get lineups for a region
## computeChannelMap
Compute the best channel map, given device and lineup
### Example Usage
<!-- UsageSnippet language="java" operationID="computeChannelMap" method="get" path="/livetv/epg/channelmap" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ComputeChannelMapRequest;
import dev.plexapi.sdk.models.operations.ComputeChannelMapResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ComputeChannelMapRequest req = ComputeChannelMapRequest.builder()
.deviceQueryParameter("<value>")
.lineup("<value>")
.build();
ComputeChannelMapResponse res = sdk.epg().computeChannelMap()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `request` | [ComputeChannelMapRequest](../../models/operations/ComputeChannelMapRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ComputeChannelMapResponse](../../models/operations/ComputeChannelMapResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getChannels
Get channels for a lineup within an EPG provider
### Example Usage
<!-- UsageSnippet language="java" operationID="getChannels" method="get" path="/livetv/epg/channels" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetChannelsRequest;
import dev.plexapi.sdk.models.operations.GetChannelsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetChannelsRequest req = GetChannelsRequest.builder()
.lineup("<value>")
.build();
GetChannelsResponse res = sdk.epg().getChannels()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `request` | [GetChannelsRequest](../../models/operations/GetChannelsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetChannelsResponse](../../models/operations/GetChannelsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getCountries
This endpoint returns a list of countries which EPG data is available for. There are three flavors, as specfied by the `flavor` attribute
### Example Usage
<!-- UsageSnippet language="java" operationID="getCountries" method="get" path="/livetv/epg/countries" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetCountriesResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetCountriesResponse res = sdk.epg().getCountries()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[GetCountriesResponse](../../models/operations/GetCountriesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getAllLanguages
Returns a list of all possible languages for EPG data.
### Example Usage
<!-- UsageSnippet language="java" operationID="getAllLanguages" method="get" path="/livetv/epg/languages" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetAllLanguagesResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetAllLanguagesResponse res = sdk.epg().getAllLanguages()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[GetAllLanguagesResponse](../../models/operations/GetAllLanguagesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getLineup
Compute the best lineup, given lineup group and device
### Example Usage
<!-- UsageSnippet language="java" operationID="getLineup" method="get" path="/livetv/epg/lineup" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetLineupRequest;
import dev.plexapi.sdk.models.operations.GetLineupResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetLineupRequest req = GetLineupRequest.builder()
.deviceQueryParameter("<value>")
.lineupGroup("<value>")
.build();
GetLineupResponse res = sdk.epg().getLineup()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| `request` | [GetLineupRequest](../../models/operations/GetLineupRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetLineupResponse](../../models/operations/GetLineupResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getLineupChannels
Get the channels across multiple lineups
### Example Usage
<!-- UsageSnippet language="java" operationID="getLineupChannels" method="get" path="/livetv/epg/lineupchannels" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetLineupChannelsRequest;
import dev.plexapi.sdk.models.operations.GetLineupChannelsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetLineupChannelsRequest req = GetLineupChannelsRequest.builder()
.lineup(List.of(
"<value 1>",
"<value 2>"))
.build();
GetLineupChannelsResponse res = sdk.epg().getLineupChannels()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `request` | [GetLineupChannelsRequest](../../models/operations/GetLineupChannelsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetLineupChannelsResponse](../../models/operations/GetLineupChannelsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getCountriesLineups
Returns a list of lineups for a given country, EPG provider and postal code
### Example Usage
<!-- UsageSnippet language="java" operationID="getCountriesLineups" method="get" path="/livetv/epg/countries/{country}/{epgId}/lineups" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetCountriesLineupsRequest;
import dev.plexapi.sdk.models.operations.GetCountriesLineupsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetCountriesLineupsRequest req = GetCountriesLineupsRequest.builder()
.country("Malawi")
.epgId("<id>")
.build();
GetCountriesLineupsResponse res = sdk.epg().getCountriesLineups()
.request(req)
.call();
if (res.mediaContainerWithLineup().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `request` | [GetCountriesLineupsRequest](../../models/operations/GetCountriesLineupsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetCountriesLineupsResponse](../../models/operations/GetCountriesLineupsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getCountryRegions
Get regions for a country within an EPG provider
### Example Usage
<!-- UsageSnippet language="java" operationID="getCountryRegions" method="get" path="/livetv/epg/countries/{country}/{epgId}/regions" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetCountryRegionsRequest;
import dev.plexapi.sdk.models.operations.GetCountryRegionsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetCountryRegionsRequest req = GetCountryRegionsRequest.builder()
.country("Morocco")
.epgId("<id>")
.build();
GetCountryRegionsResponse res = sdk.epg().getCountryRegions()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `request` | [GetCountryRegionsRequest](../../models/operations/GetCountryRegionsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetCountryRegionsResponse](../../models/operations/GetCountryRegionsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## listLineups
Get lineups for a region within an EPG provider
### Example Usage
<!-- UsageSnippet language="java" operationID="listLineups" method="get" path="/livetv/epg/countries/{country}/{epgId}/regions/{region}/lineups" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ListLineupsRequest;
import dev.plexapi.sdk.models.operations.ListLineupsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ListLineupsRequest req = ListLineupsRequest.builder()
.country("Vanuatu")
.epgId("<id>")
.region("<value>")
.build();
ListLineupsResponse res = sdk.epg().listLineups()
.request(req)
.call();
if (res.mediaContainerWithLineup().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `request` | [ListLineupsRequest](../../models/operations/ListLineupsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ListLineupsResponse](../../models/operations/ListLineupsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

144
docs/sdks/events/README.md Normal file
View File

@@ -0,0 +1,144 @@
# Events
(*events()*)
## Overview
The server can notify clients in real-time of a wide range of events, from library scanning, to preferences being modified, to changes to media, and many other things. This is also the mechanism by which activity progress is reported.
Two protocols for receiving the events are available: EventSource (also known as SSE), and WebSocket.
### Available Operations
* [getNotifications](#getnotifications) - Connect to Eventsource
* [connectWebSocket](#connectwebsocket) - Connect to WebSocket
## getNotifications
Connect to the event source to get a stream of events
### Example Usage
<!-- UsageSnippet language="java" operationID="getNotifications" method="get" path="/:/eventsource/notifications" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetNotificationsRequest;
import dev.plexapi.sdk.models.operations.GetNotificationsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetNotificationsRequest req = GetNotificationsRequest.builder()
.build();
GetNotificationsResponse res = sdk.events().getNotifications()
.request(req)
.call();
if (res.responseStream().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `request` | [GetNotificationsRequest](../../models/operations/GetNotificationsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetNotificationsResponse](../../models/operations/GetNotificationsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## connectWebSocket
Connect to the web socket to get a stream of events
### Example Usage
<!-- UsageSnippet language="java" operationID="connectWebSocket" method="get" path="/:/websocket/notifications" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ConnectWebSocketRequest;
import dev.plexapi.sdk.models.operations.ConnectWebSocketResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ConnectWebSocketRequest req = ConnectWebSocketRequest.builder()
.build();
ConnectWebSocketResponse res = sdk.events().connectWebSocket()
.request(req)
.call();
if (res.responseStream().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `request` | [ConnectWebSocketRequest](../../models/operations/ConnectWebSocketRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ConnectWebSocketResponse](../../models/operations/ConnectWebSocketResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

254
docs/sdks/general/README.md Normal file
View File

@@ -0,0 +1,254 @@
# General
(*general()*)
## Overview
General endpoints for basic PMS operation not specific to any media provider
### Available Operations
* [getServerInfo](#getserverinfo) - Get PMS info
* [getIdentity](#getidentity) - Get PMS identity
* [getSourceConnectionInformation](#getsourceconnectioninformation) - Get Source Connection Information
* [getTransientToken](#gettransienttoken) - Get Transient Tokens
## getServerInfo
Information about this PMS setup and configuration
### Example Usage
<!-- UsageSnippet language="java" operationID="getServerInfo" method="get" path="/" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetServerInfoRequest;
import dev.plexapi.sdk.models.operations.GetServerInfoResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetServerInfoRequest req = GetServerInfoRequest.builder()
.build();
GetServerInfoResponse res = sdk.general().getServerInfo()
.request(req)
.call();
if (res.mediaContainerWithDirectory().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `request` | [GetServerInfoRequest](../../models/operations/GetServerInfoRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetServerInfoResponse](../../models/operations/GetServerInfoResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getIdentity
Get details about this PMS's identity
### Example Usage
<!-- UsageSnippet language="java" operationID="getIdentity" method="get" path="/identity" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetIdentityResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.build();
GetIdentityResponse res = sdk.general().getIdentity()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[GetIdentityResponse](../../models/operations/GetIdentityResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getSourceConnectionInformation
If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token.
### Example Usage
<!-- UsageSnippet language="java" operationID="getSourceConnectionInformation" method="get" path="/security/resources" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetSourceConnectionInformationRequest;
import dev.plexapi.sdk.models.operations.GetSourceConnectionInformationResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetSourceConnectionInformationRequest req = GetSourceConnectionInformationRequest.builder()
.source("server://client-identifier")
.refresh(BoolInt.ONE)
.build();
GetSourceConnectionInformationResponse res = sdk.general().getSourceConnectionInformation()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `request` | [GetSourceConnectionInformationRequest](../../models/operations/GetSourceConnectionInformationRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetSourceConnectionInformationResponse](../../models/operations/GetSourceConnectionInformationResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getTransientToken
This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted.
Note: This endpoint responds to all HTTP verbs but POST in preferred
### Example Usage
<!-- UsageSnippet language="java" operationID="getTransientToken" method="post" path="/security/token" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.*;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetTransientTokenRequest req = GetTransientTokenRequest.builder()
.type(QueryParamType.DELEGATION)
.scope(Scope.ALL)
.build();
GetTransientTokenResponse res = sdk.general().getTransientToken()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `request` | [GetTransientTokenRequest](../../models/operations/GetTransientTokenRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetTransientTokenResponse](../../models/operations/GetTransientTokenResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,213 @@
# LibraryCollections
(*libraryCollections()*)
## Overview
Endpoints for manipulating collections. In addition to these endpoints, `/library/collections/:collectionId/X` will be rerouted to `/library/metadata/:collectionId/X` and respond to those endpoints as well.
### Available Operations
* [addCollectionItems](#addcollectionitems) - Add items to a collection
* [deleteCollectionItem](#deletecollectionitem) - Delete an item from a collection
* [moveCollectionItem](#movecollectionitem) - Reorder an item in the collection
## addCollectionItems
Add items to a collection by uri
### Example Usage
<!-- UsageSnippet language="java" operationID="addCollectionItems" method="put" path="/library/collections/{collectionId}/items" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.AddCollectionItemsRequest;
import dev.plexapi.sdk.models.operations.AddCollectionItemsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
AddCollectionItemsRequest req = AddCollectionItemsRequest.builder()
.collectionId(338144L)
.uri("https://expensive-bakeware.com")
.build();
AddCollectionItemsResponse res = sdk.libraryCollections().addCollectionItems()
.request(req)
.call();
if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `request` | [AddCollectionItemsRequest](../../models/operations/AddCollectionItemsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[AddCollectionItemsResponse](../../models/operations/AddCollectionItemsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## deleteCollectionItem
Delete an item from a collection
### Example Usage
<!-- UsageSnippet language="java" operationID="deleteCollectionItem" method="put" path="/library/collections/{collectionId}/items/{itemId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.DeleteCollectionItemRequest;
import dev.plexapi.sdk.models.operations.DeleteCollectionItemResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
DeleteCollectionItemRequest req = DeleteCollectionItemRequest.builder()
.collectionId(320928L)
.itemId(406983L)
.build();
DeleteCollectionItemResponse res = sdk.libraryCollections().deleteCollectionItem()
.request(req)
.call();
if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `request` | [DeleteCollectionItemRequest](../../models/operations/DeleteCollectionItemRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[DeleteCollectionItemResponse](../../models/operations/DeleteCollectionItemResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## moveCollectionItem
Reorder items in a collection with one item after another
### Example Usage
<!-- UsageSnippet language="java" operationID="moveCollectionItem" method="put" path="/library/collections/{collectionId}/items/{itemId}/move" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.MoveCollectionItemRequest;
import dev.plexapi.sdk.models.operations.MoveCollectionItemResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
MoveCollectionItemRequest req = MoveCollectionItemRequest.builder()
.collectionId(239532L)
.itemId(513864L)
.build();
MoveCollectionItemResponse res = sdk.libraryCollections().moveCollectionItem()
.request(req)
.call();
if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `request` | [MoveCollectionItemRequest](../../models/operations/MoveCollectionItemRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[MoveCollectionItemResponse](../../models/operations/MoveCollectionItemResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -0,0 +1,813 @@
# LibraryPlaylists
(*libraryPlaylists()*)
## Overview
Endpoints for manipulating playlists.
### Available Operations
* [createPlaylist](#createplaylist) - Create a Playlist
* [uploadPlaylist](#uploadplaylist) - Upload
* [deletePlaylist](#deleteplaylist) - Delete a Playlist
* [updatePlaylist](#updateplaylist) - Editing a Playlist
* [getPlaylistGenerators](#getplaylistgenerators) - Get a playlist's generators
* [clearPlaylistItems](#clearplaylistitems) - Clearing a playlist
* [addPlaylistItems](#addplaylistitems) - Adding to a Playlist
* [deletePlaylistItem](#deleteplaylistitem) - Delete a Generator
* [getPlaylistGenerator](#getplaylistgenerator) - Get a playlist generator
* [getPlaylistGeneratorItems](#getplaylistgeneratoritems) - Get a playlist generator's items
* [movePlaylistItem](#moveplaylistitem) - Moving items in a playlist
* [refreshPlaylist](#refreshplaylist) - Reprocess a generator
## createPlaylist
Create a new playlist. By default the playlist is blank.
### Example Usage
<!-- UsageSnippet language="java" operationID="createPlaylist" method="post" path="/playlists" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.CreatePlaylistRequest;
import dev.plexapi.sdk.models.operations.CreatePlaylistResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
CreatePlaylistRequest req = CreatePlaylistRequest.builder()
.uri("https://short-term-disconnection.name/")
.build();
CreatePlaylistResponse res = sdk.libraryPlaylists().createPlaylist()
.request(req)
.call();
if (res.mediaContainerWithPlaylistMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `request` | [CreatePlaylistRequest](../../models/operations/CreatePlaylistRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[CreatePlaylistResponse](../../models/operations/CreatePlaylistResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## uploadPlaylist
Imports m3u playlists by passing a path on the server to scan for m3u-formatted playlist files, or a path to a single playlist file.
### Example Usage
<!-- UsageSnippet language="java" operationID="uploadPlaylist" method="post" path="/playlists/upload" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.UploadPlaylistRequest;
import dev.plexapi.sdk.models.operations.UploadPlaylistResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
UploadPlaylistRequest req = UploadPlaylistRequest.builder()
.path("/home/barkley/playlist.m3u")
.force(BoolInt.ONE)
.build();
UploadPlaylistResponse res = sdk.libraryPlaylists().uploadPlaylist()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `request` | [UploadPlaylistRequest](../../models/operations/UploadPlaylistRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[UploadPlaylistResponse](../../models/operations/UploadPlaylistResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## deletePlaylist
Deletes a playlist by provided id
### Example Usage
<!-- UsageSnippet language="java" operationID="deletePlaylist" method="delete" path="/playlists/{playlistId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.DeletePlaylistRequest;
import dev.plexapi.sdk.models.operations.DeletePlaylistResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
DeletePlaylistRequest req = DeletePlaylistRequest.builder()
.playlistId(343293L)
.build();
DeletePlaylistResponse res = sdk.libraryPlaylists().deletePlaylist()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `request` | [DeletePlaylistRequest](../../models/operations/DeletePlaylistRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[DeletePlaylistResponse](../../models/operations/DeletePlaylistResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## updatePlaylist
Edits a playlist in the same manner as [editing metadata](#tag/Provider/operation/metadataPutItem)
### Example Usage
<!-- UsageSnippet language="java" operationID="updatePlaylist" method="put" path="/playlists/{playlistId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.UpdatePlaylistRequest;
import dev.plexapi.sdk.models.operations.UpdatePlaylistResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
UpdatePlaylistRequest req = UpdatePlaylistRequest.builder()
.playlistId(157966L)
.build();
UpdatePlaylistResponse res = sdk.libraryPlaylists().updatePlaylist()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `request` | [UpdatePlaylistRequest](../../models/operations/UpdatePlaylistRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[UpdatePlaylistResponse](../../models/operations/UpdatePlaylistResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getPlaylistGenerators
Get all the generators in a playlist
### Example Usage
<!-- UsageSnippet language="java" operationID="getPlaylistGenerators" method="get" path="/playlists/{playlistId}/generators" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetPlaylistGeneratorsRequest;
import dev.plexapi.sdk.models.operations.GetPlaylistGeneratorsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetPlaylistGeneratorsRequest req = GetPlaylistGeneratorsRequest.builder()
.playlistId(162342L)
.build();
GetPlaylistGeneratorsResponse res = sdk.libraryPlaylists().getPlaylistGenerators()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `request` | [GetPlaylistGeneratorsRequest](../../models/operations/GetPlaylistGeneratorsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetPlaylistGeneratorsResponse](../../models/operations/GetPlaylistGeneratorsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## clearPlaylistItems
Clears a playlist, only works with dumb playlists. Returns the playlist.
### Example Usage
<!-- UsageSnippet language="java" operationID="clearPlaylistItems" method="delete" path="/playlists/{playlistId}/items" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ClearPlaylistItemsRequest;
import dev.plexapi.sdk.models.operations.ClearPlaylistItemsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ClearPlaylistItemsRequest req = ClearPlaylistItemsRequest.builder()
.playlistId(552140L)
.build();
ClearPlaylistItemsResponse res = sdk.libraryPlaylists().clearPlaylistItems()
.request(req)
.call();
if (res.mediaContainerWithPlaylistMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `request` | [ClearPlaylistItemsRequest](../../models/operations/ClearPlaylistItemsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ClearPlaylistItemsResponse](../../models/operations/ClearPlaylistItemsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## addPlaylistItems
Adds a generator to a playlist, same parameters as the POST above. With a dumb playlist, this adds the specified items to the playlist. With a smart playlist, passing a new `uri` parameter replaces the rules for the playlist. Returns the playlist.
### Example Usage
<!-- UsageSnippet language="java" operationID="addPlaylistItems" method="put" path="/playlists/{playlistId}/items" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.AddPlaylistItemsRequest;
import dev.plexapi.sdk.models.operations.AddPlaylistItemsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
AddPlaylistItemsRequest req = AddPlaylistItemsRequest.builder()
.playlistId(533723L)
.build();
AddPlaylistItemsResponse res = sdk.libraryPlaylists().addPlaylistItems()
.request(req)
.call();
if (res.mediaContainerWithPlaylistMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `request` | [AddPlaylistItemsRequest](../../models/operations/AddPlaylistItemsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[AddPlaylistItemsResponse](../../models/operations/AddPlaylistItemsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## deletePlaylistItem
Deletes an item from a playlist. Only works with dumb playlists.
### Example Usage
<!-- UsageSnippet language="java" operationID="deletePlaylistItem" method="delete" path="/playlists/{playlistId}/items/{generatorId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.DeletePlaylistItemRequest;
import dev.plexapi.sdk.models.operations.DeletePlaylistItemResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
DeletePlaylistItemRequest req = DeletePlaylistItemRequest.builder()
.playlistId(981646L)
.generatorId(194010L)
.build();
DeletePlaylistItemResponse res = sdk.libraryPlaylists().deletePlaylistItem()
.request(req)
.call();
if (res.mediaContainerWithPlaylistMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `request` | [DeletePlaylistItemRequest](../../models/operations/DeletePlaylistItemRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[DeletePlaylistItemResponse](../../models/operations/DeletePlaylistItemResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getPlaylistGenerator
Get a playlist's generator. Only used for optimized versions
### Example Usage
<!-- UsageSnippet language="java" operationID="getPlaylistGenerator" method="get" path="/playlists/{playlistId}/items/{generatorId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetPlaylistGeneratorRequest;
import dev.plexapi.sdk.models.operations.GetPlaylistGeneratorResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetPlaylistGeneratorRequest req = GetPlaylistGeneratorRequest.builder()
.playlistId(744880L)
.generatorId(322168L)
.build();
GetPlaylistGeneratorResponse res = sdk.libraryPlaylists().getPlaylistGenerator()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `request` | [GetPlaylistGeneratorRequest](../../models/operations/GetPlaylistGeneratorRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetPlaylistGeneratorResponse](../../models/operations/GetPlaylistGeneratorResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getPlaylistGeneratorItems
Get a playlist generator's items
### Example Usage
<!-- UsageSnippet language="java" operationID="getPlaylistGeneratorItems" method="get" path="/playlists/{playlistId}/items/{generatorId}/items" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetPlaylistGeneratorItemsRequest;
import dev.plexapi.sdk.models.operations.GetPlaylistGeneratorItemsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetPlaylistGeneratorItemsRequest req = GetPlaylistGeneratorItemsRequest.builder()
.playlistId(77230L)
.generatorId(979714L)
.build();
GetPlaylistGeneratorItemsResponse res = sdk.libraryPlaylists().getPlaylistGeneratorItems()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `request` | [GetPlaylistGeneratorItemsRequest](../../models/operations/GetPlaylistGeneratorItemsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetPlaylistGeneratorItemsResponse](../../models/operations/GetPlaylistGeneratorItemsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## movePlaylistItem
Moves an item in a playlist. Only works with dumb playlists.
### Example Usage
<!-- UsageSnippet language="java" operationID="movePlaylistItem" method="put" path="/playlists/{playlistId}/items/{playlistItemId}/move" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.MovePlaylistItemRequest;
import dev.plexapi.sdk.models.operations.MovePlaylistItemResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
MovePlaylistItemRequest req = MovePlaylistItemRequest.builder()
.playlistId(940298L)
.playlistItemId(375626L)
.build();
MovePlaylistItemResponse res = sdk.libraryPlaylists().movePlaylistItem()
.request(req)
.call();
if (res.mediaContainerWithPlaylistMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `request` | [MovePlaylistItemRequest](../../models/operations/MovePlaylistItemRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[MovePlaylistItemResponse](../../models/operations/MovePlaylistItemResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## refreshPlaylist
Make a generator reprocess (refresh)
### Example Usage
<!-- UsageSnippet language="java" operationID="refreshPlaylist" method="put" path="/playlists/{playlistId}/items/{generatorId}/{metadataId}/{action}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.*;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
RefreshPlaylistRequest req = RefreshPlaylistRequest.builder()
.playlistId(895314L)
.generatorId(629742L)
.metadataId(724422L)
.action(Action.DISABLE)
.build();
RefreshPlaylistResponse res = sdk.libraryPlaylists().refreshPlaylist()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `request` | [RefreshPlaylistRequest](../../models/operations/RefreshPlaylistRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[RefreshPlaylistResponse](../../models/operations/RefreshPlaylistResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

253
docs/sdks/livetv/README.md Normal file
View File

@@ -0,0 +1,253 @@
# LiveTV
(*liveTV()*)
## Overview
LiveTV contains the playback sessions of a channel from a DVR device
### Available Operations
* [getSessions](#getsessions) - Get all sessions
* [getLiveTVSession](#getlivetvsession) - Get a single session
* [getSessionPlaylistIndex](#getsessionplaylistindex) - Get a session playlist index
* [getSessionSegment](#getsessionsegment) - Get a single session segment
## getSessions
Get all livetv sessions and metadata
### Example Usage
<!-- UsageSnippet language="java" operationID="getSessions" method="get" path="/livetv/sessions" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetSessionsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetSessionsResponse res = sdk.liveTV().getSessions()
.call();
if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
```
### Response
**[GetSessionsResponse](../../models/operations/GetSessionsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getLiveTVSession
Get a single livetv session and metadata
### Example Usage
<!-- UsageSnippet language="java" operationID="getLiveTVSession" method="get" path="/livetv/sessions/{sessionId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetLiveTVSessionRequest;
import dev.plexapi.sdk.models.operations.GetLiveTVSessionResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetLiveTVSessionRequest req = GetLiveTVSessionRequest.builder()
.sessionId("<id>")
.build();
GetLiveTVSessionResponse res = sdk.liveTV().getLiveTVSession()
.request(req)
.call();
if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `request` | [GetLiveTVSessionRequest](../../models/operations/GetLiveTVSessionRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetLiveTVSessionResponse](../../models/operations/GetLiveTVSessionResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getSessionPlaylistIndex
Get a playlist index for playing this session
### Example Usage
<!-- UsageSnippet language="java" operationID="getSessionPlaylistIndex" method="get" path="/livetv/sessions/{sessionId}/{consumerId}/index.m3u8" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetSessionPlaylistIndexRequest;
import dev.plexapi.sdk.models.operations.GetSessionPlaylistIndexResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetSessionPlaylistIndexRequest req = GetSessionPlaylistIndexRequest.builder()
.sessionId("<id>")
.consumerId("<id>")
.build();
GetSessionPlaylistIndexResponse res = sdk.liveTV().getSessionPlaylistIndex()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `request` | [GetSessionPlaylistIndexRequest](../../models/operations/GetSessionPlaylistIndexRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetSessionPlaylistIndexResponse](../../models/operations/GetSessionPlaylistIndexResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getSessionSegment
Get a single LiveTV session segment
### Example Usage
<!-- UsageSnippet language="java" operationID="getSessionSegment" method="get" path="/livetv/sessions/{sessionId}/{consumerId}/{segmentId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetSessionSegmentRequest;
import dev.plexapi.sdk.models.operations.GetSessionSegmentResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetSessionSegmentRequest req = GetSessionSegmentRequest.builder()
.sessionId("<id>")
.consumerId("<id>")
.segmentId("<id>")
.build();
GetSessionSegmentResponse res = sdk.liveTV().getSessionSegment()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `request` | [GetSessionSegmentRequest](../../models/operations/GetSessionSegmentRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetSessionSegmentResponse](../../models/operations/GetSessionSegmentResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -3,121 +3,107 @@
## Overview
Submit logs to the Log Handler for Plex Media Server
Logging mechanism to allow clients to log to the server
### Available Operations
* [logLine](#logline) - Logging a single line message.
* [logMultiLine](#logmultiline) - Logging a multi-line message
* [enablePaperTrail](#enablepapertrail) - Enabling Papertrail
* [writeLog](#writelog) - Logging a multi-line message to the Plex Media Server log
* [writeMessage](#writemessage) - Logging a single-line message to the Plex Media Server log
* [enablePapertrail](#enablepapertrail) - Enabling Papertrail
## logLine
## writeLog
This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.
This endpoint will write multiple lines to the main Plex Media Server log in a single request. It takes a set of query strings as would normally sent to the above PUT endpoint as a linefeed-separated block of POST data. The parameters for each query string match as above.
### Example Usage
<!-- UsageSnippet language="java" operationID="logLine" method="get" path="/log" -->
<!-- UsageSnippet language="java" operationID="writeLog" method="post" path="/log" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.LogLineBadRequest;
import dev.plexapi.sdk.models.errors.LogLineUnauthorized;
import dev.plexapi.sdk.models.operations.Level;
import dev.plexapi.sdk.models.operations.LogLineResponse;
import dev.plexapi.sdk.models.operations.WriteLogResponse;
import dev.plexapi.sdk.utils.Utils;
import java.io.FileInputStream;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws LogLineBadRequest, LogLineUnauthorized, Exception {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
LogLineResponse res = sdk.log().logLine()
.level(Level.THREE)
.message("Test log message")
.source("Postman")
byte[] req = Utils.readBytesAndClose(new FileInputStream("example.file"));
WriteLogResponse res = sdk.log().writeLog()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `level` | [Level](../../models/operations/Level.md) | :heavy_check_mark: | An integer log level to write to the PMS log with.<br/>0: Error<br/>1: Warning<br/>2: Info<br/>3: Debug<br/>4: Verbose<br/> | |
| `message` | *String* | :heavy_check_mark: | The text of the message to write to the log. | Test log message |
| `source` | *String* | :heavy_check_mark: | a string indicating the source of the message. | Postman |
| Parameter | Type | Required | Description |
| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ |
| `request` | [byte[]](../../models//.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[LogLineResponse](../../models/operations/LogLineResponse.md)**
**[WriteLogResponse](../../models/operations/WriteLogResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------------------------- | --------------------------------- | --------------------------------- |
| models/errors/LogLineBadRequest | 400 | application/json |
| models/errors/LogLineUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## logMultiLine
## writeMessage
This endpoint allows for the batch addition of log entries to the main Plex Media Server log.
It accepts a text/plain request body, where each line represents a distinct log entry.
Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'.
This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.
Log entries are separated by a newline character (`\n`).
Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters.
This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests.
The 'level' parameter specifies the log entry's severity or importance, with the following integer values:
- `0`: Error - Critical issues that require immediate attention.
- `1`: Warning - Important events that are not critical but may indicate potential issues.
- `2`: Info - General informational messages about system operation.
- `3`: Debug - Detailed information useful for debugging purposes.
- `4`: Verbose - Highly detailed diagnostic information for in-depth analysis.
The 'message' parameter contains the log text, and 'source' identifies the log message's origin (e.g., an application name or module).
Example of a single log entry format:
`level=4&message=Sample%20log%20entry&source=applicationName`
Ensure each parameter is properly URL-encoded to avoid interpretation issues.
Note: This endpoint responds to all HTTP verbs **except POST** but PUT is preferred
### Example Usage
<!-- UsageSnippet language="java" operationID="logMultiLine" method="post" path="/log" -->
<!-- UsageSnippet language="java" operationID="writeMessage" method="put" path="/log" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.LogMultiLineBadRequest;
import dev.plexapi.sdk.models.errors.LogMultiLineUnauthorized;
import dev.plexapi.sdk.models.operations.LogMultiLineResponse;
import dev.plexapi.sdk.models.operations.WriteMessageRequest;
import dev.plexapi.sdk.models.operations.WriteMessageResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
import java.lang.String;
public class Application {
public static void main(String[] args) throws LogMultiLineBadRequest, LogMultiLineUnauthorized, Exception {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
String req = "level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman\nlevel=1&message=Test%20message%203&source=postman";
WriteMessageRequest req = WriteMessageRequest.builder()
.build();
LogMultiLineResponse res = sdk.log().logMultiLine()
WriteMessageResponse res = sdk.log().writeMessage()
.request(req)
.call();
@@ -128,48 +114,63 @@ public class Application {
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ |
| `request` | [String](../../models//.md) | :heavy_check_mark: | The request object to use for the request. |
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `request` | [WriteMessageRequest](../../models/operations/WriteMessageRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[LogMultiLineResponse](../../models/operations/LogMultiLineResponse.md)**
**[WriteMessageResponse](../../models/operations/WriteMessageResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
| models/errors/LogMultiLineBadRequest | 400 | application/json |
| models/errors/LogMultiLineUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## enablePaperTrail
## enablePapertrail
This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time.
This endpoint will enable all Plex Media Server logs to be sent to the Papertrail networked logging site for a period of time
Note: This endpoint responds to all HTTP verbs but POST is preferred
### Example Usage
<!-- UsageSnippet language="java" operationID="enablePaperTrail" method="get" path="/log/networked" -->
<!-- UsageSnippet language="java" operationID="enablePapertrail" method="post" path="/log/networked" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.EnablePaperTrailBadRequest;
import dev.plexapi.sdk.models.errors.EnablePaperTrailUnauthorized;
import dev.plexapi.sdk.models.operations.EnablePaperTrailResponse;
import dev.plexapi.sdk.models.operations.EnablePapertrailRequest;
import dev.plexapi.sdk.models.operations.EnablePapertrailResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws EnablePaperTrailBadRequest, EnablePaperTrailUnauthorized, Exception {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
EnablePaperTrailResponse res = sdk.log().enablePaperTrail()
EnablePapertrailRequest req = EnablePapertrailRequest.builder()
.build();
EnablePapertrailResponse res = sdk.log().enablePapertrail()
.request(req)
.call();
// handle response
@@ -177,14 +178,18 @@ public class Application {
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `request` | [EnablePapertrailRequest](../../models/operations/EnablePapertrailRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[EnablePaperTrailResponse](../../models/operations/EnablePaperTrailResponse.md)**
**[EnablePapertrailResponse](../../models/operations/EnablePapertrailResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ |
| models/errors/EnablePaperTrailBadRequest | 400 | application/json |
| models/errors/EnablePaperTrailUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -1,299 +0,0 @@
# Media
(*media()*)
## Overview
API Calls interacting with Plex Media Server Media
### Available Operations
* [markPlayed](#markplayed) - Mark Media Played
* [markUnplayed](#markunplayed) - Mark Media Unplayed
* [updatePlayProgress](#updateplayprogress) - Update Media Play Progress
* [getBannerImage](#getbannerimage) - Get Banner Image
* [getThumbImage](#getthumbimage) - Get Thumb Image
## markPlayed
This will mark the provided media key as Played.
### Example Usage
<!-- UsageSnippet language="java" operationID="markPlayed" method="get" path="/:/scrobble" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.MarkPlayedBadRequest;
import dev.plexapi.sdk.models.errors.MarkPlayedUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
MarkPlayedResponse res = sdk.media().markPlayed()
.key(59398d)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- |
| `key` | *double* | :heavy_check_mark: | The media key to mark as played | 59398 |
### Response
**[MarkPlayedResponse](../../models/operations/MarkPlayedResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------ | ------------------------------------ | ------------------------------------ |
| models/errors/MarkPlayedBadRequest | 400 | application/json |
| models/errors/MarkPlayedUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## markUnplayed
This will mark the provided media key as Unplayed.
### Example Usage
<!-- UsageSnippet language="java" operationID="markUnplayed" method="get" path="/:/unscrobble" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.MarkUnplayedBadRequest;
import dev.plexapi.sdk.models.errors.MarkUnplayedUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
MarkUnplayedResponse res = sdk.media().markUnplayed()
.key(59398d)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- |
| `key` | *double* | :heavy_check_mark: | The media key to mark as Unplayed | 59398 |
### Response
**[MarkUnplayedResponse](../../models/operations/MarkUnplayedResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
| models/errors/MarkUnplayedBadRequest | 400 | application/json |
| models/errors/MarkUnplayedUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## updatePlayProgress
This API command can be used to update the play progress of a media item.
### Example Usage
<!-- UsageSnippet language="java" operationID="updatePlayProgress" method="post" path="/:/progress" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.UpdatePlayProgressBadRequest;
import dev.plexapi.sdk.models.errors.UpdatePlayProgressUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
UpdatePlayProgressResponse res = sdk.media().updatePlayProgress()
.key("<key>")
.time(90000d)
.state("played")
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `key` | *String* | :heavy_check_mark: | the media key | |
| `time` | *double* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | 90000 |
| `state` | *String* | :heavy_check_mark: | The playback state of the media item. | played |
### Response
**[UpdatePlayProgressResponse](../../models/operations/UpdatePlayProgressResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| models/errors/UpdatePlayProgressBadRequest | 400 | application/json |
| models/errors/UpdatePlayProgressUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getBannerImage
Gets the banner image of the media item
### Example Usage
<!-- UsageSnippet language="java" operationID="get-banner-image" method="get" path="/library/metadata/{ratingKey}/banner" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetBannerImageBadRequest;
import dev.plexapi.sdk.models.errors.GetBannerImageUnauthorized;
import dev.plexapi.sdk.models.operations.GetBannerImageRequest;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.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
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `request` | [GetBannerImageRequest](../../models/operations/GetBannerImageRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetBannerImageResponse](../../models/operations/GetBannerImageResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
| models/errors/GetBannerImageBadRequest | 400 | application/json |
| models/errors/GetBannerImageUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getThumbImage
Gets the thumbnail image of the media item
### Example Usage
<!-- UsageSnippet language="java" operationID="get-thumb-image" method="get" path="/library/metadata/{ratingKey}/thumb" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetThumbImageBadRequest;
import dev.plexapi.sdk.models.errors.GetThumbImageUnauthorized;
import dev.plexapi.sdk.models.operations.GetThumbImageRequest;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.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
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `request` | [GetThumbImageRequest](../../models/operations/GetThumbImageRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetThumbImageResponse](../../models/operations/GetThumbImageResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------------------------------- | --------------------------------------- | --------------------------------------- |
| models/errors/GetThumbImageBadRequest | 400 | application/json |
| models/errors/GetThumbImageUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -0,0 +1,210 @@
# Playlist
(*playlist()*)
## Overview
Media playlists that can be created and played back
### Available Operations
* [listPlaylists](#listplaylists) - List playlists
* [getPlaylist](#getplaylist) - Retrieve Playlist
* [getPlaylistItems](#getplaylistitems) - Retrieve Playlist Contents
## listPlaylists
Gets a list of playlists and playlist folders for a user. General filters are permitted, such as `sort=lastViewedAt:desc`. A flat playlist list can be retrieved using `type=15` to limit the collection to just playlists.
### Example Usage
<!-- UsageSnippet language="java" operationID="listPlaylists" method="get" path="/playlists" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ListPlaylistsRequest;
import dev.plexapi.sdk.models.operations.ListPlaylistsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ListPlaylistsRequest req = ListPlaylistsRequest.builder()
.build();
ListPlaylistsResponse res = sdk.playlist().listPlaylists()
.request(req)
.call();
if (res.mediaContainerWithPlaylistMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `request` | [ListPlaylistsRequest](../../models/operations/ListPlaylistsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ListPlaylistsResponse](../../models/operations/ListPlaylistsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getPlaylist
Gets detailed metadata for a playlist. A playlist for many purposes (rating, editing metadata, tagging), can be treated like a regular metadata item:
Smart playlist details contain the `content` attribute. This is the content URI for the generator. This can then be parsed by a client to provide smart playlist editing.
### Example Usage
<!-- UsageSnippet language="java" operationID="getPlaylist" method="get" path="/playlists/{playlistId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetPlaylistRequest;
import dev.plexapi.sdk.models.operations.GetPlaylistResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetPlaylistRequest req = GetPlaylistRequest.builder()
.playlistId(841953L)
.build();
GetPlaylistResponse res = sdk.playlist().getPlaylist()
.request(req)
.call();
if (res.mediaContainerWithPlaylistMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `request` | [GetPlaylistRequest](../../models/operations/GetPlaylistRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetPlaylistResponse](../../models/operations/GetPlaylistResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getPlaylistItems
Gets the contents of a playlist. Should be paged by clients via standard mechanisms. By default leaves are returned (e.g. episodes, movies). In order to return other types you can use the `type` parameter. For example, you could use this to display a list of recently added albums vis a smart playlist. Note that for dumb playlists, items have a `playlistItemID` attribute which is used for deleting or moving items.
### Example Usage
<!-- UsageSnippet language="java" operationID="getPlaylistItems" method="get" path="/playlists/{playlistId}/items" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetPlaylistItemsRequest;
import dev.plexapi.sdk.models.operations.GetPlaylistItemsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetPlaylistItemsRequest req = GetPlaylistItemsRequest.builder()
.playlistId(118195L)
.build();
GetPlaylistItemsResponse res = sdk.playlist().getPlaylistItems()
.request(req)
.call();
if (res.mediaContainerWithMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `request` | [GetPlaylistItemsRequest](../../models/operations/GetPlaylistItemsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetPlaylistItemsResponse](../../models/operations/GetPlaylistItemsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -1,527 +0,0 @@
# Playlists
(*playlists()*)
## Overview
Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017").
They can be organized in (optionally nesting) folders.
Retrieving a playlist, or its items, will trigger a refresh of its metadata.
This may cause the duration and number of items to change.
### Available Operations
* [createPlaylist](#createplaylist) - Create a Playlist
* [getPlaylists](#getplaylists) - Get All Playlists
* [getPlaylist](#getplaylist) - Retrieve Playlist
* [deletePlaylist](#deleteplaylist) - Deletes a Playlist
* [updatePlaylist](#updateplaylist) - Update a Playlist
* [getPlaylistContents](#getplaylistcontents) - Retrieve Playlist Contents
* [clearPlaylistContents](#clearplaylistcontents) - Delete Playlist Contents
* [addPlaylistContents](#addplaylistcontents) - Adding to a Playlist
* [uploadPlaylist](#uploadplaylist) - Upload Playlist
## createPlaylist
Create a new playlist. By default the playlist is blank. To create a playlist along with a first item, pass:
- `uri` - The content URI for what we're playing (e.g. `server://1234/com.plexapp.plugins.library/library/metadata/1`).
- `playQueueID` - To create a playlist from an existing play queue.
### Example Usage
<!-- UsageSnippet language="java" operationID="createPlaylist" method="post" path="/playlists" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.CreatePlaylistBadRequest;
import dev.plexapi.sdk.models.errors.CreatePlaylistUnauthorized;
import dev.plexapi.sdk.models.operations.*;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws CreatePlaylistBadRequest, CreatePlaylistUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
CreatePlaylistRequest req = CreatePlaylistRequest.builder()
.title("<value>")
.type(CreatePlaylistQueryParamType.AUDIO)
.smart(Smart.ONE)
.uri("https://short-term-disconnection.name/")
.build();
CreatePlaylistResponse res = sdk.playlists().createPlaylist()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `request` | [CreatePlaylistRequest](../../models/operations/CreatePlaylistRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[CreatePlaylistResponse](../../models/operations/CreatePlaylistResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
| models/errors/CreatePlaylistBadRequest | 400 | application/json |
| models/errors/CreatePlaylistUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getPlaylists
Get All Playlists given the specified filters.
### Example Usage
<!-- UsageSnippet language="java" operationID="getPlaylists" method="get" path="/playlists" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetPlaylistsBadRequest;
import dev.plexapi.sdk.models.errors.GetPlaylistsUnauthorized;
import dev.plexapi.sdk.models.operations.GetPlaylistsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws GetPlaylistsBadRequest, GetPlaylistsUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetPlaylistsResponse res = sdk.playlists().getPlaylists()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
| `playlistType` | [Optional\<PlaylistType>](../../models/operations/PlaylistType.md) | :heavy_minus_sign: | limit to a type of playlist. |
| `smart` | [Optional\<QueryParamSmart>](../../models/operations/QueryParamSmart.md) | :heavy_minus_sign: | type of playlists to return (default is all). |
### Response
**[GetPlaylistsResponse](../../models/operations/GetPlaylistsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
| models/errors/GetPlaylistsBadRequest | 400 | application/json |
| models/errors/GetPlaylistsUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getPlaylist
Gets detailed metadata for a playlist. A playlist for many purposes (rating, editing metadata, tagging), can be treated like a regular metadata item:
Smart playlist details contain the `content` attribute. This is the content URI for the generator. This can then be parsed by a client to provide smart playlist editing.
### Example Usage
<!-- UsageSnippet language="java" operationID="getPlaylist" method="get" path="/playlists/{playlistID}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetPlaylistBadRequest;
import dev.plexapi.sdk.models.errors.GetPlaylistUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetPlaylistResponse res = sdk.playlists().getPlaylist()
.playlistID(8419.53)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------- | ---------------------- | ---------------------- | ---------------------- |
| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist |
### Response
**[GetPlaylistResponse](../../models/operations/GetPlaylistResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------- | ------------------------------------- | ------------------------------------- |
| models/errors/GetPlaylistBadRequest | 400 | application/json |
| models/errors/GetPlaylistUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## deletePlaylist
This endpoint will delete a playlist
### Example Usage
<!-- UsageSnippet language="java" operationID="deletePlaylist" method="delete" path="/playlists/{playlistID}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.DeletePlaylistBadRequest;
import dev.plexapi.sdk.models.errors.DeletePlaylistUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
DeletePlaylistResponse res = sdk.playlists().deletePlaylist()
.playlistID(3432.93)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------- | ---------------------- | ---------------------- | ---------------------- |
| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist |
### Response
**[DeletePlaylistResponse](../../models/operations/DeletePlaylistResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
| models/errors/DeletePlaylistBadRequest | 400 | application/json |
| models/errors/DeletePlaylistUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## updatePlaylist
From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via `PUT /library/metadata/{playlistID}`
### Example Usage
<!-- UsageSnippet language="java" operationID="updatePlaylist" method="put" path="/playlists/{playlistID}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.UpdatePlaylistBadRequest;
import dev.plexapi.sdk.models.errors.UpdatePlaylistUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
UpdatePlaylistResponse res = sdk.playlists().updatePlaylist()
.playlistID(1579.66)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist |
| `title` | *Optional\<String>* | :heavy_minus_sign: | name of the playlist |
| `summary` | *Optional\<String>* | :heavy_minus_sign: | summary description of the playlist |
### Response
**[UpdatePlaylistResponse](../../models/operations/UpdatePlaylistResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
| models/errors/UpdatePlaylistBadRequest | 400 | application/json |
| models/errors/UpdatePlaylistUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getPlaylistContents
Gets the contents of a playlist. Should be paged by clients via standard mechanisms.
By default leaves are returned (e.g. episodes, movies). In order to return other types you can use the `type` parameter.
For example, you could use this to display a list of recently added albums vis a smart playlist.
Note that for dumb playlists, items have a `playlistItemID` attribute which is used for deleting or moving items.
### Example Usage
<!-- UsageSnippet language="java" operationID="getPlaylistContents" method="get" path="/playlists/{playlistID}/items" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetPlaylistContentsBadRequest;
import dev.plexapi.sdk.models.errors.GetPlaylistContentsUnauthorized;
import dev.plexapi.sdk.models.operations.GetPlaylistContentsQueryParamType;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents()
.playlistID(5535.42)
.type(GetPlaylistContentsQueryParamType.TvShow)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist | |
| `type` | [GetPlaylistContentsQueryParamType](../../models/operations/GetPlaylistContentsQueryParamType.md) | :heavy_check_mark: | The type of media to retrieve or filter by.<br/>1 = movie<br/>2 = show<br/>3 = season<br/>4 = episode<br/>E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/> | 2 |
### Response
**[GetPlaylistContentsResponse](../../models/operations/GetPlaylistContentsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- |
| models/errors/GetPlaylistContentsBadRequest | 400 | application/json |
| models/errors/GetPlaylistContentsUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## clearPlaylistContents
Clears a playlist, only works with dumb playlists. Returns the playlist.
### Example Usage
<!-- UsageSnippet language="java" operationID="clearPlaylistContents" method="delete" path="/playlists/{playlistID}/items" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.ClearPlaylistContentsBadRequest;
import dev.plexapi.sdk.models.errors.ClearPlaylistContentsUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents()
.playlistID(4137.37)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------- | ---------------------- | ---------------------- | ---------------------- |
| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist |
### Response
**[ClearPlaylistContentsResponse](../../models/operations/ClearPlaylistContentsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- |
| models/errors/ClearPlaylistContentsBadRequest | 400 | application/json |
| models/errors/ClearPlaylistContentsUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## addPlaylistContents
Adds a generator to a playlist, same parameters as the POST to create. With a dumb playlist, this adds the specified items to the playlist.
With a smart playlist, passing a new `uri` parameter replaces the rules for the playlist. Returns the playlist.
### Example Usage
<!-- UsageSnippet language="java" operationID="addPlaylistContents" method="put" path="/playlists/{playlistID}/items" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.AddPlaylistContentsBadRequest;
import dev.plexapi.sdk.models.errors.AddPlaylistContentsUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents()
.playlistID(7013.44)
.uri("server://12345/com.plexapp.plugins.library/library/metadata/1")
.playQueueID(123d)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist | |
| `uri` | *String* | :heavy_check_mark: | the content URI for the playlist | server://12345/com.plexapp.plugins.library/library/metadata/1 |
| `playQueueID` | *Optional\<Double>* | :heavy_minus_sign: | the play queue to add to a playlist | 123 |
### Response
**[AddPlaylistContentsResponse](../../models/operations/AddPlaylistContentsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- |
| models/errors/AddPlaylistContentsBadRequest | 400 | application/json |
| models/errors/AddPlaylistContentsUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## uploadPlaylist
Imports m3u playlists by passing a path on the server to scan for m3u-formatted playlist files, or a path to a single playlist file.
### Example Usage
<!-- UsageSnippet language="java" operationID="uploadPlaylist" method="post" path="/playlists/upload" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.UploadPlaylistBadRequest;
import dev.plexapi.sdk.models.errors.UploadPlaylistUnauthorized;
import dev.plexapi.sdk.models.operations.QueryParamForce;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
UploadPlaylistResponse res = sdk.playlists().uploadPlaylist()
.path("/home/barkley/playlist.m3u")
.force(QueryParamForce.ONE)
.sectionID(1L)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `path` | *String* | :heavy_check_mark: | absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.<br/>If the `path` argument is a directory, that path will be scanned for playlist files to be processed.<br/>Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.<br/>The GUID of each playlist is based on the filename.<br/>If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.<br/>The GUID of each playlist is based on the filename.<br/> | /home/barkley/playlist.m3u |
| `force` | [QueryParamForce](../../models/operations/QueryParamForce.md) | :heavy_check_mark: | Force overwriting of duplicate playlists.<br/>By default, a playlist file uploaded with the same path will overwrite the existing playlist.<br/>The `force` argument is used to disable overwriting.<br/>If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.<br/> | |
| `sectionID` | *long* | :heavy_check_mark: | Possibly the section ID to upload the playlist to, we are not certain. | 1 |
### Response
**[UploadPlaylistResponse](../../models/operations/UploadPlaylistResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
| models/errors/UploadPlaylistBadRequest | 400 | application/json |
| models/errors/UploadPlaylistUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -0,0 +1,631 @@
# PlayQueue
(*playQueue()*)
## Overview
The playqueue feature within a media provider
A play queue represents the current list of media for playback. Although queues are persisted by the server, they should be regarded by the user as a fairly lightweight, an ephemeral list of items queued up for playback in a session. There is generally one active queue for each type of media (music, video, photos) that can be added to or destroyed and replaced with a fresh queue.
Play Queues has a region, which we refer to in this doc (partially for historical reasons) as "Up Next". This region is defined by `playQueueLastAddedItemID` existing on the media container. This follows iTunes' terminology. It is a special region after the currently playing item but before the originally-played items. This enables "Party Mode" listening/viewing, where items can be added on-the-fly, and normal queue playback resumed when completed.
You can visualize the play queue as a sliding window in the complete list of media queued for playback. This model is important when scaling to larger play queues (e.g. shuffling 40,000 audio tracks). The client only needs visibility into small areas of the queue at any given time, and the server can optimize access in this fashion.
All created play queues will have an empty "Up Next" area - unless the item is an album and no `key` is provided. In this case the "Up Next" area will be populated by the contents of the album. This is to allow queueing of multiple albums - since the 'Add to Up Next' will insert after all the tracks. This means that If you're creating a PQ from an album, you can only shuffle it if you set `key`. This is due to the above implicit queueing of albums when no `key` is provided as well as the current limitation that you cannot shuffle a PQ with an "Up Next" area.
The play queue window advances as the server receives timeline requests. The client needs to retrieve the play queue as the “now playing” item changes. There is no play queue API to update the playing item.
### Available Operations
* [createPlayQueue](#createplayqueue) - Create a play queue
* [getPlayQueue](#getplayqueue) - Retrieve a play queue
* [addToPlayQueue](#addtoplayqueue) - Add a generator or playlist to a play queue
* [clearPlayQueue](#clearplayqueue) - Clear a play queue
* [resetPlayQueue](#resetplayqueue) - Reset a play queue
* [shuffle](#shuffle) - Shuffle a play queue
* [unshuffle](#unshuffle) - Unshuffle a play queue
* [deletePlayQueueItem](#deleteplayqueueitem) - Delete an item from a play queue
* [movePlayQueueItem](#moveplayqueueitem) - Move an item in a play queue
## createPlayQueue
Makes a new play queue for a device. The source of the playqueue can either be a URI, or a playlist. The response is a media container with the initial items in the queue. Each item in the queue will be a regular item but with `playQueueItemID` - a unique ID since the queue could have repeated items with the same `ratingKey`.
Note: Either `uri` or `playlistID` must be specified
### Example Usage
<!-- UsageSnippet language="java" operationID="createPlayQueue" method="post" path="/playQueues" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.*;
import dev.plexapi.sdk.models.shared.Accepts;
import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
CreatePlayQueueRequest req = CreatePlayQueueRequest.builder()
.type(Type.AUDIO)
.shuffle(BoolInt.ONE)
.repeat(BoolInt.ONE)
.continuous(BoolInt.ONE)
.recursive(BoolInt.ONE)
.onDeck(BoolInt.ONE)
.build();
CreatePlayQueueResponse res = sdk.playQueue().createPlayQueue()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `request` | [CreatePlayQueueRequest](../../models/operations/CreatePlayQueueRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[CreatePlayQueueResponse](../../models/operations/CreatePlayQueueResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getPlayQueue
Retrieves the play queue, centered at current item. This can be treated as a regular container by play queue-oblivious clients, but they may wish to request a large window onto the queue since they won't know to refresh.
### Example Usage
<!-- UsageSnippet language="java" operationID="getPlayQueue" method="get" path="/playQueues/{playQueueId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetPlayQueueRequest;
import dev.plexapi.sdk.models.operations.GetPlayQueueResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetPlayQueueRequest req = GetPlayQueueRequest.builder()
.playQueueId(210646L)
.own(BoolInt.ONE)
.includeBefore(BoolInt.ONE)
.includeAfter(BoolInt.ONE)
.build();
GetPlayQueueResponse res = sdk.playQueue().getPlayQueue()
.request(req)
.call();
if (res.mediaContainerWithPlaylistMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `request` | [GetPlayQueueRequest](../../models/operations/GetPlayQueueRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetPlayQueueResponse](../../models/operations/GetPlayQueueResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## addToPlayQueue
Adds an item to a play queue (e.g. party mode). Increments the version of the play queue. Takes the following parameters (`uri` and `playlistID` are mutually exclusive). Returns the modified play queue.
### Example Usage
<!-- UsageSnippet language="java" operationID="addToPlayQueue" method="put" path="/playQueues/{playQueueId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.AddToPlayQueueRequest;
import dev.plexapi.sdk.models.operations.AddToPlayQueueResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
AddToPlayQueueRequest req = AddToPlayQueueRequest.builder()
.playQueueId(919248L)
.next(BoolInt.ONE)
.build();
AddToPlayQueueResponse res = sdk.playQueue().addToPlayQueue()
.request(req)
.call();
if (res.mediaContainerWithPlaylistMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `request` | [AddToPlayQueueRequest](../../models/operations/AddToPlayQueueRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[AddToPlayQueueResponse](../../models/operations/AddToPlayQueueResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## clearPlayQueue
Deletes all items in the play queue, and increases the version of the play queue.
### Example Usage
<!-- UsageSnippet language="java" operationID="clearPlayQueue" method="delete" path="/playQueues/{playQueueId}/items" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ClearPlayQueueRequest;
import dev.plexapi.sdk.models.operations.ClearPlayQueueResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ClearPlayQueueRequest req = ClearPlayQueueRequest.builder()
.playQueueId(86357L)
.build();
ClearPlayQueueResponse res = sdk.playQueue().clearPlayQueue()
.request(req)
.call();
if (res.mediaContainerWithPlaylistMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `request` | [ClearPlayQueueRequest](../../models/operations/ClearPlayQueueRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ClearPlayQueueResponse](../../models/operations/ClearPlayQueueResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## resetPlayQueue
Reset a play queue to the first item being the current item
### Example Usage
<!-- UsageSnippet language="java" operationID="resetPlayQueue" method="put" path="/playQueues/{playQueueId}/reset" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ResetPlayQueueRequest;
import dev.plexapi.sdk.models.operations.ResetPlayQueueResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ResetPlayQueueRequest req = ResetPlayQueueRequest.builder()
.playQueueId(581891L)
.build();
ResetPlayQueueResponse res = sdk.playQueue().resetPlayQueue()
.request(req)
.call();
if (res.mediaContainerWithPlaylistMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `request` | [ResetPlayQueueRequest](../../models/operations/ResetPlayQueueRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ResetPlayQueueResponse](../../models/operations/ResetPlayQueueResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## shuffle
Shuffle a play queue (or reshuffles if already shuffled). The currently selected item is maintained. Note that this is currently only supported for play queues *without* an Up Next area. Returns the modified play queue.
### Example Usage
<!-- UsageSnippet language="java" operationID="shuffle" method="put" path="/playQueues/{playQueueId}/shuffle" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ShuffleRequest;
import dev.plexapi.sdk.models.operations.ShuffleResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ShuffleRequest req = ShuffleRequest.builder()
.playQueueId(316150L)
.build();
ShuffleResponse res = sdk.playQueue().shuffle()
.request(req)
.call();
if (res.mediaContainerWithPlaylistMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| `request` | [ShuffleRequest](../../models/operations/ShuffleRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ShuffleResponse](../../models/operations/ShuffleResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## unshuffle
Unshuffles a play queue and restores "natural order". Note that this is currently only supported for play queues *without* an Up Next area. Returns the modified play queue.
### Example Usage
<!-- UsageSnippet language="java" operationID="unshuffle" method="put" path="/playQueues/{playQueueId}/unshuffle" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.UnshuffleRequest;
import dev.plexapi.sdk.models.operations.UnshuffleResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
UnshuffleRequest req = UnshuffleRequest.builder()
.playQueueId(484388L)
.build();
UnshuffleResponse res = sdk.playQueue().unshuffle()
.request(req)
.call();
if (res.mediaContainerWithPlaylistMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| `request` | [UnshuffleRequest](../../models/operations/UnshuffleRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[UnshuffleResponse](../../models/operations/UnshuffleResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## deletePlayQueueItem
Deletes an item in a play queue. Increments the version of the play queue. Returns the modified play queue.
### Example Usage
<!-- UsageSnippet language="java" operationID="deletePlayQueueItem" method="delete" path="/playQueues/{playQueueId}/items/{playQueueItemId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.DeletePlayQueueItemRequest;
import dev.plexapi.sdk.models.operations.DeletePlayQueueItemResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
DeletePlayQueueItemRequest req = DeletePlayQueueItemRequest.builder()
.playQueueId(285738L)
.playQueueItemId(464354L)
.build();
DeletePlayQueueItemResponse res = sdk.playQueue().deletePlayQueueItem()
.request(req)
.call();
if (res.mediaContainerWithPlaylistMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `request` | [DeletePlayQueueItemRequest](../../models/operations/DeletePlayQueueItemRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[DeletePlayQueueItemResponse](../../models/operations/DeletePlayQueueItemResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## movePlayQueueItem
Moves an item in a play queue, and increases the version of the play queue. Returns the modified play queue.
### Example Usage
<!-- UsageSnippet language="java" operationID="movePlayQueueItem" method="put" path="/playQueues/{playQueueId}/items/{playQueueItemId}/move" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.MovePlayQueueItemRequest;
import dev.plexapi.sdk.models.operations.MovePlayQueueItemResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
MovePlayQueueItemRequest req = MovePlayQueueItemRequest.builder()
.playQueueId(31341L)
.playQueueItemId(495865L)
.build();
MovePlayQueueItemResponse res = sdk.playQueue().movePlayQueueItem()
.request(req)
.call();
if (res.mediaContainerWithPlaylistMetadata().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `request` | [MovePlayQueueItemRequest](../../models/operations/MovePlayQueueItemRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[MovePlayQueueItemResponse](../../models/operations/MovePlayQueueItemResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -1,401 +0,0 @@
# Plex
(*plex()*)
## Overview
API Calls that perform operations directly against https://Plex.tv
### Available Operations
* [getCompanionsData](#getcompanionsdata) - Get Companions Data
* [getUserFriends](#getuserfriends) - Get list of friends of the user logged in
* [getGeoData](#getgeodata) - Get Geo Data
* [getHomeData](#gethomedata) - Get Plex Home Data
* [getServerResources](#getserverresources) - Get Server Resources
* [getPin](#getpin) - Get a Pin
* [getTokenByPinId](#gettokenbypinid) - Get Access Token by PinId
## getCompanionsData
Get Companions Data
### Example Usage
<!-- UsageSnippet language="java" operationID="getCompanionsData" method="get" path="/companions" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetCompanionsDataBadRequest;
import dev.plexapi.sdk.models.errors.GetCompanionsDataUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetCompanionsDataResponse res = sdk.plex().getCompanionsData()
.call();
if (res.responseBodies().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ |
| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**[GetCompanionsDataResponse](../../models/operations/GetCompanionsDataResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- |
| models/errors/GetCompanionsDataBadRequest | 400 | application/json |
| models/errors/GetCompanionsDataUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getUserFriends
Get friends of provided auth token.
### Example Usage
<!-- UsageSnippet language="java" operationID="getUserFriends" method="get" path="/friends" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetUserFriendsBadRequest;
import dev.plexapi.sdk.models.errors.GetUserFriendsUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetUserFriendsResponse res = sdk.plex().getUserFriends()
.call();
if (res.friends().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ |
| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**[GetUserFriendsResponse](../../models/operations/GetUserFriendsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
| models/errors/GetUserFriendsBadRequest | 400 | application/json |
| models/errors/GetUserFriendsUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getGeoData
Returns the geolocation and locale data of the caller
### Example Usage
<!-- UsageSnippet language="java" operationID="getGeoData" method="get" path="/geoip" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetGeoDataBadRequest;
import dev.plexapi.sdk.models.errors.GetGeoDataUnauthorized;
import dev.plexapi.sdk.models.operations.GetGeoDataResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws GetGeoDataBadRequest, GetGeoDataUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder()
.build();
GetGeoDataResponse res = sdk.plex().getGeoData()
.call();
if (res.geoData().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ |
| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**[GetGeoDataResponse](../../models/operations/GetGeoDataResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------ | ------------------------------------ | ------------------------------------ |
| models/errors/GetGeoDataBadRequest | 400 | application/json |
| models/errors/GetGeoDataUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getHomeData
Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status.
### Example Usage
<!-- UsageSnippet language="java" operationID="getHomeData" method="get" path="/home" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetHomeDataBadRequest;
import dev.plexapi.sdk.models.errors.GetHomeDataUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetHomeDataResponse res = sdk.plex().getHomeData()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[GetHomeDataResponse](../../models/operations/GetHomeDataResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------- | ------------------------------------- | ------------------------------------- |
| models/errors/GetHomeDataBadRequest | 400 | application/json |
| models/errors/GetHomeDataUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getServerResources
Get Plex server access tokens and server connections
### Example Usage
<!-- UsageSnippet language="java" operationID="get-server-resources" method="get" path="/resources" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetServerResourcesBadRequest;
import dev.plexapi.sdk.models.errors.GetServerResourcesUnauthorized;
import dev.plexapi.sdk.models.operations.*;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws GetServerResourcesBadRequest, GetServerResourcesUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetServerResourcesResponse res = sdk.plex().getServerResources()
.includeHttps(IncludeHttps.Enable)
.includeRelay(IncludeRelay.Enable)
.includeIPv6(IncludeIPv6.Enable)
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.call();
if (res.plexDevices().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| `includeHttps` | [Optional\<IncludeHttps>](../../models/operations/IncludeHttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 |
| `includeRelay` | [Optional\<IncludeRelay>](../../models/operations/IncludeRelay.md) | :heavy_minus_sign: | Include Relay addresses in the results <br/>E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400<br/> | 1 |
| `includeIPv6` | [Optional\<IncludeIPv6>](../../models/operations/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 |
| `clientID` | *String* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 |
| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 |
### Response
**[GetServerResourcesResponse](../../models/operations/GetServerResourcesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| models/errors/GetServerResourcesBadRequest | 400 | application/json |
| models/errors/GetServerResourcesUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getPin
Retrieve a Pin ID from Plex.tv to use for authentication flows
### Example Usage
<!-- UsageSnippet language="java" operationID="getPin" method="post" path="/pins" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetPinBadRequest;
import dev.plexapi.sdk.models.operations.GetPinRequest;
import dev.plexapi.sdk.models.operations.GetPinResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws GetPinBadRequest, Exception {
PlexAPI sdk = PlexAPI.builder()
.build();
GetPinRequest req = GetPinRequest.builder()
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.deviceNickname("Roku 3")
.clientVersion("2.4.1")
.platform("Roku")
.build();
GetPinResponse res = sdk.plex().getPin()
.request(req)
.call();
if (res.authPinContainer().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- |
| `request` | [GetPinRequest](../../models/operations/GetPinRequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**[GetPinResponse](../../models/operations/GetPinResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------ | ------------------------------ | ------------------------------ |
| models/errors/GetPinBadRequest | 400 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getTokenByPinId
Retrieve an Access Token from Plex.tv after the Pin has been authenticated
### Example Usage
<!-- UsageSnippet language="java" operationID="getTokenByPinId" method="get" path="/pins/{pinID}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetTokenByPinIdBadRequest;
import dev.plexapi.sdk.models.errors.GetTokenByPinIdResponseBody;
import dev.plexapi.sdk.models.operations.GetTokenByPinIdRequest;
import dev.plexapi.sdk.models.operations.GetTokenByPinIdResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws GetTokenByPinIdBadRequest, GetTokenByPinIdResponseBody, Exception {
PlexAPI sdk = PlexAPI.builder()
.build();
GetTokenByPinIdRequest req = GetTokenByPinIdRequest.builder()
.pinID(232248L)
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.clientName("Plex for Roku")
.deviceNickname("Roku 3")
.clientVersion("2.4.1")
.platform("Roku")
.build();
GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId()
.request(req)
.call();
if (res.authPinContainer().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `request` | [GetTokenByPinIdRequest](../../models/operations/GetTokenByPinIdRequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**[GetTokenByPinIdResponse](../../models/operations/GetTokenByPinIdResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
| models/errors/GetTokenByPinIdBadRequest | 400 | application/json |
| models/errors/GetTokenByPinIdResponseBody | 404 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -2,30 +2,4 @@
## Overview
# Plex Media Server OpenAPI Specification
An Open Source OpenAPI Specification for Plex Media Server
Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/)
## Documentation
[API Documentation](https://plexapi.dev)
## SDKs
The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the [main specification Repository](https://github.com/LukeHagar/plex-api-spec).
| Language | Repository | Releases | Other |
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - |
| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - |
| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) |
| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - |
| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
### Available Operations

View File

@@ -0,0 +1,183 @@
# Preferences
(*preferences()*)
## Overview
API Operations against the Preferences
### Available Operations
* [getAllPreferences](#getallpreferences) - Get all preferences
* [setPreferences](#setpreferences) - Set preferences
* [getPreference](#getpreference) - Get a preferences
## getAllPreferences
Get the list of all preferences
### Example Usage
<!-- UsageSnippet language="java" operationID="getAllPreferences" method="get" path="/:/prefs" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetAllPreferencesResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetAllPreferencesResponse res = sdk.preferences().getAllPreferences()
.call();
if (res.mediaContainerWithSettings().isPresent()) {
// handle response
}
}
}
```
### Response
**[GetAllPreferencesResponse](../../models/operations/GetAllPreferencesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## setPreferences
Set a set of preferences in query parameters
### Example Usage
<!-- UsageSnippet language="java" operationID="setPreferences" method="put" path="/:/prefs" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.*;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
SetPreferencesRequest req = SetPreferencesRequest.builder()
.prefs(Prefs.builder()
.build())
.build();
SetPreferencesResponse res = sdk.preferences().setPreferences()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `request` | [SetPreferencesRequest](../../models/operations/SetPreferencesRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[SetPreferencesResponse](../../models/operations/SetPreferencesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getPreference
Get a single preference and value
### Example Usage
<!-- UsageSnippet language="java" operationID="getPreference" method="get" path="/:/prefs/get" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetPreferenceRequest;
import dev.plexapi.sdk.models.operations.GetPreferenceResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetPreferenceRequest req = GetPreferenceRequest.builder()
.build();
GetPreferenceResponse res = sdk.preferences().getPreference()
.request(req)
.call();
if (res.mediaContainerWithSettings().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `request` | [GetPreferenceRequest](../../models/operations/GetPreferenceRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetPreferenceResponse](../../models/operations/GetPreferenceResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -0,0 +1,223 @@
# Provider
(*provider()*)
## Overview
Media providers are the starting points for the entire Plex Media Server media library API. It defines the paths for the groups of endpoints. The `/media/providers` should be the only hard-coded path in clients when accessing the media library. Non-media library endpoints are outside the scope of the media provider. See the description in See [the section in API Info](#section/API-Info/Media-Providers) for more information on how to use media providers.
### Available Operations
* [listProviders](#listproviders) - Get the list of available media providers
* [addProvider](#addprovider) - Add a media provider
* [refreshProviders](#refreshproviders) - Refresh media providers
* [deleteMediaProvider](#deletemediaprovider) - Delete a media provider
## listProviders
Get the list of all available media providers for this PMS. This will generally include the library provider and possibly EPG if DVR is set up.
### Example Usage
<!-- UsageSnippet language="java" operationID="listProviders" method="get" path="/media/providers" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ListProvidersResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ListProvidersResponse res = sdk.provider().listProviders()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[ListProvidersResponse](../../models/operations/ListProvidersResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## addProvider
This endpoint registers a media provider with the server. Once registered, the media server acts as a reverse proxy to the provider, allowing both local and remote providers to work.
### Example Usage
<!-- UsageSnippet language="java" operationID="addProvider" method="post" path="/media/providers" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.AddProviderRequest;
import dev.plexapi.sdk.models.operations.AddProviderResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
AddProviderRequest req = AddProviderRequest.builder()
.url("https://steep-obedience.name/")
.build();
AddProviderResponse res = sdk.provider().addProvider()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `request` | [AddProviderRequest](../../models/operations/AddProviderRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[AddProviderResponse](../../models/operations/AddProviderResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## refreshProviders
Refresh all known media providers. This is useful in case a provider has updated features.
### Example Usage
<!-- UsageSnippet language="java" operationID="refreshProviders" method="post" path="/media/providers/refresh" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.RefreshProvidersResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
RefreshProvidersResponse res = sdk.provider().refreshProviders()
.call();
// handle response
}
}
```
### Response
**[RefreshProvidersResponse](../../models/operations/RefreshProvidersResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## deleteMediaProvider
Deletes a media provider with the given id
### Example Usage
<!-- UsageSnippet language="java" operationID="deleteMediaProvider" method="delete" path="/media/providers/{provider}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.DeleteMediaProviderRequest;
import dev.plexapi.sdk.models.operations.DeleteMediaProviderResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
DeleteMediaProviderRequest req = DeleteMediaProviderRequest.builder()
.provider("<value>")
.build();
DeleteMediaProviderResponse res = sdk.provider().deleteMediaProvider()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `request` | [DeleteMediaProviderRequest](../../models/operations/DeleteMediaProviderRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[DeleteMediaProviderResponse](../../models/operations/DeleteMediaProviderResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

77
docs/sdks/rate/README.md Normal file
View File

@@ -0,0 +1,77 @@
# Rate
(*rate()*)
## Overview
Operations for rating media items (thumbs up/down, star ratings, etc.)
### Available Operations
* [setRating](#setrating) - Rate an item
## setRating
Set the rating on an item.
This API does respond to the GET verb but applications should use PUT
### Example Usage
<!-- UsageSnippet language="java" operationID="setRating" method="put" path="/:/rate" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.SetRatingRequest;
import dev.plexapi.sdk.models.operations.SetRatingResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
SetRatingRequest req = SetRatingRequest.builder()
.identifier("<value>")
.key("<key>")
.rating(8722.46)
.build();
SetRatingResponse res = sdk.rate().setRating()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| `request` | [SetRatingRequest](../../models/operations/SetRatingRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[SetRatingResponse](../../models/operations/SetRatingResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -3,16 +3,16 @@
## Overview
API Calls that perform search operations with Plex Media Server
The search feature within a media provider
### Available Operations
* [performSearch](#performsearch) - Perform a search
* [performVoiceSearch](#performvoicesearch) - Perform a voice search
* [getSearchResults](#getsearchresults) - Get Search Results
* [searchHubs](#searchhubs) - Search Hub
* [voiceSearchHubs](#voicesearchhubs) - Voice Search Hub
## performSearch
## searchHubs
Perform a search and get the result as hubs
This endpoint performs a search across all library sections, or a single section, and returns matches as hubs, split up by type. It performs spell checking, looks for partial matches, and orders the hubs based on quality of results. In addition, based on matches, it will return other related matches (e.g. for a genre match, it may return movies in that genre, or for an actor match, movies with that actor).
@@ -30,138 +30,42 @@ This request is intended to be very fast, and called as the user types.
### Example Usage
<!-- UsageSnippet language="java" operationID="performSearch" method="get" path="/hubs/search" -->
<!-- UsageSnippet language="java" operationID="searchHubs" method="get" path="/hubs/search" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.PerformSearchBadRequest;
import dev.plexapi.sdk.models.errors.PerformSearchUnauthorized;
import dev.plexapi.sdk.models.operations.PerformSearchResponse;
import dev.plexapi.sdk.models.operations.SearchHubsRequest;
import dev.plexapi.sdk.models.operations.SearchHubsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PerformSearchBadRequest, PerformSearchUnauthorized, Exception {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
PerformSearchResponse res = sdk.search().performSearch()
.query("arnold")
.limit(5d)
.call();
SearchHubsRequest req = SearchHubsRequest.builder()
.query("<value>")
.sectionId(1L)
.build();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `query` | *String* | :heavy_check_mark: | The query term | arnold |
| `sectionId` | *Optional\<Double>* | :heavy_minus_sign: | This gives context to the search, and can result in re-ordering of search result hubs | |
| `limit` | *Optional\<Double>* | :heavy_minus_sign: | The number of items to return per hub | 5 |
### Response
**[PerformSearchResponse](../../models/operations/PerformSearchResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------------------------------- | --------------------------------------- | --------------------------------------- |
| models/errors/PerformSearchBadRequest | 400 | application/json |
| models/errors/PerformSearchUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## performVoiceSearch
This endpoint performs a search specifically tailored towards voice or other imprecise input which may work badly with the substring and spell-checking heuristics used by the `/hubs/search` endpoint.
It uses a [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) heuristic to search titles, and as such is much slower than the other search endpoint.
Whenever possible, clients should limit the search to the appropriate type.
Results, as well as their containing per-type hubs, contain a `distance` attribute which can be used to judge result quality.
### Example Usage
<!-- UsageSnippet language="java" operationID="performVoiceSearch" method="get" path="/hubs/search/voice" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.PerformVoiceSearchBadRequest;
import dev.plexapi.sdk.models.errors.PerformVoiceSearchUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
PerformVoiceSearchResponse res = sdk.search().performVoiceSearch()
.query("dead+poop")
.limit(5d)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `query` | *String* | :heavy_check_mark: | The query term | dead+poop |
| `sectionId` | *Optional\<Double>* | :heavy_minus_sign: | This gives context to the search, and can result in re-ordering of search result hubs | |
| `limit` | *Optional\<Double>* | :heavy_minus_sign: | The number of items to return per hub | 5 |
### Response
**[PerformVoiceSearchResponse](../../models/operations/PerformVoiceSearchResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| models/errors/PerformVoiceSearchBadRequest | 400 | application/json |
| models/errors/PerformVoiceSearchUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getSearchResults
This will search the database for the string provided.
### Example Usage
<!-- UsageSnippet language="java" operationID="getSearchResults" method="get" path="/search" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetSearchResultsBadRequest;
import dev.plexapi.sdk.models.errors.GetSearchResultsUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetSearchResultsResponse res = sdk.search().getSearchResults()
.query("110")
SearchHubsResponse res = sdk.search().searchHubs()
.request(req)
.call();
if (res.object().isPresent()) {
@@ -173,18 +77,87 @@ public class Application {
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ |
| `query` | *String* | :heavy_check_mark: | The search query string to use | 110 |
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
| `request` | [SearchHubsRequest](../../models/operations/SearchHubsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetSearchResultsResponse](../../models/operations/GetSearchResultsResponse.md)**
**[SearchHubsResponse](../../models/operations/SearchHubsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ |
| models/errors/GetSearchResultsBadRequest | 400 | application/json |
| models/errors/GetSearchResultsUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## voiceSearchHubs
Perform a search tailored to voice input and get the result as hubs
This endpoint performs a search specifically tailored towards voice or other imprecise input which may work badly with the substring and spell-checking heuristics used by the `/hubs/search` endpoint. It uses a [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) heuristic to search titles, and as such is much slower than the other search endpoint. Whenever possible, clients should limit the search to the appropriate type.
Results, as well as their containing per-type hubs, contain a `distance` attribute which can be used to judge result quality.
### Example Usage
<!-- UsageSnippet language="java" operationID="voiceSearchHubs" method="get" path="/hubs/search/voice" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.VoiceSearchHubsRequest;
import dev.plexapi.sdk.models.operations.VoiceSearchHubsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
VoiceSearchHubsRequest req = VoiceSearchHubsRequest.builder()
.query("<value>")
.build();
VoiceSearchHubsResponse res = sdk.search().voiceSearchHubs()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `request` | [VoiceSearchHubsRequest](../../models/operations/VoiceSearchHubsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[VoiceSearchHubsResponse](../../models/operations/VoiceSearchHubsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -1,453 +0,0 @@
# Server
(*server()*)
## Overview
Operations against the Plex Media Server System.
### Available Operations
* [getServerCapabilities](#getservercapabilities) - Get Server Capabilities
* [getServerPreferences](#getserverpreferences) - Get Server Preferences
* [getAvailableClients](#getavailableclients) - Get Available Clients
* [getDevices](#getdevices) - Get Devices
* [getServerIdentity](#getserveridentity) - Get Server Identity
* [getMyPlexAccount](#getmyplexaccount) - Get MyPlex Account
* [getResizedPhoto](#getresizedphoto) - Get a Resized Photo
* [getMediaProviders](#getmediaproviders) - Get Media Providers
* [getServerList](#getserverlist) - Get Server List
## getServerCapabilities
Get Server Capabilities
### Example Usage
<!-- UsageSnippet language="java" operationID="getServerCapabilities" method="get" path="/" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest;
import dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[GetServerCapabilitiesResponse](../../models/operations/GetServerCapabilitiesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- |
| models/errors/GetServerCapabilitiesBadRequest | 400 | application/json |
| models/errors/GetServerCapabilitiesUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getServerPreferences
Get Server Preferences
### Example Usage
<!-- UsageSnippet language="java" operationID="getServerPreferences" method="get" path="/:/prefs" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetServerPreferencesBadRequest;
import dev.plexapi.sdk.models.errors.GetServerPreferencesUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetServerPreferencesResponse res = sdk.server().getServerPreferences()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[GetServerPreferencesResponse](../../models/operations/GetServerPreferencesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
| models/errors/GetServerPreferencesBadRequest | 400 | application/json |
| models/errors/GetServerPreferencesUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getAvailableClients
Get Available Clients
### Example Usage
<!-- UsageSnippet language="java" operationID="getAvailableClients" method="get" path="/clients" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetAvailableClientsBadRequest;
import dev.plexapi.sdk.models.errors.GetAvailableClientsUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetAvailableClientsResponse res = sdk.server().getAvailableClients()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[GetAvailableClientsResponse](../../models/operations/GetAvailableClientsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- |
| models/errors/GetAvailableClientsBadRequest | 400 | application/json |
| models/errors/GetAvailableClientsUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getDevices
Get Devices
### Example Usage
<!-- UsageSnippet language="java" operationID="getDevices" method="get" path="/devices" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetDevicesBadRequest;
import dev.plexapi.sdk.models.errors.GetDevicesUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetDevicesResponse res = sdk.server().getDevices()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[GetDevicesResponse](../../models/operations/GetDevicesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------ | ------------------------------------ | ------------------------------------ |
| models/errors/GetDevicesBadRequest | 400 | application/json |
| models/errors/GetDevicesUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getServerIdentity
This request is useful to determine if the server is online or offline
### Example Usage
<!-- UsageSnippet language="java" operationID="get-server-identity" method="get" path="/identity" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetServerIdentityRequestTimeout;
import dev.plexapi.sdk.models.operations.GetServerIdentityResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws GetServerIdentityRequestTimeout, Exception {
PlexAPI sdk = PlexAPI.builder()
.build();
GetServerIdentityResponse res = sdk.server().getServerIdentity()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[GetServerIdentityResponse](../../models/operations/GetServerIdentityResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- |
| models/errors/GetServerIdentityRequestTimeout | 408 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getMyPlexAccount
Returns MyPlex Account Information
### Example Usage
<!-- UsageSnippet language="java" operationID="getMyPlexAccount" method="get" path="/myplex/account" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetMyPlexAccountBadRequest;
import dev.plexapi.sdk.models.errors.GetMyPlexAccountUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[GetMyPlexAccountResponse](../../models/operations/GetMyPlexAccountResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ |
| models/errors/GetMyPlexAccountBadRequest | 400 | application/json |
| models/errors/GetMyPlexAccountUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getResizedPhoto
Plex's Photo transcoder is used throughout the service to serve images at specified sizes.
### Example Usage
<!-- UsageSnippet language="java" operationID="getResizedPhoto" method="get" path="/photo/:/transcode" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetResizedPhotoBadRequest;
import dev.plexapi.sdk.models.errors.GetResizedPhotoUnauthorized;
import dev.plexapi.sdk.models.operations.*;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws GetResizedPhotoBadRequest, GetResizedPhotoUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetResizedPhotoRequest req = GetResizedPhotoRequest.builder()
.width(110d)
.height(165d)
.opacity(100L)
.blur(0d)
.minSize(MinSize.ZERO)
.upscale(Upscale.ZERO)
.url("/library/metadata/49564/thumb/1654258204")
.build();
GetResizedPhotoResponse res = sdk.server().getResizedPhoto()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `request` | [GetResizedPhotoRequest](../../models/operations/GetResizedPhotoRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetResizedPhotoResponse](../../models/operations/GetResizedPhotoResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
| models/errors/GetResizedPhotoBadRequest | 400 | application/json |
| models/errors/GetResizedPhotoUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getMediaProviders
Retrieves media providers and their features from the Plex server.
### Example Usage
<!-- UsageSnippet language="java" operationID="get-media-providers" method="get" path="/media/providers" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetMediaProvidersBadRequest;
import dev.plexapi.sdk.models.errors.GetMediaProvidersUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetMediaProvidersResponse res = sdk.server().getMediaProviders()
.xPlexToken("CV5xoxjTpFKUzBTShsaf")
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
| `xPlexToken` | *String* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf |
### Response
**[GetMediaProvidersResponse](../../models/operations/GetMediaProvidersResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- |
| models/errors/GetMediaProvidersBadRequest | 400 | application/json |
| models/errors/GetMediaProvidersUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getServerList
Get Server List
### Example Usage
<!-- UsageSnippet language="java" operationID="getServerList" method="get" path="/servers" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetServerListBadRequest;
import dev.plexapi.sdk.models.errors.GetServerListUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetServerListResponse res = sdk.server().getServerList()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[GetServerListResponse](../../models/operations/GetServerListResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------------------------------- | --------------------------------------- | --------------------------------------- |
| models/errors/GetServerListBadRequest | 400 | application/json |
| models/errors/GetServerListUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -1,218 +0,0 @@
# Sessions
(*sessions()*)
## Overview
API Calls that perform search operations with Plex Media Server Sessions
### Available Operations
* [getSessions](#getsessions) - Get Active Sessions
* [getSessionHistory](#getsessionhistory) - Get Session History
* [getTranscodeSessions](#gettranscodesessions) - Get Transcode Sessions
* [stopTranscodeSession](#stoptranscodesession) - Stop a Transcode Session
## getSessions
This will retrieve the "Now Playing" Information of the PMS.
### Example Usage
<!-- UsageSnippet language="java" operationID="getSessions" method="get" path="/status/sessions" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetSessionsBadRequest;
import dev.plexapi.sdk.models.errors.GetSessionsUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetSessionsResponse res = sdk.sessions().getSessions()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[GetSessionsResponse](../../models/operations/GetSessionsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------- | ------------------------------------- | ------------------------------------- |
| models/errors/GetSessionsBadRequest | 400 | application/json |
| models/errors/GetSessionsUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getSessionHistory
This will Retrieve a listing of all history views.
### Example Usage
<!-- UsageSnippet language="java" operationID="getSessionHistory" method="get" path="/status/sessions/history/all" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetSessionHistoryBadRequest;
import dev.plexapi.sdk.models.errors.GetSessionHistoryUnauthorized;
import dev.plexapi.sdk.models.operations.GetSessionHistoryResponse;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetSessionHistoryResponse res = sdk.sessions().getSessionHistory()
.sort("viewedAt:desc")
.accountId(1L)
.filter(QueryParamFilter.builder()
.build())
.librarySectionID(12L)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sort` | *Optional\<String>* | :heavy_minus_sign: | Sorts the results by the specified field followed by the direction (asc, desc)<br/> | |
| `accountId` | *Optional\<Long>* | :heavy_minus_sign: | Filter results by those that are related to a specific users id<br/> | 1 |
| `filter` | [Optional\<QueryParamFilter>](../../models/operations/QueryParamFilter.md) | :heavy_minus_sign: | Filters content by field and direction/equality<br/>(Unknown if viewedAt is the only supported column)<br/> | {<br/>"viewed-at-greater-than": {<br/>"value": "viewedAt\u003e"<br/>},<br/>"viewed-at-greater-than-or-equal-to": {<br/>"value": "viewedAt\u003e=\u003e"<br/>},<br/>"viewed-at-less-than": {<br/>"value": "viewedAt\u003c"<br/>}<br/>} |
| `librarySectionID` | *Optional\<Long>* | :heavy_minus_sign: | Filters the results based on the id of a valid library section<br/> | 12 |
### Response
**[GetSessionHistoryResponse](../../models/operations/GetSessionHistoryResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- |
| models/errors/GetSessionHistoryBadRequest | 400 | application/json |
| models/errors/GetSessionHistoryUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getTranscodeSessions
Get Transcode Sessions
### Example Usage
<!-- UsageSnippet language="java" operationID="getTranscodeSessions" method="get" path="/transcode/sessions" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetTranscodeSessionsBadRequest;
import dev.plexapi.sdk.models.errors.GetTranscodeSessionsUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[GetTranscodeSessionsResponse](../../models/operations/GetTranscodeSessionsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
| models/errors/GetTranscodeSessionsBadRequest | 400 | application/json |
| models/errors/GetTranscodeSessionsUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## stopTranscodeSession
Stop a Transcode Session
### Example Usage
<!-- UsageSnippet language="java" operationID="stopTranscodeSession" method="delete" path="/transcode/sessions/{sessionKey}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.StopTranscodeSessionBadRequest;
import dev.plexapi.sdk.models.errors.StopTranscodeSessionUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession()
.sessionKey("zz7llzqlx8w9vnrsbnwhbmep")
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
| `sessionKey` | *String* | :heavy_check_mark: | the Key of the transcode session to stop | zz7llzqlx8w9vnrsbnwhbmep |
### Response
**[StopTranscodeSessionResponse](../../models/operations/StopTranscodeSessionResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
| models/errors/StopTranscodeSessionBadRequest | 400 | application/json |
| models/errors/StopTranscodeSessionUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -1,172 +0,0 @@
# Statistics
(*statistics()*)
## Overview
API Calls that perform operations with Plex Media Server Statistics
### Available Operations
* [getStatistics](#getstatistics) - Get Media Statistics
* [getResourcesStatistics](#getresourcesstatistics) - Get Resources Statistics
* [getBandwidthStatistics](#getbandwidthstatistics) - Get Bandwidth Statistics
## getStatistics
This will return the media statistics for the server
### Example Usage
<!-- UsageSnippet language="java" operationID="getStatistics" method="get" path="/statistics/media" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetStatisticsBadRequest;
import dev.plexapi.sdk.models.errors.GetStatisticsUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetStatisticsResponse res = sdk.statistics().getStatistics()
.timespan(4L)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `timespan` | *Optional\<Long>* | :heavy_minus_sign: | The timespan to retrieve statistics for<br/>the exact meaning of this parameter is not known<br/> | 4 |
### Response
**[GetStatisticsResponse](../../models/operations/GetStatisticsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------------------------------- | --------------------------------------- | --------------------------------------- |
| models/errors/GetStatisticsBadRequest | 400 | application/json |
| models/errors/GetStatisticsUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getResourcesStatistics
This will return the resources for the server
### Example Usage
<!-- UsageSnippet language="java" operationID="getResourcesStatistics" method="get" path="/statistics/resources" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetResourcesStatisticsBadRequest;
import dev.plexapi.sdk.models.errors.GetResourcesStatisticsUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics()
.timespan(4L)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `timespan` | *Optional\<Long>* | :heavy_minus_sign: | The timespan to retrieve statistics for<br/>the exact meaning of this parameter is not known<br/> | 4 |
### Response
**[GetResourcesStatisticsResponse](../../models/operations/GetResourcesStatisticsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
| models/errors/GetResourcesStatisticsBadRequest | 400 | application/json |
| models/errors/GetResourcesStatisticsUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getBandwidthStatistics
This will return the bandwidth statistics for the server
### Example Usage
<!-- UsageSnippet language="java" operationID="getBandwidthStatistics" method="get" path="/statistics/bandwidth" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetBandwidthStatisticsBadRequest;
import dev.plexapi.sdk.models.errors.GetBandwidthStatisticsUnauthorized;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics()
.timespan(4L)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `timespan` | *Optional\<Long>* | :heavy_minus_sign: | The timespan to retrieve statistics for<br/>the exact meaning of this parameter is not known<br/> | 4 |
### Response
**[GetBandwidthStatisticsResponse](../../models/operations/GetBandwidthStatisticsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
| models/errors/GetBandwidthStatisticsBadRequest | 400 | application/json |
| models/errors/GetBandwidthStatisticsUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

387
docs/sdks/status/README.md Normal file
View File

@@ -0,0 +1,387 @@
# Status
(*status()*)
## Overview
The status endpoints give you information about current playbacks, play history, and even terminating sessions.
### Available Operations
* [listSessions](#listsessions) - List Sessions
* [getBackgroundTasks](#getbackgroundtasks) - Get background tasks
* [listPlaybackHistory](#listplaybackhistory) - List Playback History
* [terminateSession](#terminatesession) - Terminate a session
* [deleteHistory](#deletehistory) - Delete Single History Item
* [getHistoryItem](#gethistoryitem) - Get Single History Item
## listSessions
List all current playbacks on this server
### Example Usage
<!-- UsageSnippet language="java" operationID="listSessions" method="get" path="/status/sessions" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ListSessionsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ListSessionsResponse res = sdk.status().listSessions()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[ListSessionsResponse](../../models/operations/ListSessionsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getBackgroundTasks
Get the list of all background tasks
### Example Usage
<!-- UsageSnippet language="java" operationID="getBackgroundTasks" method="get" path="/status/sessions/background" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetBackgroundTasksResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetBackgroundTasksResponse res = sdk.status().getBackgroundTasks()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[GetBackgroundTasksResponse](../../models/operations/GetBackgroundTasksResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## listPlaybackHistory
List all playback history (Admin can see all users, others can only see their own).
Pagination should be used on this endpoint. Additionally this endpoint supports `includeFields`, `excludeFields`, `includeElements`, and `excludeElements` parameters.
### Example Usage
<!-- UsageSnippet language="java" operationID="listPlaybackHistory" method="get" path="/status/sessions/history/all" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ListPlaybackHistoryRequest;
import dev.plexapi.sdk.models.operations.ListPlaybackHistoryResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ListPlaybackHistoryRequest req = ListPlaybackHistoryRequest.builder()
.sort(List.of(
"v",
"i",
"e",
"w",
"e",
"d",
"A",
"t",
":",
"d",
"e",
"s",
"c",
",",
"a",
"c",
"c",
"o",
"u",
"n",
"t",
"I",
"D"))
.build();
ListPlaybackHistoryResponse res = sdk.status().listPlaybackHistory()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `request` | [ListPlaybackHistoryRequest](../../models/operations/ListPlaybackHistoryRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ListPlaybackHistoryResponse](../../models/operations/ListPlaybackHistoryResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## terminateSession
Terminate a playback session kicking off the user
### Example Usage
<!-- UsageSnippet language="java" operationID="terminateSession" method="post" path="/status/sessions/terminate" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.TerminateSessionRequest;
import dev.plexapi.sdk.models.operations.TerminateSessionResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
TerminateSessionRequest req = TerminateSessionRequest.builder()
.sessionId("cdefghijklmnopqrstuvwxyz")
.reason("Stop Playing")
.build();
TerminateSessionResponse res = sdk.status().terminateSession()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `request` | [TerminateSessionRequest](../../models/operations/TerminateSessionRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[TerminateSessionResponse](../../models/operations/TerminateSessionResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## deleteHistory
Delete a single history item by id
### Example Usage
<!-- UsageSnippet language="java" operationID="deleteHistory" method="delete" path="/status/sessions/history/{historyId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.DeleteHistoryRequest;
import dev.plexapi.sdk.models.operations.DeleteHistoryResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
DeleteHistoryRequest req = DeleteHistoryRequest.builder()
.historyId(953579L)
.build();
DeleteHistoryResponse res = sdk.status().deleteHistory()
.request(req)
.call();
if (res.mediaContainer().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `request` | [DeleteHistoryRequest](../../models/operations/DeleteHistoryRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[DeleteHistoryResponse](../../models/operations/DeleteHistoryResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getHistoryItem
Get a single history item by id
### Example Usage
<!-- UsageSnippet language="java" operationID="getHistoryItem" method="get" path="/status/sessions/history/{historyId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetHistoryItemRequest;
import dev.plexapi.sdk.models.operations.GetHistoryItemResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetHistoryItemRequest req = GetHistoryItemRequest.builder()
.historyId(832213L)
.build();
GetHistoryItemResponse res = sdk.status().getHistoryItem()
.request(req)
.call();
if (res.historyAllGetResponses200().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `request` | [GetHistoryItemRequest](../../models/operations/GetHistoryItemRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetHistoryItemResponse](../../models/operations/GetHistoryItemResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -0,0 +1,640 @@
# Subscriptions
(*subscriptions()*)
## Overview
Subscriptions determine which media will be recorded and the criteria for selecting an airing when multiple are available
### Available Operations
* [getAllSubscriptions](#getallsubscriptions) - Get all subscriptions
* [createSubscription](#createsubscription) - Create a subscription
* [processSubscriptions](#processsubscriptions) - Process all subscriptions
* [getScheduledRecordings](#getscheduledrecordings) - Get all scheduled recordings
* [getTemplate](#gettemplate) - Get the subscription template
* [cancelGrab](#cancelgrab) - Cancel an existing grab
* [deleteSubscription](#deletesubscription) - Delete a subscription
* [getSubscription](#getsubscription) - Get a single subscription
* [editSubscriptionPreferences](#editsubscriptionpreferences) - Edit a subscription
* [reorderSubscription](#reordersubscription) - Re-order a subscription
## getAllSubscriptions
Get all subscriptions and potentially the grabs too
### Example Usage
<!-- UsageSnippet language="java" operationID="getAllSubscriptions" method="get" path="/media/subscriptions" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetAllSubscriptionsRequest;
import dev.plexapi.sdk.models.operations.GetAllSubscriptionsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetAllSubscriptionsRequest req = GetAllSubscriptionsRequest.builder()
.includeGrabs(BoolInt.ONE)
.includeStorage(BoolInt.ONE)
.build();
GetAllSubscriptionsResponse res = sdk.subscriptions().getAllSubscriptions()
.request(req)
.call();
if (res.mediaContainerWithSubscription().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `request` | [GetAllSubscriptionsRequest](../../models/operations/GetAllSubscriptionsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetAllSubscriptionsResponse](../../models/operations/GetAllSubscriptionsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## createSubscription
Create a subscription. The query parameters should be mostly derived from the [template](#tag/Subscriptions/operation/mediaSubscriptionsGetTemplate)
### Example Usage
<!-- UsageSnippet language="java" operationID="createSubscription" method="post" path="/media/subscriptions" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.*;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
CreateSubscriptionRequest req = CreateSubscriptionRequest.builder()
.targetLibrarySectionID(1L)
.targetSectionLocationID(3L)
.type(2L)
.hints(Hints.builder()
.build())
.prefs(CreateSubscriptionQueryParamPrefs.builder()
.build())
.params(Params.builder()
.build())
.build();
CreateSubscriptionResponse res = sdk.subscriptions().createSubscription()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `request` | [CreateSubscriptionRequest](../../models/operations/CreateSubscriptionRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[CreateSubscriptionResponse](../../models/operations/CreateSubscriptionResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## processSubscriptions
Process all subscriptions asynchronously
### Example Usage
<!-- UsageSnippet language="java" operationID="processSubscriptions" method="post" path="/media/subscriptions/process" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ProcessSubscriptionsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ProcessSubscriptionsResponse res = sdk.subscriptions().processSubscriptions()
.call();
// handle response
}
}
```
### Response
**[ProcessSubscriptionsResponse](../../models/operations/ProcessSubscriptionsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getScheduledRecordings
Get all scheduled recordings across all subscriptions
### Example Usage
<!-- UsageSnippet language="java" operationID="getScheduledRecordings" method="get" path="/media/subscriptions/scheduled" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetScheduledRecordingsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetScheduledRecordingsResponse res = sdk.subscriptions().getScheduledRecordings()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Response
**[GetScheduledRecordingsResponse](../../models/operations/GetScheduledRecordingsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getTemplate
Get the templates for a piece of media which could include fetching one airing, season, the whole show, etc.
### Example Usage
<!-- UsageSnippet language="java" operationID="getTemplate" method="get" path="/media/subscriptions/template" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetTemplateRequest;
import dev.plexapi.sdk.models.operations.GetTemplateResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetTemplateRequest req = GetTemplateRequest.builder()
.guid("plex://episode/5fc70265c40548002d539d23")
.build();
GetTemplateResponse res = sdk.subscriptions().getTemplate()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `request` | [GetTemplateRequest](../../models/operations/GetTemplateRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetTemplateResponse](../../models/operations/GetTemplateResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## cancelGrab
Cancels an existing media grab (recording). It can be used to resolve a conflict which exists for a rolling subscription.
Note: This cancellation does not persist across a server restart, but neither does a rolling subscription itself.
### Example Usage
<!-- UsageSnippet language="java" operationID="cancelGrab" method="delete" path="/media/grabbers/operations/{operationId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.CancelGrabRequest;
import dev.plexapi.sdk.models.operations.CancelGrabResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
CancelGrabRequest req = CancelGrabRequest.builder()
.operationId("<id>")
.build();
CancelGrabResponse res = sdk.subscriptions().cancelGrab()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
| `request` | [CancelGrabRequest](../../models/operations/CancelGrabRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[CancelGrabResponse](../../models/operations/CancelGrabResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## deleteSubscription
Delete a subscription, cancelling all of its grabs as well
### Example Usage
<!-- UsageSnippet language="java" operationID="deleteSubscription" method="delete" path="/media/subscriptions/{subscriptionId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.DeleteSubscriptionRequest;
import dev.plexapi.sdk.models.operations.DeleteSubscriptionResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
DeleteSubscriptionRequest req = DeleteSubscriptionRequest.builder()
.subscriptionId(974618L)
.build();
DeleteSubscriptionResponse res = sdk.subscriptions().deleteSubscription()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `request` | [DeleteSubscriptionRequest](../../models/operations/DeleteSubscriptionRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[DeleteSubscriptionResponse](../../models/operations/DeleteSubscriptionResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getSubscription
Get a single subscription and potentially the grabs too
### Example Usage
<!-- UsageSnippet language="java" operationID="getSubscription" method="get" path="/media/subscriptions/{subscriptionId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetSubscriptionRequest;
import dev.plexapi.sdk.models.operations.GetSubscriptionResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetSubscriptionRequest req = GetSubscriptionRequest.builder()
.subscriptionId(186713L)
.includeGrabs(BoolInt.ONE)
.includeStorage(BoolInt.ONE)
.build();
GetSubscriptionResponse res = sdk.subscriptions().getSubscription()
.request(req)
.call();
if (res.mediaContainerWithSubscription().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `request` | [GetSubscriptionRequest](../../models/operations/GetSubscriptionRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetSubscriptionResponse](../../models/operations/GetSubscriptionResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## editSubscriptionPreferences
Edit a subscription's preferences
### Example Usage
<!-- UsageSnippet language="java" operationID="editSubscriptionPreferences" method="put" path="/media/subscriptions/{subscriptionId}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.*;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
EditSubscriptionPreferencesRequest req = EditSubscriptionPreferencesRequest.builder()
.subscriptionId(673918L)
.prefs(EditSubscriptionPreferencesQueryParamPrefs.builder()
.build())
.build();
EditSubscriptionPreferencesResponse res = sdk.subscriptions().editSubscriptionPreferences()
.request(req)
.call();
if (res.mediaContainerWithSubscription().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `request` | [EditSubscriptionPreferencesRequest](../../models/operations/EditSubscriptionPreferencesRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[EditSubscriptionPreferencesResponse](../../models/operations/EditSubscriptionPreferencesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## reorderSubscription
Re-order a subscription to change its priority
### Example Usage
<!-- UsageSnippet language="java" operationID="reorderSubscription" method="put" path="/media/subscriptions/{subscriptionId}/move" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.ReorderSubscriptionRequest;
import dev.plexapi.sdk.models.operations.ReorderSubscriptionResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ReorderSubscriptionRequest req = ReorderSubscriptionRequest.builder()
.subscriptionId(440634L)
.build();
ReorderSubscriptionResponse res = sdk.subscriptions().reorderSubscription()
.request(req)
.call();
if (res.mediaContainerWithSubscription().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `request` | [ReorderSubscriptionRequest](../../models/operations/ReorderSubscriptionRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ReorderSubscriptionResponse](../../models/operations/ReorderSubscriptionResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -0,0 +1,223 @@
# Timeline
(*timeline()*)
## Overview
The actions feature within a media provider
### Available Operations
* [markPlayed](#markplayed) - Mark an item as played
* [report](#report) - Report media timeline
* [unscrobble](#unscrobble) - Mark an item as unplayed
## markPlayed
Mark an item as played. Note, this does not create any view history of this item but rather just sets the state as played. The client must provide either the `key` or `uri` query parameter
This API does respond to the GET verb but applications should use PUT
### Example Usage
<!-- UsageSnippet language="java" operationID="markPlayed" method="put" path="/:/scrobble" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.MarkPlayedRequest;
import dev.plexapi.sdk.models.operations.MarkPlayedResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
MarkPlayedRequest req = MarkPlayedRequest.builder()
.identifier("<value>")
.key("59398")
.build();
MarkPlayedResponse res = sdk.timeline().markPlayed()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
| `request` | [MarkPlayedRequest](../../models/operations/MarkPlayedRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[MarkPlayedResponse](../../models/operations/MarkPlayedResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## report
This endpoint is hit during media playback for an item. It must be hit whenever the play state changes, or in the absence of a play state change, in a regular fashion (generally this means every 10 seconds on a LAN/WAN, and every 20 seconds over cellular).
### Example Usage
<!-- UsageSnippet language="java" operationID="report" method="post" path="/:/timeline" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.*;
import dev.plexapi.sdk.models.shared.Accepts;
import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
ReportRequest req = ReportRequest.builder()
.key("/foo")
.ratingKey("xyz")
.state(State.PLAYING)
.playQueueItemID("123")
.time(0L)
.duration(10000L)
.continuing(BoolInt.ONE)
.updated(14200000L)
.offline(BoolInt.ONE)
.timeToFirstFrame(1000L)
.timeStalled(1000L)
.bandwidth(100L)
.bufferedTime(100L)
.bufferedSize(1024L)
.build();
ReportResponse res = sdk.timeline().report()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- |
| `request` | [ReportRequest](../../models/operations/ReportRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ReportResponse](../../models/operations/ReportResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## unscrobble
Mark an item as unplayed. The client must provide either the `key` or `uri` query parameter
This API does respond to the GET verb but applications should use PUT
### Example Usage
<!-- UsageSnippet language="java" operationID="unscrobble" method="put" path="/:/unscrobble" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.UnscrobbleRequest;
import dev.plexapi.sdk.models.operations.UnscrobbleResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
UnscrobbleRequest req = UnscrobbleRequest.builder()
.identifier("<value>")
.build();
UnscrobbleResponse res = sdk.timeline().unscrobble()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
| `request` | [UnscrobbleRequest](../../models/operations/UnscrobbleRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[UnscrobbleResponse](../../models/operations/UnscrobbleResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -0,0 +1,426 @@
# Transcoder
(*transcoder()*)
## Overview
API Operations against the Transcoder
### Available Operations
* [transcodeImage](#transcodeimage) - Transcode an image
* [makeDecision](#makedecision) - Make a decision on media playback
* [triggerFallback](#triggerfallback) - Manually trigger a transcoder fallback
* [transcodeSubtitles](#transcodesubtitles) - Transcode subtitles
* [startTranscodeSession](#starttranscodesession) - Start A Transcoding Session
## transcodeImage
Transcode an image, possibly changing format or size
### Example Usage
<!-- UsageSnippet language="java" operationID="transcodeImage" method="get" path="/photo/:/transcode" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.TranscodeImageRequest;
import dev.plexapi.sdk.models.operations.TranscodeImageResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
TranscodeImageRequest req = TranscodeImageRequest.builder()
.url("/library/metadata/265/thumb/1715112705")
.background("#ff5522")
.upscale(BoolInt.ONE)
.minSize(BoolInt.ONE)
.rotate(BoolInt.ONE)
.blendColor("#ff5522")
.build();
TranscodeImageResponse res = sdk.transcoder().transcodeImage()
.request(req)
.call();
if (res.twoHundredImageJpegResponseStream().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `request` | [TranscodeImageRequest](../../models/operations/TranscodeImageRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[TranscodeImageResponse](../../models/operations/TranscodeImageResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## makeDecision
Make a decision on media playback based on client profile, and requested settings such as bandwidth and resolution.
### Example Usage
<!-- UsageSnippet language="java" operationID="makeDecision" method="get" path="/{transcodeType}/:/transcode/universal/decision" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.*;
import dev.plexapi.sdk.models.shared.*;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
MakeDecisionRequest req = MakeDecisionRequest.builder()
.transcodeType(TranscodeType.MUSIC)
.advancedSubtitles(AdvancedSubtitles.BURN)
.audioBoost(50L)
.audioChannelCount(5L)
.autoAdjustQuality(BoolInt.ONE)
.autoAdjustSubtitle(BoolInt.ONE)
.directPlay(BoolInt.ONE)
.directStream(BoolInt.ONE)
.directStreamAudio(BoolInt.ONE)
.disableResolutionRotation(BoolInt.ONE)
.hasMDE(BoolInt.ONE)
.location(Location.WAN)
.mediaBufferSize(102400L)
.mediaIndex(0L)
.musicBitrate(5000L)
.offset(90.5)
.partIndex(0L)
.path("/library/metadata/151671")
.peakBitrate(12000L)
.photoResolution("1080x1080")
.protocol(Protocol.DASH)
.secondsPerSegment(5L)
.subtitleSize(50L)
.videoBitrate(12000L)
.videoQuality(50L)
.videoResolution("1080x1080")
.xPlexClientProfileExtra("add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)")
.xPlexClientProfileName("generic")
.build();
MakeDecisionResponse res = sdk.transcoder().makeDecision()
.request(req)
.call();
if (res.mediaContainerWithDecision().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `request` | [MakeDecisionRequest](../../models/operations/MakeDecisionRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[MakeDecisionResponse](../../models/operations/MakeDecisionResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## triggerFallback
Manually trigger a transcoder fallback ex: HEVC to h.264 or hw to sw
### Example Usage
<!-- UsageSnippet language="java" operationID="triggerFallback" method="post" path="/{transcodeType}/:/transcode/universal/fallback" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.TriggerFallbackRequest;
import dev.plexapi.sdk.models.operations.TriggerFallbackResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import dev.plexapi.sdk.models.shared.TranscodeType;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
TriggerFallbackRequest req = TriggerFallbackRequest.builder()
.transcodeType(TranscodeType.AUDIO)
.build();
TriggerFallbackResponse res = sdk.transcoder().triggerFallback()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `request` | [TriggerFallbackRequest](../../models/operations/TriggerFallbackRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[TriggerFallbackResponse](../../models/operations/TriggerFallbackResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## transcodeSubtitles
Only transcode subtitle streams.
### Example Usage
<!-- UsageSnippet language="java" operationID="transcodeSubtitles" method="get" path="/{transcodeType}/:/transcode/universal/subtitles" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.*;
import dev.plexapi.sdk.models.shared.*;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
TranscodeSubtitlesRequest req = TranscodeSubtitlesRequest.builder()
.transcodeType(TranscodeType.AUDIO)
.advancedSubtitles(AdvancedSubtitles.BURN)
.audioBoost(50L)
.audioChannelCount(5L)
.autoAdjustQuality(BoolInt.ONE)
.autoAdjustSubtitle(BoolInt.ONE)
.directPlay(BoolInt.ONE)
.directStream(BoolInt.ONE)
.directStreamAudio(BoolInt.ONE)
.disableResolutionRotation(BoolInt.ONE)
.hasMDE(BoolInt.ONE)
.location(QueryParamLocation.WAN)
.mediaBufferSize(102400L)
.mediaIndex(0L)
.musicBitrate(5000L)
.offset(90.5)
.partIndex(0L)
.path("/library/metadata/151671")
.peakBitrate(12000L)
.photoResolution("1080x1080")
.protocol(QueryParamProtocol.DASH)
.secondsPerSegment(5L)
.subtitleSize(50L)
.videoBitrate(12000L)
.videoQuality(50L)
.videoResolution("1080x1080")
.xPlexClientProfileExtra("add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)")
.xPlexClientProfileName("generic")
.build();
TranscodeSubtitlesResponse res = sdk.transcoder().transcodeSubtitles()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `request` | [TranscodeSubtitlesRequest](../../models/operations/TranscodeSubtitlesRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[TranscodeSubtitlesResponse](../../models/operations/TranscodeSubtitlesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## startTranscodeSession
Starts the transcoder and returns the corresponding streaming resource document.
### Example Usage
<!-- UsageSnippet language="java" operationID="startTranscodeSession" method="get" path="/{transcodeType}/:/transcode/universal/start.{extension}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.*;
import dev.plexapi.sdk.models.shared.*;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
StartTranscodeSessionRequest req = StartTranscodeSessionRequest.builder()
.transcodeType(TranscodeType.MUSIC)
.extension(Extension.MPD)
.advancedSubtitles(AdvancedSubtitles.BURN)
.audioBoost(50L)
.audioChannelCount(5L)
.autoAdjustQuality(BoolInt.ONE)
.autoAdjustSubtitle(BoolInt.ONE)
.directPlay(BoolInt.ONE)
.directStream(BoolInt.ONE)
.directStreamAudio(BoolInt.ONE)
.disableResolutionRotation(BoolInt.ONE)
.hasMDE(BoolInt.ONE)
.location(StartTranscodeSessionQueryParamLocation.WAN)
.mediaBufferSize(102400L)
.mediaIndex(0L)
.musicBitrate(5000L)
.offset(90.5)
.partIndex(0L)
.path("/library/metadata/151671")
.peakBitrate(12000L)
.photoResolution("1080x1080")
.protocol(StartTranscodeSessionQueryParamProtocol.DASH)
.secondsPerSegment(5L)
.subtitleSize(50L)
.videoBitrate(12000L)
.videoQuality(50L)
.videoResolution("1080x1080")
.xPlexClientProfileExtra("add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)")
.xPlexClientProfileName("generic")
.build();
StartTranscodeSessionResponse res = sdk.transcoder().startTranscodeSession()
.request(req)
.call();
if (res.responseStream().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `request` | [StartTranscodeSessionRequest](../../models/operations/StartTranscodeSessionRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[StartTranscodeSessionResponse](../../models/operations/StartTranscodeSessionResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -0,0 +1,150 @@
# UltraBlur
(*ultraBlur()*)
## Overview
Service provided to compute UltraBlur colors and images.
### Available Operations
* [getColors](#getcolors) - Get UltraBlur Colors
* [getImage](#getimage) - Get UltraBlur Image
## getColors
Retrieves the four colors extracted from an image for clients to use to generate an ultrablur image.
### Example Usage
<!-- UsageSnippet language="java" operationID="getColors" method="get" path="/services/ultrablur/colors" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetColorsRequest;
import dev.plexapi.sdk.models.operations.GetColorsResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetColorsRequest req = GetColorsRequest.builder()
.url("/library/metadata/217745/art/1718931408")
.build();
GetColorsResponse res = sdk.ultraBlur().getColors()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| `request` | [GetColorsRequest](../../models/operations/GetColorsRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetColorsResponse](../../models/operations/GetColorsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getImage
Retrieves a server-side generated UltraBlur image based on the provided color inputs. Clients should always call this via the photo transcoder endpoint.
### Example Usage
<!-- UsageSnippet language="java" operationID="getImage" method="get" path="/services/ultrablur/image" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetImageRequest;
import dev.plexapi.sdk.models.operations.GetImageResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetImageRequest req = GetImageRequest.builder()
.topLeft("3f280a")
.topRight("6b4713")
.bottomRight("0f2a43")
.bottomLeft("1c425d")
.width(1920L)
.height(1080L)
.noise(BoolInt.ONE)
.build();
GetImageResponse res = sdk.ultraBlur().getImage()
.request(req)
.call();
if (res.responseStream().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
| `request` | [GetImageRequest](../../models/operations/GetImageRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetImageResponse](../../models/operations/GetImageResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -9,35 +9,164 @@ Updates to the status can be observed via the Event API.
### Available Operations
* [getUpdateStatus](#getupdatestatus) - Querying status of updates
* [checkForUpdates](#checkforupdates) - Checking for updates
* [applyUpdates](#applyupdates) - Apply Updates
* [applyUpdates](#applyupdates) - Applying updates
* [checkUpdates](#checkupdates) - Checking for updates
* [getUpdatesStatus](#getupdatesstatus) - Querying status of updates
## getUpdateStatus
## applyUpdates
Querying status of updates
Apply any downloaded updates. Note that the two parameters `tonight` and `skip` are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed.
### Example Usage
<!-- UsageSnippet language="java" operationID="getUpdateStatus" method="get" path="/updater/status" -->
<!-- UsageSnippet language="java" operationID="applyUpdates" method="put" path="/updater/apply" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetUpdateStatusBadRequest;
import dev.plexapi.sdk.models.errors.GetUpdateStatusUnauthorized;
import dev.plexapi.sdk.models.operations.GetUpdateStatusResponse;
import dev.plexapi.sdk.models.operations.ApplyUpdatesRequest;
import dev.plexapi.sdk.models.operations.ApplyUpdatesResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws GetUpdateStatusBadRequest, GetUpdateStatusUnauthorized, Exception {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetUpdateStatusResponse res = sdk.updater().getUpdateStatus()
ApplyUpdatesRequest req = ApplyUpdatesRequest.builder()
.tonight(BoolInt.ONE)
.skip(BoolInt.ONE)
.build();
ApplyUpdatesResponse res = sdk.updater().applyUpdates()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `request` | [ApplyUpdatesRequest](../../models/operations/ApplyUpdatesRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[ApplyUpdatesResponse](../../models/operations/ApplyUpdatesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## checkUpdates
Perform an update check and potentially download
### Example Usage
<!-- UsageSnippet language="java" operationID="checkUpdates" method="put" path="/updater/check" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.CheckUpdatesRequest;
import dev.plexapi.sdk.models.operations.CheckUpdatesResponse;
import dev.plexapi.sdk.models.shared.Accepts;
import dev.plexapi.sdk.models.shared.BoolInt;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accepts(Accepts.APPLICATION_XML)
.clientIdentifier("abc123")
.product("Plex for Roku")
.version("2.4.1")
.platform("Roku")
.platformVersion("4.3 build 1057")
.device("Roku 3")
.model("4200X")
.deviceVendor("Roku")
.deviceName("Living Room TV")
.marketplace("googlePlay")
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
CheckUpdatesRequest req = CheckUpdatesRequest.builder()
.download(BoolInt.ONE)
.build();
CheckUpdatesResponse res = sdk.updater().checkUpdates()
.request(req)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `request` | [CheckUpdatesRequest](../../models/operations/CheckUpdatesRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[CheckUpdatesResponse](../../models/operations/CheckUpdatesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getUpdatesStatus
Get the status of updating the server
### Example Usage
<!-- UsageSnippet language="java" operationID="getUpdatesStatus" method="get" path="/updater/status" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetUpdatesStatusResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetUpdatesStatusResponse res = sdk.updater().getUpdatesStatus()
.call();
if (res.object().isPresent()) {
@@ -49,118 +178,10 @@ public class Application {
### Response
**[GetUpdateStatusResponse](../../models/operations/GetUpdateStatusResponse.md)**
**[GetUpdatesStatusResponse](../../models/operations/GetUpdatesStatusResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
| models/errors/GetUpdateStatusBadRequest | 400 | application/json |
| models/errors/GetUpdateStatusUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## checkForUpdates
Checking for updates
### Example Usage
<!-- UsageSnippet language="java" operationID="checkForUpdates" method="put" path="/updater/check" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.CheckForUpdatesBadRequest;
import dev.plexapi.sdk.models.errors.CheckForUpdatesUnauthorized;
import dev.plexapi.sdk.models.operations.CheckForUpdatesResponse;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
CheckForUpdatesResponse res = sdk.updater().checkForUpdates()
.download(Download.ONE)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| `download` | [Optional\<Download>](../../models/operations/Download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | 1 |
### Response
**[CheckForUpdatesResponse](../../models/operations/CheckForUpdatesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
| models/errors/CheckForUpdatesBadRequest | 400 | application/json |
| models/errors/CheckForUpdatesUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## applyUpdates
Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed
### Example Usage
<!-- UsageSnippet language="java" operationID="applyUpdates" method="put" path="/updater/apply" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.ApplyUpdatesBadRequest;
import dev.plexapi.sdk.models.errors.ApplyUpdatesUnauthorized;
import dev.plexapi.sdk.models.operations.*;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApplyUpdatesBadRequest, ApplyUpdatesUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
ApplyUpdatesResponse res = sdk.updater().applyUpdates()
.tonight(Tonight.ONE)
.skip(Skip.ONE)
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tonight` | [Optional\<Tonight>](../../models/operations/Tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install | 1 |
| `skip` | [Optional\<Skip>](../../models/operations/Skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`. | 1 |
### Response
**[ApplyUpdatesResponse](../../models/operations/ApplyUpdatesResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
| models/errors/ApplyUpdatesBadRequest | 400 | application/json |
| models/errors/ApplyUpdatesUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -1,78 +0,0 @@
# Users
(*users()*)
## Overview
### Available Operations
* [getUsers](#getusers) - Get list of all connected users
## getUsers
Get list of all users that are friends and have library access with the provided Plex authentication token
### Example Usage
<!-- UsageSnippet language="java" operationID="get-users" method="get" path="/users" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetUsersBadRequest;
import dev.plexapi.sdk.models.errors.GetUsersUnauthorized;
import dev.plexapi.sdk.models.operations.GetUsersRequest;
import dev.plexapi.sdk.models.operations.GetUsersResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws GetUsersBadRequest, GetUsersUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder()
.build();
GetUsersRequest req = GetUsersRequest.builder()
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.xPlexToken("CV5xoxjTpFKUzBTShsaf")
.clientName("Plex for Roku")
.deviceNickname("Roku 3")
.deviceName("Chrome")
.deviceScreenResolution("1487x1165,2560x1440")
.clientVersion("2.4.1")
.platform("Roku")
.clientFeatures("external-media,indirect-media,hub-style-list")
.model("4200X")
.xPlexSessionId("97e136ef-4ddd-4ff3-89a7-a5820c96c2ca")
.xPlexLanguage("en")
.platformVersion("4.3 build 1057")
.build();
GetUsersResponse res = sdk.users().getUsers()
.request(req)
.call();
if (res.body().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
| `request` | [GetUsersRequest](../../models/operations/GetUsersRequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**[GetUsersResponse](../../models/operations/GetUsersResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------------- | ---------------------------------- | ---------------------------------- |
| models/errors/GetUsersBadRequest | 400 | application/json |
| models/errors/GetUsersUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -1,147 +0,0 @@
# Video
(*video()*)
## Overview
API Calls that perform operations with Plex Media Server Videos
### Available Operations
* [getTimeline](#gettimeline) - Get the timeline for a media item
* [startUniversalTranscode](#startuniversaltranscode) - Start Universal Transcode
## getTimeline
Get the timeline for a media item
### Example Usage
<!-- UsageSnippet language="java" operationID="getTimeline" method="get" path="/:/timeline" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetTimelineBadRequest;
import dev.plexapi.sdk.models.errors.GetTimelineUnauthorized;
import dev.plexapi.sdk.models.operations.*;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws GetTimelineBadRequest, GetTimelineUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.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
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `request` | [GetTimelineRequest](../../models/operations/GetTimelineRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[GetTimelineResponse](../../models/operations/GetTimelineResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------- | ------------------------------------- | ------------------------------------- |
| models/errors/GetTimelineBadRequest | 400 | application/json |
| models/errors/GetTimelineUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## startUniversalTranscode
Begin a Universal Transcode Session
### Example Usage
<!-- UsageSnippet language="java" operationID="startUniversalTranscode" method="get" path="/video/:/transcode/universal/start.mpd" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.StartUniversalTranscodeBadRequest;
import dev.plexapi.sdk.models.errors.StartUniversalTranscodeUnauthorized;
import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequest;
import dev.plexapi.sdk.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(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.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
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `request` | [StartUniversalTranscodeRequest](../../models/operations/StartUniversalTranscodeRequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[StartUniversalTranscodeResponse](../../models/operations/StartUniversalTranscodeResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- |
| models/errors/StartUniversalTranscodeBadRequest | 400 | application/json |
| models/errors/StartUniversalTranscodeUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |

View File

@@ -1,70 +0,0 @@
# Watchlist
(*watchlist()*)
## Overview
API Calls that perform operations with Plex Media Server Watchlists
### Available Operations
* [getWatchList](#getwatchlist) - Get User Watchlist
## getWatchList
Get User Watchlist
### Example Usage
<!-- UsageSnippet language="java" operationID="get-watch-list" method="get" path="/library/sections/watchlist/{filter}" -->
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetWatchListBadRequest;
import dev.plexapi.sdk.models.errors.GetWatchListUnauthorized;
import dev.plexapi.sdk.models.operations.*;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws GetWatchListBadRequest, GetWatchListUnauthorized, Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", ""))
.build();
GetWatchListRequest req = GetWatchListRequest.builder()
.filter(Filter.RELEASED)
.xPlexToken("CV5xoxjTpFKUzBTShsaf")
.build();
GetWatchListResponse res = sdk.watchlist().getWatchList()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `request` | [GetWatchListRequest](../../models/operations/GetWatchListRequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**[GetWatchListResponse](../../models/operations/GetWatchListResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
| models/errors/GetWatchListBadRequest | 400 | application/json |
| models/errors/GetWatchListUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |