diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index fbffcc9e..00000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,22 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/java -{ - "name": "Java SDK", - "image": "mcr.microsoft.com/devcontainers/java:1-17-bullseye", - "features": { - "ghcr.io/devcontainers/features/java:1": { - "version": "none", - "installMaven": "true", - "installGradle": "false" - } - }, - "postCreateCommand": "mvn install && mvn -f examples/pom.xml install", - "customizations": { - "codespaces": { - "openFiles": [ - "examples/src/main/java/47/one0/examples/Main.java", - "README.md" - ] - } - } -} diff --git a/.env.example b/.env.example deleted file mode 100644 index c76e20a5..00000000 --- a/.env.example +++ /dev/null @@ -1,2 +0,0 @@ -PLEXSDK_API_KEY= -PLEXSDK_API_KEY_HEADER= diff --git a/.github/workflows/codesee-arch-diagram.yml b/.github/workflows/codesee-arch-diagram.yml deleted file mode 100644 index 806d41d1..00000000 --- a/.github/workflows/codesee-arch-diagram.yml +++ /dev/null @@ -1,23 +0,0 @@ -# This workflow was added by CodeSee. Learn more at https://codesee.io/ -# This is v2.0 of this workflow file -on: - push: - branches: - - main - pull_request_target: - types: [opened, synchronize, reopened] - -name: CodeSee - -permissions: read-all - -jobs: - codesee: - runs-on: ubuntu-latest - continue-on-error: true - name: Analyze the repo with CodeSee - steps: - - uses: Codesee-io/codesee-action@v2 - with: - codesee-token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }} - codesee-url: https://app.codesee.io diff --git a/.gitignore b/.gitignore index 64cd884c..df0a9853 100644 --- a/.gitignore +++ b/.gitignore @@ -7,22 +7,3 @@ bin/ .project .settings/ .DS_Store -# Compiled class file -*.class -# Log file -*.log -# BlueJ files -*.ctxt -# Mobile Tools for Java (J2ME) -.mtj.tmp/ -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* -replay_pid* diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 71ae18cf..3e24bfaa 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,17 +1,17 @@ lockVersion: 2.0.0 -id: ff6658aa-ae09-4bec-b500-5ba8bcd3a069 +id: d74213ba-4eeb-4de9-a309-6b70cf5c4bd4 management: docChecksum: e73920abd3a55e8d249592f2e3090574 docVersion: 0.0.3 - speakeasyVersion: 1.321.0 - generationVersion: 2.354.2 + speakeasyVersion: 1.323.0 + generationVersion: 2.356.0 releaseVersion: 0.1.1 configChecksum: 32d07b03c4a1b8364852e49423957f33 features: java: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.1 - core: 3.26.0 + core: 3.26.1 flattening: 2.81.1 globalSecurity: 2.82.5 globalSecurityCallbacks: 0.1.0 @@ -1052,4 +1052,21 @@ generatedFiles: - docs/models/errors/GetWatchlistErrors.md - docs/models/errors/GetWatchlistResponseBody.md - docs/models/shared/Security.md + - docs/sdks/plexapi/README.md + - docs/sdks/server/README.md + - docs/sdks/media/README.md + - docs/sdks/video/README.md + - docs/sdks/activities/README.md + - docs/sdks/butler/README.md + - docs/sdks/plex/README.md + - docs/sdks/hubs/README.md + - docs/sdks/search/README.md + - docs/sdks/library/README.md + - docs/sdks/log/README.md + - docs/sdks/playlists/README.md + - docs/sdks/authentication/README.md + - docs/sdks/statistics/README.md + - docs/sdks/sessions/README.md + - docs/sdks/updater/README.md + - docs/sdks/watchlist/README.md - USAGE.md diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 6e474130..f37ff555 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,17 +1,17 @@ -speakeasyVersion: 1.321.0 +speakeasyVersion: 1.323.0 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:7bed80d5d81c0501209a4de7a65ad0bd438a89f9e8f6eba59701704e3fb11ead - sourceBlobDigest: sha256:ab8481086bfdae5fd1aa42a674434b35061177c23040cf48c9247708594ce134 + sourceRevisionDigest: sha256:b4ee5010d8a55049aa655b056e12618e038d75f8a8381ec498e97a413cb9f0f9 + sourceBlobDigest: sha256:cb332c62f2f70662406a011c9561382d0721b12faf89259fcc8bd7c41ddd4faa tags: - latest targets: plexjava: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:7bed80d5d81c0501209a4de7a65ad0bd438a89f9e8f6eba59701704e3fb11ead - sourceBlobDigest: sha256:ab8481086bfdae5fd1aa42a674434b35061177c23040cf48c9247708594ce134 + sourceRevisionDigest: sha256:b4ee5010d8a55049aa655b056e12618e038d75f8a8381ec498e97a413cb9f0f9 + sourceBlobDigest: sha256:cb332c62f2f70662406a011c9561382d0721b12faf89259fcc8bd7c41ddd4faa outLocation: /home/luke/github/plexjava workflow: workflowVersion: 1.0.0 diff --git a/LICENSE b/LICENSE deleted file mode 100644 index cb511c80..00000000 --- a/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2023 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 2e46b0ac..00000000 --- a/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 LukeHagar - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index 645d2bab..00000000 --- a/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -.PHONY: * - -all: speakeasy - - -speakeasy: check-speakeasy - speakeasy generate sdk --lang java -o . -s ./openapi.yaml - -speakeasy-validate: check-speakeasy - speakeasy validate openapi -s ./openapi.yaml - -openapi: - curl https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml > ./openapi.yaml - -# This will replace the generation source in your workflow file with your local schema path -generate-from-local: - @if ! which sed >/dev/null; then \ - echo "sed is not installed. Please install it using the following command:"; \ - echo "For Ubuntu/Debian: apt-get install sed"; \ - echo "For macOS: sed is pre-installed"; \ - exit 1; \ - fi - @sed -i '' '/openapi_docs: |/{n;s|-.*|- ./openapi.yaml|;}' ./.github/workflows/speakeasy_sdk_generation.yml - -check-speakeasy: - @command -v speakeasy >/dev/null 2>&1 || { echo >&2 "speakeasy CLI is not installed. Please install before continuing."; exit 1; } diff --git a/README.md b/README.md index 2f160111..b1597c58 100644 --- a/README.md +++ b/README.md @@ -1,140 +1,291 @@ +# plexapi -# PlexSDK Java SDK 0.0.1 +
+ + + + +
-A Java SDK for PlexSDK. + +## SDK Installation -An Open API Spec for interacting with Plex.tv and Plex Servers +### Getting started -- API version: 0.0.1 -- SDK version: 0.0.1 +JDK 11 or later is required. -## Table of Contents +The samples below show how a published SDK artifact is used: -- [PlexSDK Java SDK 0.0.1](#plexsdk-java-sdk-001) - - [Table of Contents](#table-of-contents) - - [Requirements](#requirements) - - [Installation](#installation) - - [Authentication](#authentication) - - [API Key](#api-key) - - [API Endpoint Services](#api-endpoint-services) - - [API Models](#api-models) - - [Testing](#testing) - - [Configuration](#configuration) - - [Sample Usage](#sample-usage) - - [License](#license) +Gradle: +```groovy +implementation 'lukehagar.plexapi:plexapi:0.1.1' +``` -## Requirements - -- Java 8 -- Maven - -## Installation - -If you use Maven, place the following within the `` tag in your pom.xml file: - -```XML +Maven: +```xml - 47.one0 - plex-sdk - 0.0.1 + lukehagar.plexapi + plexapi + 0.1.1 ``` -If you use Gradle, paste the next line inside the dependencies block of your build.gradle file: +### How to build +After cloning the git repository to your file system you can build the SDK artifact from source to the `build` directory by running `./gradlew build` on *nix systems or `gradlew.bat` on Windows systems. -```Gradle -implementation group: "47.one0", name: "PlexSDK", version: "0.0.1" +If you wish to build from source and publish the SDK artifact to your local Maven repository (on your filesystem) then use the following command (after cloning the git repo locally): + +On *nix: +```bash +./gradlew publishToMavenLocal -Pskip.signing ``` - -## Authentication - -To see whether an endpoint needs a specific type of authentication check the endpoint's documentation. - -### API Key - -The PlexSDK API uses API keys as a form of authentication. -An API key is a unique identifier used to authenticate a user, developer, or calling program to an API. - -The API key can be set for the SDK through: - -```Java -PlexSDK sdk = new PlexSDK("YOUR_API_KEY", "YOUR_API_KEY_HEADER"); +On Windows: +```bash +gradlew.bat publishToMavenLocal -Pskip.signing ``` + -## API Endpoint Services + +## SDK Example Usage -All URIs are relative to http://10.10.10.47:32400. +### Example -Click the service name for a full list of the service methods. +```java +package hello.world; -| Service | -| :------ | -|[ServerService](src/main/java/47/one0/services/README.md#serverservice)| -|[MediaService](src/main/java/47/one0/services/README.md#mediaservice)| -|[ActivitiesService](src/main/java/47/one0/services/README.md#activitiesservice)| -|[ButlerService](src/main/java/47/one0/services/README.md#butlerservice)| -|[HubsService](src/main/java/47/one0/services/README.md#hubsservice)| -|[SearchService](src/main/java/47/one0/services/README.md#searchservice)| -|[LibraryService](src/main/java/47/one0/services/README.md#libraryservice)| -|[LogService](src/main/java/47/one0/services/README.md#logservice)| -|[PlaylistsService](src/main/java/47/one0/services/README.md#playlistsservice)| -|[SecurityService](src/main/java/47/one0/services/README.md#securityservice)| -|[SessionsService](src/main/java/47/one0/services/README.md#sessionsservice)| -|[UpdaterService](src/main/java/47/one0/services/README.md#updaterservice)| -|[VideoService](src/main/java/47/one0/services/README.md#videoservice)| +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; -## API Models +public class Application { -[A list documenting all API models for this SDK](src/main/java/47/one0//models/README.md#plexsdk-models). + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); -## Testing + GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() + .call(); -Unit tests aren't available yet. When they are, you'll be able to run them with this command: + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetServerCapabilitiesResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } -```Bash -mvn clean test -``` - -## Configuration - -Your SDK may require some configuration changes. - -This API is configured to use a security token for authorization. You should edit `examples/src/main/java/47/one0/examples/Main.java` and paste your own tokens in place of `PLEXSDK_API_KEY` & `PLEXSDK_API_KEY_HEADER`. - -## Sample Usage - -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.serverService.getServerCapabilities(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); } - } } - ``` + -Inside this directory is `examples/src/main/java/47/one0/examples/Main.java`. It's a simple, "hello, world" level program to demonstate this SDK. Run `install.sh` to prepare the SDK for use. + +## Available Resources and Operations -To see what other functions this SDK is capable of, look inside `src/main/java/47/one0/http/*Client.java`. +### [server()](docs/sdks/server/README.md) -## License +* [getServerCapabilities](docs/sdks/server/README.md#getservercapabilities) - Get Server Capabilities +* [getServerPreferences](docs/sdks/server/README.md#getserverpreferences) - Get Server Preferences +* [getAvailableClients](docs/sdks/server/README.md#getavailableclients) - Get Available Clients +* [getDevices](docs/sdks/server/README.md#getdevices) - Get Devices +* [getServerIdentity](docs/sdks/server/README.md#getserveridentity) - Get Server Identity +* [getMyPlexAccount](docs/sdks/server/README.md#getmyplexaccount) - Get MyPlex Account +* [getResizedPhoto](docs/sdks/server/README.md#getresizedphoto) - Get a Resized Photo +* [getServerList](docs/sdks/server/README.md#getserverlist) - Get Server List -License: MIT. See license in LICENSE. +### [media()](docs/sdks/media/README.md) + +* [markPlayed](docs/sdks/media/README.md#markplayed) - Mark Media Played +* [markUnplayed](docs/sdks/media/README.md#markunplayed) - Mark Media Unplayed +* [updatePlayProgress](docs/sdks/media/README.md#updateplayprogress) - Update Media Play Progress + +### [video()](docs/sdks/video/README.md) + +* [getTimeline](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item +* [startUniversalTranscode](docs/sdks/video/README.md#startuniversaltranscode) - Start Universal Transcode + +### [activities()](docs/sdks/activities/README.md) + +* [getServerActivities](docs/sdks/activities/README.md#getserveractivities) - Get Server Activities +* [cancelServerActivities](docs/sdks/activities/README.md#cancelserveractivities) - Cancel Server Activities + +### [butler()](docs/sdks/butler/README.md) + +* [getButlerTasks](docs/sdks/butler/README.md#getbutlertasks) - Get Butler tasks +* [startAllTasks](docs/sdks/butler/README.md#startalltasks) - Start all Butler tasks +* [stopAllTasks](docs/sdks/butler/README.md#stopalltasks) - Stop all Butler tasks +* [startTask](docs/sdks/butler/README.md#starttask) - Start a single Butler task +* [stopTask](docs/sdks/butler/README.md#stoptask) - Stop a single Butler task + +### [plex()](docs/sdks/plex/README.md) + +* [getHomeData](docs/sdks/plex/README.md#gethomedata) - Get Plex Home Data +* [getPin](docs/sdks/plex/README.md#getpin) - Get a Pin +* [getToken](docs/sdks/plex/README.md#gettoken) - Get Access Token + +### [hubs()](docs/sdks/hubs/README.md) + +* [getGlobalHubs](docs/sdks/hubs/README.md#getglobalhubs) - Get Global Hubs +* [getLibraryHubs](docs/sdks/hubs/README.md#getlibraryhubs) - Get library specific hubs + +### [search()](docs/sdks/search/README.md) + +* [performSearch](docs/sdks/search/README.md#performsearch) - Perform a search +* [performVoiceSearch](docs/sdks/search/README.md#performvoicesearch) - Perform a voice search +* [getSearchResults](docs/sdks/search/README.md#getsearchresults) - Get Search Results + +### [library()](docs/sdks/library/README.md) + +* [getFileHash](docs/sdks/library/README.md#getfilehash) - Get Hash Value +* [getRecentlyAdded](docs/sdks/library/README.md#getrecentlyadded) - Get Recently Added +* [getLibraries](docs/sdks/library/README.md#getlibraries) - Get All Libraries +* [getLibrary](docs/sdks/library/README.md#getlibrary) - Get Library Details +* [deleteLibrary](docs/sdks/library/README.md#deletelibrary) - Delete Library Section +* [getLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items +* [refreshLibrary](docs/sdks/library/README.md#refreshlibrary) - Refresh Library +* [searchLibrary](docs/sdks/library/README.md#searchlibrary) - Search Library +* [getMetadata](docs/sdks/library/README.md#getmetadata) - Get Items Metadata +* [getMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children +* [getTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content +* [getOnDeck](docs/sdks/library/README.md#getondeck) - Get On Deck + +### [log()](docs/sdks/log/README.md) + +* [logLine](docs/sdks/log/README.md#logline) - Logging a single line message. +* [logMultiLine](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message +* [enablePaperTrail](docs/sdks/log/README.md#enablepapertrail) - Enabling Papertrail + +### [playlists()](docs/sdks/playlists/README.md) + +* [createPlaylist](docs/sdks/playlists/README.md#createplaylist) - Create a Playlist +* [getPlaylists](docs/sdks/playlists/README.md#getplaylists) - Get All Playlists +* [getPlaylist](docs/sdks/playlists/README.md#getplaylist) - Retrieve Playlist +* [deletePlaylist](docs/sdks/playlists/README.md#deleteplaylist) - Deletes a Playlist +* [updatePlaylist](docs/sdks/playlists/README.md#updateplaylist) - Update a Playlist +* [getPlaylistContents](docs/sdks/playlists/README.md#getplaylistcontents) - Retrieve Playlist Contents +* [clearPlaylistContents](docs/sdks/playlists/README.md#clearplaylistcontents) - Delete Playlist Contents +* [addPlaylistContents](docs/sdks/playlists/README.md#addplaylistcontents) - Adding to a Playlist +* [uploadPlaylist](docs/sdks/playlists/README.md#uploadplaylist) - Upload Playlist + +### [authentication()](docs/sdks/authentication/README.md) + +* [getTransientToken](docs/sdks/authentication/README.md#gettransienttoken) - Get a Transient Token. +* [getSourceConnectionInformation](docs/sdks/authentication/README.md#getsourceconnectioninformation) - Get Source Connection Information + +### [statistics()](docs/sdks/statistics/README.md) + +* [getStatistics](docs/sdks/statistics/README.md#getstatistics) - Get Media Statistics +* [getResourcesStatistics](docs/sdks/statistics/README.md#getresourcesstatistics) - Get Resources Statistics +* [getBandwidthStatistics](docs/sdks/statistics/README.md#getbandwidthstatistics) - Get Bandwidth Statistics + +### [sessions()](docs/sdks/sessions/README.md) + +* [getSessions](docs/sdks/sessions/README.md#getsessions) - Get Active Sessions +* [getSessionHistory](docs/sdks/sessions/README.md#getsessionhistory) - Get Session History +* [getTranscodeSessions](docs/sdks/sessions/README.md#gettranscodesessions) - Get Transcode Sessions +* [stopTranscodeSession](docs/sdks/sessions/README.md#stoptranscodesession) - Stop a Transcode Session + +### [updater()](docs/sdks/updater/README.md) + +* [getUpdateStatus](docs/sdks/updater/README.md#getupdatestatus) - Querying status of updates +* [checkForUpdates](docs/sdks/updater/README.md#checkforupdates) - Checking for updates +* [applyUpdates](docs/sdks/updater/README.md#applyupdates) - Apply Updates + +### [watchlist()](docs/sdks/watchlist/README.md) + +* [getWatchlist](docs/sdks/watchlist/README.md#getwatchlist) - Get User Watchlist + + + +## Global Parameters + +A parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed. + +For example, you can set `X-Plex-Client-Identifier` to `"Postman"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration. + + +### Available Globals + +The following global parameter is available. + +| Name | Type | Required | Description | +| ---- | ---- |:--------:| ----------- | +| xPlexClientIdentifier | String | | The unique identifier for the client application +This is used to track the client application and its usage +(UUID, serial number, or other number unique per device) + | + + +### Example + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .xPlexClientIdentifier("Postman") + .build(); + + GetPinResponse res = sdk.plex().getPin() + .strong(false) + .xPlexClientIdentifier("Postman") + .xPlexProduct("Postman") + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetPinResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + - - - ## Error Handling @@ -143,7 +294,7 @@ Handling errors in this SDK should largely match your expectations. All operati | Error Object | Status Code | Content Type | | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | | models/errors/GetServerCapabilitiesResponseBody | 401 | application/json | -| models/errors/SDKError | 4xx-5xx | */* | +| models/errors/SDKError | 4xx-5xx | \*\/* | ### Example @@ -427,77 +578,19 @@ public class Application { ``` - -## Global Parameters - -A parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed. - -For example, you can set `X-Plex-Client-Identifier` to `"Postman"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration. - - -### Available Globals - -The following global parameter is available. - -| Name | Type | Required | Description | -| ---- | ---- |:--------:| ----------- | -| xPlexClientIdentifier | String | | The unique identifier for the client application -This is used to track the client application and its usage -(UUID, serial number, or other number unique per device) - | - - -### Example - -```java -package hello.world; - -import java.math.BigDecimal; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.Optional; -import lukehagar.plexapi.plexapi.PlexAPI; -import lukehagar.plexapi.plexapi.models.operations.*; -import lukehagar.plexapi.plexapi.models.shared.*; -import lukehagar.plexapi.plexapi.utils.EventStream; -import org.openapitools.jackson.nullable.JsonNullable; -import static java.util.Map.entry; - -public class Application { - - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .xPlexClientIdentifier("Postman") - .build(); - - GetPinResponse res = sdk.plex().getPin() - .strong(false) - .xPlexClientIdentifier("Postman") - .xPlexProduct("Postman") - .call(); - - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetPinResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - - } -} -``` - - +# Development +## Maturity + +This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage +to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally +looking for the latest version. + +## Contributions + +While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. +We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release. + +### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks) diff --git a/docs/sdks/activities/README.md b/docs/sdks/activities/README.md new file mode 100644 index 00000000..9f193791 --- /dev/null +++ b/docs/sdks/activities/README.md @@ -0,0 +1,151 @@ +# Activities +(*activities()*) + +## Overview + +Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints. +Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity. +Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details: +- They can contain a `progress` (from 0 to 100) marking the percent completion of the activity. +- They must contain an `type` which is used by clients to distinguish the specific activity. +- They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.) +- The may contain a `Response` object which attributes which represent the result of the asynchronous operation. + + +### Available Operations + +* [getServerActivities](#getserveractivities) - Get Server Activities +* [cancelServerActivities](#cancelserveractivities) - Cancel Server Activities + +## getServerActivities + +Get Server Activities + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetServerActivitiesResponse res = sdk.activities().getServerActivities() + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetServerActivitiesResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetServerActivitiesResponse](../../models/operations/GetServerActivitiesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| models/errors/GetServerActivitiesResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## cancelServerActivities + +Cancel Server Activities + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities() + .activityUUID("25b71ed5-0f9d-461c-baa7-d404e9e10d3e") + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.CancelServerActivitiesResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `activityUUID` | *String* | :heavy_check_mark: | The UUID of the activity to cancel. | 25b71ed5-0f9d-461c-baa7-d404e9e10d3e | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.CancelServerActivitiesResponse](../../models/operations/CancelServerActivitiesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| models/errors/CancelServerActivitiesResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | diff --git a/docs/sdks/authentication/README.md b/docs/sdks/authentication/README.md new file mode 100644 index 00000000..e1182546 --- /dev/null +++ b/docs/sdks/authentication/README.md @@ -0,0 +1,155 @@ +# Authentication +(*authentication()*) + +## Overview + +API Calls regarding authentication for Plex Media Server + + +### Available Operations + +* [getTransientToken](#gettransienttoken) - Get a Transient Token. +* [getSourceConnectionInformation](#getsourceconnectioninformation) - Get Source Connection Information + +## getTransientToken + +This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetTransientTokenResponse res = sdk.authentication().getTransientToken() + .type(GetTransientTokenQueryParamType.DELEGATION) + .scope(Scope.ALL) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.GetTransientTokenResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [lukehagar.plexapi.plexapi.models.operations.GetTransientTokenQueryParamType](../../models/operations/GetTransientTokenQueryParamType.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. | +| `scope` | [lukehagar.plexapi.plexapi.models.operations.Scope](../../models/operations/Scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetTransientTokenResponse](../../models/operations/GetTransientTokenResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| models/errors/GetTransientTokenResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getSourceConnectionInformation + +If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token. +Note: requires Plex Media Server >= 1.15.4. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation() + .source("server://client-identifier") + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.GetSourceConnectionInformationResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `source` | *String* | :heavy_check_mark: | The source identifier with an included prefix. | server://client-identifier | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse](../../models/operations/GetSourceConnectionInformationResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| models/errors/GetSourceConnectionInformationResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | diff --git a/docs/sdks/butler/README.md b/docs/sdks/butler/README.md new file mode 100644 index 00000000..3a9c561b --- /dev/null +++ b/docs/sdks/butler/README.md @@ -0,0 +1,353 @@ +# Butler +(*butler()*) + +## Overview + +Butler is the task manager of the Plex Media Server Ecosystem. + + +### Available Operations + +* [getButlerTasks](#getbutlertasks) - Get Butler tasks +* [startAllTasks](#startalltasks) - Start all Butler tasks +* [stopAllTasks](#stopalltasks) - Stop all Butler tasks +* [startTask](#starttask) - Start a single Butler task +* [stopTask](#stoptask) - Stop a single Butler task + +## getButlerTasks + +Returns a list of butler tasks + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetButlerTasksResponse res = sdk.butler().getButlerTasks() + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetButlerTasksResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetButlerTasksResponse](../../models/operations/GetButlerTasksResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| models/errors/GetButlerTasksResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## startAllTasks + +This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria: +1. Any tasks not scheduled to run on the current day will be skipped. +2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately. +3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window. +4. If we are outside the configured window, the task will start immediately. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + StartAllTasksResponse res = sdk.butler().startAllTasks() + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.StartAllTasksResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.StartAllTasksResponse](../../models/operations/StartAllTasksResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| models/errors/StartAllTasksResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## stopAllTasks + +This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + StopAllTasksResponse res = sdk.butler().stopAllTasks() + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.StopAllTasksResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.StopAllTasksResponse](../../models/operations/StopAllTasksResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| models/errors/StopAllTasksResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## startTask + +This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria: +1. Any tasks not scheduled to run on the current day will be skipped. +2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately. +3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window. +4. If we are outside the configured window, the task will start immediately. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + StartTaskResponse res = sdk.butler().startTask() + .taskName(TaskName.CLEAN_OLD_BUNDLES) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.StartTaskResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `taskName` | [lukehagar.plexapi.plexapi.models.operations.TaskName](../../models/operations/TaskName.md) | :heavy_check_mark: | the name of the task to be started. | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.StartTaskResponse](../../models/operations/StartTaskResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| models/errors/StartTaskResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## stopTask + +This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + StopTaskResponse res = sdk.butler().stopTask() + .taskName(PathParamTaskName.BACKUP_DATABASE) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.StopTaskResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `taskName` | [lukehagar.plexapi.plexapi.models.operations.PathParamTaskName](../../models/operations/PathParamTaskName.md) | :heavy_check_mark: | The name of the task to be started. | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.StopTaskResponse](../../models/operations/StopTaskResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| models/errors/StopTaskResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | diff --git a/docs/sdks/hubs/README.md b/docs/sdks/hubs/README.md new file mode 100644 index 00000000..88b34f73 --- /dev/null +++ b/docs/sdks/hubs/README.md @@ -0,0 +1,161 @@ +# Hubs +(*hubs()*) + +## Overview + +Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows. + + +### Available Operations + +* [getGlobalHubs](#getglobalhubs) - Get Global Hubs +* [getLibraryHubs](#getlibraryhubs) - Get library specific hubs + +## getGlobalHubs + +Get Global Hubs filtered by the parameters provided. + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs() + .count(1262.49d) + .onlyTransient(OnlyTransient.ONE) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetGlobalHubsResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `count` | *Optional* | :heavy_minus_sign: | The number of items to return with each hub. | +| `onlyTransient` | [Optional](../../models/operations/OnlyTransient.md) | :heavy_minus_sign: | Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse](../../models/operations/GetGlobalHubsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| models/errors/GetGlobalHubsResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getLibraryHubs + +This endpoint will return a list of library specific hubs + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs() + .sectionId(6728.76d) + .count(9010.22d) + .onlyTransient(QueryParamOnlyTransient.ZERO) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetLibraryHubsResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `sectionId` | *double* | :heavy_check_mark: | the Id of the library to query | +| `count` | *Optional* | :heavy_minus_sign: | The number of items to return with each hub. | +| `onlyTransient` | [Optional](../../models/operations/QueryParamOnlyTransient.md) | :heavy_minus_sign: | Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse](../../models/operations/GetLibraryHubsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| models/errors/GetLibraryHubsResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | diff --git a/docs/sdks/library/README.md b/docs/sdks/library/README.md new file mode 100644 index 00000000..bd1e0cef --- /dev/null +++ b/docs/sdks/library/README.md @@ -0,0 +1,946 @@ +# Library +(*library()*) + +## Overview + +API Calls interacting with Plex Media Server Libraries + + +### Available Operations + +* [getFileHash](#getfilehash) - Get Hash Value +* [getRecentlyAdded](#getrecentlyadded) - Get Recently Added +* [getLibraries](#getlibraries) - Get All Libraries +* [getLibrary](#getlibrary) - Get Library Details +* [deleteLibrary](#deletelibrary) - Delete Library Section +* [getLibraryItems](#getlibraryitems) - Get Library Items +* [refreshLibrary](#refreshlibrary) - Refresh Library +* [searchLibrary](#searchlibrary) - Search Library +* [getMetadata](#getmetadata) - Get Items Metadata +* [getMetadataChildren](#getmetadatachildren) - Get Items Children +* [getTopWatchedContent](#gettopwatchedcontent) - Get Top Watched Content +* [getOnDeck](#getondeck) - Get On Deck + +## getFileHash + +This resource returns hash values for local files + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetFileHashResponse res = sdk.library().getFileHash() + .url("file://C:\Image.png&type=13") + .type(4462.17d) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.GetFileHashResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `url` | *String* | :heavy_check_mark: | This is the path to the local file, must be prefixed by `file://` | file://C:\Image.png&type=13 | +| `type` | *Optional* | :heavy_minus_sign: | Item type | | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetFileHashResponse](../../models/operations/GetFileHashResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/GetFileHashResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getRecentlyAdded + +This endpoint will return the recently added content. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetRecentlyAddedResponse res = sdk.library().getRecentlyAdded() + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetRecentlyAddedResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetRecentlyAddedResponse](../../models/operations/GetRecentlyAddedResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| models/errors/GetRecentlyAddedResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getLibraries + +A library section (commonly referred to as just a library) is a collection of media. +Libraries are typed, and depending on their type provide either a flat or a hierarchical view of the media. +For example, a music library has an artist > albums > tracks structure, whereas a movie library is flat. + +Libraries have features beyond just being a collection of media; for starters, they include information about supported types, filters and sorts. +This allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year). + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetLibrariesResponse res = sdk.library().getLibraries() + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetLibrariesResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetLibrariesResponse](../../models/operations/GetLibrariesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| models/errors/GetLibrariesResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getLibrary + +## Library Details Endpoint + +This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself. + +The details include: + +### Directories +Organized into three categories: + +- **Primary Directories**: + - Used in some clients for quick access to media subsets (e.g., "All", "On Deck"). + - Most can be replicated via media queries. + - Customizable by users. + +- **Secondary Directories**: + - Marked with `secondary="1"`. + - Used in older clients for structured navigation. + +- **Special Directories**: + - Includes a "By Folder" entry for filesystem-based browsing. + - Contains an obsolete `search="1"` entry for on-the-fly search dialog creation. + +### Types +Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls: + +- **Type Object Attributes**: + - `key`: Endpoint for the media list of this type. + - `type`: Metadata type (if standard Plex type). + - `title`: Title for this content type (e.g., "Movies"). + +- **Filter Objects**: + - Subset of the media query language. + - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`. + +- **Sort Objects**: + - Description of sort fields. + - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`. + +> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetLibraryResponse res = sdk.library().getLibrary() + .sectionId(1000d) + .includeDetails(IncludeDetails.ZERO) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetLibraryResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `sectionId` | *double* | :heavy_check_mark: | the Id of the library to query | 1000 | +| `includeDetails` | [Optional](../../models/operations/IncludeDetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts).
Only exists for backwards compatibility, media providers other than the server libraries have it on always.
| | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetLibraryResponse](../../models/operations/GetLibraryResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | +| models/errors/GetLibraryResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## deleteLibrary + +Delate a library using a specific section + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + DeleteLibraryResponse res = sdk.library().deleteLibrary() + .sectionId(1000d) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.DeleteLibraryResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `sectionId` | *double* | :heavy_check_mark: | the Id of the library to query | 1000 | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.DeleteLibraryResponse](../../models/operations/DeleteLibraryResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| models/errors/DeleteLibraryResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getLibraryItems + +Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values: +- `all`: All items in the section. +- `unwatched`: Items that have not been played. +- `newest`: Items that are recently released. +- `recentlyAdded`: Items that are recently added to the library. +- `recentlyViewed`: Items that were recently viewed. +- `onDeck`: Items to continue watching. +- `collection`: Items categorized by collection. +- `edition`: Items categorized by edition. +- `genre`: Items categorized by genre. +- `year`: Items categorized by year of release. +- `decade`: Items categorized by decade. +- `director`: Items categorized by director. +- `actor`: Items categorized by starring actor. +- `country`: Items categorized by country of origin. +- `contentRating`: Items categorized by content rating. +- `rating`: Items categorized by rating. +- `resolution`: Items categorized by resolution. +- `firstCharacter`: Items categorized by the first letter. +- `folder`: Items categorized by folder. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetLibraryItemsResponse res = sdk.library().getLibraryItems() + .sectionId("") + .tag(Tag.GENRE) + .includeGuids(1L) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetLibraryItemsResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `sectionId` | *java.lang.Object* | :heavy_check_mark: | the Id of the library to query | | +| `tag` | [lukehagar.plexapi.plexapi.models.operations.Tag](../../models/operations/Tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | | +| `includeGuids` | *Optional* | :heavy_minus_sign: | Adds the Guids object to the response
| 1 | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetLibraryItemsResponse](../../models/operations/GetLibraryItemsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| models/errors/GetLibraryItemsResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## refreshLibrary + +This endpoint Refreshes the library. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + RefreshLibraryResponse res = sdk.library().refreshLibrary() + .sectionId(934.16d) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.RefreshLibraryResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `sectionId` | *double* | :heavy_check_mark: | the Id of the library to refresh | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.RefreshLibraryResponse](../../models/operations/RefreshLibraryResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| models/errors/RefreshLibraryResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## searchLibrary + +Search for content within a specific section of the library. + +### Types +Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls: + +- **Type Object Attributes**: + - `type`: Metadata type (if standard Plex type). + - `title`: Title for this content type (e.g., "Movies"). + +- **Filter Objects**: + - Subset of the media query language. + - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`. + +- **Sort Objects**: + - Description of sort fields. + - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`. + +> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + SearchLibraryResponse res = sdk.library().searchLibrary() + .sectionId(933505L) + .type(Type.FOUR) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.SearchLibraryResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `sectionId` | *long* | :heavy_check_mark: | the Id of the library to query | +| `type` | [lukehagar.plexapi.plexapi.models.operations.Type](../../models/operations/Type.md) | :heavy_check_mark: | Plex content type to search for | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.SearchLibraryResponse](../../models/operations/SearchLibraryResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| models/errors/SearchLibraryResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getMetadata + +This endpoint will return the metadata of a library item specified with the ratingKey. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetMetadataResponse res = sdk.library().getMetadata() + .ratingKey(8382.31d) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetMetadataResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ratingKey` | *double* | :heavy_check_mark: | the id of the library item to return the children of. | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetMetadataResponse](../../models/operations/GetMetadataResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/GetMetadataResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getMetadataChildren + +This endpoint will return the children of of a library item specified with the ratingKey. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetMetadataChildrenResponse res = sdk.library().getMetadataChildren() + .ratingKey(1539.14d) + .includeElements("") + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetMetadataChildrenResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `ratingKey` | *double* | :heavy_check_mark: | the id of the library item to return the children of. | +| `includeElements` | *Optional* | :heavy_minus_sign: | Adds additional elements to the response. Supported types are (Stream)
| + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetMetadataChildrenResponse](../../models/operations/GetMetadataChildrenResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| models/errors/GetMetadataChildrenResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getTopWatchedContent + +This endpoint will return the top watched content from libraries of a certain type + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent() + .type(505531L) + .includeGuids(1L) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `type` | *long* | :heavy_check_mark: | the library type (1 - movies, 2 - shows, 3 - music) | | +| `includeGuids` | *Optional* | :heavy_minus_sign: | Adds the Guids object to the response
| 1 | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetTopWatchedContentResponse](../../models/operations/GetTopWatchedContentResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------- | ---------------------- | ---------------------- | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getOnDeck + +This endpoint will return the on deck content. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetOnDeckResponse res = sdk.library().getOnDeck() + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetOnDeckResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetOnDeckResponse](../../models/operations/GetOnDeckResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| models/errors/GetOnDeckResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | diff --git a/docs/sdks/log/README.md b/docs/sdks/log/README.md new file mode 100644 index 00000000..3e65afcf --- /dev/null +++ b/docs/sdks/log/README.md @@ -0,0 +1,244 @@ +# Log +(*log()*) + +## Overview + +Submit logs to the Log Handler for Plex Media Server + + +### Available Operations + +* [logLine](#logline) - Logging a single line message. +* [logMultiLine](#logmultiline) - Logging a multi-line message +* [enablePaperTrail](#enablepapertrail) - Enabling Papertrail + +## logLine + +This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + LogLineResponse res = sdk.log().logLine() + .level(Level.THREE) + .message("Test log message") + .source("Postman") + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.LogLineResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `level` | [lukehagar.plexapi.plexapi.models.operations.Level](../../models/operations/Level.md) | :heavy_check_mark: | An integer log level to write to the PMS log with.
0: Error
1: Warning
2: Info
3: Debug
4: Verbose
| | +| `message` | *String* | :heavy_check_mark: | The text of the message to write to the log. | Test log message | +| `source` | *String* | :heavy_check_mark: | a string indicating the source of the message. | Postman | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.LogLineResponse](../../models/operations/LogLineResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| models/errors/LogLineResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## logMultiLine + +This endpoint allows for the batch addition of log entries to the main Plex Media Server log. +It accepts a text/plain request body, where each line represents a distinct log entry. +Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'. + +Log entries are separated by a newline character (`\n`). +Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters. +This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests. + +The 'level' parameter specifies the log entry's severity or importance, with the following integer values: +- `0`: Error - Critical issues that require immediate attention. +- `1`: Warning - Important events that are not critical but may indicate potential issues. +- `2`: Info - General informational messages about system operation. +- `3`: Debug - Detailed information useful for debugging purposes. +- `4`: Verbose - Highly detailed diagnostic information for in-depth analysis. + +The 'message' parameter contains the log text, and 'source' identifies the log message's origin (e.g., an application name or module). + +Example of a single log entry format: +`level=4&message=Sample%20log%20entry&source=applicationName` + +Ensure each parameter is properly URL-encoded to avoid interpretation issues. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + String req = "level=4&message=Test%20message%201&source=postman +level=3&message=Test%20message%202&source=postman +level=1&message=Test%20message%203&source=postman"; + + LogMultiLineResponse res = sdk.log().logMultiLine() + .request(req) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.LogMultiLineResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `request` | [String](../../models//.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.LogMultiLineResponse](../../models/operations/LogMultiLineResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| models/errors/LogMultiLineResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## enablePaperTrail + +This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + EnablePaperTrailResponse res = sdk.log().enablePaperTrail() + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.EnablePaperTrailResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.EnablePaperTrailResponse](../../models/operations/EnablePaperTrailResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| models/errors/EnablePaperTrailResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | diff --git a/docs/sdks/media/README.md b/docs/sdks/media/README.md new file mode 100644 index 00000000..6ce7ec18 --- /dev/null +++ b/docs/sdks/media/README.md @@ -0,0 +1,225 @@ +# Media +(*media()*) + +## Overview + +API Calls interacting with Plex Media Server Media + + +### Available Operations + +* [markPlayed](#markplayed) - Mark Media Played +* [markUnplayed](#markunplayed) - Mark Media Unplayed +* [updatePlayProgress](#updateplayprogress) - Update Media Play Progress + +## markPlayed + +This will mark the provided media key as Played. + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + MarkPlayedResponse res = sdk.media().markPlayed() + .key(59398d) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.MarkPlayedResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `key` | *double* | :heavy_check_mark: | The media key to mark as played | 59398 | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.MarkPlayedResponse](../../models/operations/MarkPlayedResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | +| models/errors/MarkPlayedResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## markUnplayed + +This will mark the provided media key as Unplayed. + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + MarkUnplayedResponse res = sdk.media().markUnplayed() + .key(59398d) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.MarkUnplayedResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `key` | *double* | :heavy_check_mark: | The media key to mark as Unplayed | 59398 | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.MarkUnplayedResponse](../../models/operations/MarkUnplayedResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| models/errors/MarkUnplayedResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## updatePlayProgress + +This API command can be used to update the play progress of a media item. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + UpdatePlayProgressResponse res = sdk.media().updatePlayProgress() + .key("") + .time(90000d) + .state("played") + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.UpdatePlayProgressResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `key` | *String* | :heavy_check_mark: | the media key | | +| `time` | *double* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | 90000 | +| `state` | *String* | :heavy_check_mark: | The playback state of the media item. | played | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.UpdatePlayProgressResponse](../../models/operations/UpdatePlayProgressResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| models/errors/UpdatePlayProgressResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | diff --git a/docs/sdks/playlists/README.md b/docs/sdks/playlists/README.md new file mode 100644 index 00000000..0a4b79ca --- /dev/null +++ b/docs/sdks/playlists/README.md @@ -0,0 +1,689 @@ +# Playlists +(*playlists()*) + +## Overview + +Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017"). +They can be organized in (optionally nesting) folders. +Retrieving a playlist, or its items, will trigger a refresh of its metadata. +This may cause the duration and number of items to change. + + +### Available Operations + +* [createPlaylist](#createplaylist) - Create a Playlist +* [getPlaylists](#getplaylists) - Get All Playlists +* [getPlaylist](#getplaylist) - Retrieve Playlist +* [deletePlaylist](#deleteplaylist) - Deletes a Playlist +* [updatePlaylist](#updateplaylist) - Update a Playlist +* [getPlaylistContents](#getplaylistcontents) - Retrieve Playlist Contents +* [clearPlaylistContents](#clearplaylistcontents) - Delete Playlist Contents +* [addPlaylistContents](#addplaylistcontents) - Adding to a Playlist +* [uploadPlaylist](#uploadplaylist) - Upload Playlist + +## createPlaylist + +Create a new playlist. By default the playlist is blank. To create a playlist along with a first item, pass: +- `uri` - The content URI for what we're playing (e.g. `server://1234/com.plexapp.plugins.library/library/metadata/1`). +- `playQueueID` - To create a playlist from an existing play queue. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + CreatePlaylistRequest req = CreatePlaylistRequest.builder() + .title("") + .type(QueryParamType.PHOTO) + .smart(Smart.ONE) + .uri("") + .build(); + + CreatePlaylistResponse res = sdk.playlists().createPlaylist() + .request(req) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.CreatePlaylistResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `request` | [lukehagar.plexapi.plexapi.models.operations.CreatePlaylistRequest](../../models/operations/CreatePlaylistRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.CreatePlaylistResponse](../../models/operations/CreatePlaylistResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| models/errors/CreatePlaylistResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getPlaylists + +Get All Playlists given the specified filters. + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetPlaylistsResponse res = sdk.playlists().getPlaylists() + .playlistType(PlaylistType.AUDIO) + .smart(QueryParamSmart.ZERO) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetPlaylistsResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `playlistType` | [Optional](../../models/operations/PlaylistType.md) | :heavy_minus_sign: | limit to a type of playlist. | +| `smart` | [Optional](../../models/operations/QueryParamSmart.md) | :heavy_minus_sign: | type of playlists to return (default is all). | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetPlaylistsResponse](../../models/operations/GetPlaylistsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| models/errors/GetPlaylistsResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getPlaylist + +Gets detailed metadata for a playlist. A playlist for many purposes (rating, editing metadata, tagging), can be treated like a regular metadata item: +Smart playlist details contain the `content` attribute. This is the content URI for the generator. This can then be parsed by a client to provide smart playlist editing. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetPlaylistResponse res = sdk.playlists().getPlaylist() + .playlistID(4109.48d) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetPlaylistResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetPlaylistResponse](../../models/operations/GetPlaylistResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/GetPlaylistResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## deletePlaylist + +This endpoint will delete a playlist + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + DeletePlaylistResponse res = sdk.playlists().deletePlaylist() + .playlistID(216.22d) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.DeletePlaylistResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.DeletePlaylistResponse](../../models/operations/DeletePlaylistResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| models/errors/DeletePlaylistResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## updatePlaylist + +From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via `PUT /library/metadata/{playlistID}` + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + UpdatePlaylistResponse res = sdk.playlists().updatePlaylist() + .playlistID(3915d) + .title("") + .summary("") + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.UpdatePlaylistResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist | +| `title` | *Optional* | :heavy_minus_sign: | name of the playlist | +| `summary` | *Optional* | :heavy_minus_sign: | summary description of the playlist | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.UpdatePlaylistResponse](../../models/operations/UpdatePlaylistResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| models/errors/UpdatePlaylistResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getPlaylistContents + +Gets the contents of a playlist. Should be paged by clients via standard mechanisms. +By default leaves are returned (e.g. episodes, movies). In order to return other types you can use the `type` parameter. +For example, you could use this to display a list of recently added albums vis a smart playlist. +Note that for dumb playlists, items have a `playlistItemID` attribute which is used for deleting or moving items. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents() + .playlistID(5004.46d) + .type(9403.59d) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetPlaylistContentsResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist | +| `type` | *double* | :heavy_check_mark: | the metadata type of the item to return | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetPlaylistContentsResponse](../../models/operations/GetPlaylistContentsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| models/errors/GetPlaylistContentsResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## clearPlaylistContents + +Clears a playlist, only works with dumb playlists. Returns the playlist. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents() + .playlistID(1893.18d) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.ClearPlaylistContentsResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.ClearPlaylistContentsResponse](../../models/operations/ClearPlaylistContentsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| models/errors/ClearPlaylistContentsResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## addPlaylistContents + +Adds a generator to a playlist, same parameters as the POST to create. With a dumb playlist, this adds the specified items to the playlist. +With a smart playlist, passing a new `uri` parameter replaces the rules for the playlist. Returns the playlist. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents() + .playlistID(8502.01d) + .uri("server://12345/com.plexapp.plugins.library/library/metadata/1") + .playQueueID(123d) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.AddPlaylistContentsResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `playlistID` | *double* | :heavy_check_mark: | the ID of the playlist | | +| `uri` | *String* | :heavy_check_mark: | the content URI for the playlist | server://12345/com.plexapp.plugins.library/library/metadata/1 | +| `playQueueID` | *Optional* | :heavy_minus_sign: | the play queue to add to a playlist | 123 | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.AddPlaylistContentsResponse](../../models/operations/AddPlaylistContentsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| models/errors/AddPlaylistContentsResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## uploadPlaylist + +Imports m3u playlists by passing a path on the server to scan for m3u-formatted playlist files, or a path to a single playlist file. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + UploadPlaylistResponse res = sdk.playlists().uploadPlaylist() + .path("/home/barkley/playlist.m3u") + .force(Force.ZERO) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.UploadPlaylistResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `path` | *String* | :heavy_check_mark: | absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
The GUID of each playlist is based on the filename.
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.
The GUID of each playlist is based on the filename.
| /home/barkley/playlist.m3u | +| `force` | [lukehagar.plexapi.plexapi.models.operations.Force](../../models/operations/Force.md) | :heavy_check_mark: | Force overwriting of duplicate playlists.
By default, a playlist file uploaded with the same path will overwrite the existing playlist.
The `force` argument is used to disable overwriting.
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.
| | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.UploadPlaylistResponse](../../models/operations/UploadPlaylistResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| models/errors/UploadPlaylistResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | diff --git a/docs/sdks/plex/README.md b/docs/sdks/plex/README.md new file mode 100644 index 00000000..53e75d6c --- /dev/null +++ b/docs/sdks/plex/README.md @@ -0,0 +1,223 @@ +# Plex +(*plex()*) + +## Overview + +API Calls that perform operations directly against https://Plex.tv + + +### Available Operations + +* [getHomeData](#gethomedata) - Get Plex Home Data +* [getPin](#getpin) - Get a Pin +* [getToken](#gettoken) - Get Access Token + +## getHomeData + +Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status. + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetHomeDataResponse res = sdk.plex().getHomeData() + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetHomeDataResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetHomeDataResponse](../../models/operations/GetHomeDataResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/GetHomeDataResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getPin + +Retrieve a Pin from Plex.tv for authentication flows + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .xPlexClientIdentifier("Postman") + .build(); + + GetPinResponse res = sdk.plex().getPin() + .strong(false) + .xPlexClientIdentifier("Postman") + .xPlexProduct("Postman") + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetPinResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `strong` | *Optional* | :heavy_minus_sign: | Determines the kind of code returned by the API call
Strong codes are used for Pin authentication flows
Non-Strong codes are used for `Plex.tv/link`
| | +| `xPlexClientIdentifier` | *Optional* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| Postman | +| `xPlexProduct` | *String* | :heavy_check_mark: | Product name of the application shown in the list of devices
| Postman | +| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetPinResponse](../../models/operations/GetPinResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------------- | -------------------------------- | -------------------------------- | +| models/errors/GetPinResponseBody | 400 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getToken + +Retrieve an Access Token from Plex.tv after the Pin has already been authenticated + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .xPlexClientIdentifier("Postman") + .build(); + + GetTokenResponse res = sdk.plex().getToken() + .pinID("") + .xPlexClientIdentifier("Postman") + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetTokenResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `pinID` | *String* | :heavy_check_mark: | The PinID to retrieve an access token for | | +| `xPlexClientIdentifier` | *Optional* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| Postman | +| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetTokenResponse](../../models/operations/GetTokenResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| models/errors/GetTokenResponseBody | 400 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | diff --git a/docs/sdks/plexapi/README.md b/docs/sdks/plexapi/README.md new file mode 100644 index 00000000..8ee580cf --- /dev/null +++ b/docs/sdks/plexapi/README.md @@ -0,0 +1,9 @@ +# PlexAPI SDK + + +## Overview + +An Open API Spec for interacting with Plex.tv and Plex Servers + +### Available Operations + diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md new file mode 100644 index 00000000..bf4147f2 --- /dev/null +++ b/docs/sdks/search/README.md @@ -0,0 +1,246 @@ +# Search +(*search()*) + +## Overview + +API Calls that perform search operations with Plex Media Server + + +### Available Operations + +* [performSearch](#performsearch) - Perform a search +* [performVoiceSearch](#performvoicesearch) - Perform a voice search +* [getSearchResults](#getsearchresults) - Get Search Results + +## performSearch + +This endpoint performs a search across all library sections, or a single section, and returns matches as hubs, split up by type. It performs spell checking, looks for partial matches, and orders the hubs based on quality of results. In addition, based on matches, it will return other related matches (e.g. for a genre match, it may return movies in that genre, or for an actor match, movies with that actor). + +In the response's items, the following extra attributes are returned to further describe or disambiguate the result: + +- `reason`: The reason for the result, if not because of a direct search term match; can be either: + - `section`: There are multiple identical results from different sections. + - `originalTitle`: There was a search term match from the original title field (sometimes those can be very different or in a foreign language). + - ``: If the reason for the result is due to a result in another hub, the source hub identifier is returned. For example, if the search is for "dylan" then Bob Dylan may be returned as an artist result, an a few of his albums returned as album results with a reason code of `artist` (the identifier of that particular hub). Or if the search is for "arnold", there might be movie results returned with a reason of `actor` +- `reasonTitle`: The string associated with the reason code. For a section reason, it'll be the section name; For a hub identifier, it'll be a string associated with the match (e.g. `Arnold Schwarzenegger` for movies which were returned because the search was for "arnold"). +- `reasonID`: The ID of the item associated with the reason for the result. This might be a section ID, a tag ID, an artist ID, or a show ID. + +This request is intended to be very fast, and called as the user types. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + PerformSearchResponse res = sdk.search().performSearch() + .query("dylan") + .sectionId(1516.53d) + .limit(5d) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.PerformSearchResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `query` | *String* | :heavy_check_mark: | The query term | arnold | +| `sectionId` | *Optional* | :heavy_minus_sign: | This gives context to the search, and can result in re-ordering of search result hubs | | +| `limit` | *Optional* | :heavy_minus_sign: | The number of items to return per hub | 5 | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.PerformSearchResponse](../../models/operations/PerformSearchResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| models/errors/PerformSearchResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## performVoiceSearch + +This endpoint performs a search specifically tailored towards voice or other imprecise input which may work badly with the substring and spell-checking heuristics used by the `/hubs/search` endpoint. +It uses a [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) heuristic to search titles, and as such is much slower than the other search endpoint. +Whenever possible, clients should limit the search to the appropriate type. +Results, as well as their containing per-type hubs, contain a `distance` attribute which can be used to judge result quality. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + PerformVoiceSearchResponse res = sdk.search().performVoiceSearch() + .query("dead+poop") + .sectionId(4094.8d) + .limit(5d) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.PerformVoiceSearchResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `query` | *String* | :heavy_check_mark: | The query term | dead+poop | +| `sectionId` | *Optional* | :heavy_minus_sign: | This gives context to the search, and can result in re-ordering of search result hubs | | +| `limit` | *Optional* | :heavy_minus_sign: | The number of items to return per hub | 5 | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.PerformVoiceSearchResponse](../../models/operations/PerformVoiceSearchResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| models/errors/PerformVoiceSearchResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getSearchResults + +This will search the database for the string provided. + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetSearchResultsResponse res = sdk.search().getSearchResults() + .query("110") + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetSearchResultsResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `query` | *String* | :heavy_check_mark: | The search query string to use | 110 | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetSearchResultsResponse](../../models/operations/GetSearchResultsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| models/errors/GetSearchResultsResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | diff --git a/docs/sdks/server/README.md b/docs/sdks/server/README.md new file mode 100644 index 00000000..416f3f85 --- /dev/null +++ b/docs/sdks/server/README.md @@ -0,0 +1,546 @@ +# Server +(*server()*) + +## Overview + +Operations against the Plex Media Server System. + + +### Available Operations + +* [getServerCapabilities](#getservercapabilities) - Get Server Capabilities +* [getServerPreferences](#getserverpreferences) - Get Server Preferences +* [getAvailableClients](#getavailableclients) - Get Available Clients +* [getDevices](#getdevices) - Get Devices +* [getServerIdentity](#getserveridentity) - Get Server Identity +* [getMyPlexAccount](#getmyplexaccount) - Get MyPlex Account +* [getResizedPhoto](#getresizedphoto) - Get a Resized Photo +* [getServerList](#getserverlist) - Get Server List + +## getServerCapabilities + +Get Server Capabilities + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetServerCapabilitiesResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse](../../models/operations/GetServerCapabilitiesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| models/errors/GetServerCapabilitiesResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getServerPreferences + +Get Server Preferences + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetServerPreferencesResponse res = sdk.server().getServerPreferences() + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetServerPreferencesResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetServerPreferencesResponse](../../models/operations/GetServerPreferencesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| models/errors/GetServerPreferencesResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getAvailableClients + +Get Available Clients + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetAvailableClientsResponse res = sdk.server().getAvailableClients() + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetAvailableClientsResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetAvailableClientsResponse](../../models/operations/GetAvailableClientsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| models/errors/GetAvailableClientsResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getDevices + +Get Devices + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetDevicesResponse res = sdk.server().getDevices() + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetDevicesResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetDevicesResponse](../../models/operations/GetDevicesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | +| models/errors/GetDevicesResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getServerIdentity + +Get Server Identity + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetServerIdentityResponse res = sdk.server().getServerIdentity() + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetServerIdentityResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetServerIdentityResponse](../../models/operations/GetServerIdentityResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| models/errors/GetServerIdentityResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getMyPlexAccount + +Returns MyPlex Account Information + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount() + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetMyPlexAccountResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetMyPlexAccountResponse](../../models/operations/GetMyPlexAccountResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| models/errors/GetMyPlexAccountResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getResizedPhoto + +Plex's Photo transcoder is used throughout the service to serve images at specified sizes. + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetResizedPhotoRequest req = GetResizedPhotoRequest.builder() + .width(110d) + .height(165d) + .opacity(643869L) + .blur(4000d) + .minSize(MinSize.ZERO) + .upscale(Upscale.ZERO) + .url("/library/metadata/49564/thumb/1654258204") + .build(); + + GetResizedPhotoResponse res = sdk.server().getResizedPhoto() + .request(req) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.GetResizedPhotoResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `request` | [lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoRequest](../../models/operations/GetResizedPhotoRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetResizedPhotoResponse](../../models/operations/GetResizedPhotoResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| models/errors/GetResizedPhotoResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getServerList + +Get Server List + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetServerListResponse res = sdk.server().getServerList() + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetServerListResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetServerListResponse](../../models/operations/GetServerListResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| models/errors/GetServerListResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md new file mode 100644 index 00000000..cb40d3b6 --- /dev/null +++ b/docs/sdks/sessions/README.md @@ -0,0 +1,289 @@ +# Sessions +(*sessions()*) + +## Overview + +API Calls that perform search operations with Plex Media Server Sessions + + +### Available Operations + +* [getSessions](#getsessions) - Get Active Sessions +* [getSessionHistory](#getsessionhistory) - Get Session History +* [getTranscodeSessions](#gettranscodesessions) - Get Transcode Sessions +* [stopTranscodeSession](#stoptranscodesession) - Stop a Transcode Session + +## getSessions + +This will retrieve the "Now Playing" Information of the PMS. + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetSessionsResponse res = sdk.sessions().getSessions() + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetSessionsResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetSessionsResponse](../../models/operations/GetSessionsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/GetSessionsResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getSessionHistory + +This will Retrieve a listing of all history views. + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetSessionHistoryResponse res = sdk.sessions().getSessionHistory() + .sort("") + .accountId(1L) + .filter(Filter.builder() + .build()) + .librarySectionID(12L) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetSessionHistoryResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `sort` | *Optional* | :heavy_minus_sign: | Sorts the results by the specified field followed by the direction (asc, desc)
| | +| `accountId` | *Optional* | :heavy_minus_sign: | Filter results by those that are related to a specific users id
| 1 | +| `filter` | [Optional](../../models/operations/Filter.md) | :heavy_minus_sign: | Filters content by field and direction/equality
(Unknown if viewedAt is the only supported column)
| {
"viewed-at-greater-than": {
"value": "viewedAt\u003e"
},
"viewed-at-greater-than-or-equal-to": {
"value": "viewedAt\u003e=\u003e"
},
"viewed-at-less-than": {
"value": "viewedAt\u003c"
}
} | +| `librarySectionID` | *Optional* | :heavy_minus_sign: | Filters the results based on the id of a valid library section
| 12 | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetSessionHistoryResponse](../../models/operations/GetSessionHistoryResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| models/errors/GetSessionHistoryResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getTranscodeSessions + +Get Transcode Sessions + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions() + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetTranscodeSessionsResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse](../../models/operations/GetTranscodeSessionsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| models/errors/GetTranscodeSessionsResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## stopTranscodeSession + +Stop a Transcode Session + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession() + .sessionKey("zz7llzqlx8w9vnrsbnwhbmep") + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.StopTranscodeSessionResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `sessionKey` | *String* | :heavy_check_mark: | the Key of the transcode session to stop | zz7llzqlx8w9vnrsbnwhbmep | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.StopTranscodeSessionResponse](../../models/operations/StopTranscodeSessionResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| models/errors/StopTranscodeSessionResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | diff --git a/docs/sdks/statistics/README.md b/docs/sdks/statistics/README.md new file mode 100644 index 00000000..b04a9460 --- /dev/null +++ b/docs/sdks/statistics/README.md @@ -0,0 +1,226 @@ +# Statistics +(*statistics()*) + +## Overview + +API Calls that perform operations with Plex Media Server Statistics + + +### Available Operations + +* [getStatistics](#getstatistics) - Get Media Statistics +* [getResourcesStatistics](#getresourcesstatistics) - Get Resources Statistics +* [getBandwidthStatistics](#getbandwidthstatistics) - Get Bandwidth Statistics + +## getStatistics + +This will return the media statistics for the server + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetStatisticsResponse res = sdk.statistics().getStatistics() + .timespan(4L) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetStatisticsResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `timespan` | *Optional* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| 4 | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetStatisticsResponse](../../models/operations/GetStatisticsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| models/errors/GetStatisticsResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getResourcesStatistics + +This will return the resources for the server + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics() + .timespan(4L) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetResourcesStatisticsResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `timespan` | *Optional* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| 4 | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetResourcesStatisticsResponse](../../models/operations/GetResourcesStatisticsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| models/errors/GetResourcesStatisticsResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## getBandwidthStatistics + +This will return the bandwidth statistics for the server + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics() + .timespan(4L) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetBandwidthStatisticsResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `timespan` | *Optional* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| 4 | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponse](../../models/operations/GetBandwidthStatisticsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| models/errors/GetBandwidthStatisticsResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | diff --git a/docs/sdks/updater/README.md b/docs/sdks/updater/README.md new file mode 100644 index 00000000..4d28a490 --- /dev/null +++ b/docs/sdks/updater/README.md @@ -0,0 +1,219 @@ +# Updater +(*updater()*) + +## Overview + +This describes the API for searching and applying updates to the Plex Media Server. +Updates to the status can be observed via the Event API. + + +### Available Operations + +* [getUpdateStatus](#getupdatestatus) - Querying status of updates +* [checkForUpdates](#checkforupdates) - Checking for updates +* [applyUpdates](#applyupdates) - Apply Updates + +## getUpdateStatus + +Querying status of updates + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetUpdateStatusResponse res = sdk.updater().getUpdateStatus() + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetUpdateStatusResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetUpdateStatusResponse](../../models/operations/GetUpdateStatusResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| models/errors/GetUpdateStatusResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## checkForUpdates + +Checking for updates + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + CheckForUpdatesResponse res = sdk.updater().checkForUpdates() + .download(Download.ONE) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.CheckForUpdatesResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `download` | [Optional](../../models/operations/Download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | 1 | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.CheckForUpdatesResponse](../../models/operations/CheckForUpdatesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| models/errors/CheckForUpdatesResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## applyUpdates + +Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed + + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + ApplyUpdatesResponse res = sdk.updater().applyUpdates() + .tonight(Tonight.ONE) + .skip(Skip.ONE) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.ApplyUpdatesResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `tonight` | [Optional](../../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](../../models/operations/Skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. | 1 | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.ApplyUpdatesResponse](../../models/operations/ApplyUpdatesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| models/errors/ApplyUpdatesResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | diff --git a/docs/sdks/video/README.md b/docs/sdks/video/README.md new file mode 100644 index 00000000..04a21cea --- /dev/null +++ b/docs/sdks/video/README.md @@ -0,0 +1,182 @@ +# Video +(*video()*) + +## Overview + +API Calls that perform operations with Plex Media Server Videos + + +### Available Operations + +* [getTimeline](#gettimeline) - Get the timeline for a media item +* [startUniversalTranscode](#startuniversaltranscode) - Start Universal Transcode + +## getTimeline + +Get the timeline for a media item + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetTimelineRequest req = GetTimelineRequest.builder() + .ratingKey(23409d) + .key("/library/metadata/23409") + .state(State.PLAYING) + .hasMDE(1d) + .time(2000d) + .duration(10000d) + .context("home:hub.continueWatching") + .playQueueItemID(1d) + .playBackTime(2000d) + .row(1d) + .build(); + + GetTimelineResponse res = sdk.video().getTimeline() + .request(req) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.GetTimelineResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `request` | [lukehagar.plexapi.plexapi.models.operations.GetTimelineRequest](../../models/operations/GetTimelineRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetTimelineResponse](../../models/operations/GetTimelineResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/GetTimelineResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | + +## startUniversalTranscode + +Begin a Universal Transcode Session + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder() + .hasMDE(1d) + .path("/library/metadata/23409") + .mediaIndex(0d) + .partIndex(0d) + .protocol("hls") + .fastSeek(0d) + .directPlay(0d) + .directStream(0d) + .subtitleSize(100d) + .subtites("burn") + .audioBoost(100d) + .location("lan") + .mediaBufferSize(102400d) + .session("zvcage8b7rkioqcm8f4uns4c") + .addDebugOverlay(0d) + .autoAdjustQuality(0d) + .build(); + + StartUniversalTranscodeResponse res = sdk.video().startUniversalTranscode() + .request(req) + .call(); + + // handle response + } catch (lukehagar.plexapi.plexapi.models.errors.StartUniversalTranscodeResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeRequest](../../models/operations/StartUniversalTranscodeRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse](../../models/operations/StartUniversalTranscodeResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| models/errors/StartUniversalTranscodeResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | diff --git a/docs/sdks/watchlist/README.md b/docs/sdks/watchlist/README.md new file mode 100644 index 00000000..5d882d31 --- /dev/null +++ b/docs/sdks/watchlist/README.md @@ -0,0 +1,88 @@ +# Watchlist +(*watchlist()*) + +## Overview + +API Calls that perform operations with Plex Media Server Watchlists + + +### Available Operations + +* [getWatchlist](#getwatchlist) - Get User Watchlist + +## getWatchlist + +Get User Watchlist + +### Example Usage + +```java +package hello.world; + +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import lukehagar.plexapi.plexapi.PlexAPI; +import lukehagar.plexapi.plexapi.models.operations.*; +import lukehagar.plexapi.plexapi.models.shared.*; +import lukehagar.plexapi.plexapi.models.shared.Security; +import lukehagar.plexapi.plexapi.utils.EventStream; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .xPlexClientIdentifier("Postman") + .build(); + + GetWatchlistRequest req = GetWatchlistRequest.builder() + .filter(PathParamFilter.RELEASED) + .xPlexToken("") + .build(); + + GetWatchlistResponse res = sdk.watchlist().getWatchlist() + .request(req) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetWatchlistResponseBody e) { + // handle exception + throw e; + } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `request` | [lukehagar.plexapi.plexapi.models.operations.GetWatchlistRequest](../../models/operations/GetWatchlistRequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | + + +### Response + +**[lukehagar.plexapi.plexapi.models.operations.GetWatchlistResponse](../../models/operations/GetWatchlistResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| models/errors/GetWatchlistResponseBody | 401 | application/json | +| models/errors/SDKError | 4xx-5xx | \*\/* | diff --git a/examples/pom.xml b/examples/pom.xml deleted file mode 100644 index c9924025..00000000 --- a/examples/pom.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - 4.0.0 - - 47.one0 - examples - 1.0-SNAPSHOT - - - 8 - 8 - - - - com.squareup.okhttp3 - okhttp - 4.9.1 - - - com.fasterxml.jackson.core - jackson-databind - 2.14.0-rc1 - - - 47.one0 - PlexSDK - 0.0.1 - - - diff --git a/examples/src/main/java/47/one0/examples/Main.java b/examples/src/main/java/47/one0/examples/Main.java deleted file mode 100644 index b3111d0a..00000000 --- a/examples/src/main/java/47/one0/examples/Main.java +++ /dev/null @@ -1,17 +0,0 @@ -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.serverService.getServerCapabilities(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} diff --git a/examples/src/main/java/com/plexsdk/examples/Main.java b/examples/src/main/java/com/plexsdk/examples/Main.java deleted file mode 100644 index 3a0c4554..00000000 --- a/examples/src/main/java/com/plexsdk/examples/Main.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.serverService.getServerCapabilities(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..d64cd491 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/install.sh b/install.sh deleted file mode 100644 index 45eeb214..00000000 --- a/install.sh +++ /dev/null @@ -1 +0,0 @@ -mvn install diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 92690fc3..00000000 --- a/pom.xml +++ /dev/null @@ -1,254 +0,0 @@ - - - 4.0.0 - - - 47.one0 - - - plex-sdk - - - 0.0.1 - - - - ${project.groupId}:${project.artifactId} - A Java SDK for PlexSDK. - - - - - - - - - - - - - - - - - Liblab - contact@liblab.com - Liblab - https://liblab.com/ - - - - - - - MIT - - - https://opensource.org/licenses/MIT - - - - - - 1.8 - 1.8 - - UTF-8 - - - - - org.projectlombok - lombok - 1.18.30 - provided - - - junit - junit - 4.13.1 - test - - - org.junit.jupiter - junit-jupiter-api - 5.7.2 - test - - - org.junit.jupiter - junit-jupiter-engine - 5.7.2 - test - - - com.fasterxml.jackson.core - jackson-databind - 2.14.1 - - - com.squareup.okhttp3 - okhttp - 4.9.1 - - - - - - - ossrh - https://s01.oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - - - release-sign-artifacts - - - performRelease - true - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 - true - - ossrh - https://s01.oss.sonatype.org/ - true - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-sources - - jar-no-fork - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.5.0 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - - - - - - - - - maven-clean-plugin - 3.1.0 - - - - maven-resources-plugin - 3.0.2 - - - maven-compiler-plugin - 3.8.0 - - - maven-surefire-plugin - 2.22.2 - - - maven-failsafe-plugin - 2.22.2 - - - maven-jar-plugin - 3.0.2 - - - maven-install-plugin - 2.5.2 - - - maven-deploy-plugin - 2.8.2 - - - - maven-site-plugin - 3.7.1 - - - maven-project-info-reports-plugin - 3.0.0 - - - org.apache.maven.plugins - maven-pmd-plugin - 3.19.0 - - - /category/java/bestpractices.xml - /category/java/codestyle.xml - /category/java/design.xml - /category/java/performance.xml - - - - - - - - - - org.apache.maven.plugins - maven-pmd-plugin - 3.19.0 - - - - diff --git a/src/main/java/47/one0/Configuration.java b/src/main/java/47/one0/Configuration.java deleted file mode 100644 index 2ea7d10a..00000000 --- a/src/main/java/47/one0/Configuration.java +++ /dev/null @@ -1,9 +0,0 @@ -package 47.one0; - -public class Configuration { - - public static final String USER_AGENT = "liblab/0.1.25 PlexSDK/0.0.1 java/1.8"; - - public static final String DEFAULT_API_KEY_HEADER = "X-Plex-Token"; - -} diff --git a/src/main/java/47/one0/Environment.java b/src/main/java/47/one0/Environment.java deleted file mode 100644 index c7ea1abf..00000000 --- a/src/main/java/47/one0/Environment.java +++ /dev/null @@ -1,14 +0,0 @@ -package 47.one0; - -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor -public enum Environment { - DEFAULT("http://10.10.10.47:32400"); - - private final String url; - - public String getUrl() { - return this.url; - } -} diff --git a/src/main/java/47/one0/PlexSDK.java b/src/main/java/47/one0/PlexSDK.java deleted file mode 100644 index b7a95f7e..00000000 --- a/src/main/java/47/one0/PlexSDK.java +++ /dev/null @@ -1,92 +0,0 @@ -package 47.one0; - -import java.util.Map; -import 47.one0.services.*; -import 47.one0.Environment; -import okhttp3.OkHttpClient; -import 47.one0.http.interceptors.DefaultHeadersInterceptor; -import 47.one0.http.interceptors.ApiKeyInterceptor; -import 47.one0.http.interceptors.RetryInterceptor; - - -public class PlexSDK { - public ActivitiesService activitiesService; -public ButlerService butlerService; -public HubsService hubsService; -public LibraryService libraryService; -public LogService logService; -public MediaService mediaService; -public PlaylistsService playlistsService; -public SearchService searchService; -public SecurityService securityService; -public ServerService serverService; -public SessionsService sessionsService; -public UpdaterService updaterService; -public VideoService videoService; - - private final ApiKeyInterceptor apiKeyInterceptor = new ApiKeyInterceptor(); - - - public PlexSDK() { -final String serverUrl = Environment.DEFAULT.getUrl(); -final OkHttpClient httpClient = new OkHttpClient.Builder() -.addInterceptor(new DefaultHeadersInterceptor()) -.addInterceptor(new RetryInterceptor()) -.addInterceptor(apiKeyInterceptor) -.build(); - -this.activitiesService = new ActivitiesService(httpClient, serverUrl); -this.butlerService = new ButlerService(httpClient, serverUrl); -this.hubsService = new HubsService(httpClient, serverUrl); -this.libraryService = new LibraryService(httpClient, serverUrl); -this.logService = new LogService(httpClient, serverUrl); -this.mediaService = new MediaService(httpClient, serverUrl); -this.playlistsService = new PlaylistsService(httpClient, serverUrl); -this.searchService = new SearchService(httpClient, serverUrl); -this.securityService = new SecurityService(httpClient, serverUrl); -this.serverService = new ServerService(httpClient, serverUrl); -this.sessionsService = new SessionsService(httpClient, serverUrl); -this.updaterService = new UpdaterService(httpClient, serverUrl); -this.videoService = new VideoService(httpClient, serverUrl); -} - -public PlexSDK(String apiKey) { -this(apiKey, null); -} - -public PlexSDK(String apiKey, String apiKeyHeader) { -this(); -setApiKey(apiKey); -setApiKeyHeader(apiKeyHeader); -} - - - public void setBaseUrl(String url) { -this.activitiesService.setBaseUrl(url); -this.butlerService.setBaseUrl(url); -this.hubsService.setBaseUrl(url); -this.libraryService.setBaseUrl(url); -this.logService.setBaseUrl(url); -this.mediaService.setBaseUrl(url); -this.playlistsService.setBaseUrl(url); -this.searchService.setBaseUrl(url); -this.securityService.setBaseUrl(url); -this.serverService.setBaseUrl(url); -this.sessionsService.setBaseUrl(url); -this.updaterService.setBaseUrl(url); -this.videoService.setBaseUrl(url); -} - - - public void setApiKey(String apiKey) { - this.apiKeyInterceptor.setApiKey(apiKey); - } - - public void setApiKeyHeader(String apiKeyHeader) { - this.apiKeyInterceptor.setApiKeyHeader(apiKeyHeader); - } - - - - -} diff --git a/src/main/java/47/one0/exceptions/ApiException.java b/src/main/java/47/one0/exceptions/ApiException.java deleted file mode 100644 index 47e11d15..00000000 --- a/src/main/java/47/one0/exceptions/ApiException.java +++ /dev/null @@ -1,56 +0,0 @@ -package 47.one0.exceptions; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -/** - * This is the base class for all exceptions that represent an error response from the server. - */ -public class ApiException extends RuntimeException { - private static final Map ERROR_MAP = Collections.unmodifiableMap(new HashMap() { - { - put(401, "Unauthorized"); - put(403, "Forbidden"); - put(404, "Not Found"); - put(405, "Method Not Allowed"); - put(406, "Not Acceptable"); - put(409, "Conflict"); - put(410, "Gone"); - put(500, "Internal Server Error"); - put(502, "Bad Gateway"); - put(503, "Service Unavailable"); - put(504, "Gateway Timeout"); - } - }); - - private final int statusCode; - - public ApiException(int code) { - super(getExceptionMessage(code)); - this.statusCode = code; - } - - public ApiException(String message) { - super(message); - this.statusCode = 0; - } - - public ApiException(String message, Throwable t) { - super(message, t); - this.statusCode = 0; - } - - public ApiException(int code, String message) { - super(message); - this.statusCode = code; - } - - public int getStatusCode() { - return this.statusCode; - } - - static String getExceptionMessage(int code) { - return ERROR_MAP.getOrDefault(code, "Unknown Error"); - } - } diff --git a/src/main/java/47/one0/exceptions/ArgumentCannotBeNullException.java b/src/main/java/47/one0/exceptions/ArgumentCannotBeNullException.java deleted file mode 100644 index 2a10d668..00000000 --- a/src/main/java/47/one0/exceptions/ArgumentCannotBeNullException.java +++ /dev/null @@ -1,19 +0,0 @@ -package 47.one0.exceptions; - -/** - * Thrown to indicate that a service method has been passed an illegal or inappropriate argument. - * For example, if a required argument is being passed as null. - */ -public class ArgumentCannotBeNullException extends RuntimeException { - - private static final String ARGUMENT_NAME_MESSAGE_FORMAT = "Required argument %s cannot be null."; - private static final String DEFAULT_MESSAGE = "Required argument cannot be null."; - - public ArgumentCannotBeNullException() { - super(DEFAULT_MESSAGE); - } - - public ArgumentCannotBeNullException(String argumentName) { - super(String.format(ARGUMENT_NAME_MESSAGE_FORMAT, argumentName)); - } -} diff --git a/src/main/java/47/one0/hooks/CustomHook.java b/src/main/java/47/one0/hooks/CustomHook.java deleted file mode 100644 index 8b137891..00000000 --- a/src/main/java/47/one0/hooks/CustomHook.java +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/main/java/47/one0/hooks/model/Hook.java b/src/main/java/47/one0/hooks/model/Hook.java deleted file mode 100644 index dce9954b..00000000 --- a/src/main/java/47/one0/hooks/model/Hook.java +++ /dev/null @@ -1,27 +0,0 @@ -package 47.one0.hooks.model; - -/** - * Liblab Hook interface - */ -public interface Hook { - - /** - * Is called before the request is made to the API - * @param request the request about to be made by the SDK - */ - void beforeRequest(Request request); - - /** - * Is called after the response has returned - * @param request the request that was made by the SDK - * @param response the response coming back from the API the SDK has called - */ - void afterResponse(Request request, Response response); - - /** - * Is called when an error occurs in the SDK - * @param request the request that was made by the SDK - * @param exception The Exception thrown - */ - void onError(Request request, Exception exception); -} diff --git a/src/main/java/47/one0/hooks/model/Request.java b/src/main/java/47/one0/hooks/model/Request.java deleted file mode 100644 index 74465afc..00000000 --- a/src/main/java/47/one0/hooks/model/Request.java +++ /dev/null @@ -1,89 +0,0 @@ -package 47.one0.hooks.model; - -import 47.one0.http.ModelConverter; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -import okhttp3.Headers; -import okhttp3.RequestBody; - - -/** - * Liblab's representation of a request - */ -public class Request { - private String method; - private String url; - private String body; - private Map headers; - - public Request(String method, String url, String body, Map headers) { - this.method = method; - this.url = url; - this.body = body; - this.headers = headers; - } - - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getBody() { - return body; - } - - public void setBody(String body) { - this.body = body; - } - - public Map getHeaders() { - return headers; - } - - public void setHeaders(Map headers) { - this.headers = headers; - } - - public static Request toHookRequest(okhttp3.Request request) { - Map hookHeaders = request - .headers() - .toMultimap() - .entrySet() - .stream() - .collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue().get(0))); - return new Request( - request.method(), - request.url().toString(), - request.body() != null ? Objects.requireNonNull(request.body()).toString() : "", - hookHeaders - ); - } - - public static okhttp3.Request toOkHttpRequest(Request hookRequest) { - Headers.Builder headersBuilder = new Headers.Builder(); - hookRequest.getHeaders().forEach(headersBuilder::add); - - if (hookRequest.getBody() != null && !hookRequest.getBody().isEmpty()) { - RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(hookRequest.getBody())), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); - return new okhttp3.Request.Builder().method(hookRequest.getMethod(), requestBody).headers(headersBuilder.build()).url(hookRequest.url).build(); - } else { - return new okhttp3.Request.Builder().method(hookRequest.getMethod(), null).headers(headersBuilder.build()).url(hookRequest.url).build(); - } - } -} diff --git a/src/main/java/47/one0/hooks/model/Response.java b/src/main/java/47/one0/hooks/model/Response.java deleted file mode 100644 index 5b18ee2b..00000000 --- a/src/main/java/47/one0/hooks/model/Response.java +++ /dev/null @@ -1,62 +0,0 @@ -package 47.one0.hooks.model; - -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** - * Liblab's representation of a response - */ -public class Response { - private int statusCode; - private String body; - private Map headers; - - public Response(int statusCode, String body, Map headers) { - this.statusCode = statusCode; - this.body = body; - this.headers = headers; - } - - public int getStatusCode() { - return statusCode; - } - - public void setStatusCode(int statusCode) { - this.statusCode = statusCode; - } - - public String getBody() { - return body; - } - - public void setBody(String body) { - this.body = body; - } - - public Map getHeaders() { - return headers; - } - - public void setHeaders(Map headers) { - this.headers = headers; - } - - public static Response toHookResponse(okhttp3.Response response) { - - Map responseHeaders = response - .headers() - .toMultimap() - .entrySet() - .stream() - .collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue().get(0))); - - - return new Response( - response.code(), - response.body() != null ? Objects.requireNonNull(response.body()).toString() : null, - responseHeaders - ); - - } -} diff --git a/src/main/java/47/one0/http/ActivitiesClient.java b/src/main/java/47/one0/http/ActivitiesClient.java deleted file mode 100644 index ed41296c..00000000 --- a/src/main/java/47/one0/http/ActivitiesClient.java +++ /dev/null @@ -1,13 +0,0 @@ -package 47.one0.http; - -import java.util.List; - -import 47.one0.exceptions.ApiException; - -public interface ActivitiesClient { - - ResponseWithHeaders<47.one0.models.GetServerActivitiesResponse> getServerActivities() throws ApiException; - ResponseWithHeaders cancelServerActivities(String activityUUID) throws ApiException; - - -} \ No newline at end of file diff --git a/src/main/java/47/one0/http/ButlerClient.java b/src/main/java/47/one0/http/ButlerClient.java deleted file mode 100644 index de6db36b..00000000 --- a/src/main/java/47/one0/http/ButlerClient.java +++ /dev/null @@ -1,16 +0,0 @@ -package 47.one0.http; - -import java.util.List; - -import 47.one0.exceptions.ApiException; - -public interface ButlerClient { - - ResponseWithHeaders<47.one0.models.GetButlerTasksResponse> getButlerTasks() throws ApiException; - ResponseWithHeaders startAllTasks() throws ApiException; - ResponseWithHeaders stopAllTasks() throws ApiException; - ResponseWithHeaders startTask(String taskName) throws ApiException; - ResponseWithHeaders stopTask(String taskName) throws ApiException; - - -} \ No newline at end of file diff --git a/src/main/java/47/one0/http/HubsClient.java b/src/main/java/47/one0/http/HubsClient.java deleted file mode 100644 index a3d2d2e4..00000000 --- a/src/main/java/47/one0/http/HubsClient.java +++ /dev/null @@ -1,13 +0,0 @@ -package 47.one0.http; - -import java.util.List; - -import 47.one0.exceptions.ApiException; - -public interface HubsClient { - - ResponseWithHeaders getGlobalHubs(Float count, Float onlyTransient) throws ApiException; - ResponseWithHeaders getLibraryHubs(Float sectionId, Float count, Float onlyTransient) throws ApiException; - - -} \ No newline at end of file diff --git a/src/main/java/47/one0/http/LibraryClient.java b/src/main/java/47/one0/http/LibraryClient.java deleted file mode 100644 index 0c89849c..00000000 --- a/src/main/java/47/one0/http/LibraryClient.java +++ /dev/null @@ -1,23 +0,0 @@ -package 47.one0.http; - -import java.util.List; - -import 47.one0.exceptions.ApiException; - -public interface LibraryClient { - - ResponseWithHeaders getFileHash(String url, Float type) throws ApiException; - ResponseWithHeaders<47.one0.models.GetRecentlyAddedResponse> getRecentlyAdded() throws ApiException; - ResponseWithHeaders getLibraries() throws ApiException; - ResponseWithHeaders getLibrary(Float sectionId, Float includeDetails) throws ApiException; - ResponseWithHeaders deleteLibrary(Float sectionId) throws ApiException; - ResponseWithHeaders getLibraryItems(Float sectionId, Float type, String filter) throws ApiException; - ResponseWithHeaders refreshLibrary(Float sectionId) throws ApiException; - ResponseWithHeaders getLatestLibraryItems(Float sectionId, Float type, String filter) throws ApiException; - ResponseWithHeaders getCommonLibraryItems(Float sectionId, Float type, String filter) throws ApiException; - ResponseWithHeaders getMetadata(Float ratingKey) throws ApiException; - ResponseWithHeaders getMetadataChildren(Float ratingKey) throws ApiException; - ResponseWithHeaders<47.one0.models.GetOnDeckResponse> getOnDeck() throws ApiException; - - -} \ No newline at end of file diff --git a/src/main/java/47/one0/http/LogClient.java b/src/main/java/47/one0/http/LogClient.java deleted file mode 100644 index 8085c3fb..00000000 --- a/src/main/java/47/one0/http/LogClient.java +++ /dev/null @@ -1,14 +0,0 @@ -package 47.one0.http; - -import java.util.List; - -import 47.one0.exceptions.ApiException; - -public interface LogClient { - - ResponseWithHeaders logLine(Float level, String message, String source) throws ApiException; - ResponseWithHeaders logMultiLine() throws ApiException; - ResponseWithHeaders enablePaperTrail() throws ApiException; - - -} \ No newline at end of file diff --git a/src/main/java/47/one0/http/MediaClient.java b/src/main/java/47/one0/http/MediaClient.java deleted file mode 100644 index 3acec171..00000000 --- a/src/main/java/47/one0/http/MediaClient.java +++ /dev/null @@ -1,14 +0,0 @@ -package 47.one0.http; - -import java.util.List; - -import 47.one0.exceptions.ApiException; - -public interface MediaClient { - - ResponseWithHeaders markPlayed(Float key) throws ApiException; - ResponseWithHeaders markUnplayed(Float key) throws ApiException; - ResponseWithHeaders updatePlayProgress(String key, Float time, String state) throws ApiException; - - -} \ No newline at end of file diff --git a/src/main/java/47/one0/http/ModelConverter.java b/src/main/java/47/one0/http/ModelConverter.java deleted file mode 100644 index f1d74214..00000000 --- a/src/main/java/47/one0/http/ModelConverter.java +++ /dev/null @@ -1,76 +0,0 @@ -package 47.one0.http; - - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -import okhttp3.Response; -import okhttp3.ResponseBody; - -public final class ModelConverter { - private final static ObjectMapper mapper = new ObjectMapper(); - - static { - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); - mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - mapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); - } - - private ModelConverter() { - } - - public static T convert(final Response response, final Class clazz) { - final ResponseBody body = response.body(); - try { - return mapper.readValue(body.string(), clazz); - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - public static T convert(final String response, final Class clazz) { - try { - return mapper.readValue(response, clazz); - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - public static T convert(Response response, TypeReference typeReference) { - try { - return convert(response.body().string(), typeReference); - } catch (Exception e) { - e.printStackTrace(); - } - - return null; - } - - public static T convert(String response, TypeReference typeReference) { - try { - return mapper.readValue(response, typeReference); - } catch (Exception e) { - e.printStackTrace(); - } - - return null; - } - - public static String modelToJson(final Object model) { - try { - return mapper.writeValueAsString(model); - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/src/main/java/47/one0/http/PlaylistsClient.java b/src/main/java/47/one0/http/PlaylistsClient.java deleted file mode 100644 index bb9a65c1..00000000 --- a/src/main/java/47/one0/http/PlaylistsClient.java +++ /dev/null @@ -1,20 +0,0 @@ -package 47.one0.http; - -import java.util.List; - -import 47.one0.exceptions.ApiException; - -public interface PlaylistsClient { - - ResponseWithHeaders createPlaylist(String title, String type, Float smart, String uri, Float playQueueID) throws ApiException; - ResponseWithHeaders getPlaylists(String playlistType, Float smart) throws ApiException; - ResponseWithHeaders getPlaylist(Float playlistID) throws ApiException; - ResponseWithHeaders updatePlaylist(Float playlistID) throws ApiException; - ResponseWithHeaders deletePlaylist(Float playlistID) throws ApiException; - ResponseWithHeaders getPlaylistContents(Float playlistID, Float type) throws ApiException; - ResponseWithHeaders addPlaylistContents(Float playlistID, String uri, Float playQueueID) throws ApiException; - ResponseWithHeaders clearPlaylistContents(Float playlistID) throws ApiException; - ResponseWithHeaders uploadPlaylist(String path, Float force) throws ApiException; - - -} \ No newline at end of file diff --git a/src/main/java/47/one0/http/ResponseWithHeaders.java b/src/main/java/47/one0/http/ResponseWithHeaders.java deleted file mode 100644 index b8e2d2dd..00000000 --- a/src/main/java/47/one0/http/ResponseWithHeaders.java +++ /dev/null @@ -1,22 +0,0 @@ -package 47.one0.http; - -import okhttp3.Headers; - -public class ResponseWithHeaders { - private T data; - private Headers headers; - - public ResponseWithHeaders(T data, Headers headers) { - this.data = data; - this.headers = headers; - } - - public T getData() { - return data; - } - - public Headers getHeaders() { - return headers; - } - -} diff --git a/src/main/java/47/one0/http/SearchClient.java b/src/main/java/47/one0/http/SearchClient.java deleted file mode 100644 index 022275c9..00000000 --- a/src/main/java/47/one0/http/SearchClient.java +++ /dev/null @@ -1,14 +0,0 @@ -package 47.one0.http; - -import java.util.List; - -import 47.one0.exceptions.ApiException; - -public interface SearchClient { - - ResponseWithHeaders performSearch(String query, Float sectionId, Float limit) throws ApiException; - ResponseWithHeaders performVoiceSearch(String query, Float sectionId, Float limit) throws ApiException; - ResponseWithHeaders<47.one0.models.GetSearchResultsResponse> getSearchResults(String query) throws ApiException; - - -} \ No newline at end of file diff --git a/src/main/java/47/one0/http/SecurityClient.java b/src/main/java/47/one0/http/SecurityClient.java deleted file mode 100644 index 55bbf252..00000000 --- a/src/main/java/47/one0/http/SecurityClient.java +++ /dev/null @@ -1,13 +0,0 @@ -package 47.one0.http; - -import java.util.List; - -import 47.one0.exceptions.ApiException; - -public interface SecurityClient { - - ResponseWithHeaders getTransientToken(String type, String scope) throws ApiException; - ResponseWithHeaders getSourceConnectionInformation(String source) throws ApiException; - - -} \ No newline at end of file diff --git a/src/main/java/47/one0/http/ServerClient.java b/src/main/java/47/one0/http/ServerClient.java deleted file mode 100644 index 1c0ed909..00000000 --- a/src/main/java/47/one0/http/ServerClient.java +++ /dev/null @@ -1,19 +0,0 @@ -package 47.one0.http; - -import java.util.List; - -import 47.one0.exceptions.ApiException; - -public interface ServerClient { - - ResponseWithHeaders<47.one0.models.GetServerCapabilitiesResponse> getServerCapabilities() throws ApiException; - ResponseWithHeaders getServerPreferences() throws ApiException; - ResponseWithHeaders> getAvailableClients() throws ApiException; - ResponseWithHeaders<47.one0.models.GetDevicesResponse> getDevices() throws ApiException; - ResponseWithHeaders<47.one0.models.GetServerIdentityResponse> getServerIdentity() throws ApiException; - ResponseWithHeaders<47.one0.models.GetMyPlexAccountResponse> getMyPlexAccount() throws ApiException; - ResponseWithHeaders getResizedPhoto(Float width, Float height, Integer opacity, Float blur, Float minSize, Float upscale, String url) throws ApiException; - ResponseWithHeaders<47.one0.models.GetServerListResponse> getServerList() throws ApiException; - - -} \ No newline at end of file diff --git a/src/main/java/47/one0/http/SessionsClient.java b/src/main/java/47/one0/http/SessionsClient.java deleted file mode 100644 index 4e88dac6..00000000 --- a/src/main/java/47/one0/http/SessionsClient.java +++ /dev/null @@ -1,15 +0,0 @@ -package 47.one0.http; - -import java.util.List; - -import 47.one0.exceptions.ApiException; - -public interface SessionsClient { - - ResponseWithHeaders getSessions() throws ApiException; - ResponseWithHeaders getSessionHistory() throws ApiException; - ResponseWithHeaders<47.one0.models.GetTranscodeSessionsResponse> getTranscodeSessions() throws ApiException; - ResponseWithHeaders stopTranscodeSession(String sessionKey) throws ApiException; - - -} \ No newline at end of file diff --git a/src/main/java/47/one0/http/UpdaterClient.java b/src/main/java/47/one0/http/UpdaterClient.java deleted file mode 100644 index 4c797202..00000000 --- a/src/main/java/47/one0/http/UpdaterClient.java +++ /dev/null @@ -1,14 +0,0 @@ -package 47.one0.http; - -import java.util.List; - -import 47.one0.exceptions.ApiException; - -public interface UpdaterClient { - - ResponseWithHeaders getUpdateStatus() throws ApiException; - ResponseWithHeaders checkForUpdates(String download) throws ApiException; - ResponseWithHeaders applyUpdates(String tonight, String skip) throws ApiException; - - -} \ No newline at end of file diff --git a/src/main/java/47/one0/http/VideoClient.java b/src/main/java/47/one0/http/VideoClient.java deleted file mode 100644 index af4d0054..00000000 --- a/src/main/java/47/one0/http/VideoClient.java +++ /dev/null @@ -1,13 +0,0 @@ -package 47.one0.http; - -import java.util.List; - -import 47.one0.exceptions.ApiException; - -public interface VideoClient { - - ResponseWithHeaders startUniversalTranscode(Float hasMDE, String path, Float mediaIndex, Float partIndex, String protocol, Float fastSeek, Float directPlay, Float directStream, Float subtitleSize, String subtites, Float audioBoost, String location, Float mediaBufferSize, String session, Float addDebugOverlay, Float autoAdjustQuality) throws ApiException; - ResponseWithHeaders getTimeline(Float ratingKey, String key, String state, Float hasMDE, Float time, Float duration, String context, Float playQueueItemID, Float playBackTime, Float row) throws ApiException; - - -} \ No newline at end of file diff --git a/src/main/java/47/one0/http/interceptors/ApiKeyInterceptor.java b/src/main/java/47/one0/http/interceptors/ApiKeyInterceptor.java deleted file mode 100644 index f559936b..00000000 --- a/src/main/java/47/one0/http/interceptors/ApiKeyInterceptor.java +++ /dev/null @@ -1,37 +0,0 @@ -package 47.one0.http.interceptors; - -import 47.one0.Configuration; -import java.io.IOException; -import lombok.Getter; -import lombok.Setter; -import okhttp3.Interceptor; -import okhttp3.Request; -import okhttp3.Response; - -public class ApiKeyInterceptor implements Interceptor { - - @Getter - @Setter - private String apiKey; - - @Getter - @Setter - private String apiKeyHeader; - - @Override - public Response intercept(Chain chain) throws IOException { - return chain.proceed(addApiKeyToRequest(chain.request())); - } - - private Request addApiKeyToRequest(Request request) { - return this.apiKey != null && !this.apiKey.isEmpty() - ? request.newBuilder().addHeader(resolveHeader(), this.apiKey).build() - : request; - } - - private String resolveHeader() { - return this.apiKeyHeader != null && !this.apiKeyHeader.isEmpty() - ? this.apiKeyHeader - : Configuration.DEFAULT_API_KEY_HEADER; - } -} diff --git a/src/main/java/47/one0/http/interceptors/DefaultHeadersInterceptor.java b/src/main/java/47/one0/http/interceptors/DefaultHeadersInterceptor.java deleted file mode 100644 index 886a9aa5..00000000 --- a/src/main/java/47/one0/http/interceptors/DefaultHeadersInterceptor.java +++ /dev/null @@ -1,36 +0,0 @@ -package 47.one0.http.interceptors; - -import 47.one0.Configuration; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Interceptor; -import okhttp3.Request; -import okhttp3.Request.Builder; -import okhttp3.Response; - -public class DefaultHeadersInterceptor implements Interceptor { - - private final Map defaultHeaders = new HashMap<>(); - - public DefaultHeadersInterceptor() { - defaultHeaders.put("User-Agent", Configuration.USER_AGENT); - } - - @Override - public Response intercept(Chain chain) throws IOException { - return chain.proceed(addDefaultHeadersToRequest(chain.request())); - } - - private Request addDefaultHeadersToRequest(Request request) { - if (defaultHeaders.isEmpty()) { - return request; - } - - Builder requestBuilder = request.newBuilder(); - - defaultHeaders.forEach(requestBuilder::addHeader); - - return requestBuilder.build(); - } -} diff --git a/src/main/java/47/one0/http/interceptors/RetryInterceptor.java b/src/main/java/47/one0/http/interceptors/RetryInterceptor.java deleted file mode 100644 index e65cd460..00000000 --- a/src/main/java/47/one0/http/interceptors/RetryInterceptor.java +++ /dev/null @@ -1,37 +0,0 @@ -package 47.one0.http.interceptors; - -import java.io.IOException; -import java.util.stream.IntStream; - -import okhttp3.Interceptor; -import okhttp3.Request; -import okhttp3.Response; - -public class RetryInterceptor implements Interceptor { - private static final int MAX_RETRIES = 3; - private static final double RETRY_DELAY = 150; - private static final int[] RETRYABLE_CODES = { 500, 503, 504 }; - @Override - public Response intercept(Chain chain) throws IOException { - // Try the request and if it fails use exponential backoff to retry - Request request = chain.request(); - Response response = chain.proceed(request); - int tryCount = 1; - while (!response.isSuccessful() && isRetryable(response) && tryCount-1 < MAX_RETRIES) { - try { - Thread.sleep((long) Math.pow(RETRY_DELAY, tryCount-1)); - } catch (InterruptedException e) { - e.printStackTrace(); - } - response.close(); - response = chain.proceed(request); - tryCount++; - } - return response; - } - - private boolean isRetryable(Response response) { - final int statusCode = response.code(); - return IntStream.of(RETRYABLE_CODES).anyMatch(x -> x == statusCode); - } -} diff --git a/src/main/java/47/one0/http/util/HttpArgumentConverter.java b/src/main/java/47/one0/http/util/HttpArgumentConverter.java deleted file mode 100644 index 9ad0498a..00000000 --- a/src/main/java/47/one0/http/util/HttpArgumentConverter.java +++ /dev/null @@ -1,42 +0,0 @@ -package 47.one0.http.util; - - import static 47.one0.http.ModelConverter.modelToJson; - -import java.util.List; -import java.util.stream.Collectors; - -/** - * Provides static methods to convert values (object, array, boxed types) into string representation for http url. - * Usually used for converting objects to be http url friendly (e.g. query or header parameters) - */ -public class HttpArgumentConverter { - - /** - * Converts any value (object, array, primitive) into a string representation. - * - * @param value The value (object, array or primitive) to be converted. - * @return A string representation of the input value in a format that can be used as url query or header parameter value. - */ - public static String toStringArgument(final Object value) { - if (value == null) { - return ""; - } - if ( - value instanceof String || - value instanceof Number || - value instanceof Boolean || - value instanceof Enum - ) { - return String.valueOf(value); - } - if (value instanceof List) { - List list = (List) value; - return list - .stream() - .map(HttpArgumentConverter::toStringArgument) - .collect(Collectors.joining(",")); - } - - return modelToJson(value); - } -} diff --git a/src/main/java/47/one0/http/util/HttpHeaders.java b/src/main/java/47/one0/http/util/HttpHeaders.java deleted file mode 100644 index e09d0530..00000000 --- a/src/main/java/47/one0/http/util/HttpHeaders.java +++ /dev/null @@ -1,84 +0,0 @@ -package 47.one0.http.util; - - import static 47.one0.http.util.HttpArgumentConverter.toStringArgument; - - import 47.one0.exceptions.ArgumentCannotBeNullException; -import okhttp3.Headers; - -/** - * HttpHeaders represents a utility class for building HTTP headers. - */ -public class HttpHeaders { - - /** - * Private constructor to prevent direct instantiation of the class. - */ - private HttpHeaders() { - } - - /** - * Creates a new instance of the HttpHeaders.Builder. - * - * @return A new instance of HttpHeaders.Builder. - */ - public static Builder builder() { - return new Builder(); - } - - /** - * Builder class for constructing HTTP headers. - */ - public static class Builder { - - private final Headers.Builder headersBuilder; - - /** - * Constructs a new instance of the Builder. - */ - private Builder() { - this.headersBuilder = new Headers.Builder(); - } - - /** - * Adds a required header with the specified name and value to the headers' builder. - * - * @param name The name of the header. - * @param value The value of the header. - * @return The current Builder instance. - * @throws ArgumentCannotBeNullException If the value is null. - */ - public Builder addRequiredHeader(String name, Object value) - throws ArgumentCannotBeNullException { - if (value == null) { - throw new ArgumentCannotBeNullException(name); - } - this.headersBuilder.add(name, toStringArgument(value)); - - return this; - } - - /** - * Adds an optional header with the specified name and value to the headers' builder. - * - * @param name The name of the header. - * @param value The value of the header. - * @return The current Builder instance. - */ - public Builder addOptionalHeader(String name, Object value) { - if (value != null) { - this.headersBuilder.add(name, toStringArgument(value)); - } - - return this; - } - - /** - * Builds the headers using the configured values in the builder. - * - * @return The constructed Headers object. - */ - public Headers build() { - return this.headersBuilder.build(); - } - } -} diff --git a/src/main/java/47/one0/http/util/HttpUrl.java b/src/main/java/47/one0/http/util/HttpUrl.java deleted file mode 100644 index 54594448..00000000 --- a/src/main/java/47/one0/http/util/HttpUrl.java +++ /dev/null @@ -1,102 +0,0 @@ -package 47.one0.http.util; - -import static 47.one0.http.util.HttpArgumentConverter.toStringArgument; - -import 47.one0.exceptions.ArgumentCannotBeNullException; -import java.util.Objects; - -/** - * The HttpUrl class provides a convenient way to construct HTTP URLs with query parameters and path parameters. - */ -public class HttpUrl { - - /** - * Private constructor to prevent direct instantiation of the class. - */ - private HttpUrl() { - } - - /** - * Creates a new instance of the Builder class to start constructing an HTTP URL. - * - * @param url The base URL for the HTTP request. - * @return A new instance of the Builder class. - */ - public static Builder builder(String url) { - return new Builder(url); - } - - /** - * The Builder class provides methods to add query parameters and path parameters to an HTTP URL. - */ - public static class Builder { - - private final okhttp3.HttpUrl.Builder httpUrlBuilder; - - /** - * Constructs a new Builder instance with the specified base URL. - * - * @param url The base URL for the HTTP request. - */ - private Builder(String url) { - this.httpUrlBuilder = Objects.requireNonNull(okhttp3.HttpUrl.parse(url)).newBuilder(); - } - - /** - * Adds a required query parameter to the HTTP URL. - * - * @param name The name of the query parameter. - * @param value The value of the query parameter. - * @return The Builder instance. - * @throws ArgumentCannotBeNullException If the value is null. - */ - public Builder addRequiredQueryParameter(String name, Object value) throws ArgumentCannotBeNullException { - if (value == null) { - throw new ArgumentCannotBeNullException(name); - } - this.httpUrlBuilder.addQueryParameter(name, toStringArgument(value)); - - return this; - } - - /** - * Adds an optional query parameter to the HTTP URL. - * - * @param name The name of the query parameter. - * @param value The value of the query parameter. - * @return The Builder instance. - */ - public Builder addOptionalQueryParameter(String name, Object value) { - if (value != null) { - this.httpUrlBuilder.addQueryParameter(name, toStringArgument(value)); - } - - return this; - } - - /** - * Adds a path parameter to the HTTP URL. - * - * @param value The value of the path parameter. - * @return The Builder instance. - * @throws ArgumentCannotBeNullException If the value is null. - */ - public Builder addPathParameter(String value) throws ArgumentCannotBeNullException { - if (value == null || value.isEmpty()) { - throw new ArgumentCannotBeNullException(); - } - this.httpUrlBuilder.addPathSegment(value); - - return this; - } - - /** - * Builds the final HTTP URL. - * - * @return The constructed HTTP URL as a string. - */ - public String build() { - return this.httpUrlBuilder.build().toString(); - } - } -} diff --git a/src/main/java/47/one0/models/BaseModel.java b/src/main/java/47/one0/models/BaseModel.java deleted file mode 100644 index cc9a083c..00000000 --- a/src/main/java/47/one0/models/BaseModel.java +++ /dev/null @@ -1,75 +0,0 @@ -package 47.one0.models; - -import java.util.Collection; -import java.util.Set; -import java.util.stream.Collectors; -import 47.one0.http.ModelConverter; - -public abstract class BaseModel { - public abstract static class Builder { - protected static enum ValidationType { - ALL_OF, - ANY_OF, - ONE_OF, - NONE - }; - - private final ValidationType _validationType; - - protected Builder(ValidationType validationType) { - this._validationType = validationType; - } - - protected abstract Set getNonNullInstanceFieldNames(); - protected abstract Set> getRequiredFieldsGroups(); - - protected boolean isValidAllOf() { - // Check if all of the required field groups are a subset of the non-null, non-static fields. - return getNonNullInstanceFieldNames().containsAll( - getRequiredFieldsGroups().stream() - .flatMap(Collection::stream) - .collect(Collectors.toSet())); - } - - protected boolean isValidAnyOf() { - // Check if any of the required field groups are a subset of the non-null, non-static fields. - return getRequiredFieldsGroups().stream().anyMatch( - (group) -> getNonNullInstanceFieldNames().containsAll(group)); - } - - protected boolean isValidOneOf() { - // Check if the set of non-null fields match one of the required field groups. - return getRequiredFieldsGroups().contains(getNonNullInstanceFieldNames()); - } - - protected String validate() { - if (getRequiredFieldsGroups().isEmpty()) { - // Nothing to validate since there are no required fields groups. - - return null; - } - - switch (this._validationType) { - case ALL_OF: - return !isValidAllOf() ? "Object fails AllOf validation." : null; - case ANY_OF: - return !isValidAnyOf() ? "Object fails AnyOf validation." : null; - case ONE_OF: - return !isValidOneOf() ? "Object fails OneOf validation." : null; - case NONE: - default: - return !isValidOneOf() ? "Object fails required fields validation." : null; - } - } - } - - public BaseModel() { - } - - protected BaseModel(Builder builder) { - } - - public String toJson() { - return ModelConverter.modelToJson(this); - } -} diff --git a/src/main/java/47/one0/models/Download.java b/src/main/java/47/one0/models/Download.java deleted file mode 100644 index e383b819..00000000 --- a/src/main/java/47/one0/models/Download.java +++ /dev/null @@ -1,11 +0,0 @@ -package 47.one0.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Download { - V1("1"); - - public final String label; -} diff --git a/src/main/java/47/one0/models/Force.java b/src/main/java/47/one0/models/Force.java deleted file mode 100644 index b3c59828..00000000 --- a/src/main/java/47/one0/models/Force.java +++ /dev/null @@ -1,11 +0,0 @@ -package 47.one0.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Force { - V1(1); - - public final Float label; -} diff --git a/src/main/java/47/one0/models/GetButlerTasksResponse.java b/src/main/java/47/one0/models/GetButlerTasksResponse.java deleted file mode 100644 index fbd7265f..00000000 --- a/src/main/java/47/one0/models/GetButlerTasksResponse.java +++ /dev/null @@ -1,272 +0,0 @@ -package 47.one0.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetButlerTasksResponse.Builder.class) -public class GetButlerTasksResponse extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetButlerTasksResponse.ButlerTasks.Builder.class) - public static class ButlerTasks extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetButlerTasksResponse.ButlerTasks.ButlerTask.Builder.class) - public static class ButlerTask extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("description") private java.lang.String description; - @com.fasterxml.jackson.annotation.JsonProperty("enabled") private java.lang.Boolean enabled; - @com.fasterxml.jackson.annotation.JsonProperty("interval") private java.lang.Double interval; - @com.fasterxml.jackson.annotation.JsonProperty("name") private java.lang.String name; - @com.fasterxml.jackson.annotation.JsonProperty("scheduleRandomized") private java.lang.Boolean scheduleRandomized; - @com.fasterxml.jackson.annotation.JsonProperty("title") private java.lang.String title; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetButlerTasksResponse.ButlerTasks.ButlerTask build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetButlerTasksResponse.ButlerTasks.ButlerTask buildWithoutValidation() { - return new GetButlerTasksResponse.ButlerTasks.ButlerTask(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("description") private final java.lang.String description; - @com.fasterxml.jackson.annotation.JsonProperty("enabled") private final java.lang.Boolean enabled; - @com.fasterxml.jackson.annotation.JsonProperty("interval") private final java.lang.Double interval; - @com.fasterxml.jackson.annotation.JsonProperty("name") private final java.lang.String name; - @com.fasterxml.jackson.annotation.JsonProperty("scheduleRandomized") private final java.lang.Boolean scheduleRandomized; - @com.fasterxml.jackson.annotation.JsonProperty("title") private final java.lang.String title; - - ButlerTask(Builder builder) { - super(builder); - - this.description = builder.getDescription(); - this.enabled = builder.getEnabled(); - this.interval = builder.getInterval(); - this.name = builder.getName(); - this.scheduleRandomized = builder.getScheduleRandomized(); - this.title = builder.getTitle(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("ButlerTask") private java.util.List butlerTask; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetButlerTasksResponse.ButlerTasks build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetButlerTasksResponse.ButlerTasks buildWithoutValidation() { - return new GetButlerTasksResponse.ButlerTasks(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("ButlerTask") private final java.util.List butlerTask; - - ButlerTasks(Builder builder) { - super(builder); - - this.butlerTask = builder.getButlerTask(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("ButlerTasks") private GetButlerTasksResponse.ButlerTasks butlerTasks; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetButlerTasksResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetButlerTasksResponse buildWithoutValidation() { - return new GetButlerTasksResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.stream(this.getClass().getDeclaredFields()) - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("ButlerTasks") private final GetButlerTasksResponse.ButlerTasks butlerTasks; - - GetButlerTasksResponse(Builder builder) { - super(builder); - - this.butlerTasks = builder.getButlerTasks(); - } -} diff --git a/src/main/java/47/one0/models/GetDevicesResponse.java b/src/main/java/47/one0/models/GetDevicesResponse.java deleted file mode 100644 index 574ed642..00000000 --- a/src/main/java/47/one0/models/GetDevicesResponse.java +++ /dev/null @@ -1,275 +0,0 @@ -package 47.one0.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetDevicesResponse.Builder.class) -public class GetDevicesResponse extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetDevicesResponse.MediaContainer.Builder.class) - public static class MediaContainer extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetDevicesResponse.MediaContainer.Device.Builder.class) - public static class Device extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("clientIdentifier") private java.lang.String clientIdentifier; - @com.fasterxml.jackson.annotation.JsonProperty("createdAt") private java.lang.Double createdAt; - @com.fasterxml.jackson.annotation.JsonProperty("id") private java.lang.Double id; - @com.fasterxml.jackson.annotation.JsonProperty("name") private java.lang.String name; - @com.fasterxml.jackson.annotation.JsonProperty("platform") private java.lang.String platform; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetDevicesResponse.MediaContainer.Device build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetDevicesResponse.MediaContainer.Device buildWithoutValidation() { - return new GetDevicesResponse.MediaContainer.Device(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("clientIdentifier") private final java.lang.String clientIdentifier; - @com.fasterxml.jackson.annotation.JsonProperty("createdAt") private final java.lang.Double createdAt; - @com.fasterxml.jackson.annotation.JsonProperty("id") private final java.lang.Double id; - @com.fasterxml.jackson.annotation.JsonProperty("name") private final java.lang.String name; - @com.fasterxml.jackson.annotation.JsonProperty("platform") private final java.lang.String platform; - - Device(Builder builder) { - super(builder); - - this.clientIdentifier = builder.getClientIdentifier(); - this.createdAt = builder.getCreatedAt(); - this.id = builder.getId(); - this.name = builder.getName(); - this.platform = builder.getPlatform(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("Device") private java.util.List device; - @com.fasterxml.jackson.annotation.JsonProperty("identifier") private java.lang.String identifier; - @com.fasterxml.jackson.annotation.JsonProperty("size") private java.lang.Double size; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetDevicesResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetDevicesResponse.MediaContainer buildWithoutValidation() { - return new GetDevicesResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("Device") private final java.util.List device; - @com.fasterxml.jackson.annotation.JsonProperty("identifier") private final java.lang.String identifier; - @com.fasterxml.jackson.annotation.JsonProperty("size") private final java.lang.Double size; - - MediaContainer(Builder builder) { - super(builder); - - this.device = builder.getDevice(); - this.identifier = builder.getIdentifier(); - this.size = builder.getSize(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private GetDevicesResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetDevicesResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetDevicesResponse buildWithoutValidation() { - return new GetDevicesResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.stream(this.getClass().getDeclaredFields()) - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private final GetDevicesResponse.MediaContainer mediaContainer; - - GetDevicesResponse(Builder builder) { - super(builder); - - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/47/one0/models/GetMyPlexAccountResponse.java b/src/main/java/47/one0/models/GetMyPlexAccountResponse.java deleted file mode 100644 index 329b17a6..00000000 --- a/src/main/java/47/one0/models/GetMyPlexAccountResponse.java +++ /dev/null @@ -1,205 +0,0 @@ -package 47.one0.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetMyPlexAccountResponse.Builder.class) -public class GetMyPlexAccountResponse extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetMyPlexAccountResponse.MyPlex.Builder.class) - public static class MyPlex extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("authToken") private java.lang.String authToken; - @com.fasterxml.jackson.annotation.JsonProperty("mappingError") private java.lang.String mappingError; - @com.fasterxml.jackson.annotation.JsonProperty("mappingState") private java.lang.String mappingState; - @com.fasterxml.jackson.annotation.JsonProperty("privateAddress") private java.lang.String privateAddress; - @com.fasterxml.jackson.annotation.JsonProperty("privatePort") private java.lang.Double privatePort; - @com.fasterxml.jackson.annotation.JsonProperty("publicAddress") private java.lang.String publicAddress; - @com.fasterxml.jackson.annotation.JsonProperty("publicPort") private java.lang.Double publicPort; - @com.fasterxml.jackson.annotation.JsonProperty("signInState") private java.lang.String signInState; - @com.fasterxml.jackson.annotation.JsonProperty("subscriptionActive") private java.lang.Boolean subscriptionActive; - @com.fasterxml.jackson.annotation.JsonProperty("subscriptionFeatures") private java.lang.String subscriptionFeatures; - @com.fasterxml.jackson.annotation.JsonProperty("subscriptionState") private java.lang.String subscriptionState; - @com.fasterxml.jackson.annotation.JsonProperty("username") private java.lang.String username; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetMyPlexAccountResponse.MyPlex build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetMyPlexAccountResponse.MyPlex buildWithoutValidation() { - return new GetMyPlexAccountResponse.MyPlex(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("authToken") private final java.lang.String authToken; - @com.fasterxml.jackson.annotation.JsonProperty("mappingError") private final java.lang.String mappingError; - @com.fasterxml.jackson.annotation.JsonProperty("mappingState") private final java.lang.String mappingState; - @com.fasterxml.jackson.annotation.JsonProperty("privateAddress") private final java.lang.String privateAddress; - @com.fasterxml.jackson.annotation.JsonProperty("privatePort") private final java.lang.Double privatePort; - @com.fasterxml.jackson.annotation.JsonProperty("publicAddress") private final java.lang.String publicAddress; - @com.fasterxml.jackson.annotation.JsonProperty("publicPort") private final java.lang.Double publicPort; - @com.fasterxml.jackson.annotation.JsonProperty("signInState") private final java.lang.String signInState; - @com.fasterxml.jackson.annotation.JsonProperty("subscriptionActive") private final java.lang.Boolean subscriptionActive; - @com.fasterxml.jackson.annotation.JsonProperty("subscriptionFeatures") private final java.lang.String subscriptionFeatures; - @com.fasterxml.jackson.annotation.JsonProperty("subscriptionState") private final java.lang.String subscriptionState; - @com.fasterxml.jackson.annotation.JsonProperty("username") private final java.lang.String username; - - MyPlex(Builder builder) { - super(builder); - - this.authToken = builder.getAuthToken(); - this.mappingError = builder.getMappingError(); - this.mappingState = builder.getMappingState(); - this.privateAddress = builder.getPrivateAddress(); - this.privatePort = builder.getPrivatePort(); - this.publicAddress = builder.getPublicAddress(); - this.publicPort = builder.getPublicPort(); - this.signInState = builder.getSignInState(); - this.subscriptionActive = builder.getSubscriptionActive(); - this.subscriptionFeatures = builder.getSubscriptionFeatures(); - this.subscriptionState = builder.getSubscriptionState(); - this.username = builder.getUsername(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MyPlex") private GetMyPlexAccountResponse.MyPlex myPlex; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetMyPlexAccountResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetMyPlexAccountResponse buildWithoutValidation() { - return new GetMyPlexAccountResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.stream(this.getClass().getDeclaredFields()) - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MyPlex") private final GetMyPlexAccountResponse.MyPlex myPlex; - - GetMyPlexAccountResponse(Builder builder) { - super(builder); - - this.myPlex = builder.getMyPlex(); - } -} diff --git a/src/main/java/47/one0/models/GetOnDeckResponse.java b/src/main/java/47/one0/models/GetOnDeckResponse.java deleted file mode 100644 index 6fcd26a1..00000000 --- a/src/main/java/47/one0/models/GetOnDeckResponse.java +++ /dev/null @@ -1,851 +0,0 @@ -package 47.one0.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetOnDeckResponse.Builder.class) -public class GetOnDeckResponse extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetOnDeckResponse.MediaContainer.Builder.class) - public static class MediaContainer extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetOnDeckResponse.MediaContainer.Metadata.Builder.class) - public static class Metadata extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetOnDeckResponse.MediaContainer.Metadata.Guid.Builder.class) - public static class Guid extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("id") private java.lang.String id; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetOnDeckResponse.MediaContainer.Metadata.Guid build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetOnDeckResponse.MediaContainer.Metadata.Guid buildWithoutValidation() { - return new GetOnDeckResponse.MediaContainer.Metadata.Guid(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("id") private final java.lang.String id; - - Guid(Builder builder) { - super(builder); - - this.id = builder.getId(); - } - } - - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetOnDeckResponse.MediaContainer.Metadata.Media.Builder.class) - public static class Media extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetOnDeckResponse.MediaContainer.Metadata.Media.Part.Builder.class) - public static class Part extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetOnDeckResponse.MediaContainer.Metadata.Media.Part.Stream.Builder.class) - public static class Stream extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("default_") private java.lang.Boolean _default; - @com.fasterxml.jackson.annotation.JsonProperty("bitDepth") private java.lang.Double bitDepth; - @com.fasterxml.jackson.annotation.JsonProperty("bitrate") private java.lang.Double bitrate; - @com.fasterxml.jackson.annotation.JsonProperty("chromaLocation") private java.lang.String chromaLocation; - @com.fasterxml.jackson.annotation.JsonProperty("chromaSubsampling") private java.lang.String chromaSubsampling; - @com.fasterxml.jackson.annotation.JsonProperty("codec") private java.lang.String codec; - @com.fasterxml.jackson.annotation.JsonProperty("codedHeight") private java.lang.Double codedHeight; - @com.fasterxml.jackson.annotation.JsonProperty("codedWidth") private java.lang.Double codedWidth; - @com.fasterxml.jackson.annotation.JsonProperty("colorRange") private java.lang.String colorRange; - @com.fasterxml.jackson.annotation.JsonProperty("displayTitle") private java.lang.String displayTitle; - @com.fasterxml.jackson.annotation.JsonProperty("extendedDisplayTitle") private java.lang.String extendedDisplayTitle; - @com.fasterxml.jackson.annotation.JsonProperty("frameRate") private java.lang.Double frameRate; - @com.fasterxml.jackson.annotation.JsonProperty("height") private java.lang.Double height; - @com.fasterxml.jackson.annotation.JsonProperty("id") private java.lang.Double id; - @com.fasterxml.jackson.annotation.JsonProperty("index") private java.lang.Double index; - @com.fasterxml.jackson.annotation.JsonProperty("language") private java.lang.String language; - @com.fasterxml.jackson.annotation.JsonProperty("languageCode") private java.lang.String languageCode; - @com.fasterxml.jackson.annotation.JsonProperty("languageTag") private java.lang.String languageTag; - @com.fasterxml.jackson.annotation.JsonProperty("level") private java.lang.Double level; - @com.fasterxml.jackson.annotation.JsonProperty("profile") private java.lang.String profile; - @com.fasterxml.jackson.annotation.JsonProperty("refFrames") private java.lang.Double refFrames; - @com.fasterxml.jackson.annotation.JsonProperty("streamType") private java.lang.Double streamType; - @com.fasterxml.jackson.annotation.JsonProperty("width") private java.lang.Double width; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetOnDeckResponse.MediaContainer.Metadata.Media.Part.Stream build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetOnDeckResponse.MediaContainer.Metadata.Media.Part.Stream buildWithoutValidation() { - return new GetOnDeckResponse.MediaContainer.Metadata.Media.Part.Stream(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("default_") private final java.lang.Boolean _default; - @com.fasterxml.jackson.annotation.JsonProperty("bitDepth") private final java.lang.Double bitDepth; - @com.fasterxml.jackson.annotation.JsonProperty("bitrate") private final java.lang.Double bitrate; - @com.fasterxml.jackson.annotation.JsonProperty("chromaLocation") private final java.lang.String chromaLocation; - @com.fasterxml.jackson.annotation.JsonProperty("chromaSubsampling") private final java.lang.String chromaSubsampling; - @com.fasterxml.jackson.annotation.JsonProperty("codec") private final java.lang.String codec; - @com.fasterxml.jackson.annotation.JsonProperty("codedHeight") private final java.lang.Double codedHeight; - @com.fasterxml.jackson.annotation.JsonProperty("codedWidth") private final java.lang.Double codedWidth; - @com.fasterxml.jackson.annotation.JsonProperty("colorRange") private final java.lang.String colorRange; - @com.fasterxml.jackson.annotation.JsonProperty("displayTitle") private final java.lang.String displayTitle; - @com.fasterxml.jackson.annotation.JsonProperty("extendedDisplayTitle") private final java.lang.String extendedDisplayTitle; - @com.fasterxml.jackson.annotation.JsonProperty("frameRate") private final java.lang.Double frameRate; - @com.fasterxml.jackson.annotation.JsonProperty("height") private final java.lang.Double height; - @com.fasterxml.jackson.annotation.JsonProperty("id") private final java.lang.Double id; - @com.fasterxml.jackson.annotation.JsonProperty("index") private final java.lang.Double index; - @com.fasterxml.jackson.annotation.JsonProperty("language") private final java.lang.String language; - @com.fasterxml.jackson.annotation.JsonProperty("languageCode") private final java.lang.String languageCode; - @com.fasterxml.jackson.annotation.JsonProperty("languageTag") private final java.lang.String languageTag; - @com.fasterxml.jackson.annotation.JsonProperty("level") private final java.lang.Double level; - @com.fasterxml.jackson.annotation.JsonProperty("profile") private final java.lang.String profile; - @com.fasterxml.jackson.annotation.JsonProperty("refFrames") private final java.lang.Double refFrames; - @com.fasterxml.jackson.annotation.JsonProperty("streamType") private final java.lang.Double streamType; - @com.fasterxml.jackson.annotation.JsonProperty("width") private final java.lang.Double width; - - Stream(Builder builder) { - super(builder); - - this._default = builder.get_default(); - this.bitDepth = builder.getBitDepth(); - this.bitrate = builder.getBitrate(); - this.chromaLocation = builder.getChromaLocation(); - this.chromaSubsampling = builder.getChromaSubsampling(); - this.codec = builder.getCodec(); - this.codedHeight = builder.getCodedHeight(); - this.codedWidth = builder.getCodedWidth(); - this.colorRange = builder.getColorRange(); - this.displayTitle = builder.getDisplayTitle(); - this.extendedDisplayTitle = builder.getExtendedDisplayTitle(); - this.frameRate = builder.getFrameRate(); - this.height = builder.getHeight(); - this.id = builder.getId(); - this.index = builder.getIndex(); - this.language = builder.getLanguage(); - this.languageCode = builder.getLanguageCode(); - this.languageTag = builder.getLanguageTag(); - this.level = builder.getLevel(); - this.profile = builder.getProfile(); - this.refFrames = builder.getRefFrames(); - this.streamType = builder.getStreamType(); - this.width = builder.getWidth(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("audioProfile") private java.lang.String audioProfile; - @com.fasterxml.jackson.annotation.JsonProperty("container") private java.lang.String container; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("file") private java.lang.String file; - @com.fasterxml.jackson.annotation.JsonProperty("id") private java.lang.Double id; - @com.fasterxml.jackson.annotation.JsonProperty("key") private java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("size") private java.lang.Double size; - @com.fasterxml.jackson.annotation.JsonProperty("Stream") private java.util.List stream; - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") private java.lang.String videoProfile; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetOnDeckResponse.MediaContainer.Metadata.Media.Part build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetOnDeckResponse.MediaContainer.Metadata.Media.Part buildWithoutValidation() { - return new GetOnDeckResponse.MediaContainer.Metadata.Media.Part(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("audioProfile") private final java.lang.String audioProfile; - @com.fasterxml.jackson.annotation.JsonProperty("container") private final java.lang.String container; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private final java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("file") private final java.lang.String file; - @com.fasterxml.jackson.annotation.JsonProperty("id") private final java.lang.Double id; - @com.fasterxml.jackson.annotation.JsonProperty("key") private final java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("size") private final java.lang.Double size; - @com.fasterxml.jackson.annotation.JsonProperty("Stream") private final java.util.List stream; - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") private final java.lang.String videoProfile; - - Part(Builder builder) { - super(builder); - - this.audioProfile = builder.getAudioProfile(); - this.container = builder.getContainer(); - this.duration = builder.getDuration(); - this.file = builder.getFile(); - this.id = builder.getId(); - this.key = builder.getKey(); - this.size = builder.getSize(); - this.stream = builder.getStream(); - this.videoProfile = builder.getVideoProfile(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("aspectRatio") private java.lang.Double aspectRatio; - @com.fasterxml.jackson.annotation.JsonProperty("audioChannels") private java.lang.Double audioChannels; - @com.fasterxml.jackson.annotation.JsonProperty("audioCodec") private java.lang.String audioCodec; - @com.fasterxml.jackson.annotation.JsonProperty("audioProfile") private java.lang.String audioProfile; - @com.fasterxml.jackson.annotation.JsonProperty("bitrate") private java.lang.Double bitrate; - @com.fasterxml.jackson.annotation.JsonProperty("container") private java.lang.String container; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("height") private java.lang.Double height; - @com.fasterxml.jackson.annotation.JsonProperty("id") private java.lang.Double id; - @com.fasterxml.jackson.annotation.JsonProperty("Part") private java.util.List part; - @com.fasterxml.jackson.annotation.JsonProperty("videoCodec") private java.lang.String videoCodec; - @com.fasterxml.jackson.annotation.JsonProperty("videoFrameRate") private java.lang.String videoFrameRate; - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") private java.lang.String videoProfile; - @com.fasterxml.jackson.annotation.JsonProperty("videoResolution") private java.lang.String videoResolution; - @com.fasterxml.jackson.annotation.JsonProperty("width") private java.lang.Double width; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetOnDeckResponse.MediaContainer.Metadata.Media build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetOnDeckResponse.MediaContainer.Metadata.Media buildWithoutValidation() { - return new GetOnDeckResponse.MediaContainer.Metadata.Media(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("aspectRatio") private final java.lang.Double aspectRatio; - @com.fasterxml.jackson.annotation.JsonProperty("audioChannels") private final java.lang.Double audioChannels; - @com.fasterxml.jackson.annotation.JsonProperty("audioCodec") private final java.lang.String audioCodec; - @com.fasterxml.jackson.annotation.JsonProperty("audioProfile") private final java.lang.String audioProfile; - @com.fasterxml.jackson.annotation.JsonProperty("bitrate") private final java.lang.Double bitrate; - @com.fasterxml.jackson.annotation.JsonProperty("container") private final java.lang.String container; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private final java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("height") private final java.lang.Double height; - @com.fasterxml.jackson.annotation.JsonProperty("id") private final java.lang.Double id; - @com.fasterxml.jackson.annotation.JsonProperty("Part") private final java.util.List part; - @com.fasterxml.jackson.annotation.JsonProperty("videoCodec") private final java.lang.String videoCodec; - @com.fasterxml.jackson.annotation.JsonProperty("videoFrameRate") private final java.lang.String videoFrameRate; - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") private final java.lang.String videoProfile; - @com.fasterxml.jackson.annotation.JsonProperty("videoResolution") private final java.lang.String videoResolution; - @com.fasterxml.jackson.annotation.JsonProperty("width") private final java.lang.Double width; - - Media(Builder builder) { - super(builder); - - this.aspectRatio = builder.getAspectRatio(); - this.audioChannels = builder.getAudioChannels(); - this.audioCodec = builder.getAudioCodec(); - this.audioProfile = builder.getAudioProfile(); - this.bitrate = builder.getBitrate(); - this.container = builder.getContainer(); - this.duration = builder.getDuration(); - this.height = builder.getHeight(); - this.id = builder.getId(); - this.part = builder.getPart(); - this.videoCodec = builder.getVideoCodec(); - this.videoFrameRate = builder.getVideoFrameRate(); - this.videoProfile = builder.getVideoProfile(); - this.videoResolution = builder.getVideoResolution(); - this.width = builder.getWidth(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("addedAt") private java.lang.Double addedAt; - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") private java.lang.Boolean allowSync; - @com.fasterxml.jackson.annotation.JsonProperty("art") private java.lang.String art; - @com.fasterxml.jackson.annotation.JsonProperty("contentRating") private java.lang.String contentRating; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("grandparentArt") private java.lang.String grandparentArt; - @com.fasterxml.jackson.annotation.JsonProperty("grandparentGuid") private java.lang.String grandparentGuid; - @com.fasterxml.jackson.annotation.JsonProperty("grandparentKey") private java.lang.String grandparentKey; - @com.fasterxml.jackson.annotation.JsonProperty("grandparentRatingKey") private java.lang.Double grandparentRatingKey; - @com.fasterxml.jackson.annotation.JsonProperty("grandparentTheme") private java.lang.String grandparentTheme; - @com.fasterxml.jackson.annotation.JsonProperty("grandparentThumb") private java.lang.String grandparentThumb; - @com.fasterxml.jackson.annotation.JsonProperty("grandparentTitle") private java.lang.String grandparentTitle; - @com.fasterxml.jackson.annotation.JsonProperty("Guid") private java.util.List guid; - @com.fasterxml.jackson.annotation.JsonProperty("index") private java.lang.Double index; - @com.fasterxml.jackson.annotation.JsonProperty("key") private java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("lastViewedAt") private java.lang.Double lastViewedAt; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionID") private java.lang.Double librarySectionId; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionKey") private java.lang.String librarySectionKey; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionTitle") private java.lang.String librarySectionTitle; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionUUID") private java.lang.String librarySectionUuid; - @com.fasterxml.jackson.annotation.JsonProperty("Media") private java.util.List media; - @com.fasterxml.jackson.annotation.JsonProperty("originallyAvailableAt") private java.lang.String originallyAvailableAt; - @com.fasterxml.jackson.annotation.JsonProperty("parentGuid") private java.lang.String parentGuid; - @com.fasterxml.jackson.annotation.JsonProperty("parentIndex") private java.lang.Double parentIndex; - @com.fasterxml.jackson.annotation.JsonProperty("parentKey") private java.lang.String parentKey; - @com.fasterxml.jackson.annotation.JsonProperty("parentRatingKey") private java.lang.Double parentRatingKey; - @com.fasterxml.jackson.annotation.JsonProperty("parentThumb") private java.lang.String parentThumb; - @com.fasterxml.jackson.annotation.JsonProperty("parentTitle") private java.lang.String parentTitle; - @com.fasterxml.jackson.annotation.JsonProperty("ratingKey") private java.lang.Double ratingKey; - @com.fasterxml.jackson.annotation.JsonProperty("summary") private java.lang.String summary; - @com.fasterxml.jackson.annotation.JsonProperty("thumb") private java.lang.String thumb; - @com.fasterxml.jackson.annotation.JsonProperty("title") private java.lang.String title; - @com.fasterxml.jackson.annotation.JsonProperty("type") private java.lang.String type; - @com.fasterxml.jackson.annotation.JsonProperty("updatedAt") private java.lang.Double updatedAt; - @com.fasterxml.jackson.annotation.JsonProperty("year") private java.lang.Double year; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetOnDeckResponse.MediaContainer.Metadata build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetOnDeckResponse.MediaContainer.Metadata buildWithoutValidation() { - return new GetOnDeckResponse.MediaContainer.Metadata(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("addedAt") private final java.lang.Double addedAt; - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") private final java.lang.Boolean allowSync; - @com.fasterxml.jackson.annotation.JsonProperty("art") private final java.lang.String art; - @com.fasterxml.jackson.annotation.JsonProperty("contentRating") private final java.lang.String contentRating; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private final java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("grandparentArt") private final java.lang.String grandparentArt; - @com.fasterxml.jackson.annotation.JsonProperty("grandparentGuid") private final java.lang.String grandparentGuid; - @com.fasterxml.jackson.annotation.JsonProperty("grandparentKey") private final java.lang.String grandparentKey; - @com.fasterxml.jackson.annotation.JsonProperty("grandparentRatingKey") private final java.lang.Double grandparentRatingKey; - @com.fasterxml.jackson.annotation.JsonProperty("grandparentTheme") private final java.lang.String grandparentTheme; - @com.fasterxml.jackson.annotation.JsonProperty("grandparentThumb") private final java.lang.String grandparentThumb; - @com.fasterxml.jackson.annotation.JsonProperty("grandparentTitle") private final java.lang.String grandparentTitle; - @com.fasterxml.jackson.annotation.JsonProperty("Guid") private final java.util.List guid; - @com.fasterxml.jackson.annotation.JsonProperty("index") private final java.lang.Double index; - @com.fasterxml.jackson.annotation.JsonProperty("key") private final java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("lastViewedAt") private final java.lang.Double lastViewedAt; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionID") private final java.lang.Double librarySectionId; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionKey") private final java.lang.String librarySectionKey; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionTitle") private final java.lang.String librarySectionTitle; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionUUID") private final java.lang.String librarySectionUuid; - @com.fasterxml.jackson.annotation.JsonProperty("Media") private final java.util.List media; - @com.fasterxml.jackson.annotation.JsonProperty("originallyAvailableAt") private final java.lang.String originallyAvailableAt; - @com.fasterxml.jackson.annotation.JsonProperty("parentGuid") private final java.lang.String parentGuid; - @com.fasterxml.jackson.annotation.JsonProperty("parentIndex") private final java.lang.Double parentIndex; - @com.fasterxml.jackson.annotation.JsonProperty("parentKey") private final java.lang.String parentKey; - @com.fasterxml.jackson.annotation.JsonProperty("parentRatingKey") private final java.lang.Double parentRatingKey; - @com.fasterxml.jackson.annotation.JsonProperty("parentThumb") private final java.lang.String parentThumb; - @com.fasterxml.jackson.annotation.JsonProperty("parentTitle") private final java.lang.String parentTitle; - @com.fasterxml.jackson.annotation.JsonProperty("ratingKey") private final java.lang.Double ratingKey; - @com.fasterxml.jackson.annotation.JsonProperty("summary") private final java.lang.String summary; - @com.fasterxml.jackson.annotation.JsonProperty("thumb") private final java.lang.String thumb; - @com.fasterxml.jackson.annotation.JsonProperty("title") private final java.lang.String title; - @com.fasterxml.jackson.annotation.JsonProperty("type") private final java.lang.String type; - @com.fasterxml.jackson.annotation.JsonProperty("updatedAt") private final java.lang.Double updatedAt; - @com.fasterxml.jackson.annotation.JsonProperty("year") private final java.lang.Double year; - - Metadata(Builder builder) { - super(builder); - - this.addedAt = builder.getAddedAt(); - this.allowSync = builder.getAllowSync(); - this.art = builder.getArt(); - this.contentRating = builder.getContentRating(); - this.duration = builder.getDuration(); - this.grandparentArt = builder.getGrandparentArt(); - this.grandparentGuid = builder.getGrandparentGuid(); - this.grandparentKey = builder.getGrandparentKey(); - this.grandparentRatingKey = builder.getGrandparentRatingKey(); - this.grandparentTheme = builder.getGrandparentTheme(); - this.grandparentThumb = builder.getGrandparentThumb(); - this.grandparentTitle = builder.getGrandparentTitle(); - this.guid = builder.getGuid(); - this.index = builder.getIndex(); - this.key = builder.getKey(); - this.lastViewedAt = builder.getLastViewedAt(); - this.librarySectionId = builder.getLibrarySectionId(); - this.librarySectionKey = builder.getLibrarySectionKey(); - this.librarySectionTitle = builder.getLibrarySectionTitle(); - this.librarySectionUuid = builder.getLibrarySectionUuid(); - this.media = builder.getMedia(); - this.originallyAvailableAt = builder.getOriginallyAvailableAt(); - this.parentGuid = builder.getParentGuid(); - this.parentIndex = builder.getParentIndex(); - this.parentKey = builder.getParentKey(); - this.parentRatingKey = builder.getParentRatingKey(); - this.parentThumb = builder.getParentThumb(); - this.parentTitle = builder.getParentTitle(); - this.ratingKey = builder.getRatingKey(); - this.summary = builder.getSummary(); - this.thumb = builder.getThumb(); - this.title = builder.getTitle(); - this.type = builder.getType(); - this.updatedAt = builder.getUpdatedAt(); - this.year = builder.getYear(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") private java.lang.Boolean allowSync; - @com.fasterxml.jackson.annotation.JsonProperty("identifier") private java.lang.String identifier; - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagPrefix") private java.lang.String mediaTagPrefix; - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagVersion") private java.lang.Double mediaTagVersion; - @com.fasterxml.jackson.annotation.JsonProperty("Metadata") private java.util.List metadata; - @com.fasterxml.jackson.annotation.JsonProperty("mixedParents") private java.lang.Boolean mixedParents; - @com.fasterxml.jackson.annotation.JsonProperty("size") private java.lang.Double size; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetOnDeckResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetOnDeckResponse.MediaContainer buildWithoutValidation() { - return new GetOnDeckResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") private final java.lang.Boolean allowSync; - @com.fasterxml.jackson.annotation.JsonProperty("identifier") private final java.lang.String identifier; - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagPrefix") private final java.lang.String mediaTagPrefix; - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagVersion") private final java.lang.Double mediaTagVersion; - @com.fasterxml.jackson.annotation.JsonProperty("Metadata") private final java.util.List metadata; - @com.fasterxml.jackson.annotation.JsonProperty("mixedParents") private final java.lang.Boolean mixedParents; - @com.fasterxml.jackson.annotation.JsonProperty("size") private final java.lang.Double size; - - MediaContainer(Builder builder) { - super(builder); - - this.allowSync = builder.getAllowSync(); - this.identifier = builder.getIdentifier(); - this.mediaTagPrefix = builder.getMediaTagPrefix(); - this.mediaTagVersion = builder.getMediaTagVersion(); - this.metadata = builder.getMetadata(); - this.mixedParents = builder.getMixedParents(); - this.size = builder.getSize(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private GetOnDeckResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetOnDeckResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetOnDeckResponse buildWithoutValidation() { - return new GetOnDeckResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.stream(this.getClass().getDeclaredFields()) - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private final GetOnDeckResponse.MediaContainer mediaContainer; - - GetOnDeckResponse(Builder builder) { - super(builder); - - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/47/one0/models/GetRecentlyAddedResponse.java b/src/main/java/47/one0/models/GetRecentlyAddedResponse.java deleted file mode 100644 index f80dded3..00000000 --- a/src/main/java/47/one0/models/GetRecentlyAddedResponse.java +++ /dev/null @@ -1,1045 +0,0 @@ -package 47.one0.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetRecentlyAddedResponse.Builder.class) -public class GetRecentlyAddedResponse extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetRecentlyAddedResponse.MediaContainer.Builder.class) - public static class MediaContainer extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetRecentlyAddedResponse.MediaContainer.Metadata.Builder.class) - public static class Metadata extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetRecentlyAddedResponse.MediaContainer.Metadata.Media.Builder.class) - public static class Media extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetRecentlyAddedResponse.MediaContainer.Metadata.Media.Part.Builder.class) - public static class Part extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("container") private java.lang.String container; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("file") private java.lang.String file; - @com.fasterxml.jackson.annotation.JsonProperty("has64bitOffsets") private java.lang.Boolean has64BitOffsets; - @com.fasterxml.jackson.annotation.JsonProperty("hasThumbnail") private java.lang.Double hasThumbnail; - @com.fasterxml.jackson.annotation.JsonProperty("id") private java.lang.Double id; - @com.fasterxml.jackson.annotation.JsonProperty("key") private java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("optimizedForStreaming") private java.lang.Boolean optimizedForStreaming; - @com.fasterxml.jackson.annotation.JsonProperty("size") private java.lang.Double size; - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") private java.lang.String videoProfile; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Media.Part build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Media.Part buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer.Metadata.Media.Part(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("container") private final java.lang.String container; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private final java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("file") private final java.lang.String file; - @com.fasterxml.jackson.annotation.JsonProperty("has64bitOffsets") private final java.lang.Boolean has64BitOffsets; - @com.fasterxml.jackson.annotation.JsonProperty("hasThumbnail") private final java.lang.Double hasThumbnail; - @com.fasterxml.jackson.annotation.JsonProperty("id") private final java.lang.Double id; - @com.fasterxml.jackson.annotation.JsonProperty("key") private final java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("optimizedForStreaming") private final java.lang.Boolean optimizedForStreaming; - @com.fasterxml.jackson.annotation.JsonProperty("size") private final java.lang.Double size; - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") private final java.lang.String videoProfile; - - Part(Builder builder) { - super(builder); - - this.container = builder.getContainer(); - this.duration = builder.getDuration(); - this.file = builder.getFile(); - this.has64BitOffsets = builder.getHas64BitOffsets(); - this.hasThumbnail = builder.getHasThumbnail(); - this.id = builder.getId(); - this.key = builder.getKey(); - this.optimizedForStreaming = builder.getOptimizedForStreaming(); - this.size = builder.getSize(); - this.videoProfile = builder.getVideoProfile(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("aspectRatio") private java.lang.Double aspectRatio; - @com.fasterxml.jackson.annotation.JsonProperty("audioChannels") private java.lang.Double audioChannels; - @com.fasterxml.jackson.annotation.JsonProperty("audioCodec") private java.lang.String audioCodec; - @com.fasterxml.jackson.annotation.JsonProperty("bitrate") private java.lang.Double bitrate; - @com.fasterxml.jackson.annotation.JsonProperty("container") private java.lang.String container; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("has64bitOffsets") private java.lang.Boolean has64BitOffsets; - @com.fasterxml.jackson.annotation.JsonProperty("height") private java.lang.Double height; - @com.fasterxml.jackson.annotation.JsonProperty("id") private java.lang.Double id; - @com.fasterxml.jackson.annotation.JsonProperty("optimizedForStreaming") private java.lang.Double optimizedForStreaming; - @com.fasterxml.jackson.annotation.JsonProperty("Part") private java.util.List part; - @com.fasterxml.jackson.annotation.JsonProperty("videoCodec") private java.lang.String videoCodec; - @com.fasterxml.jackson.annotation.JsonProperty("videoFrameRate") private java.lang.String videoFrameRate; - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") private java.lang.String videoProfile; - @com.fasterxml.jackson.annotation.JsonProperty("videoResolution") private java.lang.Double videoResolution; - @com.fasterxml.jackson.annotation.JsonProperty("width") private java.lang.Double width; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Media build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Media buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer.Metadata.Media(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("aspectRatio") private final java.lang.Double aspectRatio; - @com.fasterxml.jackson.annotation.JsonProperty("audioChannels") private final java.lang.Double audioChannels; - @com.fasterxml.jackson.annotation.JsonProperty("audioCodec") private final java.lang.String audioCodec; - @com.fasterxml.jackson.annotation.JsonProperty("bitrate") private final java.lang.Double bitrate; - @com.fasterxml.jackson.annotation.JsonProperty("container") private final java.lang.String container; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private final java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("has64bitOffsets") private final java.lang.Boolean has64BitOffsets; - @com.fasterxml.jackson.annotation.JsonProperty("height") private final java.lang.Double height; - @com.fasterxml.jackson.annotation.JsonProperty("id") private final java.lang.Double id; - @com.fasterxml.jackson.annotation.JsonProperty("optimizedForStreaming") private final java.lang.Double optimizedForStreaming; - @com.fasterxml.jackson.annotation.JsonProperty("Part") private final java.util.List part; - @com.fasterxml.jackson.annotation.JsonProperty("videoCodec") private final java.lang.String videoCodec; - @com.fasterxml.jackson.annotation.JsonProperty("videoFrameRate") private final java.lang.String videoFrameRate; - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") private final java.lang.String videoProfile; - @com.fasterxml.jackson.annotation.JsonProperty("videoResolution") private final java.lang.Double videoResolution; - @com.fasterxml.jackson.annotation.JsonProperty("width") private final java.lang.Double width; - - Media(Builder builder) { - super(builder); - - this.aspectRatio = builder.getAspectRatio(); - this.audioChannels = builder.getAudioChannels(); - this.audioCodec = builder.getAudioCodec(); - this.bitrate = builder.getBitrate(); - this.container = builder.getContainer(); - this.duration = builder.getDuration(); - this.has64BitOffsets = builder.getHas64BitOffsets(); - this.height = builder.getHeight(); - this.id = builder.getId(); - this.optimizedForStreaming = builder.getOptimizedForStreaming(); - this.part = builder.getPart(); - this.videoCodec = builder.getVideoCodec(); - this.videoFrameRate = builder.getVideoFrameRate(); - this.videoProfile = builder.getVideoProfile(); - this.videoResolution = builder.getVideoResolution(); - this.width = builder.getWidth(); - } - } - - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetRecentlyAddedResponse.MediaContainer.Metadata.Genre.Builder.class) - public static class Genre extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Genre build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Genre buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer.Metadata.Genre(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private final java.lang.String tag; - - Genre(Builder builder) { - super(builder); - - this.tag = builder.getTag(); - } - } - - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetRecentlyAddedResponse.MediaContainer.Metadata.Director.Builder.class) - public static class Director extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Director build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Director buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer.Metadata.Director(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private final java.lang.String tag; - - Director(Builder builder) { - super(builder); - - this.tag = builder.getTag(); - } - } - - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetRecentlyAddedResponse.MediaContainer.Metadata.Writer.Builder.class) - public static class Writer extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Writer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Writer buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer.Metadata.Writer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private final java.lang.String tag; - - Writer(Builder builder) { - super(builder); - - this.tag = builder.getTag(); - } - } - - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetRecentlyAddedResponse.MediaContainer.Metadata.Country.Builder.class) - public static class Country extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Country build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Country buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer.Metadata.Country(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private final java.lang.String tag; - - Country(Builder builder) { - super(builder); - - this.tag = builder.getTag(); - } - } - - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetRecentlyAddedResponse.MediaContainer.Metadata.Role.Builder.class) - public static class Role extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Role build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Role buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer.Metadata.Role(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private final java.lang.String tag; - - Role(Builder builder) { - super(builder); - - this.tag = builder.getTag(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("addedAt") private java.lang.Double addedAt; - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") private java.lang.Boolean allowSync; - @com.fasterxml.jackson.annotation.JsonProperty("art") private java.lang.String art; - @com.fasterxml.jackson.annotation.JsonProperty("audienceRating") private java.lang.Double audienceRating; - @com.fasterxml.jackson.annotation.JsonProperty("audienceRatingImage") private java.lang.String audienceRatingImage; - @com.fasterxml.jackson.annotation.JsonProperty("chapterSource") private java.lang.String chapterSource; - @com.fasterxml.jackson.annotation.JsonProperty("contentRating") private java.lang.String contentRating; - @com.fasterxml.jackson.annotation.JsonProperty("Country") private java.util.List country; - @com.fasterxml.jackson.annotation.JsonProperty("Director") private java.util.List director; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("Genre") private java.util.List genre; - @com.fasterxml.jackson.annotation.JsonProperty("guid") private java.lang.String guid; - @com.fasterxml.jackson.annotation.JsonProperty("key") private java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionID") private java.lang.Double librarySectionId; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionTitle") private java.lang.String librarySectionTitle; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionUUID") private java.lang.String librarySectionUuid; - @com.fasterxml.jackson.annotation.JsonProperty("Media") private java.util.List media; - @com.fasterxml.jackson.annotation.JsonProperty("originallyAvailableAt") private java.lang.String originallyAvailableAt; - @com.fasterxml.jackson.annotation.JsonProperty("primaryExtraKey") private java.lang.String primaryExtraKey; - @com.fasterxml.jackson.annotation.JsonProperty("rating") private java.lang.Double rating; - @com.fasterxml.jackson.annotation.JsonProperty("ratingImage") private java.lang.String ratingImage; - @com.fasterxml.jackson.annotation.JsonProperty("ratingKey") private java.lang.Double ratingKey; - @com.fasterxml.jackson.annotation.JsonProperty("Role") private java.util.List role; - @com.fasterxml.jackson.annotation.JsonProperty("studio") private java.lang.String studio; - @com.fasterxml.jackson.annotation.JsonProperty("summary") private java.lang.String summary; - @com.fasterxml.jackson.annotation.JsonProperty("tagline") private java.lang.String tagline; - @com.fasterxml.jackson.annotation.JsonProperty("thumb") private java.lang.String thumb; - @com.fasterxml.jackson.annotation.JsonProperty("title") private java.lang.String title; - @com.fasterxml.jackson.annotation.JsonProperty("type") private java.lang.String type; - @com.fasterxml.jackson.annotation.JsonProperty("updatedAt") private java.lang.Double updatedAt; - @com.fasterxml.jackson.annotation.JsonProperty("Writer") private java.util.List writer; - @com.fasterxml.jackson.annotation.JsonProperty("year") private java.lang.Double year; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer.Metadata(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("addedAt") private final java.lang.Double addedAt; - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") private final java.lang.Boolean allowSync; - @com.fasterxml.jackson.annotation.JsonProperty("art") private final java.lang.String art; - @com.fasterxml.jackson.annotation.JsonProperty("audienceRating") private final java.lang.Double audienceRating; - @com.fasterxml.jackson.annotation.JsonProperty("audienceRatingImage") private final java.lang.String audienceRatingImage; - @com.fasterxml.jackson.annotation.JsonProperty("chapterSource") private final java.lang.String chapterSource; - @com.fasterxml.jackson.annotation.JsonProperty("contentRating") private final java.lang.String contentRating; - @com.fasterxml.jackson.annotation.JsonProperty("Country") private final java.util.List country; - @com.fasterxml.jackson.annotation.JsonProperty("Director") private final java.util.List director; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private final java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("Genre") private final java.util.List genre; - @com.fasterxml.jackson.annotation.JsonProperty("guid") private final java.lang.String guid; - @com.fasterxml.jackson.annotation.JsonProperty("key") private final java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionID") private final java.lang.Double librarySectionId; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionTitle") private final java.lang.String librarySectionTitle; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionUUID") private final java.lang.String librarySectionUuid; - @com.fasterxml.jackson.annotation.JsonProperty("Media") private final java.util.List media; - @com.fasterxml.jackson.annotation.JsonProperty("originallyAvailableAt") private final java.lang.String originallyAvailableAt; - @com.fasterxml.jackson.annotation.JsonProperty("primaryExtraKey") private final java.lang.String primaryExtraKey; - @com.fasterxml.jackson.annotation.JsonProperty("rating") private final java.lang.Double rating; - @com.fasterxml.jackson.annotation.JsonProperty("ratingImage") private final java.lang.String ratingImage; - @com.fasterxml.jackson.annotation.JsonProperty("ratingKey") private final java.lang.Double ratingKey; - @com.fasterxml.jackson.annotation.JsonProperty("Role") private final java.util.List role; - @com.fasterxml.jackson.annotation.JsonProperty("studio") private final java.lang.String studio; - @com.fasterxml.jackson.annotation.JsonProperty("summary") private final java.lang.String summary; - @com.fasterxml.jackson.annotation.JsonProperty("tagline") private final java.lang.String tagline; - @com.fasterxml.jackson.annotation.JsonProperty("thumb") private final java.lang.String thumb; - @com.fasterxml.jackson.annotation.JsonProperty("title") private final java.lang.String title; - @com.fasterxml.jackson.annotation.JsonProperty("type") private final java.lang.String type; - @com.fasterxml.jackson.annotation.JsonProperty("updatedAt") private final java.lang.Double updatedAt; - @com.fasterxml.jackson.annotation.JsonProperty("Writer") private final java.util.List writer; - @com.fasterxml.jackson.annotation.JsonProperty("year") private final java.lang.Double year; - - Metadata(Builder builder) { - super(builder); - - this.addedAt = builder.getAddedAt(); - this.allowSync = builder.getAllowSync(); - this.art = builder.getArt(); - this.audienceRating = builder.getAudienceRating(); - this.audienceRatingImage = builder.getAudienceRatingImage(); - this.chapterSource = builder.getChapterSource(); - this.contentRating = builder.getContentRating(); - this.country = builder.getCountry(); - this.director = builder.getDirector(); - this.duration = builder.getDuration(); - this.genre = builder.getGenre(); - this.guid = builder.getGuid(); - this.key = builder.getKey(); - this.librarySectionId = builder.getLibrarySectionId(); - this.librarySectionTitle = builder.getLibrarySectionTitle(); - this.librarySectionUuid = builder.getLibrarySectionUuid(); - this.media = builder.getMedia(); - this.originallyAvailableAt = builder.getOriginallyAvailableAt(); - this.primaryExtraKey = builder.getPrimaryExtraKey(); - this.rating = builder.getRating(); - this.ratingImage = builder.getRatingImage(); - this.ratingKey = builder.getRatingKey(); - this.role = builder.getRole(); - this.studio = builder.getStudio(); - this.summary = builder.getSummary(); - this.tagline = builder.getTagline(); - this.thumb = builder.getThumb(); - this.title = builder.getTitle(); - this.type = builder.getType(); - this.updatedAt = builder.getUpdatedAt(); - this.writer = builder.getWriter(); - this.year = builder.getYear(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") private java.lang.Boolean allowSync; - @com.fasterxml.jackson.annotation.JsonProperty("identifier") private java.lang.String identifier; - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagPrefix") private java.lang.String mediaTagPrefix; - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagVersion") private java.lang.Double mediaTagVersion; - @com.fasterxml.jackson.annotation.JsonProperty("Metadata") private java.util.List metadata; - @com.fasterxml.jackson.annotation.JsonProperty("mixedParents") private java.lang.Boolean mixedParents; - @com.fasterxml.jackson.annotation.JsonProperty("size") private java.lang.Double size; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") private final java.lang.Boolean allowSync; - @com.fasterxml.jackson.annotation.JsonProperty("identifier") private final java.lang.String identifier; - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagPrefix") private final java.lang.String mediaTagPrefix; - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagVersion") private final java.lang.Double mediaTagVersion; - @com.fasterxml.jackson.annotation.JsonProperty("Metadata") private final java.util.List metadata; - @com.fasterxml.jackson.annotation.JsonProperty("mixedParents") private final java.lang.Boolean mixedParents; - @com.fasterxml.jackson.annotation.JsonProperty("size") private final java.lang.Double size; - - MediaContainer(Builder builder) { - super(builder); - - this.allowSync = builder.getAllowSync(); - this.identifier = builder.getIdentifier(); - this.mediaTagPrefix = builder.getMediaTagPrefix(); - this.mediaTagVersion = builder.getMediaTagVersion(); - this.metadata = builder.getMetadata(); - this.mixedParents = builder.getMixedParents(); - this.size = builder.getSize(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private GetRecentlyAddedResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse buildWithoutValidation() { - return new GetRecentlyAddedResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.stream(this.getClass().getDeclaredFields()) - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private final GetRecentlyAddedResponse.MediaContainer mediaContainer; - - GetRecentlyAddedResponse(Builder builder) { - super(builder); - - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/47/one0/models/GetSearchResultsResponse.java b/src/main/java/47/one0/models/GetSearchResultsResponse.java deleted file mode 100644 index 8e2aa4a8..00000000 --- a/src/main/java/47/one0/models/GetSearchResultsResponse.java +++ /dev/null @@ -1,1132 +0,0 @@ -package 47.one0.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetSearchResultsResponse.Builder.class) -public class GetSearchResultsResponse extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetSearchResultsResponse.MediaContainer.Builder.class) - public static class MediaContainer extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetSearchResultsResponse.MediaContainer.Metadata.Builder.class) - public static class Metadata extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetSearchResultsResponse.MediaContainer.Metadata.Media.Builder.class) - public static class Media extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetSearchResultsResponse.MediaContainer.Metadata.Media.Part.Builder.class) - public static class Part extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("audioProfile") private java.lang.String audioProfile; - @com.fasterxml.jackson.annotation.JsonProperty("container") private java.lang.String container; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("file") private java.lang.String file; - @com.fasterxml.jackson.annotation.JsonProperty("id") private java.lang.Double id; - @com.fasterxml.jackson.annotation.JsonProperty("key") private java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("size") private java.lang.Double size; - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") private java.lang.String videoProfile; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Media.Part build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Media.Part buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Metadata.Media.Part(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("audioProfile") private final java.lang.String audioProfile; - @com.fasterxml.jackson.annotation.JsonProperty("container") private final java.lang.String container; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private final java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("file") private final java.lang.String file; - @com.fasterxml.jackson.annotation.JsonProperty("id") private final java.lang.Double id; - @com.fasterxml.jackson.annotation.JsonProperty("key") private final java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("size") private final java.lang.Double size; - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") private final java.lang.String videoProfile; - - Part(Builder builder) { - super(builder); - - this.audioProfile = builder.getAudioProfile(); - this.container = builder.getContainer(); - this.duration = builder.getDuration(); - this.file = builder.getFile(); - this.id = builder.getId(); - this.key = builder.getKey(); - this.size = builder.getSize(); - this.videoProfile = builder.getVideoProfile(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("aspectRatio") private java.lang.Double aspectRatio; - @com.fasterxml.jackson.annotation.JsonProperty("audioChannels") private java.lang.Double audioChannels; - @com.fasterxml.jackson.annotation.JsonProperty("audioCodec") private java.lang.String audioCodec; - @com.fasterxml.jackson.annotation.JsonProperty("audioProfile") private java.lang.String audioProfile; - @com.fasterxml.jackson.annotation.JsonProperty("bitrate") private java.lang.Double bitrate; - @com.fasterxml.jackson.annotation.JsonProperty("container") private java.lang.String container; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("height") private java.lang.Double height; - @com.fasterxml.jackson.annotation.JsonProperty("id") private java.lang.Double id; - @com.fasterxml.jackson.annotation.JsonProperty("Part") private java.util.List part; - @com.fasterxml.jackson.annotation.JsonProperty("videoCodec") private java.lang.String videoCodec; - @com.fasterxml.jackson.annotation.JsonProperty("videoFrameRate") private java.lang.String videoFrameRate; - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") private java.lang.String videoProfile; - @com.fasterxml.jackson.annotation.JsonProperty("videoResolution") private java.lang.Double videoResolution; - @com.fasterxml.jackson.annotation.JsonProperty("width") private java.lang.Double width; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Media build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Media buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Metadata.Media(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("aspectRatio") private final java.lang.Double aspectRatio; - @com.fasterxml.jackson.annotation.JsonProperty("audioChannels") private final java.lang.Double audioChannels; - @com.fasterxml.jackson.annotation.JsonProperty("audioCodec") private final java.lang.String audioCodec; - @com.fasterxml.jackson.annotation.JsonProperty("audioProfile") private final java.lang.String audioProfile; - @com.fasterxml.jackson.annotation.JsonProperty("bitrate") private final java.lang.Double bitrate; - @com.fasterxml.jackson.annotation.JsonProperty("container") private final java.lang.String container; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private final java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("height") private final java.lang.Double height; - @com.fasterxml.jackson.annotation.JsonProperty("id") private final java.lang.Double id; - @com.fasterxml.jackson.annotation.JsonProperty("Part") private final java.util.List part; - @com.fasterxml.jackson.annotation.JsonProperty("videoCodec") private final java.lang.String videoCodec; - @com.fasterxml.jackson.annotation.JsonProperty("videoFrameRate") private final java.lang.String videoFrameRate; - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") private final java.lang.String videoProfile; - @com.fasterxml.jackson.annotation.JsonProperty("videoResolution") private final java.lang.Double videoResolution; - @com.fasterxml.jackson.annotation.JsonProperty("width") private final java.lang.Double width; - - Media(Builder builder) { - super(builder); - - this.aspectRatio = builder.getAspectRatio(); - this.audioChannels = builder.getAudioChannels(); - this.audioCodec = builder.getAudioCodec(); - this.audioProfile = builder.getAudioProfile(); - this.bitrate = builder.getBitrate(); - this.container = builder.getContainer(); - this.duration = builder.getDuration(); - this.height = builder.getHeight(); - this.id = builder.getId(); - this.part = builder.getPart(); - this.videoCodec = builder.getVideoCodec(); - this.videoFrameRate = builder.getVideoFrameRate(); - this.videoProfile = builder.getVideoProfile(); - this.videoResolution = builder.getVideoResolution(); - this.width = builder.getWidth(); - } - } - - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetSearchResultsResponse.MediaContainer.Metadata.Genre.Builder.class) - public static class Genre extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Genre build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Genre buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Metadata.Genre(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private final java.lang.String tag; - - Genre(Builder builder) { - super(builder); - - this.tag = builder.getTag(); - } - } - - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetSearchResultsResponse.MediaContainer.Metadata.Director.Builder.class) - public static class Director extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Director build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Director buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Metadata.Director(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private final java.lang.String tag; - - Director(Builder builder) { - super(builder); - - this.tag = builder.getTag(); - } - } - - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetSearchResultsResponse.MediaContainer.Metadata.Writer.Builder.class) - public static class Writer extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Writer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Writer buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Metadata.Writer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private final java.lang.String tag; - - Writer(Builder builder) { - super(builder); - - this.tag = builder.getTag(); - } - } - - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetSearchResultsResponse.MediaContainer.Metadata.Country.Builder.class) - public static class Country extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Country build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Country buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Metadata.Country(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private final java.lang.String tag; - - Country(Builder builder) { - super(builder); - - this.tag = builder.getTag(); - } - } - - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetSearchResultsResponse.MediaContainer.Metadata.Role.Builder.class) - public static class Role extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Role build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Role buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Metadata.Role(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") private final java.lang.String tag; - - Role(Builder builder) { - super(builder); - - this.tag = builder.getTag(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("addedAt") private java.lang.Double addedAt; - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") private java.lang.Boolean allowSync; - @com.fasterxml.jackson.annotation.JsonProperty("art") private java.lang.String art; - @com.fasterxml.jackson.annotation.JsonProperty("audienceRating") private java.lang.Double audienceRating; - @com.fasterxml.jackson.annotation.JsonProperty("audienceRatingImage") private java.lang.String audienceRatingImage; - @com.fasterxml.jackson.annotation.JsonProperty("chapterSource") private java.lang.String chapterSource; - @com.fasterxml.jackson.annotation.JsonProperty("contentRating") private java.lang.String contentRating; - @com.fasterxml.jackson.annotation.JsonProperty("Country") private java.util.List country; - @com.fasterxml.jackson.annotation.JsonProperty("Director") private java.util.List director; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("Genre") private java.util.List genre; - @com.fasterxml.jackson.annotation.JsonProperty("guid") private java.lang.String guid; - @com.fasterxml.jackson.annotation.JsonProperty("key") private java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionID") private java.lang.Double librarySectionId; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionTitle") private java.lang.String librarySectionTitle; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionUUID") private java.lang.String librarySectionUuid; - @com.fasterxml.jackson.annotation.JsonProperty("Media") private java.util.List media; - @com.fasterxml.jackson.annotation.JsonProperty("originallyAvailableAt") private java.lang.String originallyAvailableAt; - @com.fasterxml.jackson.annotation.JsonProperty("personal") private java.lang.Boolean personal; - @com.fasterxml.jackson.annotation.JsonProperty("primaryExtraKey") private java.lang.String primaryExtraKey; - @com.fasterxml.jackson.annotation.JsonProperty("rating") private java.lang.Double rating; - @com.fasterxml.jackson.annotation.JsonProperty("ratingImage") private java.lang.String ratingImage; - @com.fasterxml.jackson.annotation.JsonProperty("ratingKey") private java.lang.Double ratingKey; - @com.fasterxml.jackson.annotation.JsonProperty("Role") private java.util.List role; - @com.fasterxml.jackson.annotation.JsonProperty("sourceTitle") private java.lang.String sourceTitle; - @com.fasterxml.jackson.annotation.JsonProperty("studio") private java.lang.String studio; - @com.fasterxml.jackson.annotation.JsonProperty("summary") private java.lang.String summary; - @com.fasterxml.jackson.annotation.JsonProperty("tagline") private java.lang.String tagline; - @com.fasterxml.jackson.annotation.JsonProperty("thumb") private java.lang.String thumb; - @com.fasterxml.jackson.annotation.JsonProperty("title") private java.lang.String title; - @com.fasterxml.jackson.annotation.JsonProperty("type") private java.lang.String type; - @com.fasterxml.jackson.annotation.JsonProperty("updatedAt") private java.lang.Double updatedAt; - @com.fasterxml.jackson.annotation.JsonProperty("Writer") private java.util.List writer; - @com.fasterxml.jackson.annotation.JsonProperty("year") private java.lang.Double year; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Metadata build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Metadata buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Metadata(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("addedAt") private final java.lang.Double addedAt; - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") private final java.lang.Boolean allowSync; - @com.fasterxml.jackson.annotation.JsonProperty("art") private final java.lang.String art; - @com.fasterxml.jackson.annotation.JsonProperty("audienceRating") private final java.lang.Double audienceRating; - @com.fasterxml.jackson.annotation.JsonProperty("audienceRatingImage") private final java.lang.String audienceRatingImage; - @com.fasterxml.jackson.annotation.JsonProperty("chapterSource") private final java.lang.String chapterSource; - @com.fasterxml.jackson.annotation.JsonProperty("contentRating") private final java.lang.String contentRating; - @com.fasterxml.jackson.annotation.JsonProperty("Country") private final java.util.List country; - @com.fasterxml.jackson.annotation.JsonProperty("Director") private final java.util.List director; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private final java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("Genre") private final java.util.List genre; - @com.fasterxml.jackson.annotation.JsonProperty("guid") private final java.lang.String guid; - @com.fasterxml.jackson.annotation.JsonProperty("key") private final java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionID") private final java.lang.Double librarySectionId; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionTitle") private final java.lang.String librarySectionTitle; - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionUUID") private final java.lang.String librarySectionUuid; - @com.fasterxml.jackson.annotation.JsonProperty("Media") private final java.util.List media; - @com.fasterxml.jackson.annotation.JsonProperty("originallyAvailableAt") private final java.lang.String originallyAvailableAt; - @com.fasterxml.jackson.annotation.JsonProperty("personal") private final java.lang.Boolean personal; - @com.fasterxml.jackson.annotation.JsonProperty("primaryExtraKey") private final java.lang.String primaryExtraKey; - @com.fasterxml.jackson.annotation.JsonProperty("rating") private final java.lang.Double rating; - @com.fasterxml.jackson.annotation.JsonProperty("ratingImage") private final java.lang.String ratingImage; - @com.fasterxml.jackson.annotation.JsonProperty("ratingKey") private final java.lang.Double ratingKey; - @com.fasterxml.jackson.annotation.JsonProperty("Role") private final java.util.List role; - @com.fasterxml.jackson.annotation.JsonProperty("sourceTitle") private final java.lang.String sourceTitle; - @com.fasterxml.jackson.annotation.JsonProperty("studio") private final java.lang.String studio; - @com.fasterxml.jackson.annotation.JsonProperty("summary") private final java.lang.String summary; - @com.fasterxml.jackson.annotation.JsonProperty("tagline") private final java.lang.String tagline; - @com.fasterxml.jackson.annotation.JsonProperty("thumb") private final java.lang.String thumb; - @com.fasterxml.jackson.annotation.JsonProperty("title") private final java.lang.String title; - @com.fasterxml.jackson.annotation.JsonProperty("type") private final java.lang.String type; - @com.fasterxml.jackson.annotation.JsonProperty("updatedAt") private final java.lang.Double updatedAt; - @com.fasterxml.jackson.annotation.JsonProperty("Writer") private final java.util.List writer; - @com.fasterxml.jackson.annotation.JsonProperty("year") private final java.lang.Double year; - - Metadata(Builder builder) { - super(builder); - - this.addedAt = builder.getAddedAt(); - this.allowSync = builder.getAllowSync(); - this.art = builder.getArt(); - this.audienceRating = builder.getAudienceRating(); - this.audienceRatingImage = builder.getAudienceRatingImage(); - this.chapterSource = builder.getChapterSource(); - this.contentRating = builder.getContentRating(); - this.country = builder.getCountry(); - this.director = builder.getDirector(); - this.duration = builder.getDuration(); - this.genre = builder.getGenre(); - this.guid = builder.getGuid(); - this.key = builder.getKey(); - this.librarySectionId = builder.getLibrarySectionId(); - this.librarySectionTitle = builder.getLibrarySectionTitle(); - this.librarySectionUuid = builder.getLibrarySectionUuid(); - this.media = builder.getMedia(); - this.originallyAvailableAt = builder.getOriginallyAvailableAt(); - this.personal = builder.getPersonal(); - this.primaryExtraKey = builder.getPrimaryExtraKey(); - this.rating = builder.getRating(); - this.ratingImage = builder.getRatingImage(); - this.ratingKey = builder.getRatingKey(); - this.role = builder.getRole(); - this.sourceTitle = builder.getSourceTitle(); - this.studio = builder.getStudio(); - this.summary = builder.getSummary(); - this.tagline = builder.getTagline(); - this.thumb = builder.getThumb(); - this.title = builder.getTitle(); - this.type = builder.getType(); - this.updatedAt = builder.getUpdatedAt(); - this.writer = builder.getWriter(); - this.year = builder.getYear(); - } - } - - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetSearchResultsResponse.MediaContainer.Provider.Builder.class) - public static class Provider extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("key") private java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("title") private java.lang.String title; - @com.fasterxml.jackson.annotation.JsonProperty("type") private java.lang.String type; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Provider build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Provider buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Provider(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("key") private final java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("title") private final java.lang.String title; - @com.fasterxml.jackson.annotation.JsonProperty("type") private final java.lang.String type; - - Provider(Builder builder) { - super(builder); - - this.key = builder.getKey(); - this.title = builder.getTitle(); - this.type = builder.getType(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("identifier") private java.lang.String identifier; - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagPrefix") private java.lang.String mediaTagPrefix; - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagVersion") private java.lang.Double mediaTagVersion; - @com.fasterxml.jackson.annotation.JsonProperty("Metadata") private java.util.List metadata; - @com.fasterxml.jackson.annotation.JsonProperty("Provider") private java.util.List provider; - @com.fasterxml.jackson.annotation.JsonProperty("size") private java.lang.Double size; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("identifier") private final java.lang.String identifier; - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagPrefix") private final java.lang.String mediaTagPrefix; - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagVersion") private final java.lang.Double mediaTagVersion; - @com.fasterxml.jackson.annotation.JsonProperty("Metadata") private final java.util.List metadata; - @com.fasterxml.jackson.annotation.JsonProperty("Provider") private final java.util.List provider; - @com.fasterxml.jackson.annotation.JsonProperty("size") private final java.lang.Double size; - - MediaContainer(Builder builder) { - super(builder); - - this.identifier = builder.getIdentifier(); - this.mediaTagPrefix = builder.getMediaTagPrefix(); - this.mediaTagVersion = builder.getMediaTagVersion(); - this.metadata = builder.getMetadata(); - this.provider = builder.getProvider(); - this.size = builder.getSize(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private GetSearchResultsResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse buildWithoutValidation() { - return new GetSearchResultsResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.stream(this.getClass().getDeclaredFields()) - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private final GetSearchResultsResponse.MediaContainer mediaContainer; - - GetSearchResultsResponse(Builder builder) { - super(builder); - - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/47/one0/models/GetServerActivitiesResponse.java b/src/main/java/47/one0/models/GetServerActivitiesResponse.java deleted file mode 100644 index b9152654..00000000 --- a/src/main/java/47/one0/models/GetServerActivitiesResponse.java +++ /dev/null @@ -1,366 +0,0 @@ -package 47.one0.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetServerActivitiesResponse.Builder.class) -public class GetServerActivitiesResponse extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetServerActivitiesResponse.MediaContainer.Builder.class) - public static class MediaContainer extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetServerActivitiesResponse.MediaContainer.Activity.Builder.class) - public static class Activity extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetServerActivitiesResponse.MediaContainer.Activity.Context.Builder.class) - public static class Context extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionID") private java.lang.String librarySectionId; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerActivitiesResponse.MediaContainer.Activity.Context build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerActivitiesResponse.MediaContainer.Activity.Context buildWithoutValidation() { - return new GetServerActivitiesResponse.MediaContainer.Activity.Context(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionID") private final java.lang.String librarySectionId; - - Context(Builder builder) { - super(builder); - - this.librarySectionId = builder.getLibrarySectionId(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("cancellable") private java.lang.Boolean cancellable; - @com.fasterxml.jackson.annotation.JsonProperty("Context") private GetServerActivitiesResponse.MediaContainer.Activity.Context context; - @com.fasterxml.jackson.annotation.JsonProperty("progress") private java.lang.Double progress; - @com.fasterxml.jackson.annotation.JsonProperty("subtitle") private java.lang.String subtitle; - @com.fasterxml.jackson.annotation.JsonProperty("title") private java.lang.String title; - @com.fasterxml.jackson.annotation.JsonProperty("type") private java.lang.String type; - @com.fasterxml.jackson.annotation.JsonProperty("userID") private java.lang.Double userId; - @com.fasterxml.jackson.annotation.JsonProperty("uuid") private java.lang.String uuid; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerActivitiesResponse.MediaContainer.Activity build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerActivitiesResponse.MediaContainer.Activity buildWithoutValidation() { - return new GetServerActivitiesResponse.MediaContainer.Activity(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("cancellable") private final java.lang.Boolean cancellable; - @com.fasterxml.jackson.annotation.JsonProperty("Context") private final GetServerActivitiesResponse.MediaContainer.Activity.Context context; - @com.fasterxml.jackson.annotation.JsonProperty("progress") private final java.lang.Double progress; - @com.fasterxml.jackson.annotation.JsonProperty("subtitle") private final java.lang.String subtitle; - @com.fasterxml.jackson.annotation.JsonProperty("title") private final java.lang.String title; - @com.fasterxml.jackson.annotation.JsonProperty("type") private final java.lang.String type; - @com.fasterxml.jackson.annotation.JsonProperty("userID") private final java.lang.Double userId; - @com.fasterxml.jackson.annotation.JsonProperty("uuid") private final java.lang.String uuid; - - Activity(Builder builder) { - super(builder); - - this.cancellable = builder.getCancellable(); - this.context = builder.getContext(); - this.progress = builder.getProgress(); - this.subtitle = builder.getSubtitle(); - this.title = builder.getTitle(); - this.type = builder.getType(); - this.userId = builder.getUserId(); - this.uuid = builder.getUuid(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("Activity") private java.util.List activity; - @com.fasterxml.jackson.annotation.JsonProperty("size") private java.lang.Double size; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerActivitiesResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerActivitiesResponse.MediaContainer buildWithoutValidation() { - return new GetServerActivitiesResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("Activity") private final java.util.List activity; - @com.fasterxml.jackson.annotation.JsonProperty("size") private final java.lang.Double size; - - MediaContainer(Builder builder) { - super(builder); - - this.activity = builder.getActivity(); - this.size = builder.getSize(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private GetServerActivitiesResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerActivitiesResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerActivitiesResponse buildWithoutValidation() { - return new GetServerActivitiesResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.stream(this.getClass().getDeclaredFields()) - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private final GetServerActivitiesResponse.MediaContainer mediaContainer; - - GetServerActivitiesResponse(Builder builder) { - super(builder); - - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/47/one0/models/GetServerCapabilitiesResponse.java b/src/main/java/47/one0/models/GetServerCapabilitiesResponse.java deleted file mode 100644 index 0ec01719..00000000 --- a/src/main/java/47/one0/models/GetServerCapabilitiesResponse.java +++ /dev/null @@ -1,413 +0,0 @@ -package 47.one0.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetServerCapabilitiesResponse.Builder.class) -public class GetServerCapabilitiesResponse extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetServerCapabilitiesResponse.MediaContainer.Builder.class) - public static class MediaContainer extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetServerCapabilitiesResponse.MediaContainer.Directory.Builder.class) - public static class Directory extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("count") private java.lang.Double count; - @com.fasterxml.jackson.annotation.JsonProperty("key") private java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("title") private java.lang.String title; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerCapabilitiesResponse.MediaContainer.Directory build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerCapabilitiesResponse.MediaContainer.Directory buildWithoutValidation() { - return new GetServerCapabilitiesResponse.MediaContainer.Directory(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("count") private final java.lang.Double count; - @com.fasterxml.jackson.annotation.JsonProperty("key") private final java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("title") private final java.lang.String title; - - Directory(Builder builder) { - super(builder); - - this.count = builder.getCount(); - this.key = builder.getKey(); - this.title = builder.getTitle(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("allowCameraUpload") private java.lang.Boolean allowCameraUpload; - @com.fasterxml.jackson.annotation.JsonProperty("allowChannelAccess") private java.lang.Boolean allowChannelAccess; - @com.fasterxml.jackson.annotation.JsonProperty("allowMediaDeletion") private java.lang.Boolean allowMediaDeletion; - @com.fasterxml.jackson.annotation.JsonProperty("allowSharing") private java.lang.Boolean allowSharing; - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") private java.lang.Boolean allowSync; - @com.fasterxml.jackson.annotation.JsonProperty("allowTuners") private java.lang.Boolean allowTuners; - @com.fasterxml.jackson.annotation.JsonProperty("backgroundProcessing") private java.lang.Boolean backgroundProcessing; - @com.fasterxml.jackson.annotation.JsonProperty("certificate") private java.lang.Boolean certificate; - @com.fasterxml.jackson.annotation.JsonProperty("companionProxy") private java.lang.Boolean companionProxy; - @com.fasterxml.jackson.annotation.JsonProperty("countryCode") private java.lang.String countryCode; - @com.fasterxml.jackson.annotation.JsonProperty("diagnostics") private java.lang.String diagnostics; - @com.fasterxml.jackson.annotation.JsonProperty("Directory") private java.util.List directory; - @com.fasterxml.jackson.annotation.JsonProperty("eventStream") private java.lang.Boolean eventStream; - @com.fasterxml.jackson.annotation.JsonProperty("friendlyName") private java.lang.String friendlyName; - @com.fasterxml.jackson.annotation.JsonProperty("hubSearch") private java.lang.Boolean hubSearch; - @com.fasterxml.jackson.annotation.JsonProperty("itemClusters") private java.lang.Boolean itemClusters; - @com.fasterxml.jackson.annotation.JsonProperty("livetv") private java.lang.Double livetv; - @com.fasterxml.jackson.annotation.JsonProperty("machineIdentifier") private java.lang.String machineIdentifier; - @com.fasterxml.jackson.annotation.JsonProperty("mediaProviders") private java.lang.Boolean mediaProviders; - @com.fasterxml.jackson.annotation.JsonProperty("multiuser") private java.lang.Boolean multiuser; - @com.fasterxml.jackson.annotation.JsonProperty("musicAnalysis") private java.lang.Double musicAnalysis; - @com.fasterxml.jackson.annotation.JsonProperty("myPlex") private java.lang.Boolean myPlex; - @com.fasterxml.jackson.annotation.JsonProperty("myPlexMappingState") private java.lang.String myPlexMappingState; - @com.fasterxml.jackson.annotation.JsonProperty("myPlexSigninState") private java.lang.String myPlexSigninState; - @com.fasterxml.jackson.annotation.JsonProperty("myPlexSubscription") private java.lang.Boolean myPlexSubscription; - @com.fasterxml.jackson.annotation.JsonProperty("myPlexUsername") private java.lang.String myPlexUsername; - @com.fasterxml.jackson.annotation.JsonProperty("offlineTranscode") private java.lang.Double offlineTranscode; - @com.fasterxml.jackson.annotation.JsonProperty("ownerFeatures") private java.lang.String ownerFeatures; - @com.fasterxml.jackson.annotation.JsonProperty("photoAutoTag") private java.lang.Boolean photoAutoTag; - @com.fasterxml.jackson.annotation.JsonProperty("platform") private java.lang.String platform; - @com.fasterxml.jackson.annotation.JsonProperty("platformVersion") private java.lang.String platformVersion; - @com.fasterxml.jackson.annotation.JsonProperty("pluginHost") private java.lang.Boolean pluginHost; - @com.fasterxml.jackson.annotation.JsonProperty("pushNotifications") private java.lang.Boolean pushNotifications; - @com.fasterxml.jackson.annotation.JsonProperty("readOnlyLibraries") private java.lang.Boolean readOnlyLibraries; - @com.fasterxml.jackson.annotation.JsonProperty("size") private java.lang.Double size; - @com.fasterxml.jackson.annotation.JsonProperty("streamingBrainABRVersion") private java.lang.Double streamingBrainAbrversion; - @com.fasterxml.jackson.annotation.JsonProperty("streamingBrainVersion") private java.lang.Double streamingBrainVersion; - @com.fasterxml.jackson.annotation.JsonProperty("sync") private java.lang.Boolean sync; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderActiveVideoSessions") private java.lang.Double transcoderActiveVideoSessions; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderAudio") private java.lang.Boolean transcoderAudio; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderLyrics") private java.lang.Boolean transcoderLyrics; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderPhoto") private java.lang.Boolean transcoderPhoto; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderSubtitles") private java.lang.Boolean transcoderSubtitles; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderVideo") private java.lang.Boolean transcoderVideo; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderVideoBitrates") private java.lang.String transcoderVideoBitrates; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderVideoQualities") private java.lang.String transcoderVideoQualities; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderVideoResolutions") private java.lang.String transcoderVideoResolutions; - @com.fasterxml.jackson.annotation.JsonProperty("updatedAt") private java.lang.Double updatedAt; - @com.fasterxml.jackson.annotation.JsonProperty("updater") private java.lang.Boolean updater; - @com.fasterxml.jackson.annotation.JsonProperty("version") private java.lang.String version; - @com.fasterxml.jackson.annotation.JsonProperty("voiceSearch") private java.lang.Boolean voiceSearch; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerCapabilitiesResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerCapabilitiesResponse.MediaContainer buildWithoutValidation() { - return new GetServerCapabilitiesResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("allowCameraUpload") private final java.lang.Boolean allowCameraUpload; - @com.fasterxml.jackson.annotation.JsonProperty("allowChannelAccess") private final java.lang.Boolean allowChannelAccess; - @com.fasterxml.jackson.annotation.JsonProperty("allowMediaDeletion") private final java.lang.Boolean allowMediaDeletion; - @com.fasterxml.jackson.annotation.JsonProperty("allowSharing") private final java.lang.Boolean allowSharing; - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") private final java.lang.Boolean allowSync; - @com.fasterxml.jackson.annotation.JsonProperty("allowTuners") private final java.lang.Boolean allowTuners; - @com.fasterxml.jackson.annotation.JsonProperty("backgroundProcessing") private final java.lang.Boolean backgroundProcessing; - @com.fasterxml.jackson.annotation.JsonProperty("certificate") private final java.lang.Boolean certificate; - @com.fasterxml.jackson.annotation.JsonProperty("companionProxy") private final java.lang.Boolean companionProxy; - @com.fasterxml.jackson.annotation.JsonProperty("countryCode") private final java.lang.String countryCode; - @com.fasterxml.jackson.annotation.JsonProperty("diagnostics") private final java.lang.String diagnostics; - @com.fasterxml.jackson.annotation.JsonProperty("Directory") private final java.util.List directory; - @com.fasterxml.jackson.annotation.JsonProperty("eventStream") private final java.lang.Boolean eventStream; - @com.fasterxml.jackson.annotation.JsonProperty("friendlyName") private final java.lang.String friendlyName; - @com.fasterxml.jackson.annotation.JsonProperty("hubSearch") private final java.lang.Boolean hubSearch; - @com.fasterxml.jackson.annotation.JsonProperty("itemClusters") private final java.lang.Boolean itemClusters; - @com.fasterxml.jackson.annotation.JsonProperty("livetv") private final java.lang.Double livetv; - @com.fasterxml.jackson.annotation.JsonProperty("machineIdentifier") private final java.lang.String machineIdentifier; - @com.fasterxml.jackson.annotation.JsonProperty("mediaProviders") private final java.lang.Boolean mediaProviders; - @com.fasterxml.jackson.annotation.JsonProperty("multiuser") private final java.lang.Boolean multiuser; - @com.fasterxml.jackson.annotation.JsonProperty("musicAnalysis") private final java.lang.Double musicAnalysis; - @com.fasterxml.jackson.annotation.JsonProperty("myPlex") private final java.lang.Boolean myPlex; - @com.fasterxml.jackson.annotation.JsonProperty("myPlexMappingState") private final java.lang.String myPlexMappingState; - @com.fasterxml.jackson.annotation.JsonProperty("myPlexSigninState") private final java.lang.String myPlexSigninState; - @com.fasterxml.jackson.annotation.JsonProperty("myPlexSubscription") private final java.lang.Boolean myPlexSubscription; - @com.fasterxml.jackson.annotation.JsonProperty("myPlexUsername") private final java.lang.String myPlexUsername; - @com.fasterxml.jackson.annotation.JsonProperty("offlineTranscode") private final java.lang.Double offlineTranscode; - @com.fasterxml.jackson.annotation.JsonProperty("ownerFeatures") private final java.lang.String ownerFeatures; - @com.fasterxml.jackson.annotation.JsonProperty("photoAutoTag") private final java.lang.Boolean photoAutoTag; - @com.fasterxml.jackson.annotation.JsonProperty("platform") private final java.lang.String platform; - @com.fasterxml.jackson.annotation.JsonProperty("platformVersion") private final java.lang.String platformVersion; - @com.fasterxml.jackson.annotation.JsonProperty("pluginHost") private final java.lang.Boolean pluginHost; - @com.fasterxml.jackson.annotation.JsonProperty("pushNotifications") private final java.lang.Boolean pushNotifications; - @com.fasterxml.jackson.annotation.JsonProperty("readOnlyLibraries") private final java.lang.Boolean readOnlyLibraries; - @com.fasterxml.jackson.annotation.JsonProperty("size") private final java.lang.Double size; - @com.fasterxml.jackson.annotation.JsonProperty("streamingBrainABRVersion") private final java.lang.Double streamingBrainAbrversion; - @com.fasterxml.jackson.annotation.JsonProperty("streamingBrainVersion") private final java.lang.Double streamingBrainVersion; - @com.fasterxml.jackson.annotation.JsonProperty("sync") private final java.lang.Boolean sync; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderActiveVideoSessions") private final java.lang.Double transcoderActiveVideoSessions; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderAudio") private final java.lang.Boolean transcoderAudio; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderLyrics") private final java.lang.Boolean transcoderLyrics; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderPhoto") private final java.lang.Boolean transcoderPhoto; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderSubtitles") private final java.lang.Boolean transcoderSubtitles; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderVideo") private final java.lang.Boolean transcoderVideo; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderVideoBitrates") private final java.lang.String transcoderVideoBitrates; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderVideoQualities") private final java.lang.String transcoderVideoQualities; - @com.fasterxml.jackson.annotation.JsonProperty("transcoderVideoResolutions") private final java.lang.String transcoderVideoResolutions; - @com.fasterxml.jackson.annotation.JsonProperty("updatedAt") private final java.lang.Double updatedAt; - @com.fasterxml.jackson.annotation.JsonProperty("updater") private final java.lang.Boolean updater; - @com.fasterxml.jackson.annotation.JsonProperty("version") private final java.lang.String version; - @com.fasterxml.jackson.annotation.JsonProperty("voiceSearch") private final java.lang.Boolean voiceSearch; - - MediaContainer(Builder builder) { - super(builder); - - this.allowCameraUpload = builder.getAllowCameraUpload(); - this.allowChannelAccess = builder.getAllowChannelAccess(); - this.allowMediaDeletion = builder.getAllowMediaDeletion(); - this.allowSharing = builder.getAllowSharing(); - this.allowSync = builder.getAllowSync(); - this.allowTuners = builder.getAllowTuners(); - this.backgroundProcessing = builder.getBackgroundProcessing(); - this.certificate = builder.getCertificate(); - this.companionProxy = builder.getCompanionProxy(); - this.countryCode = builder.getCountryCode(); - this.diagnostics = builder.getDiagnostics(); - this.directory = builder.getDirectory(); - this.eventStream = builder.getEventStream(); - this.friendlyName = builder.getFriendlyName(); - this.hubSearch = builder.getHubSearch(); - this.itemClusters = builder.getItemClusters(); - this.livetv = builder.getLivetv(); - this.machineIdentifier = builder.getMachineIdentifier(); - this.mediaProviders = builder.getMediaProviders(); - this.multiuser = builder.getMultiuser(); - this.musicAnalysis = builder.getMusicAnalysis(); - this.myPlex = builder.getMyPlex(); - this.myPlexMappingState = builder.getMyPlexMappingState(); - this.myPlexSigninState = builder.getMyPlexSigninState(); - this.myPlexSubscription = builder.getMyPlexSubscription(); - this.myPlexUsername = builder.getMyPlexUsername(); - this.offlineTranscode = builder.getOfflineTranscode(); - this.ownerFeatures = builder.getOwnerFeatures(); - this.photoAutoTag = builder.getPhotoAutoTag(); - this.platform = builder.getPlatform(); - this.platformVersion = builder.getPlatformVersion(); - this.pluginHost = builder.getPluginHost(); - this.pushNotifications = builder.getPushNotifications(); - this.readOnlyLibraries = builder.getReadOnlyLibraries(); - this.size = builder.getSize(); - this.streamingBrainAbrversion = builder.getStreamingBrainAbrversion(); - this.streamingBrainVersion = builder.getStreamingBrainVersion(); - this.sync = builder.getSync(); - this.transcoderActiveVideoSessions = builder.getTranscoderActiveVideoSessions(); - this.transcoderAudio = builder.getTranscoderAudio(); - this.transcoderLyrics = builder.getTranscoderLyrics(); - this.transcoderPhoto = builder.getTranscoderPhoto(); - this.transcoderSubtitles = builder.getTranscoderSubtitles(); - this.transcoderVideo = builder.getTranscoderVideo(); - this.transcoderVideoBitrates = builder.getTranscoderVideoBitrates(); - this.transcoderVideoQualities = builder.getTranscoderVideoQualities(); - this.transcoderVideoResolutions = builder.getTranscoderVideoResolutions(); - this.updatedAt = builder.getUpdatedAt(); - this.updater = builder.getUpdater(); - this.version = builder.getVersion(); - this.voiceSearch = builder.getVoiceSearch(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private GetServerCapabilitiesResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerCapabilitiesResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerCapabilitiesResponse buildWithoutValidation() { - return new GetServerCapabilitiesResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.stream(this.getClass().getDeclaredFields()) - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private final GetServerCapabilitiesResponse.MediaContainer mediaContainer; - - GetServerCapabilitiesResponse(Builder builder) { - super(builder); - - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/47/one0/models/GetServerIdentityResponse.java b/src/main/java/47/one0/models/GetServerIdentityResponse.java deleted file mode 100644 index e96cea0c..00000000 --- a/src/main/java/47/one0/models/GetServerIdentityResponse.java +++ /dev/null @@ -1,181 +0,0 @@ -package 47.one0.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetServerIdentityResponse.Builder.class) -public class GetServerIdentityResponse extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetServerIdentityResponse.MediaContainer.Builder.class) - public static class MediaContainer extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("claimed") private java.lang.Boolean claimed; - @com.fasterxml.jackson.annotation.JsonProperty("machineIdentifier") private java.lang.String machineIdentifier; - @com.fasterxml.jackson.annotation.JsonProperty("size") private java.lang.Double size; - @com.fasterxml.jackson.annotation.JsonProperty("version") private java.lang.String version; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerIdentityResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerIdentityResponse.MediaContainer buildWithoutValidation() { - return new GetServerIdentityResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("claimed") private final java.lang.Boolean claimed; - @com.fasterxml.jackson.annotation.JsonProperty("machineIdentifier") private final java.lang.String machineIdentifier; - @com.fasterxml.jackson.annotation.JsonProperty("size") private final java.lang.Double size; - @com.fasterxml.jackson.annotation.JsonProperty("version") private final java.lang.String version; - - MediaContainer(Builder builder) { - super(builder); - - this.claimed = builder.getClaimed(); - this.machineIdentifier = builder.getMachineIdentifier(); - this.size = builder.getSize(); - this.version = builder.getVersion(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private GetServerIdentityResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerIdentityResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerIdentityResponse buildWithoutValidation() { - return new GetServerIdentityResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.stream(this.getClass().getDeclaredFields()) - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private final GetServerIdentityResponse.MediaContainer mediaContainer; - - GetServerIdentityResponse(Builder builder) { - super(builder); - - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/47/one0/models/GetServerListResponse.java b/src/main/java/47/one0/models/GetServerListResponse.java deleted file mode 100644 index 614bb1ef..00000000 --- a/src/main/java/47/one0/models/GetServerListResponse.java +++ /dev/null @@ -1,275 +0,0 @@ -package 47.one0.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetServerListResponse.Builder.class) -public class GetServerListResponse extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetServerListResponse.MediaContainer.Builder.class) - public static class MediaContainer extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetServerListResponse.MediaContainer.Server.Builder.class) - public static class Server extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("address") private java.lang.String address; - @com.fasterxml.jackson.annotation.JsonProperty("host") private java.lang.String host; - @com.fasterxml.jackson.annotation.JsonProperty("machineIdentifier") private java.lang.String machineIdentifier; - @com.fasterxml.jackson.annotation.JsonProperty("name") private java.lang.String name; - @com.fasterxml.jackson.annotation.JsonProperty("port") private java.lang.Double port; - @com.fasterxml.jackson.annotation.JsonProperty("version") private java.lang.String version; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerListResponse.MediaContainer.Server build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerListResponse.MediaContainer.Server buildWithoutValidation() { - return new GetServerListResponse.MediaContainer.Server(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("address") private final java.lang.String address; - @com.fasterxml.jackson.annotation.JsonProperty("host") private final java.lang.String host; - @com.fasterxml.jackson.annotation.JsonProperty("machineIdentifier") private final java.lang.String machineIdentifier; - @com.fasterxml.jackson.annotation.JsonProperty("name") private final java.lang.String name; - @com.fasterxml.jackson.annotation.JsonProperty("port") private final java.lang.Double port; - @com.fasterxml.jackson.annotation.JsonProperty("version") private final java.lang.String version; - - Server(Builder builder) { - super(builder); - - this.address = builder.getAddress(); - this.host = builder.getHost(); - this.machineIdentifier = builder.getMachineIdentifier(); - this.name = builder.getName(); - this.port = builder.getPort(); - this.version = builder.getVersion(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("Server") private java.util.List server; - @com.fasterxml.jackson.annotation.JsonProperty("size") private java.lang.Double size; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerListResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerListResponse.MediaContainer buildWithoutValidation() { - return new GetServerListResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("Server") private final java.util.List server; - @com.fasterxml.jackson.annotation.JsonProperty("size") private final java.lang.Double size; - - MediaContainer(Builder builder) { - super(builder); - - this.server = builder.getServer(); - this.size = builder.getSize(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private GetServerListResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerListResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerListResponse buildWithoutValidation() { - return new GetServerListResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.stream(this.getClass().getDeclaredFields()) - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private final GetServerListResponse.MediaContainer mediaContainer; - - GetServerListResponse(Builder builder) { - super(builder); - - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/47/one0/models/GetTranscodeSessionsResponse.java b/src/main/java/47/one0/models/GetTranscodeSessionsResponse.java deleted file mode 100644 index ca044104..00000000 --- a/src/main/java/47/one0/models/GetTranscodeSessionsResponse.java +++ /dev/null @@ -1,323 +0,0 @@ -package 47.one0.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetTranscodeSessionsResponse.Builder.class) -public class GetTranscodeSessionsResponse extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetTranscodeSessionsResponse.MediaContainer.Builder.class) - public static class MediaContainer extends 47.one0.models.BaseModel { - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = GetTranscodeSessionsResponse.MediaContainer.TranscodeSession.Builder.class) - public static class TranscodeSession extends 47.one0.models.BaseModel { - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("audioChannels") private java.lang.Double audioChannels; - @com.fasterxml.jackson.annotation.JsonProperty("audioCodec") private java.lang.String audioCodec; - @com.fasterxml.jackson.annotation.JsonProperty("audioDecision") private java.lang.String audioDecision; - @com.fasterxml.jackson.annotation.JsonProperty("complete") private java.lang.Boolean complete; - @com.fasterxml.jackson.annotation.JsonProperty("container") private java.lang.String container; - @com.fasterxml.jackson.annotation.JsonProperty("context") private java.lang.String context; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("error") private java.lang.Boolean error; - @com.fasterxml.jackson.annotation.JsonProperty("key") private java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("maxOffsetAvailable") private java.lang.Double maxOffsetAvailable; - @com.fasterxml.jackson.annotation.JsonProperty("minOffsetAvailable") private java.lang.Double minOffsetAvailable; - @com.fasterxml.jackson.annotation.JsonProperty("progress") private java.lang.Double progress; - @com.fasterxml.jackson.annotation.JsonProperty("protocol") private java.lang.String protocol; - @com.fasterxml.jackson.annotation.JsonProperty("size") private java.lang.Double size; - @com.fasterxml.jackson.annotation.JsonProperty("sourceAudioCodec") private java.lang.String sourceAudioCodec; - @com.fasterxml.jackson.annotation.JsonProperty("sourceVideoCodec") private java.lang.String sourceVideoCodec; - @com.fasterxml.jackson.annotation.JsonProperty("speed") private java.lang.Double speed; - @com.fasterxml.jackson.annotation.JsonProperty("throttled") private java.lang.Boolean throttled; - @com.fasterxml.jackson.annotation.JsonProperty("timeStamp") private java.lang.Double timeStamp; - @com.fasterxml.jackson.annotation.JsonProperty("transcodeHwRequested") private java.lang.Boolean transcodeHwRequested; - @com.fasterxml.jackson.annotation.JsonProperty("videoCodec") private java.lang.String videoCodec; - @com.fasterxml.jackson.annotation.JsonProperty("videoDecision") private java.lang.String videoDecision; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetTranscodeSessionsResponse.MediaContainer.TranscodeSession build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetTranscodeSessionsResponse.MediaContainer.TranscodeSession buildWithoutValidation() { - return new GetTranscodeSessionsResponse.MediaContainer.TranscodeSession(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("audioChannels") private final java.lang.Double audioChannels; - @com.fasterxml.jackson.annotation.JsonProperty("audioCodec") private final java.lang.String audioCodec; - @com.fasterxml.jackson.annotation.JsonProperty("audioDecision") private final java.lang.String audioDecision; - @com.fasterxml.jackson.annotation.JsonProperty("complete") private final java.lang.Boolean complete; - @com.fasterxml.jackson.annotation.JsonProperty("container") private final java.lang.String container; - @com.fasterxml.jackson.annotation.JsonProperty("context") private final java.lang.String context; - @com.fasterxml.jackson.annotation.JsonProperty("duration") private final java.lang.Double duration; - @com.fasterxml.jackson.annotation.JsonProperty("error") private final java.lang.Boolean error; - @com.fasterxml.jackson.annotation.JsonProperty("key") private final java.lang.String key; - @com.fasterxml.jackson.annotation.JsonProperty("maxOffsetAvailable") private final java.lang.Double maxOffsetAvailable; - @com.fasterxml.jackson.annotation.JsonProperty("minOffsetAvailable") private final java.lang.Double minOffsetAvailable; - @com.fasterxml.jackson.annotation.JsonProperty("progress") private final java.lang.Double progress; - @com.fasterxml.jackson.annotation.JsonProperty("protocol") private final java.lang.String protocol; - @com.fasterxml.jackson.annotation.JsonProperty("size") private final java.lang.Double size; - @com.fasterxml.jackson.annotation.JsonProperty("sourceAudioCodec") private final java.lang.String sourceAudioCodec; - @com.fasterxml.jackson.annotation.JsonProperty("sourceVideoCodec") private final java.lang.String sourceVideoCodec; - @com.fasterxml.jackson.annotation.JsonProperty("speed") private final java.lang.Double speed; - @com.fasterxml.jackson.annotation.JsonProperty("throttled") private final java.lang.Boolean throttled; - @com.fasterxml.jackson.annotation.JsonProperty("timeStamp") private final java.lang.Double timeStamp; - @com.fasterxml.jackson.annotation.JsonProperty("transcodeHwRequested") private final java.lang.Boolean transcodeHwRequested; - @com.fasterxml.jackson.annotation.JsonProperty("videoCodec") private final java.lang.String videoCodec; - @com.fasterxml.jackson.annotation.JsonProperty("videoDecision") private final java.lang.String videoDecision; - - TranscodeSession(Builder builder) { - super(builder); - - this.audioChannels = builder.getAudioChannels(); - this.audioCodec = builder.getAudioCodec(); - this.audioDecision = builder.getAudioDecision(); - this.complete = builder.getComplete(); - this.container = builder.getContainer(); - this.context = builder.getContext(); - this.duration = builder.getDuration(); - this.error = builder.getError(); - this.key = builder.getKey(); - this.maxOffsetAvailable = builder.getMaxOffsetAvailable(); - this.minOffsetAvailable = builder.getMinOffsetAvailable(); - this.progress = builder.getProgress(); - this.protocol = builder.getProtocol(); - this.size = builder.getSize(); - this.sourceAudioCodec = builder.getSourceAudioCodec(); - this.sourceVideoCodec = builder.getSourceVideoCodec(); - this.speed = builder.getSpeed(); - this.throttled = builder.getThrottled(); - this.timeStamp = builder.getTimeStamp(); - this.transcodeHwRequested = builder.getTranscodeHwRequested(); - this.videoCodec = builder.getVideoCodec(); - this.videoDecision = builder.getVideoDecision(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("size") private java.lang.Double size; - @com.fasterxml.jackson.annotation.JsonProperty("TranscodeSession") private java.util.List transcodeSession; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetTranscodeSessionsResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetTranscodeSessionsResponse.MediaContainer buildWithoutValidation() { - return new GetTranscodeSessionsResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.asList(this.getClass().getDeclaredFields()).stream() - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("size") private final java.lang.Double size; - @com.fasterxml.jackson.annotation.JsonProperty("TranscodeSession") private final java.util.List transcodeSession; - - MediaContainer(Builder builder) { - super(builder); - - this.size = builder.getSize(); - this.transcodeSession = builder.getTranscodeSession(); - } - } - - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(buildMethodName = "buildWithoutValidation", withPrefix = "set") - public static class Builder extends 47.one0.models.BaseModel.Builder { - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = - new java.lang.String[][] { - - }; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays.stream(requiredFieldsGroups) - .map((group) -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private GetTranscodeSessionsResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetTranscodeSessionsResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new 47.one0.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetTranscodeSessionsResponse buildWithoutValidation() { - return new GetTranscodeSessionsResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays.stream(this.getClass().getDeclaredFields()) - .filter( - (field) -> { - try { - // Filter fields that are non-static and have values that are not null. - return !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null; - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new 47.one0.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", e); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") private final GetTranscodeSessionsResponse.MediaContainer mediaContainer; - - GetTranscodeSessionsResponse(Builder builder) { - super(builder); - - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/47/one0/models/IncludeDetails.java b/src/main/java/47/one0/models/IncludeDetails.java deleted file mode 100644 index 3d57bdd1..00000000 --- a/src/main/java/47/one0/models/IncludeDetails.java +++ /dev/null @@ -1,11 +0,0 @@ -package 47.one0.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum IncludeDetails { - V1(1); - - public final Float label; -} diff --git a/src/main/java/47/one0/models/Level.java b/src/main/java/47/one0/models/Level.java deleted file mode 100644 index 2b5ae513..00000000 --- a/src/main/java/47/one0/models/Level.java +++ /dev/null @@ -1,14 +0,0 @@ -package 47.one0.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Level { - V1(1), - V2(2), - V3(3), - V4(4); - - public final Float label; -} diff --git a/src/main/java/47/one0/models/MinSize.java b/src/main/java/47/one0/models/MinSize.java deleted file mode 100644 index 8fa4739e..00000000 --- a/src/main/java/47/one0/models/MinSize.java +++ /dev/null @@ -1,11 +0,0 @@ -package 47.one0.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum MinSize { - V1(1); - - public final Float label; -} diff --git a/src/main/java/47/one0/models/OnlyTransient.java b/src/main/java/47/one0/models/OnlyTransient.java deleted file mode 100644 index 17aa8545..00000000 --- a/src/main/java/47/one0/models/OnlyTransient.java +++ /dev/null @@ -1,11 +0,0 @@ -package 47.one0.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum OnlyTransient { - V1(1); - - public final Float label; -} diff --git a/src/main/java/47/one0/models/PlaylistType.java b/src/main/java/47/one0/models/PlaylistType.java deleted file mode 100644 index bfa87241..00000000 --- a/src/main/java/47/one0/models/PlaylistType.java +++ /dev/null @@ -1,13 +0,0 @@ -package 47.one0.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum PlaylistType { - AUDIO("audio"), - VIDEO("video"), - PHOTO("photo"); - - public final String label; -} diff --git a/src/main/java/47/one0/models/README.md b/src/main/java/47/one0/models/README.md deleted file mode 100644 index 7b315dee..00000000 --- a/src/main/java/47/one0/models/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# PlexSDK Models - -A list of all models. -- [Level](#level) -- [Upscale](#upscale) -- [Type](#type) -- [Smart](#smart) -- [Force](#force) -- [SecurityType](#securitytype) -- [Scope](#scope) -- [Download](#download) -- [Tonight](#tonight) -- [Skip](#skip) -- [State](#state) -- [GetServerCapabilitiesResponse](#getservercapabilitiesresponse) -- [GetServerActivitiesResponse](#getserveractivitiesresponse) -- [GetButlerTasksResponse](#getbutlertasksresponse) -- [GetAvailableClientsResponse](#getavailableclientsresponse) -- [GetDevicesResponse](#getdevicesresponse) -- [GetServerIdentityResponse](#getserveridentityresponse) -- [GetRecentlyAddedResponse](#getrecentlyaddedresponse) -- [GetOnDeckResponse](#getondeckresponse) -- [GetMyPlexAccountResponse](#getmyplexaccountresponse) -- [GetSearchResultsResponse](#getsearchresultsresponse) -- [GetServerListResponse](#getserverlistresponse) -- [GetTranscodeSessionsResponse](#gettranscodesessionsresponse) -- [TaskName](#taskname) -- [OnlyTransient](#onlytransient) -- [IncludeDetails](#includedetails) -- [MinSize](#minsize) -- [PlaylistType](#playlisttype) - -## Level - -## Upscale - -## Type - -## Smart - -## Force - -## SecurityType - -## Scope - -## Download - -## Tonight - -## Skip - -## State - -## GetServerCapabilitiesResponse - -## GetServerActivitiesResponse - -## GetButlerTasksResponse - -## GetAvailableClientsResponse - -## GetDevicesResponse - -## GetServerIdentityResponse - -## GetRecentlyAddedResponse - -## GetOnDeckResponse - -## GetMyPlexAccountResponse - -## GetSearchResultsResponse - -## GetServerListResponse - -## GetTranscodeSessionsResponse - -## TaskName - -## OnlyTransient - -## IncludeDetails - -## MinSize - -## PlaylistType - - - diff --git a/src/main/java/47/one0/models/Scope.java b/src/main/java/47/one0/models/Scope.java deleted file mode 100644 index 55a93e76..00000000 --- a/src/main/java/47/one0/models/Scope.java +++ /dev/null @@ -1,11 +0,0 @@ -package 47.one0.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Scope { - ALL("all"); - - public final String label; -} diff --git a/src/main/java/47/one0/models/SecurityType.java b/src/main/java/47/one0/models/SecurityType.java deleted file mode 100644 index 68ec7afb..00000000 --- a/src/main/java/47/one0/models/SecurityType.java +++ /dev/null @@ -1,11 +0,0 @@ -package 47.one0.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum SecurityType { - DELEGATION("delegation"); - - public final String label; -} diff --git a/src/main/java/47/one0/models/Skip.java b/src/main/java/47/one0/models/Skip.java deleted file mode 100644 index b0759c03..00000000 --- a/src/main/java/47/one0/models/Skip.java +++ /dev/null @@ -1,11 +0,0 @@ -package 47.one0.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Skip { - V1("1"); - - public final String label; -} diff --git a/src/main/java/47/one0/models/Smart.java b/src/main/java/47/one0/models/Smart.java deleted file mode 100644 index 72a2b017..00000000 --- a/src/main/java/47/one0/models/Smart.java +++ /dev/null @@ -1,11 +0,0 @@ -package 47.one0.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Smart { - V1(1); - - public final Float label; -} diff --git a/src/main/java/47/one0/models/State.java b/src/main/java/47/one0/models/State.java deleted file mode 100644 index fa72aa55..00000000 --- a/src/main/java/47/one0/models/State.java +++ /dev/null @@ -1,13 +0,0 @@ -package 47.one0.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum State { - PLAYING("playing"), - PAUSED("paused"), - STOPPED("stopped"); - - public final String label; -} diff --git a/src/main/java/47/one0/models/TaskName.java b/src/main/java/47/one0/models/TaskName.java deleted file mode 100644 index 2e197b2f..00000000 --- a/src/main/java/47/one0/models/TaskName.java +++ /dev/null @@ -1,24 +0,0 @@ -package 47.one0.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum TaskName { - BACKUPDATABASE("BackupDatabase"), - BUILDGRACENOTECOLLECTIONS("BuildGracenoteCollections"), - CHECKFORUPDATES("CheckForUpdates"), - CLEANOLDBUNDLES("CleanOldBundles"), - CLEANOLDCACHEFILES("CleanOldCacheFiles"), - DEEPMEDIAANALYSIS("DeepMediaAnalysis"), - GENERATEAUTOTAGS("GenerateAutoTags"), - GENERATECHAPTERTHUMBS("GenerateChapterThumbs"), - GENERATEMEDIAINDEXFILES("GenerateMediaIndexFiles"), - OPTIMIZEDATABASE("OptimizeDatabase"), - REFRESHLIBRARIES("RefreshLibraries"), - REFRESHLOCALMEDIA("RefreshLocalMedia"), - REFRESHPERIODICMETADATA("RefreshPeriodicMetadata"), - UPGRADEMEDIAANALYSIS("UpgradeMediaAnalysis"); - - public final String label; -} diff --git a/src/main/java/47/one0/models/Tonight.java b/src/main/java/47/one0/models/Tonight.java deleted file mode 100644 index 8f7766ff..00000000 --- a/src/main/java/47/one0/models/Tonight.java +++ /dev/null @@ -1,11 +0,0 @@ -package 47.one0.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Tonight { - V1("1"); - - public final String label; -} diff --git a/src/main/java/47/one0/models/Type.java b/src/main/java/47/one0/models/Type.java deleted file mode 100644 index ce5c59cf..00000000 --- a/src/main/java/47/one0/models/Type.java +++ /dev/null @@ -1,13 +0,0 @@ -package 47.one0.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Type { - AUDIO("audio"), - VIDEO("video"), - PHOTO("photo"); - - public final String label; -} diff --git a/src/main/java/47/one0/models/Upscale.java b/src/main/java/47/one0/models/Upscale.java deleted file mode 100644 index bbf79004..00000000 --- a/src/main/java/47/one0/models/Upscale.java +++ /dev/null @@ -1,11 +0,0 @@ -package 47.one0.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Upscale { - V1(1); - - public final Float label; -} diff --git a/src/main/java/47/one0/services/ActivitiesService.java b/src/main/java/47/one0/services/ActivitiesService.java deleted file mode 100644 index 7503c912..00000000 --- a/src/main/java/47/one0/services/ActivitiesService.java +++ /dev/null @@ -1,56 +0,0 @@ -package 47.one0.services; - -import java.util.Map; -import java.io.IOException; -import 47.one0.exceptions.ApiException; -import 47.one0.models.BaseModel; -import java.util.List; -import java.util.Objects; -import 47.one0.http.*; -import okhttp3.Headers; -import 47.one0.http.util.HttpUrl; -import 47.one0.http.util.HttpHeaders; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -public class ActivitiesService extends BaseService implements ActivitiesClient { -public ActivitiesService(OkHttpClient httpClient, String serverUrl) { super(httpClient, serverUrl); } - /** - * @summary Get Server Activities - */ - public ResponseWithHeaders<47.one0.models.GetServerActivitiesResponse> getServerActivities() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("activities") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - return new ResponseWithHeaders<47.one0.models.GetServerActivitiesResponse>(ModelConverter.convert(response, new com.fasterxml.jackson.core.type.TypeReference<47.one0.models.GetServerActivitiesResponse>() {}), response.headers()); -} - /** - * @summary Cancel Server Activities - * @param {String} activityUUID - The UUID of the activity to cancel. - */ - public ResponseWithHeaders cancelServerActivities(String activityUUID) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("activities") -.addPathParameter(String.valueOf(activityUUID)) -.build(); -Request request = new Request.Builder().url(url) -.delete() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} -} \ No newline at end of file diff --git a/src/main/java/47/one0/services/BaseService.java b/src/main/java/47/one0/services/BaseService.java deleted file mode 100644 index 0d0affb9..00000000 --- a/src/main/java/47/one0/services/BaseService.java +++ /dev/null @@ -1,55 +0,0 @@ -package 47.one0.services; -import 47.one0.http.ModelConverter; -import 47.one0.Configuration; -import 47.one0.models.*; -import 47.one0.exceptions.ApiException; - -import java.io.IOException; -import java.util.List; -import java.util.Map; - - -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -public class BaseService { - protected OkHttpClient httpClient; - protected String serverUrl; - - - public BaseService(OkHttpClient httpClient, String serverUrl) { - this.httpClient = httpClient; - this.serverUrl = serverUrl; - - } - - public void setBaseUrl(String serverUrl) { - this.serverUrl = serverUrl; - } - - protected Response execute(Request request) throws ApiException { - Response response; - try { - - response = this.httpClient.newCall(request).execute(); - - } catch (IOException e) { - ApiException apiException = new ApiException(e.getMessage()); - - throw apiException; - } - if (response.isSuccessful()) { - return response; - } else { - ApiException apiException = new ApiException(response.code()); - - throw apiException; - } - } - - -} diff --git a/src/main/java/47/one0/services/ButlerService.java b/src/main/java/47/one0/services/ButlerService.java deleted file mode 100644 index 1131f651..00000000 --- a/src/main/java/47/one0/services/ButlerService.java +++ /dev/null @@ -1,126 +0,0 @@ -package 47.one0.services; - -import java.util.Map; -import java.io.IOException; -import 47.one0.exceptions.ApiException; -import 47.one0.models.BaseModel; -import java.util.List; -import java.util.Objects; -import 47.one0.http.*; -import okhttp3.Headers; -import 47.one0.http.util.HttpUrl; -import 47.one0.http.util.HttpHeaders; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -public class ButlerService extends BaseService implements ButlerClient { -public ButlerService(OkHttpClient httpClient, String serverUrl) { super(httpClient, serverUrl); } - /** - * @summary Get Butler tasks - */ - public ResponseWithHeaders<47.one0.models.GetButlerTasksResponse> getButlerTasks() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("butler") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - return new ResponseWithHeaders<47.one0.models.GetButlerTasksResponse>(ModelConverter.convert(response, new com.fasterxml.jackson.core.type.TypeReference<47.one0.models.GetButlerTasksResponse>() {}), response.headers()); -} - /** - * @summary Start all Butler tasks - */ - public ResponseWithHeaders startAllTasks() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("butler") -.build(); -RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); -Request request = new Request.Builder().url(url) -.post(requestBody) -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Stop all Butler tasks - */ - public ResponseWithHeaders stopAllTasks() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("butler") -.build(); -Request request = new Request.Builder().url(url) -.delete() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Start a single Butler task - * @param {String} taskName - the name of the task to be started. - */ - public ResponseWithHeaders startTask(String taskName) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("butler") -.addPathParameter(String.valueOf(taskName)) -.build(); -RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); -Request request = new Request.Builder().url(url) -.post(requestBody) -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Stop a single Butler task - * @param {String} taskName - The name of the task to be started. - */ - public ResponseWithHeaders stopTask(String taskName) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("butler") -.addPathParameter(String.valueOf(taskName)) -.build(); -Request request = new Request.Builder().url(url) -.delete() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} -} \ No newline at end of file diff --git a/src/main/java/47/one0/services/HubsService.java b/src/main/java/47/one0/services/HubsService.java deleted file mode 100644 index a65dbd80..00000000 --- a/src/main/java/47/one0/services/HubsService.java +++ /dev/null @@ -1,70 +0,0 @@ -package 47.one0.services; - -import java.util.Map; -import java.io.IOException; -import 47.one0.exceptions.ApiException; -import 47.one0.models.BaseModel; -import java.util.List; -import java.util.Objects; -import 47.one0.http.*; -import okhttp3.Headers; -import 47.one0.http.util.HttpUrl; -import 47.one0.http.util.HttpHeaders; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -public class HubsService extends BaseService implements HubsClient { -public HubsService(OkHttpClient httpClient, String serverUrl) { super(httpClient, serverUrl); } - /** - * @summary Get Global Hubs - * @param {Number} [count] - The number of items to return with each hub. - * @param {Number} [onlyTransient] - Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). - */ - public ResponseWithHeaders getGlobalHubs(Float count, Float onlyTransient) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("hubs") -.addOptionalQueryParameter("count", count) -.addOptionalQueryParameter("onlyTransient", onlyTransient) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Get library specific hubs - * @param {Number} sectionId - the Id of the library to query - * @param {Number} [count] - The number of items to return with each hub. - * @param {Number} [onlyTransient] - Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). - */ - public ResponseWithHeaders getLibraryHubs(Float sectionId, Float count, Float onlyTransient) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("hubs") -.addPathParameter("sections") -.addPathParameter(String.valueOf(sectionId)) -.addOptionalQueryParameter("count", count) -.addOptionalQueryParameter("onlyTransient", onlyTransient) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} -} \ No newline at end of file diff --git a/src/main/java/47/one0/services/LibraryService.java b/src/main/java/47/one0/services/LibraryService.java deleted file mode 100644 index dc871f66..00000000 --- a/src/main/java/47/one0/services/LibraryService.java +++ /dev/null @@ -1,302 +0,0 @@ -package 47.one0.services; - -import java.util.Map; -import java.io.IOException; -import 47.one0.exceptions.ApiException; -import 47.one0.models.BaseModel; -import java.util.List; -import java.util.Objects; -import 47.one0.http.*; -import okhttp3.Headers; -import 47.one0.http.util.HttpUrl; -import 47.one0.http.util.HttpHeaders; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -public class LibraryService extends BaseService implements LibraryClient { -public LibraryService(OkHttpClient httpClient, String serverUrl) { super(httpClient, serverUrl); } - /** - * @summary Get Hash Value - * @param {String} url - This is the path to the local file, must be prefixed by `file://` - * @param {Number} [type] - Item type - */ - public ResponseWithHeaders getFileHash(String url, Float type) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("library") -.addPathParameter("hashes") -.addRequiredQueryParameter("url", url) -.addOptionalQueryParameter("type", type) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Get Recently Added - */ - public ResponseWithHeaders<47.one0.models.GetRecentlyAddedResponse> getRecentlyAdded() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("library") -.addPathParameter("recentlyAdded") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - return new ResponseWithHeaders<47.one0.models.GetRecentlyAddedResponse>(ModelConverter.convert(response, new com.fasterxml.jackson.core.type.TypeReference<47.one0.models.GetRecentlyAddedResponse>() {}), response.headers()); -} - /** - * @summary Get All Libraries - */ - public ResponseWithHeaders getLibraries() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("library") -.addPathParameter("sections") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Get Library Details - * @param {Number} sectionId - the Id of the library to query - * @param {Number} [includeDetails] - Whether or not to include details for a section (types, filters, and sorts). -Only exists for backwards compatibility, media providers other than the server libraries have it on always. - - */ - public ResponseWithHeaders getLibrary(Float sectionId, Float includeDetails) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("library") -.addPathParameter("sections") -.addPathParameter(String.valueOf(sectionId)) -.addOptionalQueryParameter("includeDetails", includeDetails) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Delete Library Section - * @param {Number} sectionId - the Id of the library to query - */ - public ResponseWithHeaders deleteLibrary(Float sectionId) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("library") -.addPathParameter("sections") -.addPathParameter(String.valueOf(sectionId)) -.build(); -Request request = new Request.Builder().url(url) -.delete() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Get Library Items - * @param {Number} sectionId - the Id of the library to query - * @param {Number} [type] - item type - * @param {String} [filter] - the filter parameter - */ - public ResponseWithHeaders getLibraryItems(Float sectionId, Float type, String filter) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("library") -.addPathParameter("sections") -.addPathParameter(String.valueOf(sectionId)) -.addPathParameter("all") -.addOptionalQueryParameter("type", type) -.addOptionalQueryParameter("filter", filter) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Refresh Library - * @param {Number} sectionId - the Id of the library to refresh - */ - public ResponseWithHeaders refreshLibrary(Float sectionId) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("library") -.addPathParameter("sections") -.addPathParameter(String.valueOf(sectionId)) -.addPathParameter("refresh") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Get Latest Library Items - * @param {Number} sectionId - the Id of the library to query - * @param {Number} type - item type - * @param {String} [filter] - the filter parameter - */ - public ResponseWithHeaders getLatestLibraryItems(Float sectionId, Float type, String filter) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("library") -.addPathParameter("sections") -.addPathParameter(String.valueOf(sectionId)) -.addPathParameter("latest") -.addRequiredQueryParameter("type", type) -.addOptionalQueryParameter("filter", filter) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Get Common Library Items - * @param {Number} sectionId - the Id of the library to query - * @param {Number} type - item type - * @param {String} [filter] - the filter parameter - */ - public ResponseWithHeaders getCommonLibraryItems(Float sectionId, Float type, String filter) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("library") -.addPathParameter("sections") -.addPathParameter(String.valueOf(sectionId)) -.addPathParameter("common") -.addRequiredQueryParameter("type", type) -.addOptionalQueryParameter("filter", filter) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Get Items Metadata - * @param {Number} ratingKey - the id of the library item to return the children of. - */ - public ResponseWithHeaders getMetadata(Float ratingKey) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("library") -.addPathParameter("metadata") -.addPathParameter(String.valueOf(ratingKey)) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Get Items Children - * @param {Number} ratingKey - the id of the library item to return the children of. - */ - public ResponseWithHeaders getMetadataChildren(Float ratingKey) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("library") -.addPathParameter("metadata") -.addPathParameter(String.valueOf(ratingKey)) -.addPathParameter("children") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Get On Deck - */ - public ResponseWithHeaders<47.one0.models.GetOnDeckResponse> getOnDeck() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("library") -.addPathParameter("onDeck") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - return new ResponseWithHeaders<47.one0.models.GetOnDeckResponse>(ModelConverter.convert(response, new com.fasterxml.jackson.core.type.TypeReference<47.one0.models.GetOnDeckResponse>() {}), response.headers()); -} -} \ No newline at end of file diff --git a/src/main/java/47/one0/services/LogService.java b/src/main/java/47/one0/services/LogService.java deleted file mode 100644 index 5e9e1521..00000000 --- a/src/main/java/47/one0/services/LogService.java +++ /dev/null @@ -1,96 +0,0 @@ -package 47.one0.services; - -import java.util.Map; -import java.io.IOException; -import 47.one0.exceptions.ApiException; -import 47.one0.models.BaseModel; -import java.util.List; -import java.util.Objects; -import 47.one0.http.*; -import okhttp3.Headers; -import 47.one0.http.util.HttpUrl; -import 47.one0.http.util.HttpHeaders; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -public class LogService extends BaseService implements LogClient { -public LogService(OkHttpClient httpClient, String serverUrl) { super(httpClient, serverUrl); } - /** - * @summary Logging a single line message. - * @param {Number} level - An integer log level to write to the PMS log with. -0: Error -1: Warning -2: Info -3: Debug -4: Verbose - - * @param {String} message - The text of the message to write to the log. - * @param {String} source - a string indicating the source of the message. - */ - public ResponseWithHeaders logLine(Float level, String message, String source) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("log") -.addRequiredQueryParameter("level", level) -.addRequiredQueryParameter("message", message) -.addRequiredQueryParameter("source", source) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Logging a multi-line message - */ - public ResponseWithHeaders logMultiLine() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("log") -.build(); -RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); -Request request = new Request.Builder().url(url) -.post(requestBody) -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Enabling Papertrail - */ - public ResponseWithHeaders enablePaperTrail() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("log") -.addPathParameter("networked") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} -} \ No newline at end of file diff --git a/src/main/java/47/one0/services/MediaService.java b/src/main/java/47/one0/services/MediaService.java deleted file mode 100644 index 6798a898..00000000 --- a/src/main/java/47/one0/services/MediaService.java +++ /dev/null @@ -1,96 +0,0 @@ -package 47.one0.services; - -import java.util.Map; -import java.io.IOException; -import 47.one0.exceptions.ApiException; -import 47.one0.models.BaseModel; -import java.util.List; -import java.util.Objects; -import 47.one0.http.*; -import okhttp3.Headers; -import 47.one0.http.util.HttpUrl; -import 47.one0.http.util.HttpHeaders; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -public class MediaService extends BaseService implements MediaClient { -public MediaService(OkHttpClient httpClient, String serverUrl) { super(httpClient, serverUrl); } - /** - * @summary Mark Media Played - * @param {Number} key - The media key to mark as played - */ - public ResponseWithHeaders markPlayed(Float key) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter(":") -.addPathParameter("scrobble") -.addRequiredQueryParameter("key", key) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Mark Media Unplayed - * @param {Number} key - The media key to mark as Unplayed - */ - public ResponseWithHeaders markUnplayed(Float key) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter(":") -.addPathParameter("unscrobble") -.addRequiredQueryParameter("key", key) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Update Media Play Progress - * @param {String} key - the media key - * @param {Number} time - The time, in milliseconds, used to set the media playback progress. - * @param {String} state - The playback state of the media item. - */ - public ResponseWithHeaders updatePlayProgress(String key, Float time, String state) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter(":") -.addPathParameter("progress") -.addRequiredQueryParameter("key", key) -.addRequiredQueryParameter("time", time) -.addRequiredQueryParameter("state", state) -.build(); -RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); -Request request = new Request.Builder().url(url) -.post(requestBody) -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} -} \ No newline at end of file diff --git a/src/main/java/47/one0/services/PlaylistsService.java b/src/main/java/47/one0/services/PlaylistsService.java deleted file mode 100644 index 3015888a..00000000 --- a/src/main/java/47/one0/services/PlaylistsService.java +++ /dev/null @@ -1,264 +0,0 @@ -package 47.one0.services; - -import java.util.Map; -import java.io.IOException; -import 47.one0.exceptions.ApiException; -import 47.one0.models.BaseModel; -import java.util.List; -import java.util.Objects; -import 47.one0.http.*; -import okhttp3.Headers; -import 47.one0.http.util.HttpUrl; -import 47.one0.http.util.HttpHeaders; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -public class PlaylistsService extends BaseService implements PlaylistsClient { -public PlaylistsService(OkHttpClient httpClient, String serverUrl) { super(httpClient, serverUrl); } - /** - * @summary Create a Playlist - * @param {String} title - name of the playlist - * @param {String} type - type of playlist to create - * @param {Number} smart - whether the playlist is smart or not - * @param {String} [uri] - the content URI for the playlist - * @param {Number} [playQueueID] - the play queue to copy to a playlist - */ - public ResponseWithHeaders createPlaylist(String title, String type, Float smart, String uri, Float playQueueID) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("playlists") -.addRequiredQueryParameter("title", title) -.addRequiredQueryParameter("type", type) -.addRequiredQueryParameter("smart", smart) -.addOptionalQueryParameter("uri", uri) -.addOptionalQueryParameter("playQueueID", playQueueID) -.build(); -RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); -Request request = new Request.Builder().url(url) -.post(requestBody) -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Get All Playlists - * @param {String} [playlistType] - limit to a type of playlist. - * @param {Number} [smart] - type of playlists to return (default is all). - */ - public ResponseWithHeaders getPlaylists(String playlistType, Float smart) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("playlists") -.addPathParameter("all") -.addOptionalQueryParameter("playlistType", playlistType) -.addOptionalQueryParameter("smart", smart) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Retrieve Playlist - * @param {Number} playlistID - the ID of the playlist - */ - public ResponseWithHeaders getPlaylist(Float playlistID) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("playlists") -.addPathParameter(String.valueOf(playlistID)) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Update a Playlist - * @param {Number} playlistID - the ID of the playlist - */ - public ResponseWithHeaders updatePlaylist(Float playlistID) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("playlists") -.addPathParameter(String.valueOf(playlistID)) -.build(); -RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); -Request request = new Request.Builder().url(url) -.put(requestBody) -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Deletes a Playlist - * @param {Number} playlistID - the ID of the playlist - */ - public ResponseWithHeaders deletePlaylist(Float playlistID) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("playlists") -.addPathParameter(String.valueOf(playlistID)) -.build(); -Request request = new Request.Builder().url(url) -.delete() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Retrieve Playlist Contents - * @param {Number} playlistID - the ID of the playlist - * @param {Number} type - the metadata type of the item to return - */ - public ResponseWithHeaders getPlaylistContents(Float playlistID, Float type) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("playlists") -.addPathParameter(String.valueOf(playlistID)) -.addPathParameter("items") -.addRequiredQueryParameter("type", type) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Adding to a Playlist - * @param {Number} playlistID - the ID of the playlist - * @param {String} uri - the content URI for the playlist - * @param {Number} playQueueID - the play queue to add to a playlist - */ - public ResponseWithHeaders addPlaylistContents(Float playlistID, String uri, Float playQueueID) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("playlists") -.addPathParameter(String.valueOf(playlistID)) -.addPathParameter("items") -.addRequiredQueryParameter("uri", uri) -.addRequiredQueryParameter("playQueueID", playQueueID) -.build(); -RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); -Request request = new Request.Builder().url(url) -.put(requestBody) -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Delete Playlist Contents - * @param {Number} playlistID - the ID of the playlist - */ - public ResponseWithHeaders clearPlaylistContents(Float playlistID) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("playlists") -.addPathParameter(String.valueOf(playlistID)) -.addPathParameter("items") -.build(); -Request request = new Request.Builder().url(url) -.delete() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Upload Playlist - * @param {String} path - absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server. -If the `path` argument is a directory, that path will be scanned for playlist files to be processed. -Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it. -The GUID of each playlist is based on the filename. -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. -The GUID of each playlist is based on the filename. - - * @param {Number} force - force overwriting of duplicate playlists. By default, a playlist file uploaded with the same path will overwrite the existing playlist. -The `force` argument is used to disable overwriting. 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. - - */ - public ResponseWithHeaders uploadPlaylist(String path, Float force) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("playlists") -.addPathParameter("upload") -.addRequiredQueryParameter("path", path) -.addRequiredQueryParameter("force", force) -.build(); -RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); -Request request = new Request.Builder().url(url) -.post(requestBody) -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} -} \ No newline at end of file diff --git a/src/main/java/47/one0/services/README.md b/src/main/java/47/one0/services/README.md deleted file mode 100644 index d67c2303..00000000 --- a/src/main/java/47/one0/services/README.md +++ /dev/null @@ -1,2383 +0,0 @@ -# PlexSDK Services -A list of all services and services methods. -- Services - - - [Server](#server) - - - [Media](#media) - - - [Activities](#activities) - - - [Butler](#butler) - - - [Hubs](#hubs) - - - [Search](#search) - - - [Library](#library) - - - [Log](#log) - - - [Playlists](#playlists) - - - [Security](#security) - - - [Sessions](#sessions) - - - [Updater](#updater) - - - [Video](#video) -- [All Methods](#all-methods) - - -## Server - -| Method | Description| -| :-------- | :----------| -| [getServerCapabilities](#getservercapabilities) | Server Capabilities | -| [getServerPreferences](#getserverpreferences) | Get Server Preferences | -| [getAvailableClients](#getavailableclients) | Get Available Clients | -| [getDevices](#getdevices) | Get Devices | -| [getServerIdentity](#getserveridentity) | Get Server Identity | -| [getMyPlexAccount](#getmyplexaccount) | Get MyPlex Account | -| [getResizedPhoto](#getresizedphoto) | Get a Resized Photo | -| [getServerList](#getserverlist) | Get Server List | - - -## Media - -| Method | Description| -| :-------- | :----------| -| [markPlayed](#markplayed) | Mark Media Played | -| [markUnplayed](#markunplayed) | Mark Media Unplayed | -| [updatePlayProgress](#updateplayprogress) | Update Media Play Progress | - - -## Activities - -| Method | Description| -| :-------- | :----------| -| [getServerActivities](#getserveractivities) | Get Server Activities | -| [cancelServerActivities](#cancelserveractivities) | Cancel Server Activities | - - -## Butler - -| Method | Description| -| :-------- | :----------| -| [startAllTasks](#startalltasks) | Start all Butler tasks | -| [getButlerTasks](#getbutlertasks) | Get Butler tasks | -| [stopAllTasks](#stopalltasks) | Stop all Butler tasks | -| [startTask](#starttask) | Start a single Butler task | -| [stopTask](#stoptask) | Stop a single Butler task | - - -## Hubs - -| Method | Description| -| :-------- | :----------| -| [getGlobalHubs](#getglobalhubs) | Get Global Hubs | -| [getLibraryHubs](#getlibraryhubs) | Get library specific hubs | - - -## Search - -| Method | Description| -| :-------- | :----------| -| [performSearch](#performsearch) | Perform a search | -| [performVoiceSearch](#performvoicesearch) | Perform a voice search | -| [getSearchResults](#getsearchresults) | Get Search Results | - - -## Library - -| Method | Description| -| :-------- | :----------| -| [getFileHash](#getfilehash) | Get Hash Value | -| [getRecentlyAdded](#getrecentlyadded) | Get Recently Added | -| [getLibraries](#getlibraries) | Get All Libraries | -| [getLibrary](#getlibrary) | Get Library Details | -| [deleteLibrary](#deletelibrary) | Delete Library Section | -| [getLibraryItems](#getlibraryitems) | Get Library Items | -| [refreshLibrary](#refreshlibrary) | Refresh Library | -| [getLatestLibraryItems](#getlatestlibraryitems) | Get Latest Library Items | -| [getCommonLibraryItems](#getcommonlibraryitems) | Get Common Library Items | -| [getMetadata](#getmetadata) | Get Items Metadata | -| [getMetadataChildren](#getmetadatachildren) | Get Items Children | -| [getOnDeck](#getondeck) | Get On Deck | - - -## Log - -| Method | Description| -| :-------- | :----------| -| [logMultiLine](#logmultiline) | Logging a multi-line message | -| [logLine](#logline) | Logging a single line message. | -| [enablePaperTrail](#enablepapertrail) | Enabling Papertrail | - - -## Playlists - -| Method | Description| -| :-------- | :----------| -| [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 | - - -## Security - -| Method | Description| -| :-------- | :----------| -| [getTransientToken](#gettransienttoken) | Get a Transient Token. | -| [getSourceConnectionInformation](#getsourceconnectioninformation) | Get Source Connection Information | - - -## Sessions - -| Method | Description| -| :-------- | :----------| -| [getSessions](#getsessions) | Get Active Sessions | -| [getSessionHistory](#getsessionhistory) | Get Session History | -| [getTranscodeSessions](#gettranscodesessions) | Get Transcode Sessions | -| [stopTranscodeSession](#stoptranscodesession) | Stop a Transcode Session | - - -## Updater - -| Method | Description| -| :-------- | :----------| -| [getUpdateStatus](#getupdatestatus) | Querying status of updates | -| [checkForUpdates](#checkforupdates) | Checking for updates | -| [applyUpdates](#applyupdates) | Apply Updates | - - -## Video - -| Method | Description| -| :-------- | :----------| -| [startUniversalTranscode](#startuniversaltranscode) | Start Universal Transcode | -| [getTimeline](#gettimeline) | Get the timeline for a media item | - - -## All Methods - - -### **getServerCapabilities** -Server Capabilities -- HTTP Method: GET -- Endpoint: / - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetServerCapabilitiesResponse](/src/main/java/io/plexsdk/models/README.md#getservercapabilitiesresponse) - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.serverService.getServerCapabilities(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getServerPreferences** -Get Server Preferences -- HTTP Method: GET -- Endpoint: /:/prefs - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.serverService.getServerPreferences(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getAvailableClients** -Get Available Clients -- HTTP Method: GET -- Endpoint: /clients - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetAvailableClientsResponse](/src/main/java/io/plexsdk/models/README.md#getavailableclientsresponse) - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.serverService.getAvailableClients(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getDevices** -Get Devices -- HTTP Method: GET -- Endpoint: /devices - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetDevicesResponse](/src/main/java/io/plexsdk/models/README.md#getdevicesresponse) - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.serverService.getDevices(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getServerIdentity** -Get Server Identity -- HTTP Method: GET -- Endpoint: /identity - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetServerIdentityResponse](/src/main/java/io/plexsdk/models/README.md#getserveridentityresponse) - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.serverService.getServerIdentity(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getMyPlexAccount** -Get MyPlex Account -- HTTP Method: GET -- Endpoint: /myplex/account - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetMyPlexAccountResponse](/src/main/java/io/plexsdk/models/README.md#getmyplexaccountresponse) - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.serverService.getMyPlexAccount(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getResizedPhoto** -Get a Resized Photo -- HTTP Method: GET -- Endpoint: /photo/:/transcode - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| width | Float | Required | The width for the resized photo | -| height | Float | Required | The height for the resized photo | -| opacity | Integer | Required | The opacity for the resized photo | -| blur | Float | Required | The width for the resized photo | -| minSize | [MinSize](/src/main/java/io/plexsdk/models/README.md#minsize) | Required | images are always scaled proportionally. A value of '1' in minSize will make the smaller native dimension the dimension resized against. | -| upscale | [Upscale](/src/main/java/io/plexsdk/models/README.md#upscale) | Required | allow images to be resized beyond native dimensions. | -| url | String | Required | path to image within Plex | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.serverService.getResizedPhoto(853213706, 2, 9, 3, 3, 3, "urlSampleValue"); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getServerList** -Get Server List -- HTTP Method: GET -- Endpoint: /servers - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetServerListResponse](/src/main/java/io/plexsdk/models/README.md#getserverlistresponse) - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.serverService.getServerList(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **markPlayed** -Mark Media Played -- HTTP Method: GET -- Endpoint: /:/scrobble - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| key | Float | Required | The media key to mark as played | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.mediaService.markPlayed(5); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **markUnplayed** -Mark Media Unplayed -- HTTP Method: GET -- Endpoint: /:/unscrobble - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| key | Float | Required | The media key to mark as Unplayed | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.mediaService.markUnplayed(8); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **updatePlayProgress** -Update Media Play Progress -- HTTP Method: POST -- Endpoint: /:/progress - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| key | String | Required | the media key | -| time | Float | Required | The time, in milliseconds, used to set the media playback progress. | -| state | String | Required | The playback state of the media item. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.mediaService.updatePlayProgress("keySampleValue", 1, "stateSampleValue"); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **getServerActivities** -Get Server Activities -- HTTP Method: GET -- Endpoint: /activities - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetServerActivitiesResponse](/src/main/java/io/plexsdk/models/README.md#getserveractivitiesresponse) - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.activitiesService.getServerActivities(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **cancelServerActivities** -Cancel Server Activities -- HTTP Method: DELETE -- Endpoint: /activities/{activityUUID} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| activityUuid | String | Required | The UUID of the activity to cancel. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.activitiesService.cancelServerActivities("activityUUIDSampleValue"); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **startAllTasks** -Start all Butler tasks -- HTTP Method: POST -- Endpoint: /butler - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.butlerService.startAllTasks(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getButlerTasks** -Get Butler tasks -- HTTP Method: GET -- Endpoint: /butler - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetButlerTasksResponse](/src/main/java/io/plexsdk/models/README.md#getbutlertasksresponse) - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.butlerService.getButlerTasks(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **stopAllTasks** -Stop all Butler tasks -- HTTP Method: DELETE -- Endpoint: /butler - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.butlerService.stopAllTasks(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **startTask** -Start a single Butler task -- HTTP Method: POST -- Endpoint: /butler/{taskName} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| taskName | [TaskName](/src/main/java/io/plexsdk/models/README.md#taskname) | Required | the name of the task to be started. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.butlerService.startTask("taskNameSampleValue"); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **stopTask** -Stop a single Butler task -- HTTP Method: DELETE -- Endpoint: /butler/{taskName} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| taskName | [TaskName](/src/main/java/io/plexsdk/models/README.md#taskname) | Required | The name of the task to be started. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.butlerService.stopTask("taskNameSampleValue"); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **getGlobalHubs** -Get Global Hubs -- HTTP Method: GET -- Endpoint: /hubs - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| count | Float | Optional | The number of items to return with each hub. | -| onlyTransient | [OnlyTransient](/src/main/java/io/plexsdk/models/README.md#onlytransient) | Optional | Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.hubsService.getGlobalHubs(4, 4); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getLibraryHubs** -Get library specific hubs -- HTTP Method: GET -- Endpoint: /hubs/sections/{sectionId} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| sectionId | Float | Required | the Id of the library to query | -| count | Float | Optional | The number of items to return with each hub. | -| onlyTransient | [OnlyTransient](/src/main/java/io/plexsdk/models/README.md#onlytransient) | Optional | Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.hubsService.getLibraryHubs(9, 1, 8); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **performSearch** -Perform a search -- HTTP Method: GET -- Endpoint: /hubs/search - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| query | String | Required | The query term | -| sectionId | Float | Optional | This gives context to the search, and can result in re-ordering of search result hubs | -| limit | Float | Optional | The number of items to return per hub | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.searchService.performSearch("querySampleValue", 3, 9); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **performVoiceSearch** -Perform a voice search -- HTTP Method: GET -- Endpoint: /hubs/search/voice - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| query | String | Required | The query term | -| sectionId | Float | Optional | This gives context to the search, and can result in re-ordering of search result hubs | -| limit | Float | Optional | The number of items to return per hub | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.searchService.performVoiceSearch("querySampleValue", 7, 9); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getSearchResults** -Get Search Results -- HTTP Method: GET -- Endpoint: /search - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| query | String | Required | The search query string to use | - -**Return Type** - -[GetSearchResultsResponse](/src/main/java/io/plexsdk/models/README.md#getsearchresultsresponse) - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.searchService.getSearchResults("querySampleValue"); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **getFileHash** -Get Hash Value -- HTTP Method: GET -- Endpoint: /library/hashes - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| url | String | Required | This is the path to the local file, must be prefixed by `file://` | -| type | Float | Optional | Item type | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.libraryService.getFileHash("urlSampleValue", 6); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getRecentlyAdded** -Get Recently Added -- HTTP Method: GET -- Endpoint: /library/recentlyAdded - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetRecentlyAddedResponse](/src/main/java/io/plexsdk/models/README.md#getrecentlyaddedresponse) - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.libraryService.getRecentlyAdded(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getLibraries** -Get All Libraries -- HTTP Method: GET -- Endpoint: /library/sections - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.libraryService.getLibraries(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getLibrary** -Get Library Details -- HTTP Method: GET -- Endpoint: /library/sections/{sectionId} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| sectionId | Float | Required | the Id of the library to query | -| includeDetails | [IncludeDetails](/src/main/java/io/plexsdk/models/README.md#includedetails) | Optional | Whether or not to include details for a section (types, filters, and sorts).
Only exists for backwards compatibility, media providers other than the server libraries have it on always.
| - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.libraryService.getLibrary(6, 7); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **deleteLibrary** -Delete Library Section -- HTTP Method: DELETE -- Endpoint: /library/sections/{sectionId} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| sectionId | Float | Required | the Id of the library to query | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.libraryService.deleteLibrary(8); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getLibraryItems** -Get Library Items -- HTTP Method: GET -- Endpoint: /library/sections/{sectionId}/all - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| sectionId | Float | Required | the Id of the library to query | -| type | Float | Optional | item type | -| filter | String | Optional | the filter parameter | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.libraryService.getLibraryItems(9, 1, "filterSampleValue"); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **refreshLibrary** -Refresh Library -- HTTP Method: GET -- Endpoint: /library/sections/{sectionId}/refresh - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| sectionId | Float | Required | the Id of the library to refresh | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.libraryService.refreshLibrary(2); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getLatestLibraryItems** -Get Latest Library Items -- HTTP Method: GET -- Endpoint: /library/sections/{sectionId}/latest - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| sectionId | Float | Required | the Id of the library to query | -| type | Float | Required | item type | -| filter | String | Optional | the filter parameter | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.libraryService.getLatestLibraryItems(5, 3, "filterSampleValue"); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getCommonLibraryItems** -Get Common Library Items -- HTTP Method: GET -- Endpoint: /library/sections/{sectionId}/common - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| sectionId | Float | Required | the Id of the library to query | -| type | Float | Required | item type | -| filter | String | Optional | the filter parameter | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.libraryService.getCommonLibraryItems(1, 8, "filterSampleValue"); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getMetadata** -Get Items Metadata -- HTTP Method: GET -- Endpoint: /library/metadata/{ratingKey} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| ratingKey | Float | Required | the id of the library item to return the children of. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.libraryService.getMetadata(5); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getMetadataChildren** -Get Items Children -- HTTP Method: GET -- Endpoint: /library/metadata/{ratingKey}/children - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| ratingKey | Float | Required | the id of the library item to return the children of. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.libraryService.getMetadataChildren(3); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getOnDeck** -Get On Deck -- HTTP Method: GET -- Endpoint: /library/onDeck - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetOnDeckResponse](/src/main/java/io/plexsdk/models/README.md#getondeckresponse) - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.libraryService.getOnDeck(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **logMultiLine** -Logging a multi-line message -- HTTP Method: POST -- Endpoint: /log - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.logService.logMultiLine(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **logLine** -Logging a single line message. -- HTTP Method: GET -- Endpoint: /log - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| level | [Level](/src/main/java/io/plexsdk/models/README.md#level) | Required | An integer log level to write to the PMS log with.
0: Error
1: Warning
2: Info
3: Debug
4: Verbose
| -| message | String | Required | The text of the message to write to the log. | -| source | String | Required | a string indicating the source of the message. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.logService.logLine(9, "messageSampleValue", "sourceSampleValue"); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **enablePaperTrail** -Enabling Papertrail -- HTTP Method: GET -- Endpoint: /log/networked - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.logService.enablePaperTrail(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **createPlaylist** -Create a Playlist -- HTTP Method: POST -- Endpoint: /playlists - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| title | String | Required | name of the playlist | -| type | [Type](/src/main/java/io/plexsdk/models/README.md#type) | Required | type of playlist to create | -| smart | [Smart](/src/main/java/io/plexsdk/models/README.md#smart) | Required | whether the playlist is smart or not | -| uri | String | Optional | the content URI for the playlist | -| playQueueId | Float | Optional | the play queue to copy to a playlist | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.playlistsService.createPlaylist("titleSampleValue", "typeSampleValue", 2, "uriSampleValue", 1); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getPlaylists** -Get All Playlists -- HTTP Method: GET -- Endpoint: /playlists/all - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| playlistType | [PlaylistType](/src/main/java/io/plexsdk/models/README.md#playlisttype) | Optional | limit to a type of playlist. | -| smart | [Smart](/src/main/java/io/plexsdk/models/README.md#smart) | Optional | type of playlists to return (default is all). | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.playlistsService.getPlaylists("playlistTypeSampleValue", 9); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getPlaylist** -Retrieve Playlist -- HTTP Method: GET -- Endpoint: /playlists/{playlistID} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| playlistId | Float | Required | the ID of the playlist | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.playlistsService.getPlaylist(4); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **deletePlaylist** -Deletes a Playlist -- HTTP Method: DELETE -- Endpoint: /playlists/{playlistID} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| playlistId | Float | Required | the ID of the playlist | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.playlistsService.deletePlaylist(1); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **updatePlaylist** -Update a Playlist -- HTTP Method: PUT -- Endpoint: /playlists/{playlistID} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| playlistId | Float | Required | the ID of the playlist | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.playlistsService.updatePlaylist(7); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getPlaylistContents** -Retrieve Playlist Contents -- HTTP Method: GET -- Endpoint: /playlists/{playlistID}/items - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| playlistId | Float | Required | the ID of the playlist | -| type | Float | Required | the metadata type of the item to return | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.playlistsService.getPlaylistContents(3, 1); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **clearPlaylistContents** -Delete Playlist Contents -- HTTP Method: DELETE -- Endpoint: /playlists/{playlistID}/items - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| playlistId | Float | Required | the ID of the playlist | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.playlistsService.clearPlaylistContents(8); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **addPlaylistContents** -Adding to a Playlist -- HTTP Method: PUT -- Endpoint: /playlists/{playlistID}/items - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| playlistId | Float | Required | the ID of the playlist | -| uri | String | Required | the content URI for the playlist | -| playQueueId | Float | Required | the play queue to add to a playlist | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.playlistsService.addPlaylistContents(6, "uriSampleValue", 4); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **uploadPlaylist** -Upload Playlist -- HTTP Method: POST -- Endpoint: /playlists/upload - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| path | String | Required | absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
The GUID of each playlist is based on the filename.
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.
The GUID of each playlist is based on the filename.
| -| force | [Force](/src/main/java/io/plexsdk/models/README.md#force) | Required | force overwriting of duplicate playlists. By default, a playlist file uploaded with the same path will overwrite the existing playlist.
The `force` argument is used to disable overwriting. 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.
| - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.playlistsService.uploadPlaylist("pathSampleValue", 5); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **getTransientToken** -Get a Transient Token. -- HTTP Method: GET -- Endpoint: /security/token - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| type | [SecurityType](/src/main/java/io/plexsdk/models/README.md#securitytype) | Required | `delegation` - This is the only supported `type` parameter. | -| scope | [Scope](/src/main/java/io/plexsdk/models/README.md#scope) | Required | `all` - This is the only supported `scope` parameter. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.securityService.getTransientToken("typeSampleValue", "scopeSampleValue"); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getSourceConnectionInformation** -Get Source Connection Information -- HTTP Method: GET -- Endpoint: /security/resources - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| source | String | Required | The source identifier with an included prefix. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.securityService.getSourceConnectionInformation("sourceSampleValue"); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **getSessions** -Get Active Sessions -- HTTP Method: GET -- Endpoint: /status/sessions - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.sessionsService.getSessions(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getSessionHistory** -Get Session History -- HTTP Method: GET -- Endpoint: /status/sessions/history/all - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.sessionsService.getSessionHistory(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getTranscodeSessions** -Get Transcode Sessions -- HTTP Method: GET -- Endpoint: /transcode/sessions - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetTranscodeSessionsResponse](/src/main/java/io/plexsdk/models/README.md#gettranscodesessionsresponse) - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.sessionsService.getTranscodeSessions(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **stopTranscodeSession** -Stop a Transcode Session -- HTTP Method: DELETE -- Endpoint: /transcode/sessions/{sessionKey} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| sessionKey | String | Required | the Key of the transcode session to stop | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.sessionsService.stopTranscodeSession("sessionKeySampleValue"); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **getUpdateStatus** -Querying status of updates -- HTTP Method: GET -- Endpoint: /updater/status - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.updaterService.getUpdateStatus(); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **checkForUpdates** -Checking for updates -- HTTP Method: PUT -- Endpoint: /updater/check - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| download | [Download](/src/main/java/io/plexsdk/models/README.md#download) | Optional | Indicate that you want to start download any updates found. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.updaterService.checkForUpdates(null); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **applyUpdates** -Apply Updates -- HTTP Method: PUT -- Endpoint: /updater/apply - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| tonight | [Tonight](/src/main/java/io/plexsdk/models/README.md#tonight) | Optional | 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 | -| skip | [Skip](/src/main/java/io/plexsdk/models/README.md#skip) | Optional | Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.updaterService.applyUpdates(null, null); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **startUniversalTranscode** -Start Universal Transcode -- HTTP Method: GET -- Endpoint: /video/:/transcode/universal/start.mpd - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| hasMde | Float | Required | Whether the media item has MDE | -| path | String | Required | The path to the media item to transcode | -| mediaIndex | Float | Required | The index of the media item to transcode | -| partIndex | Float | Required | The index of the part to transcode | -| protocol | String | Required | The protocol to use for the transcode session | -| fastSeek | Float | Optional | Whether to use fast seek or not | -| directPlay | Float | Optional | Whether to use direct play or not | -| directStream | Float | Optional | Whether to use direct stream or not | -| subtitleSize | Float | Optional | The size of the subtitles | -| subtites | String | Optional | The subtitles | -| audioBoost | Float | Optional | The audio boost | -| location | String | Optional | The location of the transcode session | -| mediaBufferSize | Float | Optional | The size of the media buffer | -| session | String | Optional | The session ID | -| addDebugOverlay | Float | Optional | Whether to add a debug overlay or not | -| autoAdjustQuality | Float | Optional | Whether to auto adjust quality or not | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.videoService.startUniversalTranscode(4, "pathSampleValue", 3, 7, "protocolSampleValue", 6, 9, 5, 3, "subtitesSampleValue", 5, "locationSampleValue", 4, "sessionSampleValue", 5, 6); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getTimeline** -Get the timeline for a media item -- HTTP Method: GET -- Endpoint: /:/timeline - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| ratingKey | Float | Required | The rating key of the media item | -| key | String | Required | The key of the media item to get the timeline for | -| state | [State](/src/main/java/io/plexsdk/models/README.md#state) | Required | The state of the media item | -| hasMde | Float | Required | Whether the media item has MDE | -| time | Float | Required | The time of the media item | -| duration | Float | Required | The duration of the media item | -| context | String | Required | The context of the media item | -| playQueueItemId | Float | Required | The play queue item ID of the media item | -| playBackTime | Float | Required | The playback time of the media item | -| row | Float | Required | The row of the media item | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package 47.one0.examples; - -import 47.one0.exceptions.ApiException; -import 47.one0.PlexSDK; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK(System.getenv("PLEXSDK_API_KEY"), System.getenv("PLEXSDK_API_KEY_HEADER")); - try { - Object response = client.videoService.getTimeline(5, "keySampleValue", "stateSampleValue", 8, 4, 2, "contextSampleValue", 2, 3, 9); - System.out.println(response); - } catch(ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - diff --git a/src/main/java/47/one0/services/SearchService.java b/src/main/java/47/one0/services/SearchService.java deleted file mode 100644 index 9d97cf1b..00000000 --- a/src/main/java/47/one0/services/SearchService.java +++ /dev/null @@ -1,91 +0,0 @@ -package 47.one0.services; - -import java.util.Map; -import java.io.IOException; -import 47.one0.exceptions.ApiException; -import 47.one0.models.BaseModel; -import java.util.List; -import java.util.Objects; -import 47.one0.http.*; -import okhttp3.Headers; -import 47.one0.http.util.HttpUrl; -import 47.one0.http.util.HttpHeaders; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -public class SearchService extends BaseService implements SearchClient { -public SearchService(OkHttpClient httpClient, String serverUrl) { super(httpClient, serverUrl); } - /** - * @summary Perform a search - * @param {String} query - The query term - * @param {Number} [sectionId] - This gives context to the search, and can result in re-ordering of search result hubs - * @param {Number} [limit] - The number of items to return per hub - */ - public ResponseWithHeaders performSearch(String query, Float sectionId, Float limit) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("hubs") -.addPathParameter("search") -.addRequiredQueryParameter("query", query) -.addOptionalQueryParameter("sectionId", sectionId) -.addOptionalQueryParameter("limit", limit) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Perform a voice search - * @param {String} query - The query term - * @param {Number} [sectionId] - This gives context to the search, and can result in re-ordering of search result hubs - * @param {Number} [limit] - The number of items to return per hub - */ - public ResponseWithHeaders performVoiceSearch(String query, Float sectionId, Float limit) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("hubs") -.addPathParameter("search") -.addPathParameter("voice") -.addRequiredQueryParameter("query", query) -.addOptionalQueryParameter("sectionId", sectionId) -.addOptionalQueryParameter("limit", limit) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Get Search Results - * @param {String} query - The search query string to use - */ - public ResponseWithHeaders<47.one0.models.GetSearchResultsResponse> getSearchResults(String query) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("search") -.addRequiredQueryParameter("query", query) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - return new ResponseWithHeaders<47.one0.models.GetSearchResultsResponse>(ModelConverter.convert(response, new com.fasterxml.jackson.core.type.TypeReference<47.one0.models.GetSearchResultsResponse>() {}), response.headers()); -} -} \ No newline at end of file diff --git a/src/main/java/47/one0/services/SecurityService.java b/src/main/java/47/one0/services/SecurityService.java deleted file mode 100644 index 4e2ce6c4..00000000 --- a/src/main/java/47/one0/services/SecurityService.java +++ /dev/null @@ -1,67 +0,0 @@ -package 47.one0.services; - -import java.util.Map; -import java.io.IOException; -import 47.one0.exceptions.ApiException; -import 47.one0.models.BaseModel; -import java.util.List; -import java.util.Objects; -import 47.one0.http.*; -import okhttp3.Headers; -import 47.one0.http.util.HttpUrl; -import 47.one0.http.util.HttpHeaders; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -public class SecurityService extends BaseService implements SecurityClient { -public SecurityService(OkHttpClient httpClient, String serverUrl) { super(httpClient, serverUrl); } - /** - * @summary Get a Transient Token. - * @param {String} type - `delegation` - This is the only supported `type` parameter. - * @param {String} scope - `all` - This is the only supported `scope` parameter. - */ - public ResponseWithHeaders getTransientToken(String type, String scope) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("security") -.addPathParameter("token") -.addRequiredQueryParameter("type", type) -.addRequiredQueryParameter("scope", scope) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Get Source Connection Information - * @param {String} source - The source identifier with an included prefix. - */ - public ResponseWithHeaders getSourceConnectionInformation(String source) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("security") -.addPathParameter("resources") -.addRequiredQueryParameter("source", source) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} -} \ No newline at end of file diff --git a/src/main/java/47/one0/services/ServerService.java b/src/main/java/47/one0/services/ServerService.java deleted file mode 100644 index 49d0f5ee..00000000 --- a/src/main/java/47/one0/services/ServerService.java +++ /dev/null @@ -1,166 +0,0 @@ -package 47.one0.services; - -import java.util.Map; -import java.io.IOException; -import 47.one0.exceptions.ApiException; -import 47.one0.models.BaseModel; -import java.util.List; -import java.util.Objects; -import 47.one0.http.*; -import okhttp3.Headers; -import 47.one0.http.util.HttpUrl; -import 47.one0.http.util.HttpHeaders; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -public class ServerService extends BaseService implements ServerClient { -public ServerService(OkHttpClient httpClient, String serverUrl) { super(httpClient, serverUrl); } - /** - * @summary Server Capabilities - */ - public ResponseWithHeaders<47.one0.models.GetServerCapabilitiesResponse> getServerCapabilities() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - return new ResponseWithHeaders<47.one0.models.GetServerCapabilitiesResponse>(ModelConverter.convert(response, new com.fasterxml.jackson.core.type.TypeReference<47.one0.models.GetServerCapabilitiesResponse>() {}), response.headers()); -} - /** - * @summary Get Server Preferences - */ - public ResponseWithHeaders getServerPreferences() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter(":") -.addPathParameter("prefs") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Get Available Clients - */ - public ResponseWithHeaders> getAvailableClients() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("clients") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - return new ResponseWithHeaders>(ModelConverter.convert(response, new com.fasterxml.jackson.core.type.TypeReference>() {}), response.headers()); -} - /** - * @summary Get Devices - */ - public ResponseWithHeaders<47.one0.models.GetDevicesResponse> getDevices() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("devices") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - return new ResponseWithHeaders<47.one0.models.GetDevicesResponse>(ModelConverter.convert(response, new com.fasterxml.jackson.core.type.TypeReference<47.one0.models.GetDevicesResponse>() {}), response.headers()); -} - /** - * @summary Get Server Identity - */ - public ResponseWithHeaders<47.one0.models.GetServerIdentityResponse> getServerIdentity() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("identity") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - return new ResponseWithHeaders<47.one0.models.GetServerIdentityResponse>(ModelConverter.convert(response, new com.fasterxml.jackson.core.type.TypeReference<47.one0.models.GetServerIdentityResponse>() {}), response.headers()); -} - /** - * @summary Get MyPlex Account - */ - public ResponseWithHeaders<47.one0.models.GetMyPlexAccountResponse> getMyPlexAccount() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("myplex") -.addPathParameter("account") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - return new ResponseWithHeaders<47.one0.models.GetMyPlexAccountResponse>(ModelConverter.convert(response, new com.fasterxml.jackson.core.type.TypeReference<47.one0.models.GetMyPlexAccountResponse>() {}), response.headers()); -} - /** - * @summary Get a Resized Photo - * @param {Number} width - The width for the resized photo - * @param {Number} height - The height for the resized photo - * @param {Integer} opacity - The opacity for the resized photo - * @param {Number} blur - The width for the resized photo - * @param {Number} minSize - images are always scaled proportionally. A value of '1' in minSize will make the smaller native dimension the dimension resized against. - * @param {Number} upscale - allow images to be resized beyond native dimensions. - * @param {String} url - path to image within Plex - */ - public ResponseWithHeaders getResizedPhoto(Float width, Float height, Integer opacity, Float blur, Float minSize, Float upscale, String url) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("photo") -.addPathParameter(":") -.addPathParameter("transcode") -.addRequiredQueryParameter("width", width) -.addRequiredQueryParameter("height", height) -.addRequiredQueryParameter("opacity", opacity) -.addRequiredQueryParameter("blur", blur) -.addRequiredQueryParameter("minSize", minSize) -.addRequiredQueryParameter("upscale", upscale) -.addRequiredQueryParameter("url", url) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Get Server List - */ - public ResponseWithHeaders<47.one0.models.GetServerListResponse> getServerList() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("servers") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - return new ResponseWithHeaders<47.one0.models.GetServerListResponse>(ModelConverter.convert(response, new com.fasterxml.jackson.core.type.TypeReference<47.one0.models.GetServerListResponse>() {}), response.headers()); -} -} \ No newline at end of file diff --git a/src/main/java/47/one0/services/SessionsService.java b/src/main/java/47/one0/services/SessionsService.java deleted file mode 100644 index af8c0621..00000000 --- a/src/main/java/47/one0/services/SessionsService.java +++ /dev/null @@ -1,102 +0,0 @@ -package 47.one0.services; - -import java.util.Map; -import java.io.IOException; -import 47.one0.exceptions.ApiException; -import 47.one0.models.BaseModel; -import java.util.List; -import java.util.Objects; -import 47.one0.http.*; -import okhttp3.Headers; -import 47.one0.http.util.HttpUrl; -import 47.one0.http.util.HttpHeaders; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -public class SessionsService extends BaseService implements SessionsClient { -public SessionsService(OkHttpClient httpClient, String serverUrl) { super(httpClient, serverUrl); } - /** - * @summary Get Active Sessions - */ - public ResponseWithHeaders getSessions() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("status") -.addPathParameter("sessions") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Get Session History - */ - public ResponseWithHeaders getSessionHistory() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("status") -.addPathParameter("sessions") -.addPathParameter("history") -.addPathParameter("all") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Get Transcode Sessions - */ - public ResponseWithHeaders<47.one0.models.GetTranscodeSessionsResponse> getTranscodeSessions() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("transcode") -.addPathParameter("sessions") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - return new ResponseWithHeaders<47.one0.models.GetTranscodeSessionsResponse>(ModelConverter.convert(response, new com.fasterxml.jackson.core.type.TypeReference<47.one0.models.GetTranscodeSessionsResponse>() {}), response.headers()); -} - /** - * @summary Stop a Transcode Session - * @param {String} sessionKey - the Key of the transcode session to stop - */ - public ResponseWithHeaders stopTranscodeSession(String sessionKey) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("transcode") -.addPathParameter("sessions") -.addPathParameter(String.valueOf(sessionKey)) -.build(); -Request request = new Request.Builder().url(url) -.delete() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} -} \ No newline at end of file diff --git a/src/main/java/47/one0/services/UpdaterService.java b/src/main/java/47/one0/services/UpdaterService.java deleted file mode 100644 index 1dfbd713..00000000 --- a/src/main/java/47/one0/services/UpdaterService.java +++ /dev/null @@ -1,96 +0,0 @@ -package 47.one0.services; - -import java.util.Map; -import java.io.IOException; -import 47.one0.exceptions.ApiException; -import 47.one0.models.BaseModel; -import java.util.List; -import java.util.Objects; -import 47.one0.http.*; -import okhttp3.Headers; -import 47.one0.http.util.HttpUrl; -import 47.one0.http.util.HttpHeaders; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -public class UpdaterService extends BaseService implements UpdaterClient { -public UpdaterService(OkHttpClient httpClient, String serverUrl) { super(httpClient, serverUrl); } - /** - * @summary Querying status of updates - */ - public ResponseWithHeaders getUpdateStatus() throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("updater") -.addPathParameter("status") -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Checking for updates - * @param {Download} [download] - Indicate that you want to start download any updates found. - */ - public ResponseWithHeaders checkForUpdates(String download) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("updater") -.addPathParameter("check") -.addOptionalQueryParameter("download", download) -.build(); -RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); -Request request = new Request.Builder().url(url) -.put(requestBody) -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Apply Updates - * @param {Tonight} [tonight] - 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 - * @param {Skip} [skip] - Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. - */ - public ResponseWithHeaders applyUpdates(String tonight, String skip) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("updater") -.addPathParameter("apply") -.addOptionalQueryParameter("tonight", tonight) -.addOptionalQueryParameter("skip", skip) -.build(); -RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); -Request request = new Request.Builder().url(url) -.put(requestBody) -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} -} \ No newline at end of file diff --git a/src/main/java/47/one0/services/VideoService.java b/src/main/java/47/one0/services/VideoService.java deleted file mode 100644 index fbe7c5f8..00000000 --- a/src/main/java/47/one0/services/VideoService.java +++ /dev/null @@ -1,116 +0,0 @@ -package 47.one0.services; - -import java.util.Map; -import java.io.IOException; -import 47.one0.exceptions.ApiException; -import 47.one0.models.BaseModel; -import java.util.List; -import java.util.Objects; -import 47.one0.http.*; -import okhttp3.Headers; -import 47.one0.http.util.HttpUrl; -import 47.one0.http.util.HttpHeaders; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -public class VideoService extends BaseService implements VideoClient { -public VideoService(OkHttpClient httpClient, String serverUrl) { super(httpClient, serverUrl); } - /** - * @summary Start Universal Transcode - * @param {Number} hasMDE - Whether the media item has MDE - * @param {String} path - The path to the media item to transcode - * @param {Number} mediaIndex - The index of the media item to transcode - * @param {Number} partIndex - The index of the part to transcode - * @param {String} protocol - The protocol to use for the transcode session - * @param {Number} [fastSeek] - Whether to use fast seek or not - * @param {Number} [directPlay] - Whether to use direct play or not - * @param {Number} [directStream] - Whether to use direct stream or not - * @param {Number} [subtitleSize] - The size of the subtitles - * @param {String} [subtites] - The subtitles - * @param {Number} [audioBoost] - The audio boost - * @param {String} [location] - The location of the transcode session - * @param {Number} [mediaBufferSize] - The size of the media buffer - * @param {String} [session] - The session ID - * @param {Number} [addDebugOverlay] - Whether to add a debug overlay or not - * @param {Number} [autoAdjustQuality] - Whether to auto adjust quality or not - */ - public ResponseWithHeaders startUniversalTranscode(Float hasMDE, String path, Float mediaIndex, Float partIndex, String protocol, Float fastSeek, Float directPlay, Float directStream, Float subtitleSize, String subtites, Float audioBoost, String location, Float mediaBufferSize, String session, Float addDebugOverlay, Float autoAdjustQuality) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter("video") -.addPathParameter(":") -.addPathParameter("transcode") -.addPathParameter("universal") -.addPathParameter("start.mpd") -.addRequiredQueryParameter("hasMDE", hasMDE) -.addRequiredQueryParameter("path", path) -.addRequiredQueryParameter("mediaIndex", mediaIndex) -.addRequiredQueryParameter("partIndex", partIndex) -.addRequiredQueryParameter("protocol", protocol) -.addOptionalQueryParameter("fastSeek", fastSeek) -.addOptionalQueryParameter("directPlay", directPlay) -.addOptionalQueryParameter("directStream", directStream) -.addOptionalQueryParameter("subtitleSize", subtitleSize) -.addOptionalQueryParameter("subtites", subtites) -.addOptionalQueryParameter("audioBoost", audioBoost) -.addOptionalQueryParameter("location", location) -.addOptionalQueryParameter("mediaBufferSize", mediaBufferSize) -.addOptionalQueryParameter("session", session) -.addOptionalQueryParameter("addDebugOverlay", addDebugOverlay) -.addOptionalQueryParameter("autoAdjustQuality", autoAdjustQuality) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} - /** - * @summary Get the timeline for a media item - * @param {Number} ratingKey - The rating key of the media item - * @param {String} key - The key of the media item to get the timeline for - * @param {String} state - The state of the media item - * @param {Number} hasMDE - Whether the media item has MDE - * @param {Number} time - The time of the media item - * @param {Number} duration - The duration of the media item - * @param {String} context - The context of the media item - * @param {Number} playQueueItemID - The play queue item ID of the media item - * @param {Number} playBackTime - The playback time of the media item - * @param {Number} row - The row of the media item - */ - public ResponseWithHeaders getTimeline(Float ratingKey, String key, String state, Float hasMDE, Float time, Float duration, String context, Float playQueueItemID, Float playBackTime, Float row) throws ApiException -{ -String url = HttpUrl.builder(this.serverUrl) -.addPathParameter(":") -.addPathParameter("timeline") -.addRequiredQueryParameter("ratingKey", ratingKey) -.addRequiredQueryParameter("key", key) -.addRequiredQueryParameter("state", state) -.addRequiredQueryParameter("hasMDE", hasMDE) -.addRequiredQueryParameter("time", time) -.addRequiredQueryParameter("duration", duration) -.addRequiredQueryParameter("context", context) -.addRequiredQueryParameter("playQueueItemID", playQueueItemID) -.addRequiredQueryParameter("playBackTime", playBackTime) -.addRequiredQueryParameter("row", row) -.build(); -Request request = new Request.Builder().url(url) -.get() -.build(); -Response response = this.execute(request); - - try { - return new ResponseWithHeaders(response.body().string(), response.headers()); - } catch (IOException e) { - e.printStackTrace(); - } - return null; -} -} \ No newline at end of file diff --git a/src/main/java/com/plexsdk/Configuration.java b/src/main/java/com/plexsdk/Configuration.java deleted file mode 100644 index cee0c3e1..00000000 --- a/src/main/java/com/plexsdk/Configuration.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.plexsdk; - -public class Configuration { - - public static final String USER_AGENT = "liblab/0.1.25 PlexSDK/0.0.1 java/1.8"; - - public static final String DEFAULT_API_KEY_HEADER = "X-Plex-Token"; -} diff --git a/src/main/java/com/plexsdk/Environment.java b/src/main/java/com/plexsdk/Environment.java deleted file mode 100644 index c57f1d91..00000000 --- a/src/main/java/com/plexsdk/Environment.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.plexsdk; - -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor -public enum Environment { - DEFAULT("{protocol}://{ip}:{port}"); - - private final String url; - - public String getUrl() { - return this.url; - } -} diff --git a/src/main/java/com/plexsdk/PlexSDK.java b/src/main/java/com/plexsdk/PlexSDK.java deleted file mode 100644 index b5ec458b..00000000 --- a/src/main/java/com/plexsdk/PlexSDK.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.plexsdk; - -import com.plexsdk.Environment; -import com.plexsdk.http.interceptors.ApiKeyInterceptor; -import com.plexsdk.http.interceptors.DefaultHeadersInterceptor; -import com.plexsdk.http.interceptors.RetryInterceptor; -import com.plexsdk.services.*; -import java.util.Map; -import okhttp3.OkHttpClient; - -public class PlexSDK { - - public ActivitiesService activitiesService; - public ButlerService butlerService; - public HubsService hubsService; - public LibraryService libraryService; - public LogService logService; - public MediaService mediaService; - public PlaylistsService playlistsService; - public SearchService searchService; - public SecurityService securityService; - public ServerService serverService; - public SessionsService sessionsService; - public UpdaterService updaterService; - public VideoService videoService; - - private final ApiKeyInterceptor apiKeyInterceptor = new ApiKeyInterceptor(); - - public PlexSDK() { - final String serverUrl = Environment.DEFAULT.getUrl(); - final OkHttpClient httpClient = new OkHttpClient.Builder() - .addInterceptor(new DefaultHeadersInterceptor()) - .addInterceptor(new RetryInterceptor()) - .addInterceptor(apiKeyInterceptor) - .build(); - - this.activitiesService = new ActivitiesService(httpClient, serverUrl); - this.butlerService = new ButlerService(httpClient, serverUrl); - this.hubsService = new HubsService(httpClient, serverUrl); - this.libraryService = new LibraryService(httpClient, serverUrl); - this.logService = new LogService(httpClient, serverUrl); - this.mediaService = new MediaService(httpClient, serverUrl); - this.playlistsService = new PlaylistsService(httpClient, serverUrl); - this.searchService = new SearchService(httpClient, serverUrl); - this.securityService = new SecurityService(httpClient, serverUrl); - this.serverService = new ServerService(httpClient, serverUrl); - this.sessionsService = new SessionsService(httpClient, serverUrl); - this.updaterService = new UpdaterService(httpClient, serverUrl); - this.videoService = new VideoService(httpClient, serverUrl); - } - - public PlexSDK(String apiKey) { - this(apiKey, null); - } - - public PlexSDK(String apiKey, String apiKeyHeader) { - this(); - setApiKey(apiKey); - setApiKeyHeader(apiKeyHeader); - } - - public void setBaseUrl(String url) { - this.activitiesService.setBaseUrl(url); - this.butlerService.setBaseUrl(url); - this.hubsService.setBaseUrl(url); - this.libraryService.setBaseUrl(url); - this.logService.setBaseUrl(url); - this.mediaService.setBaseUrl(url); - this.playlistsService.setBaseUrl(url); - this.searchService.setBaseUrl(url); - this.securityService.setBaseUrl(url); - this.serverService.setBaseUrl(url); - this.sessionsService.setBaseUrl(url); - this.updaterService.setBaseUrl(url); - this.videoService.setBaseUrl(url); - } - - public void setApiKey(String apiKey) { - this.apiKeyInterceptor.setApiKey(apiKey); - } - - public void setApiKeyHeader(String apiKeyHeader) { - this.apiKeyInterceptor.setApiKeyHeader(apiKeyHeader); - } -} diff --git a/src/main/java/com/plexsdk/exceptions/ApiException.java b/src/main/java/com/plexsdk/exceptions/ApiException.java deleted file mode 100644 index 83d9401c..00000000 --- a/src/main/java/com/plexsdk/exceptions/ApiException.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.plexsdk.exceptions; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -/** - * This is the base class for all exceptions that represent an error response from the server. - */ -public class ApiException extends RuntimeException { - - private static final Map ERROR_MAP = Collections.unmodifiableMap( - new HashMap() { - { - put(401, "Unauthorized"); - put(403, "Forbidden"); - put(404, "Not Found"); - put(405, "Method Not Allowed"); - put(406, "Not Acceptable"); - put(409, "Conflict"); - put(410, "Gone"); - put(500, "Internal Server Error"); - put(502, "Bad Gateway"); - put(503, "Service Unavailable"); - put(504, "Gateway Timeout"); - } - } - ); - - private final int statusCode; - - public ApiException(int code) { - super(getExceptionMessage(code)); - this.statusCode = code; - } - - public ApiException(String message) { - super(message); - this.statusCode = 0; - } - - public ApiException(String message, Throwable t) { - super(message, t); - this.statusCode = 0; - } - - public ApiException(int code, String message) { - super(message); - this.statusCode = code; - } - - public int getStatusCode() { - return this.statusCode; - } - - static String getExceptionMessage(int code) { - return ERROR_MAP.getOrDefault(code, "Unknown Error"); - } -} diff --git a/src/main/java/com/plexsdk/exceptions/ArgumentCannotBeNullException.java b/src/main/java/com/plexsdk/exceptions/ArgumentCannotBeNullException.java deleted file mode 100644 index d098cc2c..00000000 --- a/src/main/java/com/plexsdk/exceptions/ArgumentCannotBeNullException.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.plexsdk.exceptions; - -/** - * Thrown to indicate that a service method has been passed an illegal or inappropriate argument. - * For example, if a required argument is being passed as null. - */ -public class ArgumentCannotBeNullException extends RuntimeException { - - private static final String ARGUMENT_NAME_MESSAGE_FORMAT = "Required argument %s cannot be null."; - private static final String DEFAULT_MESSAGE = "Required argument cannot be null."; - - public ArgumentCannotBeNullException() { - super(DEFAULT_MESSAGE); - } - - public ArgumentCannotBeNullException(String argumentName) { - super(String.format(ARGUMENT_NAME_MESSAGE_FORMAT, argumentName)); - } -} diff --git a/src/main/java/com/plexsdk/hooks/CustomHook.java b/src/main/java/com/plexsdk/hooks/CustomHook.java deleted file mode 100644 index 8b137891..00000000 --- a/src/main/java/com/plexsdk/hooks/CustomHook.java +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/main/java/com/plexsdk/hooks/model/Hook.java b/src/main/java/com/plexsdk/hooks/model/Hook.java deleted file mode 100644 index f8f00b27..00000000 --- a/src/main/java/com/plexsdk/hooks/model/Hook.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.plexsdk.hooks.model; - -/** - * Liblab Hook interface - */ -public interface Hook { - /** - * Is called before the request is made to the API - * @param request the request about to be made by the SDK - */ - void beforeRequest(Request request); - - /** - * Is called after the response has returned - * @param request the request that was made by the SDK - * @param response the response coming back from the API the SDK has called - */ - void afterResponse(Request request, Response response); - - /** - * Is called when an error occurs in the SDK - * @param request the request that was made by the SDK - * @param exception The Exception thrown - */ - void onError(Request request, Exception exception); -} diff --git a/src/main/java/com/plexsdk/hooks/model/Request.java b/src/main/java/com/plexsdk/hooks/model/Request.java deleted file mode 100644 index 13c28f35..00000000 --- a/src/main/java/com/plexsdk/hooks/model/Request.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.plexsdk.hooks.model; - -import com.plexsdk.http.ModelConverter; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; -import okhttp3.Headers; -import okhttp3.RequestBody; - -/** - * Liblab's representation of a request - */ -public class Request { - - private String method; - private String url; - private String body; - private Map headers; - - public Request(String method, String url, String body, Map headers) { - this.method = method; - this.url = url; - this.body = body; - this.headers = headers; - } - - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getBody() { - return body; - } - - public void setBody(String body) { - this.body = body; - } - - public Map getHeaders() { - return headers; - } - - public void setHeaders(Map headers) { - this.headers = headers; - } - - public static Request toHookRequest(okhttp3.Request request) { - Map hookHeaders = request - .headers() - .toMultimap() - .entrySet() - .stream() - .collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue().get(0))); - return new Request( - request.method(), - request.url().toString(), - request.body() != null ? Objects.requireNonNull(request.body()).toString() : "", - hookHeaders - ); - } - - public static okhttp3.Request toOkHttpRequest(Request hookRequest) { - Headers.Builder headersBuilder = new Headers.Builder(); - hookRequest.getHeaders().forEach(headersBuilder::add); - - if (hookRequest.getBody() != null && !hookRequest.getBody().isEmpty()) { - RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(hookRequest.getBody())), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); - return new okhttp3.Request.Builder() - .method(hookRequest.getMethod(), requestBody) - .headers(headersBuilder.build()) - .url(hookRequest.url) - .build(); - } else { - return new okhttp3.Request.Builder() - .method(hookRequest.getMethod(), null) - .headers(headersBuilder.build()) - .url(hookRequest.url) - .build(); - } - } -} diff --git a/src/main/java/com/plexsdk/hooks/model/Response.java b/src/main/java/com/plexsdk/hooks/model/Response.java deleted file mode 100644 index 74be23e9..00000000 --- a/src/main/java/com/plexsdk/hooks/model/Response.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.plexsdk.hooks.model; - -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** - * Liblab's representation of a response - */ -public class Response { - - private int statusCode; - private String body; - private Map headers; - - public Response(int statusCode, String body, Map headers) { - this.statusCode = statusCode; - this.body = body; - this.headers = headers; - } - - public int getStatusCode() { - return statusCode; - } - - public void setStatusCode(int statusCode) { - this.statusCode = statusCode; - } - - public String getBody() { - return body; - } - - public void setBody(String body) { - this.body = body; - } - - public Map getHeaders() { - return headers; - } - - public void setHeaders(Map headers) { - this.headers = headers; - } - - public static Response toHookResponse(okhttp3.Response response) { - Map responseHeaders = response - .headers() - .toMultimap() - .entrySet() - .stream() - .collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue().get(0))); - - return new Response( - response.code(), - response.body() != null ? Objects.requireNonNull(response.body()).toString() : null, - responseHeaders - ); - } -} diff --git a/src/main/java/com/plexsdk/http/ActivitiesClient.java b/src/main/java/com/plexsdk/http/ActivitiesClient.java deleted file mode 100644 index fee8f43d..00000000 --- a/src/main/java/com/plexsdk/http/ActivitiesClient.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.plexsdk.http; - -import com.plexsdk.exceptions.ApiException; -import java.util.List; - -public interface ActivitiesClient { - ResponseWithHeaders getServerActivities() - throws ApiException; - ResponseWithHeaders cancelServerActivities(String activityUUID) throws ApiException; -} diff --git a/src/main/java/com/plexsdk/http/ButlerClient.java b/src/main/java/com/plexsdk/http/ButlerClient.java deleted file mode 100644 index 28981015..00000000 --- a/src/main/java/com/plexsdk/http/ButlerClient.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.plexsdk.http; - -import com.plexsdk.exceptions.ApiException; -import java.util.List; - -public interface ButlerClient { - ResponseWithHeaders getButlerTasks() - throws ApiException; - ResponseWithHeaders startAllTasks() throws ApiException; - ResponseWithHeaders stopAllTasks() throws ApiException; - ResponseWithHeaders startTask(String taskName) throws ApiException; - ResponseWithHeaders stopTask(String taskName) throws ApiException; -} diff --git a/src/main/java/com/plexsdk/http/HubsClient.java b/src/main/java/com/plexsdk/http/HubsClient.java deleted file mode 100644 index d810fdcb..00000000 --- a/src/main/java/com/plexsdk/http/HubsClient.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.plexsdk.http; - -import com.plexsdk.exceptions.ApiException; -import java.util.List; - -public interface HubsClient { - ResponseWithHeaders getGlobalHubs(Float count, Float onlyTransient) throws ApiException; - ResponseWithHeaders getLibraryHubs(Float sectionId, Float count, Float onlyTransient) - throws ApiException; -} diff --git a/src/main/java/com/plexsdk/http/LibraryClient.java b/src/main/java/com/plexsdk/http/LibraryClient.java deleted file mode 100644 index 35a577bd..00000000 --- a/src/main/java/com/plexsdk/http/LibraryClient.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.plexsdk.http; - -import com.plexsdk.exceptions.ApiException; -import java.util.List; - -public interface LibraryClient { - ResponseWithHeaders getFileHash(String url, Float type) throws ApiException; - ResponseWithHeaders getRecentlyAdded() - throws ApiException; - ResponseWithHeaders getLibraries() throws ApiException; - ResponseWithHeaders getLibrary(Float sectionId, Float includeDetails) throws ApiException; - ResponseWithHeaders deleteLibrary(Float sectionId) throws ApiException; - ResponseWithHeaders getLibraryItems(Float sectionId, Float type, String filter) - throws ApiException; - ResponseWithHeaders refreshLibrary(Float sectionId) throws ApiException; - ResponseWithHeaders getLatestLibraryItems(Float sectionId, Float type, String filter) - throws ApiException; - ResponseWithHeaders getCommonLibraryItems(Float sectionId, Float type, String filter) - throws ApiException; - ResponseWithHeaders getMetadata(Float ratingKey) throws ApiException; - ResponseWithHeaders getMetadataChildren(Float ratingKey) throws ApiException; - ResponseWithHeaders getOnDeck() throws ApiException; -} diff --git a/src/main/java/com/plexsdk/http/LogClient.java b/src/main/java/com/plexsdk/http/LogClient.java deleted file mode 100644 index 03d82d00..00000000 --- a/src/main/java/com/plexsdk/http/LogClient.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.plexsdk.http; - -import com.plexsdk.exceptions.ApiException; -import java.util.List; - -public interface LogClient { - ResponseWithHeaders logLine(Float level, String message, String source) - throws ApiException; - ResponseWithHeaders logMultiLine() throws ApiException; - ResponseWithHeaders enablePaperTrail() throws ApiException; -} diff --git a/src/main/java/com/plexsdk/http/MediaClient.java b/src/main/java/com/plexsdk/http/MediaClient.java deleted file mode 100644 index 195cb88e..00000000 --- a/src/main/java/com/plexsdk/http/MediaClient.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.plexsdk.http; - -import com.plexsdk.exceptions.ApiException; -import java.util.List; - -public interface MediaClient { - ResponseWithHeaders markPlayed(Float key) throws ApiException; - ResponseWithHeaders markUnplayed(Float key) throws ApiException; - ResponseWithHeaders updatePlayProgress(String key, Float time, String state) - throws ApiException; -} diff --git a/src/main/java/com/plexsdk/http/ModelConverter.java b/src/main/java/com/plexsdk/http/ModelConverter.java deleted file mode 100644 index 7fa98cd8..00000000 --- a/src/main/java/com/plexsdk/http/ModelConverter.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.plexsdk.http; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public final class ModelConverter { - - private static final ObjectMapper mapper = new ObjectMapper(); - - static { - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); - mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - mapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); - } - - private ModelConverter() {} - - public static T convert(final Response response, final Class clazz) { - final ResponseBody body = response.body(); - try { - return mapper.readValue(body.string(), clazz); - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - public static T convert(final String response, final Class clazz) { - try { - return mapper.readValue(response, clazz); - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - public static T convert(Response response, TypeReference typeReference) { - try { - return convert(response.body().string(), typeReference); - } catch (Exception e) { - e.printStackTrace(); - } - - return null; - } - - public static T convert(String response, TypeReference typeReference) { - try { - return mapper.readValue(response, typeReference); - } catch (Exception e) { - e.printStackTrace(); - } - - return null; - } - - public static String modelToJson(final Object model) { - try { - return mapper.writeValueAsString(model); - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/src/main/java/com/plexsdk/http/PlaylistsClient.java b/src/main/java/com/plexsdk/http/PlaylistsClient.java deleted file mode 100644 index 5d5c7bb1..00000000 --- a/src/main/java/com/plexsdk/http/PlaylistsClient.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.plexsdk.http; - -import com.plexsdk.exceptions.ApiException; -import java.util.List; - -public interface PlaylistsClient { - ResponseWithHeaders createPlaylist( - String title, - String type, - Float smart, - String uri, - Float playQueueID - ) throws ApiException; - ResponseWithHeaders getPlaylists(String playlistType, Float smart) throws ApiException; - ResponseWithHeaders getPlaylist(Float playlistID) throws ApiException; - ResponseWithHeaders updatePlaylist(Float playlistID) throws ApiException; - ResponseWithHeaders deletePlaylist(Float playlistID) throws ApiException; - ResponseWithHeaders getPlaylistContents(Float playlistID, Float type) throws ApiException; - ResponseWithHeaders addPlaylistContents(Float playlistID, String uri, Float playQueueID) - throws ApiException; - ResponseWithHeaders clearPlaylistContents(Float playlistID) throws ApiException; - ResponseWithHeaders uploadPlaylist(String path, Float force) throws ApiException; -} diff --git a/src/main/java/com/plexsdk/http/ResponseWithHeaders.java b/src/main/java/com/plexsdk/http/ResponseWithHeaders.java deleted file mode 100644 index 4ce761fb..00000000 --- a/src/main/java/com/plexsdk/http/ResponseWithHeaders.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.plexsdk.http; - -import okhttp3.Headers; - -public class ResponseWithHeaders { - - private T data; - private Headers headers; - - public ResponseWithHeaders(T data, Headers headers) { - this.data = data; - this.headers = headers; - } - - public T getData() { - return data; - } - - public Headers getHeaders() { - return headers; - } -} diff --git a/src/main/java/com/plexsdk/http/SearchClient.java b/src/main/java/com/plexsdk/http/SearchClient.java deleted file mode 100644 index 71ef6ee1..00000000 --- a/src/main/java/com/plexsdk/http/SearchClient.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.plexsdk.http; - -import com.plexsdk.exceptions.ApiException; -import java.util.List; - -public interface SearchClient { - ResponseWithHeaders performSearch(String query, Float sectionId, Float limit) - throws ApiException; - ResponseWithHeaders performVoiceSearch(String query, Float sectionId, Float limit) - throws ApiException; - ResponseWithHeaders getSearchResults(String query) - throws ApiException; -} diff --git a/src/main/java/com/plexsdk/http/SecurityClient.java b/src/main/java/com/plexsdk/http/SecurityClient.java deleted file mode 100644 index 7aef9b8b..00000000 --- a/src/main/java/com/plexsdk/http/SecurityClient.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.plexsdk.http; - -import com.plexsdk.exceptions.ApiException; -import java.util.List; - -public interface SecurityClient { - ResponseWithHeaders getTransientToken(String type, String scope) throws ApiException; - ResponseWithHeaders getSourceConnectionInformation(String source) throws ApiException; -} diff --git a/src/main/java/com/plexsdk/http/ServerClient.java b/src/main/java/com/plexsdk/http/ServerClient.java deleted file mode 100644 index 1110b609..00000000 --- a/src/main/java/com/plexsdk/http/ServerClient.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.plexsdk.http; - -import com.plexsdk.exceptions.ApiException; -import java.util.List; - -public interface ServerClient { - ResponseWithHeaders getServerCapabilities() - throws ApiException; - ResponseWithHeaders getServerPreferences() throws ApiException; - ResponseWithHeaders< - java.util.List - > getAvailableClients() throws ApiException; - ResponseWithHeaders getDevices() throws ApiException; - ResponseWithHeaders getServerIdentity() - throws ApiException; - ResponseWithHeaders getMyPlexAccount() - throws ApiException; - ResponseWithHeaders getResizedPhoto( - Float width, - Float height, - Integer opacity, - Float blur, - Float minSize, - Float upscale, - String url - ) throws ApiException; - ResponseWithHeaders getServerList() throws ApiException; -} diff --git a/src/main/java/com/plexsdk/http/SessionsClient.java b/src/main/java/com/plexsdk/http/SessionsClient.java deleted file mode 100644 index 8951e877..00000000 --- a/src/main/java/com/plexsdk/http/SessionsClient.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.plexsdk.http; - -import com.plexsdk.exceptions.ApiException; -import java.util.List; - -public interface SessionsClient { - ResponseWithHeaders getSessions() throws ApiException; - ResponseWithHeaders getSessionHistory() throws ApiException; - ResponseWithHeaders getTranscodeSessions() - throws ApiException; - ResponseWithHeaders stopTranscodeSession(String sessionKey) throws ApiException; -} diff --git a/src/main/java/com/plexsdk/http/UpdaterClient.java b/src/main/java/com/plexsdk/http/UpdaterClient.java deleted file mode 100644 index 346f49a3..00000000 --- a/src/main/java/com/plexsdk/http/UpdaterClient.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.plexsdk.http; - -import com.plexsdk.exceptions.ApiException; -import java.util.List; - -public interface UpdaterClient { - ResponseWithHeaders getUpdateStatus() throws ApiException; - ResponseWithHeaders checkForUpdates(String download) throws ApiException; - ResponseWithHeaders applyUpdates(String tonight, String skip) throws ApiException; -} diff --git a/src/main/java/com/plexsdk/http/VideoClient.java b/src/main/java/com/plexsdk/http/VideoClient.java deleted file mode 100644 index 1dbee738..00000000 --- a/src/main/java/com/plexsdk/http/VideoClient.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.plexsdk.http; - -import com.plexsdk.exceptions.ApiException; -import java.util.List; - -public interface VideoClient { - ResponseWithHeaders startUniversalTranscode( - Float hasMDE, - String path, - Float mediaIndex, - Float partIndex, - String protocol, - Float fastSeek, - Float directPlay, - Float directStream, - Float subtitleSize, - String subtites, - Float audioBoost, - String location, - Float mediaBufferSize, - String session, - Float addDebugOverlay, - Float autoAdjustQuality - ) throws ApiException; - ResponseWithHeaders getTimeline( - Float ratingKey, - String key, - String state, - Float hasMDE, - Float time, - Float duration, - String context, - Float playQueueItemID, - Float playBackTime, - Float row - ) throws ApiException; -} diff --git a/src/main/java/com/plexsdk/http/interceptors/ApiKeyInterceptor.java b/src/main/java/com/plexsdk/http/interceptors/ApiKeyInterceptor.java deleted file mode 100644 index 5dc2e48f..00000000 --- a/src/main/java/com/plexsdk/http/interceptors/ApiKeyInterceptor.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.plexsdk.http.interceptors; - -import com.plexsdk.Configuration; -import java.io.IOException; -import lombok.Getter; -import lombok.Setter; -import okhttp3.Interceptor; -import okhttp3.Request; -import okhttp3.Response; - -public class ApiKeyInterceptor implements Interceptor { - - @Getter - @Setter - private String apiKey; - - @Getter - @Setter - private String apiKeyHeader; - - @Override - public Response intercept(Chain chain) throws IOException { - return chain.proceed(addApiKeyToRequest(chain.request())); - } - - private Request addApiKeyToRequest(Request request) { - return this.apiKey != null && !this.apiKey.isEmpty() - ? request.newBuilder().addHeader(resolveHeader(), this.apiKey).build() - : request; - } - - private String resolveHeader() { - return this.apiKeyHeader != null && !this.apiKeyHeader.isEmpty() - ? this.apiKeyHeader - : Configuration.DEFAULT_API_KEY_HEADER; - } -} diff --git a/src/main/java/com/plexsdk/http/interceptors/DefaultHeadersInterceptor.java b/src/main/java/com/plexsdk/http/interceptors/DefaultHeadersInterceptor.java deleted file mode 100644 index e04b23b0..00000000 --- a/src/main/java/com/plexsdk/http/interceptors/DefaultHeadersInterceptor.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.plexsdk.http.interceptors; - -import com.plexsdk.Configuration; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Interceptor; -import okhttp3.Request; -import okhttp3.Request.Builder; -import okhttp3.Response; - -public class DefaultHeadersInterceptor implements Interceptor { - - private final Map defaultHeaders = new HashMap<>(); - - public DefaultHeadersInterceptor() { - defaultHeaders.put("User-Agent", Configuration.USER_AGENT); - } - - @Override - public Response intercept(Chain chain) throws IOException { - return chain.proceed(addDefaultHeadersToRequest(chain.request())); - } - - private Request addDefaultHeadersToRequest(Request request) { - if (defaultHeaders.isEmpty()) { - return request; - } - - Builder requestBuilder = request.newBuilder(); - - defaultHeaders.forEach(requestBuilder::addHeader); - - return requestBuilder.build(); - } -} diff --git a/src/main/java/com/plexsdk/http/interceptors/RetryInterceptor.java b/src/main/java/com/plexsdk/http/interceptors/RetryInterceptor.java deleted file mode 100644 index c3f74c85..00000000 --- a/src/main/java/com/plexsdk/http/interceptors/RetryInterceptor.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.plexsdk.http.interceptors; - -import java.io.IOException; -import java.util.stream.IntStream; -import okhttp3.Interceptor; -import okhttp3.Request; -import okhttp3.Response; - -public class RetryInterceptor implements Interceptor { - - private static final int MAX_RETRIES = 3; - private static final double RETRY_DELAY = 150; - private static final int[] RETRYABLE_CODES = { 500, 503, 504 }; - - @Override - public Response intercept(Chain chain) throws IOException { - // Try the request and if it fails use exponential backoff to retry - Request request = chain.request(); - Response response = chain.proceed(request); - int tryCount = 1; - while (!response.isSuccessful() && isRetryable(response) && tryCount - 1 < MAX_RETRIES) { - try { - Thread.sleep((long) Math.pow(RETRY_DELAY, tryCount - 1)); - } catch (InterruptedException e) { - e.printStackTrace(); - } - response.close(); - response = chain.proceed(request); - tryCount++; - } - return response; - } - - private boolean isRetryable(Response response) { - final int statusCode = response.code(); - return IntStream.of(RETRYABLE_CODES).anyMatch(x -> x == statusCode); - } -} diff --git a/src/main/java/com/plexsdk/http/util/HttpArgumentConverter.java b/src/main/java/com/plexsdk/http/util/HttpArgumentConverter.java deleted file mode 100644 index 8e5b9630..00000000 --- a/src/main/java/com/plexsdk/http/util/HttpArgumentConverter.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.plexsdk.http.util; - -import static com.plexsdk.http.ModelConverter.modelToJson; - -import java.util.List; -import java.util.stream.Collectors; - -/** - * Provides static methods to convert values (object, array, boxed types) into string representation for http url. - * Usually used for converting objects to be http url friendly (e.g. query or header parameters) - */ -public class HttpArgumentConverter { - - /** - * Converts any value (object, array, primitive) into a string representation. - * - * @param value The value (object, array or primitive) to be converted. - * @return A string representation of the input value in a format that can be used as url query or header parameter value. - */ - public static String toStringArgument(final Object value) { - if (value == null) { - return ""; - } - if ( - value instanceof String || - value instanceof Number || - value instanceof Boolean || - value instanceof Enum - ) { - return String.valueOf(value); - } - if (value instanceof List) { - List list = (List) value; - return list - .stream() - .map(HttpArgumentConverter::toStringArgument) - .collect(Collectors.joining(",")); - } - - return modelToJson(value); - } -} diff --git a/src/main/java/com/plexsdk/http/util/HttpHeaders.java b/src/main/java/com/plexsdk/http/util/HttpHeaders.java deleted file mode 100644 index 385bc540..00000000 --- a/src/main/java/com/plexsdk/http/util/HttpHeaders.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.plexsdk.http.util; - -import static com.plexsdk.http.util.HttpArgumentConverter.toStringArgument; - -import com.plexsdk.exceptions.ArgumentCannotBeNullException; -import okhttp3.Headers; - -/** - * HttpHeaders represents a utility class for building HTTP headers. - */ -public class HttpHeaders { - - /** - * Private constructor to prevent direct instantiation of the class. - */ - private HttpHeaders() {} - - /** - * Creates a new instance of the HttpHeaders.Builder. - * - * @return A new instance of HttpHeaders.Builder. - */ - public static Builder builder() { - return new Builder(); - } - - /** - * Builder class for constructing HTTP headers. - */ - public static class Builder { - - private final Headers.Builder headersBuilder; - - /** - * Constructs a new instance of the Builder. - */ - private Builder() { - this.headersBuilder = new Headers.Builder(); - } - - /** - * Adds a required header with the specified name and value to the headers' builder. - * - * @param name The name of the header. - * @param value The value of the header. - * @return The current Builder instance. - * @throws ArgumentCannotBeNullException If the value is null. - */ - public Builder addRequiredHeader(String name, Object value) - throws ArgumentCannotBeNullException { - if (value == null) { - throw new ArgumentCannotBeNullException(name); - } - this.headersBuilder.add(name, toStringArgument(value)); - - return this; - } - - /** - * Adds an optional header with the specified name and value to the headers' builder. - * - * @param name The name of the header. - * @param value The value of the header. - * @return The current Builder instance. - */ - public Builder addOptionalHeader(String name, Object value) { - if (value != null) { - this.headersBuilder.add(name, toStringArgument(value)); - } - - return this; - } - - /** - * Builds the headers using the configured values in the builder. - * - * @return The constructed Headers object. - */ - public Headers build() { - return this.headersBuilder.build(); - } - } -} diff --git a/src/main/java/com/plexsdk/http/util/HttpUrl.java b/src/main/java/com/plexsdk/http/util/HttpUrl.java deleted file mode 100644 index f4211ef0..00000000 --- a/src/main/java/com/plexsdk/http/util/HttpUrl.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.plexsdk.http.util; - -import static com.plexsdk.http.util.HttpArgumentConverter.toStringArgument; - -import com.plexsdk.exceptions.ArgumentCannotBeNullException; -import java.util.Objects; - -/** - * The HttpUrl class provides a convenient way to construct HTTP URLs with query parameters and path parameters. - */ -public class HttpUrl { - - /** - * Private constructor to prevent direct instantiation of the class. - */ - private HttpUrl() {} - - /** - * Creates a new instance of the Builder class to start constructing an HTTP URL. - * - * @param url The base URL for the HTTP request. - * @return A new instance of the Builder class. - */ - public static Builder builder(String url) { - return new Builder(url); - } - - /** - * The Builder class provides methods to add query parameters and path parameters to an HTTP URL. - */ - public static class Builder { - - private final okhttp3.HttpUrl.Builder httpUrlBuilder; - - /** - * Constructs a new Builder instance with the specified base URL. - * - * @param url The base URL for the HTTP request. - */ - private Builder(String url) { - this.httpUrlBuilder = Objects.requireNonNull(okhttp3.HttpUrl.parse(url)).newBuilder(); - } - - /** - * Adds a required query parameter to the HTTP URL. - * - * @param name The name of the query parameter. - * @param value The value of the query parameter. - * @return The Builder instance. - * @throws ArgumentCannotBeNullException If the value is null. - */ - public Builder addRequiredQueryParameter(String name, Object value) - throws ArgumentCannotBeNullException { - if (value == null) { - throw new ArgumentCannotBeNullException(name); - } - this.httpUrlBuilder.addQueryParameter(name, toStringArgument(value)); - - return this; - } - - /** - * Adds an optional query parameter to the HTTP URL. - * - * @param name The name of the query parameter. - * @param value The value of the query parameter. - * @return The Builder instance. - */ - public Builder addOptionalQueryParameter(String name, Object value) { - if (value != null) { - this.httpUrlBuilder.addQueryParameter(name, toStringArgument(value)); - } - - return this; - } - - /** - * Adds a path parameter to the HTTP URL. - * - * @param value The value of the path parameter. - * @return The Builder instance. - * @throws ArgumentCannotBeNullException If the value is null. - */ - public Builder addPathParameter(String value) throws ArgumentCannotBeNullException { - if (value == null || value.isEmpty()) { - throw new ArgumentCannotBeNullException(); - } - this.httpUrlBuilder.addPathSegment(value); - - return this; - } - - /** - * Builds the final HTTP URL. - * - * @return The constructed HTTP URL as a string. - */ - public String build() { - return this.httpUrlBuilder.build().toString(); - } - } -} diff --git a/src/main/java/com/plexsdk/models/BaseModel.java b/src/main/java/com/plexsdk/models/BaseModel.java deleted file mode 100644 index 680d7181..00000000 --- a/src/main/java/com/plexsdk/models/BaseModel.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.plexsdk.models; - -import com.plexsdk.http.ModelConverter; -import java.util.Collection; -import java.util.Set; -import java.util.stream.Collectors; - -public abstract class BaseModel { - - public abstract static class Builder { - - protected static enum ValidationType { - ALL_OF, - ANY_OF, - ONE_OF, - NONE, - } - - private final ValidationType _validationType; - - protected Builder(ValidationType validationType) { - this._validationType = validationType; - } - - protected abstract Set getNonNullInstanceFieldNames(); - - protected abstract Set> getRequiredFieldsGroups(); - - protected boolean isValidAllOf() { - // Check if all of the required field groups are a subset of the non-null, non-static fields. - return getNonNullInstanceFieldNames() - .containsAll( - getRequiredFieldsGroups().stream().flatMap(Collection::stream).collect(Collectors.toSet()) - ); - } - - protected boolean isValidAnyOf() { - // Check if any of the required field groups are a subset of the non-null, non-static fields. - return getRequiredFieldsGroups() - .stream() - .anyMatch(group -> getNonNullInstanceFieldNames().containsAll(group)); - } - - protected boolean isValidOneOf() { - // Check if the set of non-null fields match one of the required field groups. - return getRequiredFieldsGroups().contains(getNonNullInstanceFieldNames()); - } - - protected String validate() { - if (getRequiredFieldsGroups().isEmpty()) { - // Nothing to validate since there are no required fields groups. - - return null; - } - - switch (this._validationType) { - case ALL_OF: - return !isValidAllOf() ? "Object fails AllOf validation." : null; - case ANY_OF: - return !isValidAnyOf() ? "Object fails AnyOf validation." : null; - case ONE_OF: - return !isValidOneOf() ? "Object fails OneOf validation." : null; - case NONE: - default: - return !isValidOneOf() ? "Object fails required fields validation." : null; - } - } - } - - public BaseModel() {} - - protected BaseModel(Builder builder) {} - - public String toJson() { - return ModelConverter.modelToJson(this); - } -} diff --git a/src/main/java/com/plexsdk/models/Download.java b/src/main/java/com/plexsdk/models/Download.java deleted file mode 100644 index da48c05c..00000000 --- a/src/main/java/com/plexsdk/models/Download.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.plexsdk.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Download { - V1("1"); - - public final String label; -} diff --git a/src/main/java/com/plexsdk/models/Force.java b/src/main/java/com/plexsdk/models/Force.java deleted file mode 100644 index 3acd483e..00000000 --- a/src/main/java/com/plexsdk/models/Force.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.plexsdk.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Force { - V1(1); - - public final Float label; -} diff --git a/src/main/java/com/plexsdk/models/GetButlerTasksResponse.java b/src/main/java/com/plexsdk/models/GetButlerTasksResponse.java deleted file mode 100644 index 026d1bde..00000000 --- a/src/main/java/com/plexsdk/models/GetButlerTasksResponse.java +++ /dev/null @@ -1,332 +0,0 @@ -package com.plexsdk.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL -) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetButlerTasksResponse.Builder.class -) -public class GetButlerTasksResponse extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetButlerTasksResponse.ButlerTasks.Builder.class - ) - public static class ButlerTasks extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetButlerTasksResponse.ButlerTasks.ButlerTask.Builder.class - ) - public static class ButlerTask extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("description") - private java.lang.String description; - - @com.fasterxml.jackson.annotation.JsonProperty("enabled") - private java.lang.Boolean enabled; - - @com.fasterxml.jackson.annotation.JsonProperty("interval") - private java.lang.Double interval; - - @com.fasterxml.jackson.annotation.JsonProperty("name") - private java.lang.String name; - - @com.fasterxml.jackson.annotation.JsonProperty("scheduleRandomized") - private java.lang.Boolean scheduleRandomized; - - @com.fasterxml.jackson.annotation.JsonProperty("title") - private java.lang.String title; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetButlerTasksResponse.ButlerTasks.ButlerTask build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetButlerTasksResponse.ButlerTasks.ButlerTask buildWithoutValidation() { - return new GetButlerTasksResponse.ButlerTasks.ButlerTask(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("description") - private final java.lang.String description; - - @com.fasterxml.jackson.annotation.JsonProperty("enabled") - private final java.lang.Boolean enabled; - - @com.fasterxml.jackson.annotation.JsonProperty("interval") - private final java.lang.Double interval; - - @com.fasterxml.jackson.annotation.JsonProperty("name") - private final java.lang.String name; - - @com.fasterxml.jackson.annotation.JsonProperty("scheduleRandomized") - private final java.lang.Boolean scheduleRandomized; - - @com.fasterxml.jackson.annotation.JsonProperty("title") - private final java.lang.String title; - - ButlerTask(Builder builder) { - super(builder); - this.description = builder.getDescription(); - this.enabled = builder.getEnabled(); - this.interval = builder.getInterval(); - this.name = builder.getName(); - this.scheduleRandomized = builder.getScheduleRandomized(); - this.title = builder.getTitle(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("ButlerTask") - private java.util.List butlerTask; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetButlerTasksResponse.ButlerTasks build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetButlerTasksResponse.ButlerTasks buildWithoutValidation() { - return new GetButlerTasksResponse.ButlerTasks(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("ButlerTask") - private final java.util.List butlerTask; - - ButlerTasks(Builder builder) { - super(builder); - this.butlerTask = builder.getButlerTask(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("ButlerTasks") - private GetButlerTasksResponse.ButlerTasks butlerTasks; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetButlerTasksResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetButlerTasksResponse buildWithoutValidation() { - return new GetButlerTasksResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .stream(this.getClass().getDeclaredFields()) - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("ButlerTasks") - private final GetButlerTasksResponse.ButlerTasks butlerTasks; - - GetButlerTasksResponse(Builder builder) { - super(builder); - this.butlerTasks = builder.getButlerTasks(); - } -} diff --git a/src/main/java/com/plexsdk/models/GetDevicesResponse.java b/src/main/java/com/plexsdk/models/GetDevicesResponse.java deleted file mode 100644 index 9d7f1210..00000000 --- a/src/main/java/com/plexsdk/models/GetDevicesResponse.java +++ /dev/null @@ -1,339 +0,0 @@ -package com.plexsdk.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL -) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetDevicesResponse.Builder.class -) -public class GetDevicesResponse extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetDevicesResponse.MediaContainer.Builder.class - ) - public static class MediaContainer extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetDevicesResponse.MediaContainer.Device.Builder.class - ) - public static class Device extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("clientIdentifier") - private java.lang.String clientIdentifier; - - @com.fasterxml.jackson.annotation.JsonProperty("createdAt") - private java.lang.Double createdAt; - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private java.lang.Double id; - - @com.fasterxml.jackson.annotation.JsonProperty("name") - private java.lang.String name; - - @com.fasterxml.jackson.annotation.JsonProperty("platform") - private java.lang.String platform; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetDevicesResponse.MediaContainer.Device build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetDevicesResponse.MediaContainer.Device buildWithoutValidation() { - return new GetDevicesResponse.MediaContainer.Device(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("clientIdentifier") - private final java.lang.String clientIdentifier; - - @com.fasterxml.jackson.annotation.JsonProperty("createdAt") - private final java.lang.Double createdAt; - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private final java.lang.Double id; - - @com.fasterxml.jackson.annotation.JsonProperty("name") - private final java.lang.String name; - - @com.fasterxml.jackson.annotation.JsonProperty("platform") - private final java.lang.String platform; - - Device(Builder builder) { - super(builder); - this.clientIdentifier = builder.getClientIdentifier(); - this.createdAt = builder.getCreatedAt(); - this.id = builder.getId(); - this.name = builder.getName(); - this.platform = builder.getPlatform(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("Device") - private java.util.List device; - - @com.fasterxml.jackson.annotation.JsonProperty("identifier") - private java.lang.String identifier; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private java.lang.Double size; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetDevicesResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetDevicesResponse.MediaContainer buildWithoutValidation() { - return new GetDevicesResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("Device") - private final java.util.List device; - - @com.fasterxml.jackson.annotation.JsonProperty("identifier") - private final java.lang.String identifier; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private final java.lang.Double size; - - MediaContainer(Builder builder) { - super(builder); - this.device = builder.getDevice(); - this.identifier = builder.getIdentifier(); - this.size = builder.getSize(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private GetDevicesResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetDevicesResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetDevicesResponse buildWithoutValidation() { - return new GetDevicesResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .stream(this.getClass().getDeclaredFields()) - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private final GetDevicesResponse.MediaContainer mediaContainer; - - GetDevicesResponse(Builder builder) { - super(builder); - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/com/plexsdk/models/GetMyPlexAccountResponse.java b/src/main/java/com/plexsdk/models/GetMyPlexAccountResponse.java deleted file mode 100644 index a729d4ee..00000000 --- a/src/main/java/com/plexsdk/models/GetMyPlexAccountResponse.java +++ /dev/null @@ -1,274 +0,0 @@ -package com.plexsdk.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL -) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetMyPlexAccountResponse.Builder.class -) -public class GetMyPlexAccountResponse extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetMyPlexAccountResponse.MyPlex.Builder.class - ) - public static class MyPlex extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("authToken") - private java.lang.String authToken; - - @com.fasterxml.jackson.annotation.JsonProperty("mappingError") - private java.lang.String mappingError; - - @com.fasterxml.jackson.annotation.JsonProperty("mappingState") - private java.lang.String mappingState; - - @com.fasterxml.jackson.annotation.JsonProperty("privateAddress") - private java.lang.String privateAddress; - - @com.fasterxml.jackson.annotation.JsonProperty("privatePort") - private java.lang.Double privatePort; - - @com.fasterxml.jackson.annotation.JsonProperty("publicAddress") - private java.lang.String publicAddress; - - @com.fasterxml.jackson.annotation.JsonProperty("publicPort") - private java.lang.Double publicPort; - - @com.fasterxml.jackson.annotation.JsonProperty("signInState") - private java.lang.String signInState; - - @com.fasterxml.jackson.annotation.JsonProperty("subscriptionActive") - private java.lang.Boolean subscriptionActive; - - @com.fasterxml.jackson.annotation.JsonProperty("subscriptionFeatures") - private java.lang.String subscriptionFeatures; - - @com.fasterxml.jackson.annotation.JsonProperty("subscriptionState") - private java.lang.String subscriptionState; - - @com.fasterxml.jackson.annotation.JsonProperty("username") - private java.lang.String username; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetMyPlexAccountResponse.MyPlex build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetMyPlexAccountResponse.MyPlex buildWithoutValidation() { - return new GetMyPlexAccountResponse.MyPlex(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("authToken") - private final java.lang.String authToken; - - @com.fasterxml.jackson.annotation.JsonProperty("mappingError") - private final java.lang.String mappingError; - - @com.fasterxml.jackson.annotation.JsonProperty("mappingState") - private final java.lang.String mappingState; - - @com.fasterxml.jackson.annotation.JsonProperty("privateAddress") - private final java.lang.String privateAddress; - - @com.fasterxml.jackson.annotation.JsonProperty("privatePort") - private final java.lang.Double privatePort; - - @com.fasterxml.jackson.annotation.JsonProperty("publicAddress") - private final java.lang.String publicAddress; - - @com.fasterxml.jackson.annotation.JsonProperty("publicPort") - private final java.lang.Double publicPort; - - @com.fasterxml.jackson.annotation.JsonProperty("signInState") - private final java.lang.String signInState; - - @com.fasterxml.jackson.annotation.JsonProperty("subscriptionActive") - private final java.lang.Boolean subscriptionActive; - - @com.fasterxml.jackson.annotation.JsonProperty("subscriptionFeatures") - private final java.lang.String subscriptionFeatures; - - @com.fasterxml.jackson.annotation.JsonProperty("subscriptionState") - private final java.lang.String subscriptionState; - - @com.fasterxml.jackson.annotation.JsonProperty("username") - private final java.lang.String username; - - MyPlex(Builder builder) { - super(builder); - this.authToken = builder.getAuthToken(); - this.mappingError = builder.getMappingError(); - this.mappingState = builder.getMappingState(); - this.privateAddress = builder.getPrivateAddress(); - this.privatePort = builder.getPrivatePort(); - this.publicAddress = builder.getPublicAddress(); - this.publicPort = builder.getPublicPort(); - this.signInState = builder.getSignInState(); - this.subscriptionActive = builder.getSubscriptionActive(); - this.subscriptionFeatures = builder.getSubscriptionFeatures(); - this.subscriptionState = builder.getSubscriptionState(); - this.username = builder.getUsername(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MyPlex") - private GetMyPlexAccountResponse.MyPlex myPlex; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetMyPlexAccountResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetMyPlexAccountResponse buildWithoutValidation() { - return new GetMyPlexAccountResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .stream(this.getClass().getDeclaredFields()) - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MyPlex") - private final GetMyPlexAccountResponse.MyPlex myPlex; - - GetMyPlexAccountResponse(Builder builder) { - super(builder); - this.myPlex = builder.getMyPlex(); - } -} diff --git a/src/main/java/com/plexsdk/models/GetOnDeckResponse.java b/src/main/java/com/plexsdk/models/GetOnDeckResponse.java deleted file mode 100644 index cbaf81cb..00000000 --- a/src/main/java/com/plexsdk/models/GetOnDeckResponse.java +++ /dev/null @@ -1,1289 +0,0 @@ -package com.plexsdk.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL -) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetOnDeckResponse.Builder.class -) -public class GetOnDeckResponse extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetOnDeckResponse.MediaContainer.Builder.class - ) - public static class MediaContainer extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetOnDeckResponse.MediaContainer.Metadata.Builder.class - ) - public static class Metadata extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetOnDeckResponse.MediaContainer.Metadata.Guid.Builder.class - ) - public static class Guid extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private java.lang.String id; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetOnDeckResponse.MediaContainer.Metadata.Guid build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetOnDeckResponse.MediaContainer.Metadata.Guid buildWithoutValidation() { - return new GetOnDeckResponse.MediaContainer.Metadata.Guid(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private final java.lang.String id; - - Guid(Builder builder) { - super(builder); - this.id = builder.getId(); - } - } - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetOnDeckResponse.MediaContainer.Metadata.Media.Builder.class - ) - public static class Media extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetOnDeckResponse.MediaContainer.Metadata.Media.Part.Builder.class - ) - public static class Part extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetOnDeckResponse.MediaContainer.Metadata.Media.Part.Stream.Builder.class - ) - public static class Stream extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("default_") - private java.lang.Boolean _default; - - @com.fasterxml.jackson.annotation.JsonProperty("bitDepth") - private java.lang.Double bitDepth; - - @com.fasterxml.jackson.annotation.JsonProperty("bitrate") - private java.lang.Double bitrate; - - @com.fasterxml.jackson.annotation.JsonProperty("chromaLocation") - private java.lang.String chromaLocation; - - @com.fasterxml.jackson.annotation.JsonProperty("chromaSubsampling") - private java.lang.String chromaSubsampling; - - @com.fasterxml.jackson.annotation.JsonProperty("codec") - private java.lang.String codec; - - @com.fasterxml.jackson.annotation.JsonProperty("codedHeight") - private java.lang.Double codedHeight; - - @com.fasterxml.jackson.annotation.JsonProperty("codedWidth") - private java.lang.Double codedWidth; - - @com.fasterxml.jackson.annotation.JsonProperty("colorRange") - private java.lang.String colorRange; - - @com.fasterxml.jackson.annotation.JsonProperty("displayTitle") - private java.lang.String displayTitle; - - @com.fasterxml.jackson.annotation.JsonProperty("extendedDisplayTitle") - private java.lang.String extendedDisplayTitle; - - @com.fasterxml.jackson.annotation.JsonProperty("frameRate") - private java.lang.Double frameRate; - - @com.fasterxml.jackson.annotation.JsonProperty("height") - private java.lang.Double height; - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private java.lang.Double id; - - @com.fasterxml.jackson.annotation.JsonProperty("index") - private java.lang.Double index; - - @com.fasterxml.jackson.annotation.JsonProperty("language") - private java.lang.String language; - - @com.fasterxml.jackson.annotation.JsonProperty("languageCode") - private java.lang.String languageCode; - - @com.fasterxml.jackson.annotation.JsonProperty("languageTag") - private java.lang.String languageTag; - - @com.fasterxml.jackson.annotation.JsonProperty("level") - private java.lang.Double level; - - @com.fasterxml.jackson.annotation.JsonProperty("profile") - private java.lang.String profile; - - @com.fasterxml.jackson.annotation.JsonProperty("refFrames") - private java.lang.Double refFrames; - - @com.fasterxml.jackson.annotation.JsonProperty("streamType") - private java.lang.Double streamType; - - @com.fasterxml.jackson.annotation.JsonProperty("width") - private java.lang.Double width; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetOnDeckResponse.MediaContainer.Metadata.Media.Part.Stream build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetOnDeckResponse.MediaContainer.Metadata.Media.Part.Stream buildWithoutValidation() { - return new GetOnDeckResponse.MediaContainer.Metadata.Media.Part.Stream(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("default_") - private final java.lang.Boolean _default; - - @com.fasterxml.jackson.annotation.JsonProperty("bitDepth") - private final java.lang.Double bitDepth; - - @com.fasterxml.jackson.annotation.JsonProperty("bitrate") - private final java.lang.Double bitrate; - - @com.fasterxml.jackson.annotation.JsonProperty("chromaLocation") - private final java.lang.String chromaLocation; - - @com.fasterxml.jackson.annotation.JsonProperty("chromaSubsampling") - private final java.lang.String chromaSubsampling; - - @com.fasterxml.jackson.annotation.JsonProperty("codec") - private final java.lang.String codec; - - @com.fasterxml.jackson.annotation.JsonProperty("codedHeight") - private final java.lang.Double codedHeight; - - @com.fasterxml.jackson.annotation.JsonProperty("codedWidth") - private final java.lang.Double codedWidth; - - @com.fasterxml.jackson.annotation.JsonProperty("colorRange") - private final java.lang.String colorRange; - - @com.fasterxml.jackson.annotation.JsonProperty("displayTitle") - private final java.lang.String displayTitle; - - @com.fasterxml.jackson.annotation.JsonProperty("extendedDisplayTitle") - private final java.lang.String extendedDisplayTitle; - - @com.fasterxml.jackson.annotation.JsonProperty("frameRate") - private final java.lang.Double frameRate; - - @com.fasterxml.jackson.annotation.JsonProperty("height") - private final java.lang.Double height; - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private final java.lang.Double id; - - @com.fasterxml.jackson.annotation.JsonProperty("index") - private final java.lang.Double index; - - @com.fasterxml.jackson.annotation.JsonProperty("language") - private final java.lang.String language; - - @com.fasterxml.jackson.annotation.JsonProperty("languageCode") - private final java.lang.String languageCode; - - @com.fasterxml.jackson.annotation.JsonProperty("languageTag") - private final java.lang.String languageTag; - - @com.fasterxml.jackson.annotation.JsonProperty("level") - private final java.lang.Double level; - - @com.fasterxml.jackson.annotation.JsonProperty("profile") - private final java.lang.String profile; - - @com.fasterxml.jackson.annotation.JsonProperty("refFrames") - private final java.lang.Double refFrames; - - @com.fasterxml.jackson.annotation.JsonProperty("streamType") - private final java.lang.Double streamType; - - @com.fasterxml.jackson.annotation.JsonProperty("width") - private final java.lang.Double width; - - Stream(Builder builder) { - super(builder); - this._default = builder.get_default(); - this.bitDepth = builder.getBitDepth(); - this.bitrate = builder.getBitrate(); - this.chromaLocation = builder.getChromaLocation(); - this.chromaSubsampling = builder.getChromaSubsampling(); - this.codec = builder.getCodec(); - this.codedHeight = builder.getCodedHeight(); - this.codedWidth = builder.getCodedWidth(); - this.colorRange = builder.getColorRange(); - this.displayTitle = builder.getDisplayTitle(); - this.extendedDisplayTitle = builder.getExtendedDisplayTitle(); - this.frameRate = builder.getFrameRate(); - this.height = builder.getHeight(); - this.id = builder.getId(); - this.index = builder.getIndex(); - this.language = builder.getLanguage(); - this.languageCode = builder.getLanguageCode(); - this.languageTag = builder.getLanguageTag(); - this.level = builder.getLevel(); - this.profile = builder.getProfile(); - this.refFrames = builder.getRefFrames(); - this.streamType = builder.getStreamType(); - this.width = builder.getWidth(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("audioProfile") - private java.lang.String audioProfile; - - @com.fasterxml.jackson.annotation.JsonProperty("container") - private java.lang.String container; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("file") - private java.lang.String file; - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private java.lang.Double id; - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private java.lang.Double size; - - @com.fasterxml.jackson.annotation.JsonProperty("Stream") - private java.util.List< - GetOnDeckResponse.MediaContainer.Metadata.Media.Part.Stream - > stream; - - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") - private java.lang.String videoProfile; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetOnDeckResponse.MediaContainer.Metadata.Media.Part build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetOnDeckResponse.MediaContainer.Metadata.Media.Part buildWithoutValidation() { - return new GetOnDeckResponse.MediaContainer.Metadata.Media.Part(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("audioProfile") - private final java.lang.String audioProfile; - - @com.fasterxml.jackson.annotation.JsonProperty("container") - private final java.lang.String container; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private final java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("file") - private final java.lang.String file; - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private final java.lang.Double id; - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private final java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private final java.lang.Double size; - - @com.fasterxml.jackson.annotation.JsonProperty("Stream") - private final java.util.List< - GetOnDeckResponse.MediaContainer.Metadata.Media.Part.Stream - > stream; - - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") - private final java.lang.String videoProfile; - - Part(Builder builder) { - super(builder); - this.audioProfile = builder.getAudioProfile(); - this.container = builder.getContainer(); - this.duration = builder.getDuration(); - this.file = builder.getFile(); - this.id = builder.getId(); - this.key = builder.getKey(); - this.size = builder.getSize(); - this.stream = builder.getStream(); - this.videoProfile = builder.getVideoProfile(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("aspectRatio") - private java.lang.Double aspectRatio; - - @com.fasterxml.jackson.annotation.JsonProperty("audioChannels") - private java.lang.Double audioChannels; - - @com.fasterxml.jackson.annotation.JsonProperty("audioCodec") - private java.lang.String audioCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("audioProfile") - private java.lang.String audioProfile; - - @com.fasterxml.jackson.annotation.JsonProperty("bitrate") - private java.lang.Double bitrate; - - @com.fasterxml.jackson.annotation.JsonProperty("container") - private java.lang.String container; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("height") - private java.lang.Double height; - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private java.lang.Double id; - - @com.fasterxml.jackson.annotation.JsonProperty("Part") - private java.util.List part; - - @com.fasterxml.jackson.annotation.JsonProperty("videoCodec") - private java.lang.String videoCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("videoFrameRate") - private java.lang.String videoFrameRate; - - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") - private java.lang.String videoProfile; - - @com.fasterxml.jackson.annotation.JsonProperty("videoResolution") - private java.lang.String videoResolution; - - @com.fasterxml.jackson.annotation.JsonProperty("width") - private java.lang.Double width; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetOnDeckResponse.MediaContainer.Metadata.Media build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetOnDeckResponse.MediaContainer.Metadata.Media buildWithoutValidation() { - return new GetOnDeckResponse.MediaContainer.Metadata.Media(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("aspectRatio") - private final java.lang.Double aspectRatio; - - @com.fasterxml.jackson.annotation.JsonProperty("audioChannels") - private final java.lang.Double audioChannels; - - @com.fasterxml.jackson.annotation.JsonProperty("audioCodec") - private final java.lang.String audioCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("audioProfile") - private final java.lang.String audioProfile; - - @com.fasterxml.jackson.annotation.JsonProperty("bitrate") - private final java.lang.Double bitrate; - - @com.fasterxml.jackson.annotation.JsonProperty("container") - private final java.lang.String container; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private final java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("height") - private final java.lang.Double height; - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private final java.lang.Double id; - - @com.fasterxml.jackson.annotation.JsonProperty("Part") - private final java.util.List part; - - @com.fasterxml.jackson.annotation.JsonProperty("videoCodec") - private final java.lang.String videoCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("videoFrameRate") - private final java.lang.String videoFrameRate; - - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") - private final java.lang.String videoProfile; - - @com.fasterxml.jackson.annotation.JsonProperty("videoResolution") - private final java.lang.String videoResolution; - - @com.fasterxml.jackson.annotation.JsonProperty("width") - private final java.lang.Double width; - - Media(Builder builder) { - super(builder); - this.aspectRatio = builder.getAspectRatio(); - this.audioChannels = builder.getAudioChannels(); - this.audioCodec = builder.getAudioCodec(); - this.audioProfile = builder.getAudioProfile(); - this.bitrate = builder.getBitrate(); - this.container = builder.getContainer(); - this.duration = builder.getDuration(); - this.height = builder.getHeight(); - this.id = builder.getId(); - this.part = builder.getPart(); - this.videoCodec = builder.getVideoCodec(); - this.videoFrameRate = builder.getVideoFrameRate(); - this.videoProfile = builder.getVideoProfile(); - this.videoResolution = builder.getVideoResolution(); - this.width = builder.getWidth(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("addedAt") - private java.lang.Double addedAt; - - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") - private java.lang.Boolean allowSync; - - @com.fasterxml.jackson.annotation.JsonProperty("art") - private java.lang.String art; - - @com.fasterxml.jackson.annotation.JsonProperty("contentRating") - private java.lang.String contentRating; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("grandparentArt") - private java.lang.String grandparentArt; - - @com.fasterxml.jackson.annotation.JsonProperty("grandparentGuid") - private java.lang.String grandparentGuid; - - @com.fasterxml.jackson.annotation.JsonProperty("grandparentKey") - private java.lang.String grandparentKey; - - @com.fasterxml.jackson.annotation.JsonProperty("grandparentRatingKey") - private java.lang.Double grandparentRatingKey; - - @com.fasterxml.jackson.annotation.JsonProperty("grandparentTheme") - private java.lang.String grandparentTheme; - - @com.fasterxml.jackson.annotation.JsonProperty("grandparentThumb") - private java.lang.String grandparentThumb; - - @com.fasterxml.jackson.annotation.JsonProperty("grandparentTitle") - private java.lang.String grandparentTitle; - - @com.fasterxml.jackson.annotation.JsonProperty("Guid") - private java.util.List guid; - - @com.fasterxml.jackson.annotation.JsonProperty("index") - private java.lang.Double index; - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("lastViewedAt") - private java.lang.Double lastViewedAt; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionID") - private java.lang.Double librarySectionId; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionKey") - private java.lang.String librarySectionKey; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionTitle") - private java.lang.String librarySectionTitle; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionUUID") - private java.lang.String librarySectionUuid; - - @com.fasterxml.jackson.annotation.JsonProperty("Media") - private java.util.List media; - - @com.fasterxml.jackson.annotation.JsonProperty("originallyAvailableAt") - private java.lang.String originallyAvailableAt; - - @com.fasterxml.jackson.annotation.JsonProperty("parentGuid") - private java.lang.String parentGuid; - - @com.fasterxml.jackson.annotation.JsonProperty("parentIndex") - private java.lang.Double parentIndex; - - @com.fasterxml.jackson.annotation.JsonProperty("parentKey") - private java.lang.String parentKey; - - @com.fasterxml.jackson.annotation.JsonProperty("parentRatingKey") - private java.lang.Double parentRatingKey; - - @com.fasterxml.jackson.annotation.JsonProperty("parentThumb") - private java.lang.String parentThumb; - - @com.fasterxml.jackson.annotation.JsonProperty("parentTitle") - private java.lang.String parentTitle; - - @com.fasterxml.jackson.annotation.JsonProperty("ratingKey") - private java.lang.Double ratingKey; - - @com.fasterxml.jackson.annotation.JsonProperty("summary") - private java.lang.String summary; - - @com.fasterxml.jackson.annotation.JsonProperty("thumb") - private java.lang.String thumb; - - @com.fasterxml.jackson.annotation.JsonProperty("title") - private java.lang.String title; - - @com.fasterxml.jackson.annotation.JsonProperty("type") - private java.lang.String type; - - @com.fasterxml.jackson.annotation.JsonProperty("updatedAt") - private java.lang.Double updatedAt; - - @com.fasterxml.jackson.annotation.JsonProperty("year") - private java.lang.Double year; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetOnDeckResponse.MediaContainer.Metadata build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetOnDeckResponse.MediaContainer.Metadata buildWithoutValidation() { - return new GetOnDeckResponse.MediaContainer.Metadata(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("addedAt") - private final java.lang.Double addedAt; - - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") - private final java.lang.Boolean allowSync; - - @com.fasterxml.jackson.annotation.JsonProperty("art") - private final java.lang.String art; - - @com.fasterxml.jackson.annotation.JsonProperty("contentRating") - private final java.lang.String contentRating; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private final java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("grandparentArt") - private final java.lang.String grandparentArt; - - @com.fasterxml.jackson.annotation.JsonProperty("grandparentGuid") - private final java.lang.String grandparentGuid; - - @com.fasterxml.jackson.annotation.JsonProperty("grandparentKey") - private final java.lang.String grandparentKey; - - @com.fasterxml.jackson.annotation.JsonProperty("grandparentRatingKey") - private final java.lang.Double grandparentRatingKey; - - @com.fasterxml.jackson.annotation.JsonProperty("grandparentTheme") - private final java.lang.String grandparentTheme; - - @com.fasterxml.jackson.annotation.JsonProperty("grandparentThumb") - private final java.lang.String grandparentThumb; - - @com.fasterxml.jackson.annotation.JsonProperty("grandparentTitle") - private final java.lang.String grandparentTitle; - - @com.fasterxml.jackson.annotation.JsonProperty("Guid") - private final java.util.List guid; - - @com.fasterxml.jackson.annotation.JsonProperty("index") - private final java.lang.Double index; - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private final java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("lastViewedAt") - private final java.lang.Double lastViewedAt; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionID") - private final java.lang.Double librarySectionId; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionKey") - private final java.lang.String librarySectionKey; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionTitle") - private final java.lang.String librarySectionTitle; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionUUID") - private final java.lang.String librarySectionUuid; - - @com.fasterxml.jackson.annotation.JsonProperty("Media") - private final java.util.List media; - - @com.fasterxml.jackson.annotation.JsonProperty("originallyAvailableAt") - private final java.lang.String originallyAvailableAt; - - @com.fasterxml.jackson.annotation.JsonProperty("parentGuid") - private final java.lang.String parentGuid; - - @com.fasterxml.jackson.annotation.JsonProperty("parentIndex") - private final java.lang.Double parentIndex; - - @com.fasterxml.jackson.annotation.JsonProperty("parentKey") - private final java.lang.String parentKey; - - @com.fasterxml.jackson.annotation.JsonProperty("parentRatingKey") - private final java.lang.Double parentRatingKey; - - @com.fasterxml.jackson.annotation.JsonProperty("parentThumb") - private final java.lang.String parentThumb; - - @com.fasterxml.jackson.annotation.JsonProperty("parentTitle") - private final java.lang.String parentTitle; - - @com.fasterxml.jackson.annotation.JsonProperty("ratingKey") - private final java.lang.Double ratingKey; - - @com.fasterxml.jackson.annotation.JsonProperty("summary") - private final java.lang.String summary; - - @com.fasterxml.jackson.annotation.JsonProperty("thumb") - private final java.lang.String thumb; - - @com.fasterxml.jackson.annotation.JsonProperty("title") - private final java.lang.String title; - - @com.fasterxml.jackson.annotation.JsonProperty("type") - private final java.lang.String type; - - @com.fasterxml.jackson.annotation.JsonProperty("updatedAt") - private final java.lang.Double updatedAt; - - @com.fasterxml.jackson.annotation.JsonProperty("year") - private final java.lang.Double year; - - Metadata(Builder builder) { - super(builder); - this.addedAt = builder.getAddedAt(); - this.allowSync = builder.getAllowSync(); - this.art = builder.getArt(); - this.contentRating = builder.getContentRating(); - this.duration = builder.getDuration(); - this.grandparentArt = builder.getGrandparentArt(); - this.grandparentGuid = builder.getGrandparentGuid(); - this.grandparentKey = builder.getGrandparentKey(); - this.grandparentRatingKey = builder.getGrandparentRatingKey(); - this.grandparentTheme = builder.getGrandparentTheme(); - this.grandparentThumb = builder.getGrandparentThumb(); - this.grandparentTitle = builder.getGrandparentTitle(); - this.guid = builder.getGuid(); - this.index = builder.getIndex(); - this.key = builder.getKey(); - this.lastViewedAt = builder.getLastViewedAt(); - this.librarySectionId = builder.getLibrarySectionId(); - this.librarySectionKey = builder.getLibrarySectionKey(); - this.librarySectionTitle = builder.getLibrarySectionTitle(); - this.librarySectionUuid = builder.getLibrarySectionUuid(); - this.media = builder.getMedia(); - this.originallyAvailableAt = builder.getOriginallyAvailableAt(); - this.parentGuid = builder.getParentGuid(); - this.parentIndex = builder.getParentIndex(); - this.parentKey = builder.getParentKey(); - this.parentRatingKey = builder.getParentRatingKey(); - this.parentThumb = builder.getParentThumb(); - this.parentTitle = builder.getParentTitle(); - this.ratingKey = builder.getRatingKey(); - this.summary = builder.getSummary(); - this.thumb = builder.getThumb(); - this.title = builder.getTitle(); - this.type = builder.getType(); - this.updatedAt = builder.getUpdatedAt(); - this.year = builder.getYear(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") - private java.lang.Boolean allowSync; - - @com.fasterxml.jackson.annotation.JsonProperty("identifier") - private java.lang.String identifier; - - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagPrefix") - private java.lang.String mediaTagPrefix; - - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagVersion") - private java.lang.Double mediaTagVersion; - - @com.fasterxml.jackson.annotation.JsonProperty("Metadata") - private java.util.List metadata; - - @com.fasterxml.jackson.annotation.JsonProperty("mixedParents") - private java.lang.Boolean mixedParents; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private java.lang.Double size; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetOnDeckResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetOnDeckResponse.MediaContainer buildWithoutValidation() { - return new GetOnDeckResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") - private final java.lang.Boolean allowSync; - - @com.fasterxml.jackson.annotation.JsonProperty("identifier") - private final java.lang.String identifier; - - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagPrefix") - private final java.lang.String mediaTagPrefix; - - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagVersion") - private final java.lang.Double mediaTagVersion; - - @com.fasterxml.jackson.annotation.JsonProperty("Metadata") - private final java.util.List metadata; - - @com.fasterxml.jackson.annotation.JsonProperty("mixedParents") - private final java.lang.Boolean mixedParents; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private final java.lang.Double size; - - MediaContainer(Builder builder) { - super(builder); - this.allowSync = builder.getAllowSync(); - this.identifier = builder.getIdentifier(); - this.mediaTagPrefix = builder.getMediaTagPrefix(); - this.mediaTagVersion = builder.getMediaTagVersion(); - this.metadata = builder.getMetadata(); - this.mixedParents = builder.getMixedParents(); - this.size = builder.getSize(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private GetOnDeckResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetOnDeckResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetOnDeckResponse buildWithoutValidation() { - return new GetOnDeckResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .stream(this.getClass().getDeclaredFields()) - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private final GetOnDeckResponse.MediaContainer mediaContainer; - - GetOnDeckResponse(Builder builder) { - super(builder); - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/com/plexsdk/models/GetRecentlyAddedResponse.java b/src/main/java/com/plexsdk/models/GetRecentlyAddedResponse.java deleted file mode 100644 index 177fa9c8..00000000 --- a/src/main/java/com/plexsdk/models/GetRecentlyAddedResponse.java +++ /dev/null @@ -1,1430 +0,0 @@ -package com.plexsdk.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL -) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetRecentlyAddedResponse.Builder.class -) -public class GetRecentlyAddedResponse extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetRecentlyAddedResponse.MediaContainer.Builder.class - ) - public static class MediaContainer extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetRecentlyAddedResponse.MediaContainer.Metadata.Builder.class - ) - public static class Metadata extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetRecentlyAddedResponse.MediaContainer.Metadata.Media.Builder.class - ) - public static class Media extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetRecentlyAddedResponse.MediaContainer.Metadata.Media.Part.Builder.class - ) - public static class Part extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("container") - private java.lang.String container; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("file") - private java.lang.String file; - - @com.fasterxml.jackson.annotation.JsonProperty("has64bitOffsets") - private java.lang.Boolean has64BitOffsets; - - @com.fasterxml.jackson.annotation.JsonProperty("hasThumbnail") - private java.lang.Double hasThumbnail; - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private java.lang.Double id; - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("optimizedForStreaming") - private java.lang.Boolean optimizedForStreaming; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private java.lang.Double size; - - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") - private java.lang.String videoProfile; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Media.Part build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Media.Part buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer.Metadata.Media.Part(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("container") - private final java.lang.String container; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private final java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("file") - private final java.lang.String file; - - @com.fasterxml.jackson.annotation.JsonProperty("has64bitOffsets") - private final java.lang.Boolean has64BitOffsets; - - @com.fasterxml.jackson.annotation.JsonProperty("hasThumbnail") - private final java.lang.Double hasThumbnail; - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private final java.lang.Double id; - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private final java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("optimizedForStreaming") - private final java.lang.Boolean optimizedForStreaming; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private final java.lang.Double size; - - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") - private final java.lang.String videoProfile; - - Part(Builder builder) { - super(builder); - this.container = builder.getContainer(); - this.duration = builder.getDuration(); - this.file = builder.getFile(); - this.has64BitOffsets = builder.getHas64BitOffsets(); - this.hasThumbnail = builder.getHasThumbnail(); - this.id = builder.getId(); - this.key = builder.getKey(); - this.optimizedForStreaming = builder.getOptimizedForStreaming(); - this.size = builder.getSize(); - this.videoProfile = builder.getVideoProfile(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("aspectRatio") - private java.lang.Double aspectRatio; - - @com.fasterxml.jackson.annotation.JsonProperty("audioChannels") - private java.lang.Double audioChannels; - - @com.fasterxml.jackson.annotation.JsonProperty("audioCodec") - private java.lang.String audioCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("bitrate") - private java.lang.Double bitrate; - - @com.fasterxml.jackson.annotation.JsonProperty("container") - private java.lang.String container; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("has64bitOffsets") - private java.lang.Boolean has64BitOffsets; - - @com.fasterxml.jackson.annotation.JsonProperty("height") - private java.lang.Double height; - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private java.lang.Double id; - - @com.fasterxml.jackson.annotation.JsonProperty("optimizedForStreaming") - private java.lang.Double optimizedForStreaming; - - @com.fasterxml.jackson.annotation.JsonProperty("Part") - private java.util.List part; - - @com.fasterxml.jackson.annotation.JsonProperty("videoCodec") - private java.lang.String videoCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("videoFrameRate") - private java.lang.String videoFrameRate; - - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") - private java.lang.String videoProfile; - - @com.fasterxml.jackson.annotation.JsonProperty("videoResolution") - private java.lang.Double videoResolution; - - @com.fasterxml.jackson.annotation.JsonProperty("width") - private java.lang.Double width; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Media build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Media buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer.Metadata.Media(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("aspectRatio") - private final java.lang.Double aspectRatio; - - @com.fasterxml.jackson.annotation.JsonProperty("audioChannels") - private final java.lang.Double audioChannels; - - @com.fasterxml.jackson.annotation.JsonProperty("audioCodec") - private final java.lang.String audioCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("bitrate") - private final java.lang.Double bitrate; - - @com.fasterxml.jackson.annotation.JsonProperty("container") - private final java.lang.String container; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private final java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("has64bitOffsets") - private final java.lang.Boolean has64BitOffsets; - - @com.fasterxml.jackson.annotation.JsonProperty("height") - private final java.lang.Double height; - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private final java.lang.Double id; - - @com.fasterxml.jackson.annotation.JsonProperty("optimizedForStreaming") - private final java.lang.Double optimizedForStreaming; - - @com.fasterxml.jackson.annotation.JsonProperty("Part") - private final java.util.List< - GetRecentlyAddedResponse.MediaContainer.Metadata.Media.Part - > part; - - @com.fasterxml.jackson.annotation.JsonProperty("videoCodec") - private final java.lang.String videoCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("videoFrameRate") - private final java.lang.String videoFrameRate; - - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") - private final java.lang.String videoProfile; - - @com.fasterxml.jackson.annotation.JsonProperty("videoResolution") - private final java.lang.Double videoResolution; - - @com.fasterxml.jackson.annotation.JsonProperty("width") - private final java.lang.Double width; - - Media(Builder builder) { - super(builder); - this.aspectRatio = builder.getAspectRatio(); - this.audioChannels = builder.getAudioChannels(); - this.audioCodec = builder.getAudioCodec(); - this.bitrate = builder.getBitrate(); - this.container = builder.getContainer(); - this.duration = builder.getDuration(); - this.has64BitOffsets = builder.getHas64BitOffsets(); - this.height = builder.getHeight(); - this.id = builder.getId(); - this.optimizedForStreaming = builder.getOptimizedForStreaming(); - this.part = builder.getPart(); - this.videoCodec = builder.getVideoCodec(); - this.videoFrameRate = builder.getVideoFrameRate(); - this.videoProfile = builder.getVideoProfile(); - this.videoResolution = builder.getVideoResolution(); - this.width = builder.getWidth(); - } - } - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetRecentlyAddedResponse.MediaContainer.Metadata.Genre.Builder.class - ) - public static class Genre extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Genre build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Genre buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer.Metadata.Genre(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private final java.lang.String tag; - - Genre(Builder builder) { - super(builder); - this.tag = builder.getTag(); - } - } - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetRecentlyAddedResponse.MediaContainer.Metadata.Director.Builder.class - ) - public static class Director extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Director build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Director buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer.Metadata.Director(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private final java.lang.String tag; - - Director(Builder builder) { - super(builder); - this.tag = builder.getTag(); - } - } - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetRecentlyAddedResponse.MediaContainer.Metadata.Writer.Builder.class - ) - public static class Writer extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Writer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Writer buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer.Metadata.Writer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private final java.lang.String tag; - - Writer(Builder builder) { - super(builder); - this.tag = builder.getTag(); - } - } - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetRecentlyAddedResponse.MediaContainer.Metadata.Country.Builder.class - ) - public static class Country extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Country build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Country buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer.Metadata.Country(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private final java.lang.String tag; - - Country(Builder builder) { - super(builder); - this.tag = builder.getTag(); - } - } - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetRecentlyAddedResponse.MediaContainer.Metadata.Role.Builder.class - ) - public static class Role extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Role build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata.Role buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer.Metadata.Role(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private final java.lang.String tag; - - Role(Builder builder) { - super(builder); - this.tag = builder.getTag(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("addedAt") - private java.lang.Double addedAt; - - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") - private java.lang.Boolean allowSync; - - @com.fasterxml.jackson.annotation.JsonProperty("art") - private java.lang.String art; - - @com.fasterxml.jackson.annotation.JsonProperty("audienceRating") - private java.lang.Double audienceRating; - - @com.fasterxml.jackson.annotation.JsonProperty("audienceRatingImage") - private java.lang.String audienceRatingImage; - - @com.fasterxml.jackson.annotation.JsonProperty("chapterSource") - private java.lang.String chapterSource; - - @com.fasterxml.jackson.annotation.JsonProperty("contentRating") - private java.lang.String contentRating; - - @com.fasterxml.jackson.annotation.JsonProperty("Country") - private java.util.List country; - - @com.fasterxml.jackson.annotation.JsonProperty("Director") - private java.util.List director; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("Genre") - private java.util.List genre; - - @com.fasterxml.jackson.annotation.JsonProperty("guid") - private java.lang.String guid; - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionID") - private java.lang.Double librarySectionId; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionTitle") - private java.lang.String librarySectionTitle; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionUUID") - private java.lang.String librarySectionUuid; - - @com.fasterxml.jackson.annotation.JsonProperty("Media") - private java.util.List media; - - @com.fasterxml.jackson.annotation.JsonProperty("originallyAvailableAt") - private java.lang.String originallyAvailableAt; - - @com.fasterxml.jackson.annotation.JsonProperty("primaryExtraKey") - private java.lang.String primaryExtraKey; - - @com.fasterxml.jackson.annotation.JsonProperty("rating") - private java.lang.Double rating; - - @com.fasterxml.jackson.annotation.JsonProperty("ratingImage") - private java.lang.String ratingImage; - - @com.fasterxml.jackson.annotation.JsonProperty("ratingKey") - private java.lang.Double ratingKey; - - @com.fasterxml.jackson.annotation.JsonProperty("Role") - private java.util.List role; - - @com.fasterxml.jackson.annotation.JsonProperty("studio") - private java.lang.String studio; - - @com.fasterxml.jackson.annotation.JsonProperty("summary") - private java.lang.String summary; - - @com.fasterxml.jackson.annotation.JsonProperty("tagline") - private java.lang.String tagline; - - @com.fasterxml.jackson.annotation.JsonProperty("thumb") - private java.lang.String thumb; - - @com.fasterxml.jackson.annotation.JsonProperty("title") - private java.lang.String title; - - @com.fasterxml.jackson.annotation.JsonProperty("type") - private java.lang.String type; - - @com.fasterxml.jackson.annotation.JsonProperty("updatedAt") - private java.lang.Double updatedAt; - - @com.fasterxml.jackson.annotation.JsonProperty("Writer") - private java.util.List writer; - - @com.fasterxml.jackson.annotation.JsonProperty("year") - private java.lang.Double year; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer.Metadata buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer.Metadata(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("addedAt") - private final java.lang.Double addedAt; - - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") - private final java.lang.Boolean allowSync; - - @com.fasterxml.jackson.annotation.JsonProperty("art") - private final java.lang.String art; - - @com.fasterxml.jackson.annotation.JsonProperty("audienceRating") - private final java.lang.Double audienceRating; - - @com.fasterxml.jackson.annotation.JsonProperty("audienceRatingImage") - private final java.lang.String audienceRatingImage; - - @com.fasterxml.jackson.annotation.JsonProperty("chapterSource") - private final java.lang.String chapterSource; - - @com.fasterxml.jackson.annotation.JsonProperty("contentRating") - private final java.lang.String contentRating; - - @com.fasterxml.jackson.annotation.JsonProperty("Country") - private final java.util.List< - GetRecentlyAddedResponse.MediaContainer.Metadata.Country - > country; - - @com.fasterxml.jackson.annotation.JsonProperty("Director") - private final java.util.List< - GetRecentlyAddedResponse.MediaContainer.Metadata.Director - > director; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private final java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("Genre") - private final java.util.List genre; - - @com.fasterxml.jackson.annotation.JsonProperty("guid") - private final java.lang.String guid; - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private final java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionID") - private final java.lang.Double librarySectionId; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionTitle") - private final java.lang.String librarySectionTitle; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionUUID") - private final java.lang.String librarySectionUuid; - - @com.fasterxml.jackson.annotation.JsonProperty("Media") - private final java.util.List media; - - @com.fasterxml.jackson.annotation.JsonProperty("originallyAvailableAt") - private final java.lang.String originallyAvailableAt; - - @com.fasterxml.jackson.annotation.JsonProperty("primaryExtraKey") - private final java.lang.String primaryExtraKey; - - @com.fasterxml.jackson.annotation.JsonProperty("rating") - private final java.lang.Double rating; - - @com.fasterxml.jackson.annotation.JsonProperty("ratingImage") - private final java.lang.String ratingImage; - - @com.fasterxml.jackson.annotation.JsonProperty("ratingKey") - private final java.lang.Double ratingKey; - - @com.fasterxml.jackson.annotation.JsonProperty("Role") - private final java.util.List role; - - @com.fasterxml.jackson.annotation.JsonProperty("studio") - private final java.lang.String studio; - - @com.fasterxml.jackson.annotation.JsonProperty("summary") - private final java.lang.String summary; - - @com.fasterxml.jackson.annotation.JsonProperty("tagline") - private final java.lang.String tagline; - - @com.fasterxml.jackson.annotation.JsonProperty("thumb") - private final java.lang.String thumb; - - @com.fasterxml.jackson.annotation.JsonProperty("title") - private final java.lang.String title; - - @com.fasterxml.jackson.annotation.JsonProperty("type") - private final java.lang.String type; - - @com.fasterxml.jackson.annotation.JsonProperty("updatedAt") - private final java.lang.Double updatedAt; - - @com.fasterxml.jackson.annotation.JsonProperty("Writer") - private final java.util.List writer; - - @com.fasterxml.jackson.annotation.JsonProperty("year") - private final java.lang.Double year; - - Metadata(Builder builder) { - super(builder); - this.addedAt = builder.getAddedAt(); - this.allowSync = builder.getAllowSync(); - this.art = builder.getArt(); - this.audienceRating = builder.getAudienceRating(); - this.audienceRatingImage = builder.getAudienceRatingImage(); - this.chapterSource = builder.getChapterSource(); - this.contentRating = builder.getContentRating(); - this.country = builder.getCountry(); - this.director = builder.getDirector(); - this.duration = builder.getDuration(); - this.genre = builder.getGenre(); - this.guid = builder.getGuid(); - this.key = builder.getKey(); - this.librarySectionId = builder.getLibrarySectionId(); - this.librarySectionTitle = builder.getLibrarySectionTitle(); - this.librarySectionUuid = builder.getLibrarySectionUuid(); - this.media = builder.getMedia(); - this.originallyAvailableAt = builder.getOriginallyAvailableAt(); - this.primaryExtraKey = builder.getPrimaryExtraKey(); - this.rating = builder.getRating(); - this.ratingImage = builder.getRatingImage(); - this.ratingKey = builder.getRatingKey(); - this.role = builder.getRole(); - this.studio = builder.getStudio(); - this.summary = builder.getSummary(); - this.tagline = builder.getTagline(); - this.thumb = builder.getThumb(); - this.title = builder.getTitle(); - this.type = builder.getType(); - this.updatedAt = builder.getUpdatedAt(); - this.writer = builder.getWriter(); - this.year = builder.getYear(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") - private java.lang.Boolean allowSync; - - @com.fasterxml.jackson.annotation.JsonProperty("identifier") - private java.lang.String identifier; - - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagPrefix") - private java.lang.String mediaTagPrefix; - - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagVersion") - private java.lang.Double mediaTagVersion; - - @com.fasterxml.jackson.annotation.JsonProperty("Metadata") - private java.util.List metadata; - - @com.fasterxml.jackson.annotation.JsonProperty("mixedParents") - private java.lang.Boolean mixedParents; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private java.lang.Double size; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse.MediaContainer buildWithoutValidation() { - return new GetRecentlyAddedResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") - private final java.lang.Boolean allowSync; - - @com.fasterxml.jackson.annotation.JsonProperty("identifier") - private final java.lang.String identifier; - - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagPrefix") - private final java.lang.String mediaTagPrefix; - - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagVersion") - private final java.lang.Double mediaTagVersion; - - @com.fasterxml.jackson.annotation.JsonProperty("Metadata") - private final java.util.List metadata; - - @com.fasterxml.jackson.annotation.JsonProperty("mixedParents") - private final java.lang.Boolean mixedParents; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private final java.lang.Double size; - - MediaContainer(Builder builder) { - super(builder); - this.allowSync = builder.getAllowSync(); - this.identifier = builder.getIdentifier(); - this.mediaTagPrefix = builder.getMediaTagPrefix(); - this.mediaTagVersion = builder.getMediaTagVersion(); - this.metadata = builder.getMetadata(); - this.mixedParents = builder.getMixedParents(); - this.size = builder.getSize(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private GetRecentlyAddedResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetRecentlyAddedResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetRecentlyAddedResponse buildWithoutValidation() { - return new GetRecentlyAddedResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .stream(this.getClass().getDeclaredFields()) - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private final GetRecentlyAddedResponse.MediaContainer mediaContainer; - - GetRecentlyAddedResponse(Builder builder) { - super(builder); - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/com/plexsdk/models/GetSearchResultsResponse.java b/src/main/java/com/plexsdk/models/GetSearchResultsResponse.java deleted file mode 100644 index 08c31ba6..00000000 --- a/src/main/java/com/plexsdk/models/GetSearchResultsResponse.java +++ /dev/null @@ -1,1530 +0,0 @@ -package com.plexsdk.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL -) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetSearchResultsResponse.Builder.class -) -public class GetSearchResultsResponse extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetSearchResultsResponse.MediaContainer.Builder.class - ) - public static class MediaContainer extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetSearchResultsResponse.MediaContainer.Metadata.Builder.class - ) - public static class Metadata extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetSearchResultsResponse.MediaContainer.Metadata.Media.Builder.class - ) - public static class Media extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetSearchResultsResponse.MediaContainer.Metadata.Media.Part.Builder.class - ) - public static class Part extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("audioProfile") - private java.lang.String audioProfile; - - @com.fasterxml.jackson.annotation.JsonProperty("container") - private java.lang.String container; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("file") - private java.lang.String file; - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private java.lang.Double id; - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private java.lang.Double size; - - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") - private java.lang.String videoProfile; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Media.Part build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Media.Part buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Metadata.Media.Part(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("audioProfile") - private final java.lang.String audioProfile; - - @com.fasterxml.jackson.annotation.JsonProperty("container") - private final java.lang.String container; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private final java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("file") - private final java.lang.String file; - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private final java.lang.Double id; - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private final java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private final java.lang.Double size; - - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") - private final java.lang.String videoProfile; - - Part(Builder builder) { - super(builder); - this.audioProfile = builder.getAudioProfile(); - this.container = builder.getContainer(); - this.duration = builder.getDuration(); - this.file = builder.getFile(); - this.id = builder.getId(); - this.key = builder.getKey(); - this.size = builder.getSize(); - this.videoProfile = builder.getVideoProfile(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("aspectRatio") - private java.lang.Double aspectRatio; - - @com.fasterxml.jackson.annotation.JsonProperty("audioChannels") - private java.lang.Double audioChannels; - - @com.fasterxml.jackson.annotation.JsonProperty("audioCodec") - private java.lang.String audioCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("audioProfile") - private java.lang.String audioProfile; - - @com.fasterxml.jackson.annotation.JsonProperty("bitrate") - private java.lang.Double bitrate; - - @com.fasterxml.jackson.annotation.JsonProperty("container") - private java.lang.String container; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("height") - private java.lang.Double height; - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private java.lang.Double id; - - @com.fasterxml.jackson.annotation.JsonProperty("Part") - private java.util.List part; - - @com.fasterxml.jackson.annotation.JsonProperty("videoCodec") - private java.lang.String videoCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("videoFrameRate") - private java.lang.String videoFrameRate; - - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") - private java.lang.String videoProfile; - - @com.fasterxml.jackson.annotation.JsonProperty("videoResolution") - private java.lang.Double videoResolution; - - @com.fasterxml.jackson.annotation.JsonProperty("width") - private java.lang.Double width; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Media build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Media buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Metadata.Media(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("aspectRatio") - private final java.lang.Double aspectRatio; - - @com.fasterxml.jackson.annotation.JsonProperty("audioChannels") - private final java.lang.Double audioChannels; - - @com.fasterxml.jackson.annotation.JsonProperty("audioCodec") - private final java.lang.String audioCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("audioProfile") - private final java.lang.String audioProfile; - - @com.fasterxml.jackson.annotation.JsonProperty("bitrate") - private final java.lang.Double bitrate; - - @com.fasterxml.jackson.annotation.JsonProperty("container") - private final java.lang.String container; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private final java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("height") - private final java.lang.Double height; - - @com.fasterxml.jackson.annotation.JsonProperty("id") - private final java.lang.Double id; - - @com.fasterxml.jackson.annotation.JsonProperty("Part") - private final java.util.List< - GetSearchResultsResponse.MediaContainer.Metadata.Media.Part - > part; - - @com.fasterxml.jackson.annotation.JsonProperty("videoCodec") - private final java.lang.String videoCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("videoFrameRate") - private final java.lang.String videoFrameRate; - - @com.fasterxml.jackson.annotation.JsonProperty("videoProfile") - private final java.lang.String videoProfile; - - @com.fasterxml.jackson.annotation.JsonProperty("videoResolution") - private final java.lang.Double videoResolution; - - @com.fasterxml.jackson.annotation.JsonProperty("width") - private final java.lang.Double width; - - Media(Builder builder) { - super(builder); - this.aspectRatio = builder.getAspectRatio(); - this.audioChannels = builder.getAudioChannels(); - this.audioCodec = builder.getAudioCodec(); - this.audioProfile = builder.getAudioProfile(); - this.bitrate = builder.getBitrate(); - this.container = builder.getContainer(); - this.duration = builder.getDuration(); - this.height = builder.getHeight(); - this.id = builder.getId(); - this.part = builder.getPart(); - this.videoCodec = builder.getVideoCodec(); - this.videoFrameRate = builder.getVideoFrameRate(); - this.videoProfile = builder.getVideoProfile(); - this.videoResolution = builder.getVideoResolution(); - this.width = builder.getWidth(); - } - } - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetSearchResultsResponse.MediaContainer.Metadata.Genre.Builder.class - ) - public static class Genre extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Genre build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Genre buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Metadata.Genre(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private final java.lang.String tag; - - Genre(Builder builder) { - super(builder); - this.tag = builder.getTag(); - } - } - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetSearchResultsResponse.MediaContainer.Metadata.Director.Builder.class - ) - public static class Director extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Director build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Director buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Metadata.Director(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private final java.lang.String tag; - - Director(Builder builder) { - super(builder); - this.tag = builder.getTag(); - } - } - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetSearchResultsResponse.MediaContainer.Metadata.Writer.Builder.class - ) - public static class Writer extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Writer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Writer buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Metadata.Writer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private final java.lang.String tag; - - Writer(Builder builder) { - super(builder); - this.tag = builder.getTag(); - } - } - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetSearchResultsResponse.MediaContainer.Metadata.Country.Builder.class - ) - public static class Country extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Country build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Country buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Metadata.Country(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private final java.lang.String tag; - - Country(Builder builder) { - super(builder); - this.tag = builder.getTag(); - } - } - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetSearchResultsResponse.MediaContainer.Metadata.Role.Builder.class - ) - public static class Role extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private java.lang.String tag; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Role build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Metadata.Role buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Metadata.Role(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("tag") - private final java.lang.String tag; - - Role(Builder builder) { - super(builder); - this.tag = builder.getTag(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("addedAt") - private java.lang.Double addedAt; - - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") - private java.lang.Boolean allowSync; - - @com.fasterxml.jackson.annotation.JsonProperty("art") - private java.lang.String art; - - @com.fasterxml.jackson.annotation.JsonProperty("audienceRating") - private java.lang.Double audienceRating; - - @com.fasterxml.jackson.annotation.JsonProperty("audienceRatingImage") - private java.lang.String audienceRatingImage; - - @com.fasterxml.jackson.annotation.JsonProperty("chapterSource") - private java.lang.String chapterSource; - - @com.fasterxml.jackson.annotation.JsonProperty("contentRating") - private java.lang.String contentRating; - - @com.fasterxml.jackson.annotation.JsonProperty("Country") - private java.util.List country; - - @com.fasterxml.jackson.annotation.JsonProperty("Director") - private java.util.List director; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("Genre") - private java.util.List genre; - - @com.fasterxml.jackson.annotation.JsonProperty("guid") - private java.lang.String guid; - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionID") - private java.lang.Double librarySectionId; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionTitle") - private java.lang.String librarySectionTitle; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionUUID") - private java.lang.String librarySectionUuid; - - @com.fasterxml.jackson.annotation.JsonProperty("Media") - private java.util.List media; - - @com.fasterxml.jackson.annotation.JsonProperty("originallyAvailableAt") - private java.lang.String originallyAvailableAt; - - @com.fasterxml.jackson.annotation.JsonProperty("personal") - private java.lang.Boolean personal; - - @com.fasterxml.jackson.annotation.JsonProperty("primaryExtraKey") - private java.lang.String primaryExtraKey; - - @com.fasterxml.jackson.annotation.JsonProperty("rating") - private java.lang.Double rating; - - @com.fasterxml.jackson.annotation.JsonProperty("ratingImage") - private java.lang.String ratingImage; - - @com.fasterxml.jackson.annotation.JsonProperty("ratingKey") - private java.lang.Double ratingKey; - - @com.fasterxml.jackson.annotation.JsonProperty("Role") - private java.util.List role; - - @com.fasterxml.jackson.annotation.JsonProperty("sourceTitle") - private java.lang.String sourceTitle; - - @com.fasterxml.jackson.annotation.JsonProperty("studio") - private java.lang.String studio; - - @com.fasterxml.jackson.annotation.JsonProperty("summary") - private java.lang.String summary; - - @com.fasterxml.jackson.annotation.JsonProperty("tagline") - private java.lang.String tagline; - - @com.fasterxml.jackson.annotation.JsonProperty("thumb") - private java.lang.String thumb; - - @com.fasterxml.jackson.annotation.JsonProperty("title") - private java.lang.String title; - - @com.fasterxml.jackson.annotation.JsonProperty("type") - private java.lang.String type; - - @com.fasterxml.jackson.annotation.JsonProperty("updatedAt") - private java.lang.Double updatedAt; - - @com.fasterxml.jackson.annotation.JsonProperty("Writer") - private java.util.List writer; - - @com.fasterxml.jackson.annotation.JsonProperty("year") - private java.lang.Double year; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Metadata build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Metadata buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Metadata(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("addedAt") - private final java.lang.Double addedAt; - - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") - private final java.lang.Boolean allowSync; - - @com.fasterxml.jackson.annotation.JsonProperty("art") - private final java.lang.String art; - - @com.fasterxml.jackson.annotation.JsonProperty("audienceRating") - private final java.lang.Double audienceRating; - - @com.fasterxml.jackson.annotation.JsonProperty("audienceRatingImage") - private final java.lang.String audienceRatingImage; - - @com.fasterxml.jackson.annotation.JsonProperty("chapterSource") - private final java.lang.String chapterSource; - - @com.fasterxml.jackson.annotation.JsonProperty("contentRating") - private final java.lang.String contentRating; - - @com.fasterxml.jackson.annotation.JsonProperty("Country") - private final java.util.List< - GetSearchResultsResponse.MediaContainer.Metadata.Country - > country; - - @com.fasterxml.jackson.annotation.JsonProperty("Director") - private final java.util.List< - GetSearchResultsResponse.MediaContainer.Metadata.Director - > director; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private final java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("Genre") - private final java.util.List genre; - - @com.fasterxml.jackson.annotation.JsonProperty("guid") - private final java.lang.String guid; - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private final java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionID") - private final java.lang.Double librarySectionId; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionTitle") - private final java.lang.String librarySectionTitle; - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionUUID") - private final java.lang.String librarySectionUuid; - - @com.fasterxml.jackson.annotation.JsonProperty("Media") - private final java.util.List media; - - @com.fasterxml.jackson.annotation.JsonProperty("originallyAvailableAt") - private final java.lang.String originallyAvailableAt; - - @com.fasterxml.jackson.annotation.JsonProperty("personal") - private final java.lang.Boolean personal; - - @com.fasterxml.jackson.annotation.JsonProperty("primaryExtraKey") - private final java.lang.String primaryExtraKey; - - @com.fasterxml.jackson.annotation.JsonProperty("rating") - private final java.lang.Double rating; - - @com.fasterxml.jackson.annotation.JsonProperty("ratingImage") - private final java.lang.String ratingImage; - - @com.fasterxml.jackson.annotation.JsonProperty("ratingKey") - private final java.lang.Double ratingKey; - - @com.fasterxml.jackson.annotation.JsonProperty("Role") - private final java.util.List role; - - @com.fasterxml.jackson.annotation.JsonProperty("sourceTitle") - private final java.lang.String sourceTitle; - - @com.fasterxml.jackson.annotation.JsonProperty("studio") - private final java.lang.String studio; - - @com.fasterxml.jackson.annotation.JsonProperty("summary") - private final java.lang.String summary; - - @com.fasterxml.jackson.annotation.JsonProperty("tagline") - private final java.lang.String tagline; - - @com.fasterxml.jackson.annotation.JsonProperty("thumb") - private final java.lang.String thumb; - - @com.fasterxml.jackson.annotation.JsonProperty("title") - private final java.lang.String title; - - @com.fasterxml.jackson.annotation.JsonProperty("type") - private final java.lang.String type; - - @com.fasterxml.jackson.annotation.JsonProperty("updatedAt") - private final java.lang.Double updatedAt; - - @com.fasterxml.jackson.annotation.JsonProperty("Writer") - private final java.util.List writer; - - @com.fasterxml.jackson.annotation.JsonProperty("year") - private final java.lang.Double year; - - Metadata(Builder builder) { - super(builder); - this.addedAt = builder.getAddedAt(); - this.allowSync = builder.getAllowSync(); - this.art = builder.getArt(); - this.audienceRating = builder.getAudienceRating(); - this.audienceRatingImage = builder.getAudienceRatingImage(); - this.chapterSource = builder.getChapterSource(); - this.contentRating = builder.getContentRating(); - this.country = builder.getCountry(); - this.director = builder.getDirector(); - this.duration = builder.getDuration(); - this.genre = builder.getGenre(); - this.guid = builder.getGuid(); - this.key = builder.getKey(); - this.librarySectionId = builder.getLibrarySectionId(); - this.librarySectionTitle = builder.getLibrarySectionTitle(); - this.librarySectionUuid = builder.getLibrarySectionUuid(); - this.media = builder.getMedia(); - this.originallyAvailableAt = builder.getOriginallyAvailableAt(); - this.personal = builder.getPersonal(); - this.primaryExtraKey = builder.getPrimaryExtraKey(); - this.rating = builder.getRating(); - this.ratingImage = builder.getRatingImage(); - this.ratingKey = builder.getRatingKey(); - this.role = builder.getRole(); - this.sourceTitle = builder.getSourceTitle(); - this.studio = builder.getStudio(); - this.summary = builder.getSummary(); - this.tagline = builder.getTagline(); - this.thumb = builder.getThumb(); - this.title = builder.getTitle(); - this.type = builder.getType(); - this.updatedAt = builder.getUpdatedAt(); - this.writer = builder.getWriter(); - this.year = builder.getYear(); - } - } - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetSearchResultsResponse.MediaContainer.Provider.Builder.class - ) - public static class Provider extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("title") - private java.lang.String title; - - @com.fasterxml.jackson.annotation.JsonProperty("type") - private java.lang.String type; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer.Provider build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer.Provider buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer.Provider(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private final java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("title") - private final java.lang.String title; - - @com.fasterxml.jackson.annotation.JsonProperty("type") - private final java.lang.String type; - - Provider(Builder builder) { - super(builder); - this.key = builder.getKey(); - this.title = builder.getTitle(); - this.type = builder.getType(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("identifier") - private java.lang.String identifier; - - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagPrefix") - private java.lang.String mediaTagPrefix; - - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagVersion") - private java.lang.Double mediaTagVersion; - - @com.fasterxml.jackson.annotation.JsonProperty("Metadata") - private java.util.List metadata; - - @com.fasterxml.jackson.annotation.JsonProperty("Provider") - private java.util.List provider; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private java.lang.Double size; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse.MediaContainer buildWithoutValidation() { - return new GetSearchResultsResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("identifier") - private final java.lang.String identifier; - - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagPrefix") - private final java.lang.String mediaTagPrefix; - - @com.fasterxml.jackson.annotation.JsonProperty("mediaTagVersion") - private final java.lang.Double mediaTagVersion; - - @com.fasterxml.jackson.annotation.JsonProperty("Metadata") - private final java.util.List metadata; - - @com.fasterxml.jackson.annotation.JsonProperty("Provider") - private final java.util.List provider; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private final java.lang.Double size; - - MediaContainer(Builder builder) { - super(builder); - this.identifier = builder.getIdentifier(); - this.mediaTagPrefix = builder.getMediaTagPrefix(); - this.mediaTagVersion = builder.getMediaTagVersion(); - this.metadata = builder.getMetadata(); - this.provider = builder.getProvider(); - this.size = builder.getSize(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private GetSearchResultsResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetSearchResultsResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetSearchResultsResponse buildWithoutValidation() { - return new GetSearchResultsResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .stream(this.getClass().getDeclaredFields()) - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private final GetSearchResultsResponse.MediaContainer mediaContainer; - - GetSearchResultsResponse(Builder builder) { - super(builder); - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/com/plexsdk/models/GetServerActivitiesResponse.java b/src/main/java/com/plexsdk/models/GetServerActivitiesResponse.java deleted file mode 100644 index 17ee0d43..00000000 --- a/src/main/java/com/plexsdk/models/GetServerActivitiesResponse.java +++ /dev/null @@ -1,453 +0,0 @@ -package com.plexsdk.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL -) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetServerActivitiesResponse.Builder.class -) -public class GetServerActivitiesResponse extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetServerActivitiesResponse.MediaContainer.Builder.class - ) - public static class MediaContainer extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetServerActivitiesResponse.MediaContainer.Activity.Builder.class - ) - public static class Activity extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetServerActivitiesResponse.MediaContainer.Activity.Context.Builder.class - ) - public static class Context extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionID") - private java.lang.String librarySectionId; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerActivitiesResponse.MediaContainer.Activity.Context build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerActivitiesResponse.MediaContainer.Activity.Context buildWithoutValidation() { - return new GetServerActivitiesResponse.MediaContainer.Activity.Context(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("librarySectionID") - private final java.lang.String librarySectionId; - - Context(Builder builder) { - super(builder); - this.librarySectionId = builder.getLibrarySectionId(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("cancellable") - private java.lang.Boolean cancellable; - - @com.fasterxml.jackson.annotation.JsonProperty("Context") - private GetServerActivitiesResponse.MediaContainer.Activity.Context context; - - @com.fasterxml.jackson.annotation.JsonProperty("progress") - private java.lang.Double progress; - - @com.fasterxml.jackson.annotation.JsonProperty("subtitle") - private java.lang.String subtitle; - - @com.fasterxml.jackson.annotation.JsonProperty("title") - private java.lang.String title; - - @com.fasterxml.jackson.annotation.JsonProperty("type") - private java.lang.String type; - - @com.fasterxml.jackson.annotation.JsonProperty("userID") - private java.lang.Double userId; - - @com.fasterxml.jackson.annotation.JsonProperty("uuid") - private java.lang.String uuid; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerActivitiesResponse.MediaContainer.Activity build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerActivitiesResponse.MediaContainer.Activity buildWithoutValidation() { - return new GetServerActivitiesResponse.MediaContainer.Activity(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("cancellable") - private final java.lang.Boolean cancellable; - - @com.fasterxml.jackson.annotation.JsonProperty("Context") - private final GetServerActivitiesResponse.MediaContainer.Activity.Context context; - - @com.fasterxml.jackson.annotation.JsonProperty("progress") - private final java.lang.Double progress; - - @com.fasterxml.jackson.annotation.JsonProperty("subtitle") - private final java.lang.String subtitle; - - @com.fasterxml.jackson.annotation.JsonProperty("title") - private final java.lang.String title; - - @com.fasterxml.jackson.annotation.JsonProperty("type") - private final java.lang.String type; - - @com.fasterxml.jackson.annotation.JsonProperty("userID") - private final java.lang.Double userId; - - @com.fasterxml.jackson.annotation.JsonProperty("uuid") - private final java.lang.String uuid; - - Activity(Builder builder) { - super(builder); - this.cancellable = builder.getCancellable(); - this.context = builder.getContext(); - this.progress = builder.getProgress(); - this.subtitle = builder.getSubtitle(); - this.title = builder.getTitle(); - this.type = builder.getType(); - this.userId = builder.getUserId(); - this.uuid = builder.getUuid(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("Activity") - private java.util.List activity; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private java.lang.Double size; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerActivitiesResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerActivitiesResponse.MediaContainer buildWithoutValidation() { - return new GetServerActivitiesResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("Activity") - private final java.util.List activity; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private final java.lang.Double size; - - MediaContainer(Builder builder) { - super(builder); - this.activity = builder.getActivity(); - this.size = builder.getSize(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private GetServerActivitiesResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerActivitiesResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerActivitiesResponse buildWithoutValidation() { - return new GetServerActivitiesResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .stream(this.getClass().getDeclaredFields()) - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private final GetServerActivitiesResponse.MediaContainer mediaContainer; - - GetServerActivitiesResponse(Builder builder) { - super(builder); - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/com/plexsdk/models/GetServerCapabilitiesResponse.java b/src/main/java/com/plexsdk/models/GetServerCapabilitiesResponse.java deleted file mode 100644 index 9856170c..00000000 --- a/src/main/java/com/plexsdk/models/GetServerCapabilitiesResponse.java +++ /dev/null @@ -1,661 +0,0 @@ -package com.plexsdk.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL -) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetServerCapabilitiesResponse.Builder.class -) -public class GetServerCapabilitiesResponse extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetServerCapabilitiesResponse.MediaContainer.Builder.class - ) - public static class MediaContainer extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetServerCapabilitiesResponse.MediaContainer.Directory.Builder.class - ) - public static class Directory extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("count") - private java.lang.Double count; - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("title") - private java.lang.String title; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerCapabilitiesResponse.MediaContainer.Directory build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerCapabilitiesResponse.MediaContainer.Directory buildWithoutValidation() { - return new GetServerCapabilitiesResponse.MediaContainer.Directory(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("count") - private final java.lang.Double count; - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private final java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("title") - private final java.lang.String title; - - Directory(Builder builder) { - super(builder); - this.count = builder.getCount(); - this.key = builder.getKey(); - this.title = builder.getTitle(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("allowCameraUpload") - private java.lang.Boolean allowCameraUpload; - - @com.fasterxml.jackson.annotation.JsonProperty("allowChannelAccess") - private java.lang.Boolean allowChannelAccess; - - @com.fasterxml.jackson.annotation.JsonProperty("allowMediaDeletion") - private java.lang.Boolean allowMediaDeletion; - - @com.fasterxml.jackson.annotation.JsonProperty("allowSharing") - private java.lang.Boolean allowSharing; - - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") - private java.lang.Boolean allowSync; - - @com.fasterxml.jackson.annotation.JsonProperty("allowTuners") - private java.lang.Boolean allowTuners; - - @com.fasterxml.jackson.annotation.JsonProperty("backgroundProcessing") - private java.lang.Boolean backgroundProcessing; - - @com.fasterxml.jackson.annotation.JsonProperty("certificate") - private java.lang.Boolean certificate; - - @com.fasterxml.jackson.annotation.JsonProperty("companionProxy") - private java.lang.Boolean companionProxy; - - @com.fasterxml.jackson.annotation.JsonProperty("countryCode") - private java.lang.String countryCode; - - @com.fasterxml.jackson.annotation.JsonProperty("diagnostics") - private java.lang.String diagnostics; - - @com.fasterxml.jackson.annotation.JsonProperty("Directory") - private java.util.List directory; - - @com.fasterxml.jackson.annotation.JsonProperty("eventStream") - private java.lang.Boolean eventStream; - - @com.fasterxml.jackson.annotation.JsonProperty("friendlyName") - private java.lang.String friendlyName; - - @com.fasterxml.jackson.annotation.JsonProperty("hubSearch") - private java.lang.Boolean hubSearch; - - @com.fasterxml.jackson.annotation.JsonProperty("itemClusters") - private java.lang.Boolean itemClusters; - - @com.fasterxml.jackson.annotation.JsonProperty("livetv") - private java.lang.Double livetv; - - @com.fasterxml.jackson.annotation.JsonProperty("machineIdentifier") - private java.lang.String machineIdentifier; - - @com.fasterxml.jackson.annotation.JsonProperty("mediaProviders") - private java.lang.Boolean mediaProviders; - - @com.fasterxml.jackson.annotation.JsonProperty("multiuser") - private java.lang.Boolean multiuser; - - @com.fasterxml.jackson.annotation.JsonProperty("musicAnalysis") - private java.lang.Double musicAnalysis; - - @com.fasterxml.jackson.annotation.JsonProperty("myPlex") - private java.lang.Boolean myPlex; - - @com.fasterxml.jackson.annotation.JsonProperty("myPlexMappingState") - private java.lang.String myPlexMappingState; - - @com.fasterxml.jackson.annotation.JsonProperty("myPlexSigninState") - private java.lang.String myPlexSigninState; - - @com.fasterxml.jackson.annotation.JsonProperty("myPlexSubscription") - private java.lang.Boolean myPlexSubscription; - - @com.fasterxml.jackson.annotation.JsonProperty("myPlexUsername") - private java.lang.String myPlexUsername; - - @com.fasterxml.jackson.annotation.JsonProperty("offlineTranscode") - private java.lang.Double offlineTranscode; - - @com.fasterxml.jackson.annotation.JsonProperty("ownerFeatures") - private java.lang.String ownerFeatures; - - @com.fasterxml.jackson.annotation.JsonProperty("photoAutoTag") - private java.lang.Boolean photoAutoTag; - - @com.fasterxml.jackson.annotation.JsonProperty("platform") - private java.lang.String platform; - - @com.fasterxml.jackson.annotation.JsonProperty("platformVersion") - private java.lang.String platformVersion; - - @com.fasterxml.jackson.annotation.JsonProperty("pluginHost") - private java.lang.Boolean pluginHost; - - @com.fasterxml.jackson.annotation.JsonProperty("pushNotifications") - private java.lang.Boolean pushNotifications; - - @com.fasterxml.jackson.annotation.JsonProperty("readOnlyLibraries") - private java.lang.Boolean readOnlyLibraries; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private java.lang.Double size; - - @com.fasterxml.jackson.annotation.JsonProperty("streamingBrainABRVersion") - private java.lang.Double streamingBrainAbrversion; - - @com.fasterxml.jackson.annotation.JsonProperty("streamingBrainVersion") - private java.lang.Double streamingBrainVersion; - - @com.fasterxml.jackson.annotation.JsonProperty("sync") - private java.lang.Boolean sync; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderActiveVideoSessions") - private java.lang.Double transcoderActiveVideoSessions; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderAudio") - private java.lang.Boolean transcoderAudio; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderLyrics") - private java.lang.Boolean transcoderLyrics; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderPhoto") - private java.lang.Boolean transcoderPhoto; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderSubtitles") - private java.lang.Boolean transcoderSubtitles; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderVideo") - private java.lang.Boolean transcoderVideo; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderVideoBitrates") - private java.lang.String transcoderVideoBitrates; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderVideoQualities") - private java.lang.String transcoderVideoQualities; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderVideoResolutions") - private java.lang.String transcoderVideoResolutions; - - @com.fasterxml.jackson.annotation.JsonProperty("updatedAt") - private java.lang.Double updatedAt; - - @com.fasterxml.jackson.annotation.JsonProperty("updater") - private java.lang.Boolean updater; - - @com.fasterxml.jackson.annotation.JsonProperty("version") - private java.lang.String version; - - @com.fasterxml.jackson.annotation.JsonProperty("voiceSearch") - private java.lang.Boolean voiceSearch; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerCapabilitiesResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerCapabilitiesResponse.MediaContainer buildWithoutValidation() { - return new GetServerCapabilitiesResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("allowCameraUpload") - private final java.lang.Boolean allowCameraUpload; - - @com.fasterxml.jackson.annotation.JsonProperty("allowChannelAccess") - private final java.lang.Boolean allowChannelAccess; - - @com.fasterxml.jackson.annotation.JsonProperty("allowMediaDeletion") - private final java.lang.Boolean allowMediaDeletion; - - @com.fasterxml.jackson.annotation.JsonProperty("allowSharing") - private final java.lang.Boolean allowSharing; - - @com.fasterxml.jackson.annotation.JsonProperty("allowSync") - private final java.lang.Boolean allowSync; - - @com.fasterxml.jackson.annotation.JsonProperty("allowTuners") - private final java.lang.Boolean allowTuners; - - @com.fasterxml.jackson.annotation.JsonProperty("backgroundProcessing") - private final java.lang.Boolean backgroundProcessing; - - @com.fasterxml.jackson.annotation.JsonProperty("certificate") - private final java.lang.Boolean certificate; - - @com.fasterxml.jackson.annotation.JsonProperty("companionProxy") - private final java.lang.Boolean companionProxy; - - @com.fasterxml.jackson.annotation.JsonProperty("countryCode") - private final java.lang.String countryCode; - - @com.fasterxml.jackson.annotation.JsonProperty("diagnostics") - private final java.lang.String diagnostics; - - @com.fasterxml.jackson.annotation.JsonProperty("Directory") - private final java.util.List directory; - - @com.fasterxml.jackson.annotation.JsonProperty("eventStream") - private final java.lang.Boolean eventStream; - - @com.fasterxml.jackson.annotation.JsonProperty("friendlyName") - private final java.lang.String friendlyName; - - @com.fasterxml.jackson.annotation.JsonProperty("hubSearch") - private final java.lang.Boolean hubSearch; - - @com.fasterxml.jackson.annotation.JsonProperty("itemClusters") - private final java.lang.Boolean itemClusters; - - @com.fasterxml.jackson.annotation.JsonProperty("livetv") - private final java.lang.Double livetv; - - @com.fasterxml.jackson.annotation.JsonProperty("machineIdentifier") - private final java.lang.String machineIdentifier; - - @com.fasterxml.jackson.annotation.JsonProperty("mediaProviders") - private final java.lang.Boolean mediaProviders; - - @com.fasterxml.jackson.annotation.JsonProperty("multiuser") - private final java.lang.Boolean multiuser; - - @com.fasterxml.jackson.annotation.JsonProperty("musicAnalysis") - private final java.lang.Double musicAnalysis; - - @com.fasterxml.jackson.annotation.JsonProperty("myPlex") - private final java.lang.Boolean myPlex; - - @com.fasterxml.jackson.annotation.JsonProperty("myPlexMappingState") - private final java.lang.String myPlexMappingState; - - @com.fasterxml.jackson.annotation.JsonProperty("myPlexSigninState") - private final java.lang.String myPlexSigninState; - - @com.fasterxml.jackson.annotation.JsonProperty("myPlexSubscription") - private final java.lang.Boolean myPlexSubscription; - - @com.fasterxml.jackson.annotation.JsonProperty("myPlexUsername") - private final java.lang.String myPlexUsername; - - @com.fasterxml.jackson.annotation.JsonProperty("offlineTranscode") - private final java.lang.Double offlineTranscode; - - @com.fasterxml.jackson.annotation.JsonProperty("ownerFeatures") - private final java.lang.String ownerFeatures; - - @com.fasterxml.jackson.annotation.JsonProperty("photoAutoTag") - private final java.lang.Boolean photoAutoTag; - - @com.fasterxml.jackson.annotation.JsonProperty("platform") - private final java.lang.String platform; - - @com.fasterxml.jackson.annotation.JsonProperty("platformVersion") - private final java.lang.String platformVersion; - - @com.fasterxml.jackson.annotation.JsonProperty("pluginHost") - private final java.lang.Boolean pluginHost; - - @com.fasterxml.jackson.annotation.JsonProperty("pushNotifications") - private final java.lang.Boolean pushNotifications; - - @com.fasterxml.jackson.annotation.JsonProperty("readOnlyLibraries") - private final java.lang.Boolean readOnlyLibraries; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private final java.lang.Double size; - - @com.fasterxml.jackson.annotation.JsonProperty("streamingBrainABRVersion") - private final java.lang.Double streamingBrainAbrversion; - - @com.fasterxml.jackson.annotation.JsonProperty("streamingBrainVersion") - private final java.lang.Double streamingBrainVersion; - - @com.fasterxml.jackson.annotation.JsonProperty("sync") - private final java.lang.Boolean sync; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderActiveVideoSessions") - private final java.lang.Double transcoderActiveVideoSessions; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderAudio") - private final java.lang.Boolean transcoderAudio; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderLyrics") - private final java.lang.Boolean transcoderLyrics; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderPhoto") - private final java.lang.Boolean transcoderPhoto; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderSubtitles") - private final java.lang.Boolean transcoderSubtitles; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderVideo") - private final java.lang.Boolean transcoderVideo; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderVideoBitrates") - private final java.lang.String transcoderVideoBitrates; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderVideoQualities") - private final java.lang.String transcoderVideoQualities; - - @com.fasterxml.jackson.annotation.JsonProperty("transcoderVideoResolutions") - private final java.lang.String transcoderVideoResolutions; - - @com.fasterxml.jackson.annotation.JsonProperty("updatedAt") - private final java.lang.Double updatedAt; - - @com.fasterxml.jackson.annotation.JsonProperty("updater") - private final java.lang.Boolean updater; - - @com.fasterxml.jackson.annotation.JsonProperty("version") - private final java.lang.String version; - - @com.fasterxml.jackson.annotation.JsonProperty("voiceSearch") - private final java.lang.Boolean voiceSearch; - - MediaContainer(Builder builder) { - super(builder); - this.allowCameraUpload = builder.getAllowCameraUpload(); - this.allowChannelAccess = builder.getAllowChannelAccess(); - this.allowMediaDeletion = builder.getAllowMediaDeletion(); - this.allowSharing = builder.getAllowSharing(); - this.allowSync = builder.getAllowSync(); - this.allowTuners = builder.getAllowTuners(); - this.backgroundProcessing = builder.getBackgroundProcessing(); - this.certificate = builder.getCertificate(); - this.companionProxy = builder.getCompanionProxy(); - this.countryCode = builder.getCountryCode(); - this.diagnostics = builder.getDiagnostics(); - this.directory = builder.getDirectory(); - this.eventStream = builder.getEventStream(); - this.friendlyName = builder.getFriendlyName(); - this.hubSearch = builder.getHubSearch(); - this.itemClusters = builder.getItemClusters(); - this.livetv = builder.getLivetv(); - this.machineIdentifier = builder.getMachineIdentifier(); - this.mediaProviders = builder.getMediaProviders(); - this.multiuser = builder.getMultiuser(); - this.musicAnalysis = builder.getMusicAnalysis(); - this.myPlex = builder.getMyPlex(); - this.myPlexMappingState = builder.getMyPlexMappingState(); - this.myPlexSigninState = builder.getMyPlexSigninState(); - this.myPlexSubscription = builder.getMyPlexSubscription(); - this.myPlexUsername = builder.getMyPlexUsername(); - this.offlineTranscode = builder.getOfflineTranscode(); - this.ownerFeatures = builder.getOwnerFeatures(); - this.photoAutoTag = builder.getPhotoAutoTag(); - this.platform = builder.getPlatform(); - this.platformVersion = builder.getPlatformVersion(); - this.pluginHost = builder.getPluginHost(); - this.pushNotifications = builder.getPushNotifications(); - this.readOnlyLibraries = builder.getReadOnlyLibraries(); - this.size = builder.getSize(); - this.streamingBrainAbrversion = builder.getStreamingBrainAbrversion(); - this.streamingBrainVersion = builder.getStreamingBrainVersion(); - this.sync = builder.getSync(); - this.transcoderActiveVideoSessions = builder.getTranscoderActiveVideoSessions(); - this.transcoderAudio = builder.getTranscoderAudio(); - this.transcoderLyrics = builder.getTranscoderLyrics(); - this.transcoderPhoto = builder.getTranscoderPhoto(); - this.transcoderSubtitles = builder.getTranscoderSubtitles(); - this.transcoderVideo = builder.getTranscoderVideo(); - this.transcoderVideoBitrates = builder.getTranscoderVideoBitrates(); - this.transcoderVideoQualities = builder.getTranscoderVideoQualities(); - this.transcoderVideoResolutions = builder.getTranscoderVideoResolutions(); - this.updatedAt = builder.getUpdatedAt(); - this.updater = builder.getUpdater(); - this.version = builder.getVersion(); - this.voiceSearch = builder.getVoiceSearch(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private GetServerCapabilitiesResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerCapabilitiesResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerCapabilitiesResponse buildWithoutValidation() { - return new GetServerCapabilitiesResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .stream(this.getClass().getDeclaredFields()) - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private final GetServerCapabilitiesResponse.MediaContainer mediaContainer; - - GetServerCapabilitiesResponse(Builder builder) { - super(builder); - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/com/plexsdk/models/GetServerIdentityResponse.java b/src/main/java/com/plexsdk/models/GetServerIdentityResponse.java deleted file mode 100644 index 0cf63429..00000000 --- a/src/main/java/com/plexsdk/models/GetServerIdentityResponse.java +++ /dev/null @@ -1,218 +0,0 @@ -package com.plexsdk.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL -) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetServerIdentityResponse.Builder.class -) -public class GetServerIdentityResponse extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetServerIdentityResponse.MediaContainer.Builder.class - ) - public static class MediaContainer extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("claimed") - private java.lang.Boolean claimed; - - @com.fasterxml.jackson.annotation.JsonProperty("machineIdentifier") - private java.lang.String machineIdentifier; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private java.lang.Double size; - - @com.fasterxml.jackson.annotation.JsonProperty("version") - private java.lang.String version; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerIdentityResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerIdentityResponse.MediaContainer buildWithoutValidation() { - return new GetServerIdentityResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("claimed") - private final java.lang.Boolean claimed; - - @com.fasterxml.jackson.annotation.JsonProperty("machineIdentifier") - private final java.lang.String machineIdentifier; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private final java.lang.Double size; - - @com.fasterxml.jackson.annotation.JsonProperty("version") - private final java.lang.String version; - - MediaContainer(Builder builder) { - super(builder); - this.claimed = builder.getClaimed(); - this.machineIdentifier = builder.getMachineIdentifier(); - this.size = builder.getSize(); - this.version = builder.getVersion(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private GetServerIdentityResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerIdentityResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerIdentityResponse buildWithoutValidation() { - return new GetServerIdentityResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .stream(this.getClass().getDeclaredFields()) - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private final GetServerIdentityResponse.MediaContainer mediaContainer; - - GetServerIdentityResponse(Builder builder) { - super(builder); - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/com/plexsdk/models/GetServerListResponse.java b/src/main/java/com/plexsdk/models/GetServerListResponse.java deleted file mode 100644 index e1761f90..00000000 --- a/src/main/java/com/plexsdk/models/GetServerListResponse.java +++ /dev/null @@ -1,339 +0,0 @@ -package com.plexsdk.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL -) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetServerListResponse.Builder.class -) -public class GetServerListResponse extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetServerListResponse.MediaContainer.Builder.class - ) - public static class MediaContainer extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetServerListResponse.MediaContainer.Server.Builder.class - ) - public static class Server extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("address") - private java.lang.String address; - - @com.fasterxml.jackson.annotation.JsonProperty("host") - private java.lang.String host; - - @com.fasterxml.jackson.annotation.JsonProperty("machineIdentifier") - private java.lang.String machineIdentifier; - - @com.fasterxml.jackson.annotation.JsonProperty("name") - private java.lang.String name; - - @com.fasterxml.jackson.annotation.JsonProperty("port") - private java.lang.Double port; - - @com.fasterxml.jackson.annotation.JsonProperty("version") - private java.lang.String version; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerListResponse.MediaContainer.Server build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerListResponse.MediaContainer.Server buildWithoutValidation() { - return new GetServerListResponse.MediaContainer.Server(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("address") - private final java.lang.String address; - - @com.fasterxml.jackson.annotation.JsonProperty("host") - private final java.lang.String host; - - @com.fasterxml.jackson.annotation.JsonProperty("machineIdentifier") - private final java.lang.String machineIdentifier; - - @com.fasterxml.jackson.annotation.JsonProperty("name") - private final java.lang.String name; - - @com.fasterxml.jackson.annotation.JsonProperty("port") - private final java.lang.Double port; - - @com.fasterxml.jackson.annotation.JsonProperty("version") - private final java.lang.String version; - - Server(Builder builder) { - super(builder); - this.address = builder.getAddress(); - this.host = builder.getHost(); - this.machineIdentifier = builder.getMachineIdentifier(); - this.name = builder.getName(); - this.port = builder.getPort(); - this.version = builder.getVersion(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("Server") - private java.util.List server; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private java.lang.Double size; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerListResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerListResponse.MediaContainer buildWithoutValidation() { - return new GetServerListResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("Server") - private final java.util.List server; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private final java.lang.Double size; - - MediaContainer(Builder builder) { - super(builder); - this.server = builder.getServer(); - this.size = builder.getSize(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private GetServerListResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetServerListResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetServerListResponse buildWithoutValidation() { - return new GetServerListResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .stream(this.getClass().getDeclaredFields()) - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private final GetServerListResponse.MediaContainer mediaContainer; - - GetServerListResponse(Builder builder) { - super(builder); - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/com/plexsdk/models/GetTranscodeSessionsResponse.java b/src/main/java/com/plexsdk/models/GetTranscodeSessionsResponse.java deleted file mode 100644 index b9867990..00000000 --- a/src/main/java/com/plexsdk/models/GetTranscodeSessionsResponse.java +++ /dev/null @@ -1,455 +0,0 @@ -package com.plexsdk.models; - -@lombok.Getter -@lombok.EqualsAndHashCode(callSuper = false) -@lombok.ToString -@com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL -) -@com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetTranscodeSessionsResponse.Builder.class -) -public class GetTranscodeSessionsResponse extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetTranscodeSessionsResponse.MediaContainer.Builder.class - ) - public static class MediaContainer extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.EqualsAndHashCode(callSuper = false) - @lombok.ToString - @com.fasterxml.jackson.annotation.JsonInclude( - com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL - ) - @com.fasterxml.jackson.databind.annotation.JsonDeserialize( - builder = GetTranscodeSessionsResponse.MediaContainer.TranscodeSession.Builder.class - ) - public static class TranscodeSession extends com.plexsdk.models.BaseModel { - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("audioChannels") - private java.lang.Double audioChannels; - - @com.fasterxml.jackson.annotation.JsonProperty("audioCodec") - private java.lang.String audioCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("audioDecision") - private java.lang.String audioDecision; - - @com.fasterxml.jackson.annotation.JsonProperty("complete") - private java.lang.Boolean complete; - - @com.fasterxml.jackson.annotation.JsonProperty("container") - private java.lang.String container; - - @com.fasterxml.jackson.annotation.JsonProperty("context") - private java.lang.String context; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("error") - private java.lang.Boolean error; - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("maxOffsetAvailable") - private java.lang.Double maxOffsetAvailable; - - @com.fasterxml.jackson.annotation.JsonProperty("minOffsetAvailable") - private java.lang.Double minOffsetAvailable; - - @com.fasterxml.jackson.annotation.JsonProperty("progress") - private java.lang.Double progress; - - @com.fasterxml.jackson.annotation.JsonProperty("protocol") - private java.lang.String protocol; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private java.lang.Double size; - - @com.fasterxml.jackson.annotation.JsonProperty("sourceAudioCodec") - private java.lang.String sourceAudioCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("sourceVideoCodec") - private java.lang.String sourceVideoCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("speed") - private java.lang.Double speed; - - @com.fasterxml.jackson.annotation.JsonProperty("throttled") - private java.lang.Boolean throttled; - - @com.fasterxml.jackson.annotation.JsonProperty("timeStamp") - private java.lang.Double timeStamp; - - @com.fasterxml.jackson.annotation.JsonProperty("transcodeHwRequested") - private java.lang.Boolean transcodeHwRequested; - - @com.fasterxml.jackson.annotation.JsonProperty("videoCodec") - private java.lang.String videoCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("videoDecision") - private java.lang.String videoDecision; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetTranscodeSessionsResponse.MediaContainer.TranscodeSession build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetTranscodeSessionsResponse.MediaContainer.TranscodeSession buildWithoutValidation() { - return new GetTranscodeSessionsResponse.MediaContainer.TranscodeSession(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("audioChannels") - private final java.lang.Double audioChannels; - - @com.fasterxml.jackson.annotation.JsonProperty("audioCodec") - private final java.lang.String audioCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("audioDecision") - private final java.lang.String audioDecision; - - @com.fasterxml.jackson.annotation.JsonProperty("complete") - private final java.lang.Boolean complete; - - @com.fasterxml.jackson.annotation.JsonProperty("container") - private final java.lang.String container; - - @com.fasterxml.jackson.annotation.JsonProperty("context") - private final java.lang.String context; - - @com.fasterxml.jackson.annotation.JsonProperty("duration") - private final java.lang.Double duration; - - @com.fasterxml.jackson.annotation.JsonProperty("error") - private final java.lang.Boolean error; - - @com.fasterxml.jackson.annotation.JsonProperty("key") - private final java.lang.String key; - - @com.fasterxml.jackson.annotation.JsonProperty("maxOffsetAvailable") - private final java.lang.Double maxOffsetAvailable; - - @com.fasterxml.jackson.annotation.JsonProperty("minOffsetAvailable") - private final java.lang.Double minOffsetAvailable; - - @com.fasterxml.jackson.annotation.JsonProperty("progress") - private final java.lang.Double progress; - - @com.fasterxml.jackson.annotation.JsonProperty("protocol") - private final java.lang.String protocol; - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private final java.lang.Double size; - - @com.fasterxml.jackson.annotation.JsonProperty("sourceAudioCodec") - private final java.lang.String sourceAudioCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("sourceVideoCodec") - private final java.lang.String sourceVideoCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("speed") - private final java.lang.Double speed; - - @com.fasterxml.jackson.annotation.JsonProperty("throttled") - private final java.lang.Boolean throttled; - - @com.fasterxml.jackson.annotation.JsonProperty("timeStamp") - private final java.lang.Double timeStamp; - - @com.fasterxml.jackson.annotation.JsonProperty("transcodeHwRequested") - private final java.lang.Boolean transcodeHwRequested; - - @com.fasterxml.jackson.annotation.JsonProperty("videoCodec") - private final java.lang.String videoCodec; - - @com.fasterxml.jackson.annotation.JsonProperty("videoDecision") - private final java.lang.String videoDecision; - - TranscodeSession(Builder builder) { - super(builder); - this.audioChannels = builder.getAudioChannels(); - this.audioCodec = builder.getAudioCodec(); - this.audioDecision = builder.getAudioDecision(); - this.complete = builder.getComplete(); - this.container = builder.getContainer(); - this.context = builder.getContext(); - this.duration = builder.getDuration(); - this.error = builder.getError(); - this.key = builder.getKey(); - this.maxOffsetAvailable = builder.getMaxOffsetAvailable(); - this.minOffsetAvailable = builder.getMinOffsetAvailable(); - this.progress = builder.getProgress(); - this.protocol = builder.getProtocol(); - this.size = builder.getSize(); - this.sourceAudioCodec = builder.getSourceAudioCodec(); - this.sourceVideoCodec = builder.getSourceVideoCodec(); - this.speed = builder.getSpeed(); - this.throttled = builder.getThrottled(); - this.timeStamp = builder.getTimeStamp(); - this.transcodeHwRequested = builder.getTranscodeHwRequested(); - this.videoCodec = builder.getVideoCodec(); - this.videoDecision = builder.getVideoDecision(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> - java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet()) - ) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private java.lang.Double size; - - @com.fasterxml.jackson.annotation.JsonProperty("TranscodeSession") - private java.util.List< - GetTranscodeSessionsResponse.MediaContainer.TranscodeSession - > transcodeSession; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetTranscodeSessionsResponse.MediaContainer build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetTranscodeSessionsResponse.MediaContainer buildWithoutValidation() { - return new GetTranscodeSessionsResponse.MediaContainer(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .asList(this.getClass().getDeclaredFields()) - .stream() - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && - field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("size") - private final java.lang.Double size; - - @com.fasterxml.jackson.annotation.JsonProperty("TranscodeSession") - private final java.util.List< - GetTranscodeSessionsResponse.MediaContainer.TranscodeSession - > transcodeSession; - - MediaContainer(Builder builder) { - super(builder); - this.size = builder.getSize(); - this.transcodeSession = builder.getTranscodeSession(); - } - } - - @lombok.Getter - @lombok.Setter - @lombok.experimental.Accessors(chain = true) - @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder( - buildMethodName = "buildWithoutValidation", - withPrefix = "set" - ) - public static class Builder extends com.plexsdk.models.BaseModel.Builder { - - static final java.util.Set> REQUIRED_FIELDS_GROUPS; - - static { - java.lang.String[][] requiredFieldsGroups = new java.lang.String[][] {}; - - REQUIRED_FIELDS_GROUPS = - java.util.Arrays - .stream(requiredFieldsGroups) - .map(group -> java.util.Arrays.stream(group).collect(java.util.stream.Collectors.toSet())) - .collect(java.util.stream.Collectors.toSet()); - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private GetTranscodeSessionsResponse.MediaContainer mediaContainer; - - public Builder() { - super(ValidationType.ALL_OF); - } - - protected Builder(BaseModel.Builder.ValidationType validationType) { - super(validationType); - } - - public GetTranscodeSessionsResponse build() { - String validateMsg = validate(); - - if (validateMsg != null) { - throw new com.plexsdk.exceptions.ApiException(validateMsg); - } - - return buildWithoutValidation(); - } - - public GetTranscodeSessionsResponse buildWithoutValidation() { - return new GetTranscodeSessionsResponse(this); - } - - @Override - protected java.util.Set getNonNullInstanceFieldNames() { - // Introspect the class to get a list of all declared fields. - return java.util.Arrays - .stream(this.getClass().getDeclaredFields()) - .filter(field -> { - try { - // Filter fields that are non-static and have values that are not null. - return ( - !java.lang.reflect.Modifier.isStatic(field.getModifiers()) && field.get(this) != null - ); - } catch (IllegalArgumentException | IllegalAccessException e) { - // This should never happen... - - throw new com.plexsdk.exceptions.ApiException( - "Unexpected exception thrown while accessing instance fields.", - e - ); - } - }) - .map(java.lang.reflect.Field::getName) - .collect(java.util.stream.Collectors.toSet()); - } - - @Override - protected java.util.Set> getRequiredFieldsGroups() { - return REQUIRED_FIELDS_GROUPS; - } - } - - @com.fasterxml.jackson.annotation.JsonProperty("MediaContainer") - private final GetTranscodeSessionsResponse.MediaContainer mediaContainer; - - GetTranscodeSessionsResponse(Builder builder) { - super(builder); - this.mediaContainer = builder.getMediaContainer(); - } -} diff --git a/src/main/java/com/plexsdk/models/IncludeDetails.java b/src/main/java/com/plexsdk/models/IncludeDetails.java deleted file mode 100644 index 443de492..00000000 --- a/src/main/java/com/plexsdk/models/IncludeDetails.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.plexsdk.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum IncludeDetails { - V1(1); - - public final Float label; -} diff --git a/src/main/java/com/plexsdk/models/Level.java b/src/main/java/com/plexsdk/models/Level.java deleted file mode 100644 index ce0cac73..00000000 --- a/src/main/java/com/plexsdk/models/Level.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.plexsdk.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Level { - V1(1), - V2(2), - V3(3), - V4(4); - - public final Float label; -} diff --git a/src/main/java/com/plexsdk/models/MinSize.java b/src/main/java/com/plexsdk/models/MinSize.java deleted file mode 100644 index 95e7bd6b..00000000 --- a/src/main/java/com/plexsdk/models/MinSize.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.plexsdk.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum MinSize { - V1(1); - - public final Float label; -} diff --git a/src/main/java/com/plexsdk/models/OnlyTransient.java b/src/main/java/com/plexsdk/models/OnlyTransient.java deleted file mode 100644 index 61ca0934..00000000 --- a/src/main/java/com/plexsdk/models/OnlyTransient.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.plexsdk.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum OnlyTransient { - V1(1); - - public final Float label; -} diff --git a/src/main/java/com/plexsdk/models/PlaylistType.java b/src/main/java/com/plexsdk/models/PlaylistType.java deleted file mode 100644 index 88fc059a..00000000 --- a/src/main/java/com/plexsdk/models/PlaylistType.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.plexsdk.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum PlaylistType { - AUDIO("audio"), - VIDEO("video"), - PHOTO("photo"); - - public final String label; -} diff --git a/src/main/java/com/plexsdk/models/README.md b/src/main/java/com/plexsdk/models/README.md deleted file mode 100644 index 7b315dee..00000000 --- a/src/main/java/com/plexsdk/models/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# PlexSDK Models - -A list of all models. -- [Level](#level) -- [Upscale](#upscale) -- [Type](#type) -- [Smart](#smart) -- [Force](#force) -- [SecurityType](#securitytype) -- [Scope](#scope) -- [Download](#download) -- [Tonight](#tonight) -- [Skip](#skip) -- [State](#state) -- [GetServerCapabilitiesResponse](#getservercapabilitiesresponse) -- [GetServerActivitiesResponse](#getserveractivitiesresponse) -- [GetButlerTasksResponse](#getbutlertasksresponse) -- [GetAvailableClientsResponse](#getavailableclientsresponse) -- [GetDevicesResponse](#getdevicesresponse) -- [GetServerIdentityResponse](#getserveridentityresponse) -- [GetRecentlyAddedResponse](#getrecentlyaddedresponse) -- [GetOnDeckResponse](#getondeckresponse) -- [GetMyPlexAccountResponse](#getmyplexaccountresponse) -- [GetSearchResultsResponse](#getsearchresultsresponse) -- [GetServerListResponse](#getserverlistresponse) -- [GetTranscodeSessionsResponse](#gettranscodesessionsresponse) -- [TaskName](#taskname) -- [OnlyTransient](#onlytransient) -- [IncludeDetails](#includedetails) -- [MinSize](#minsize) -- [PlaylistType](#playlisttype) - -## Level - -## Upscale - -## Type - -## Smart - -## Force - -## SecurityType - -## Scope - -## Download - -## Tonight - -## Skip - -## State - -## GetServerCapabilitiesResponse - -## GetServerActivitiesResponse - -## GetButlerTasksResponse - -## GetAvailableClientsResponse - -## GetDevicesResponse - -## GetServerIdentityResponse - -## GetRecentlyAddedResponse - -## GetOnDeckResponse - -## GetMyPlexAccountResponse - -## GetSearchResultsResponse - -## GetServerListResponse - -## GetTranscodeSessionsResponse - -## TaskName - -## OnlyTransient - -## IncludeDetails - -## MinSize - -## PlaylistType - - - diff --git a/src/main/java/com/plexsdk/models/Scope.java b/src/main/java/com/plexsdk/models/Scope.java deleted file mode 100644 index f0abd27e..00000000 --- a/src/main/java/com/plexsdk/models/Scope.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.plexsdk.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Scope { - ALL("all"); - - public final String label; -} diff --git a/src/main/java/com/plexsdk/models/SecurityType.java b/src/main/java/com/plexsdk/models/SecurityType.java deleted file mode 100644 index b0bd52de..00000000 --- a/src/main/java/com/plexsdk/models/SecurityType.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.plexsdk.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum SecurityType { - DELEGATION("delegation"); - - public final String label; -} diff --git a/src/main/java/com/plexsdk/models/Skip.java b/src/main/java/com/plexsdk/models/Skip.java deleted file mode 100644 index 1b8397cf..00000000 --- a/src/main/java/com/plexsdk/models/Skip.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.plexsdk.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Skip { - V1("1"); - - public final String label; -} diff --git a/src/main/java/com/plexsdk/models/Smart.java b/src/main/java/com/plexsdk/models/Smart.java deleted file mode 100644 index 9a1d2ede..00000000 --- a/src/main/java/com/plexsdk/models/Smart.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.plexsdk.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Smart { - V1(1); - - public final Float label; -} diff --git a/src/main/java/com/plexsdk/models/State.java b/src/main/java/com/plexsdk/models/State.java deleted file mode 100644 index b6981a5a..00000000 --- a/src/main/java/com/plexsdk/models/State.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.plexsdk.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum State { - PLAYING("playing"), - PAUSED("paused"), - STOPPED("stopped"); - - public final String label; -} diff --git a/src/main/java/com/plexsdk/models/TaskName.java b/src/main/java/com/plexsdk/models/TaskName.java deleted file mode 100644 index a92b6d27..00000000 --- a/src/main/java/com/plexsdk/models/TaskName.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.plexsdk.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum TaskName { - BACKUPDATABASE("BackupDatabase"), - BUILDGRACENOTECOLLECTIONS("BuildGracenoteCollections"), - CHECKFORUPDATES("CheckForUpdates"), - CLEANOLDBUNDLES("CleanOldBundles"), - CLEANOLDCACHEFILES("CleanOldCacheFiles"), - DEEPMEDIAANALYSIS("DeepMediaAnalysis"), - GENERATEAUTOTAGS("GenerateAutoTags"), - GENERATECHAPTERTHUMBS("GenerateChapterThumbs"), - GENERATEMEDIAINDEXFILES("GenerateMediaIndexFiles"), - OPTIMIZEDATABASE("OptimizeDatabase"), - REFRESHLIBRARIES("RefreshLibraries"), - REFRESHLOCALMEDIA("RefreshLocalMedia"), - REFRESHPERIODICMETADATA("RefreshPeriodicMetadata"), - UPGRADEMEDIAANALYSIS("UpgradeMediaAnalysis"); - - public final String label; -} diff --git a/src/main/java/com/plexsdk/models/Tonight.java b/src/main/java/com/plexsdk/models/Tonight.java deleted file mode 100644 index b6c501ca..00000000 --- a/src/main/java/com/plexsdk/models/Tonight.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.plexsdk.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Tonight { - V1("1"); - - public final String label; -} diff --git a/src/main/java/com/plexsdk/models/Type.java b/src/main/java/com/plexsdk/models/Type.java deleted file mode 100644 index 9e206ab3..00000000 --- a/src/main/java/com/plexsdk/models/Type.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.plexsdk.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Type { - AUDIO("audio"), - VIDEO("video"), - PHOTO("photo"); - - public final String label; -} diff --git a/src/main/java/com/plexsdk/models/Upscale.java b/src/main/java/com/plexsdk/models/Upscale.java deleted file mode 100644 index 0074f498..00000000 --- a/src/main/java/com/plexsdk/models/Upscale.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.plexsdk.models; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public enum Upscale { - V1(1); - - public final Float label; -} diff --git a/src/main/java/com/plexsdk/services/ActivitiesService.java b/src/main/java/com/plexsdk/services/ActivitiesService.java deleted file mode 100644 index 4c8456a6..00000000 --- a/src/main/java/com/plexsdk/services/ActivitiesService.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.plexsdk.services; - -import com.plexsdk.exceptions.ApiException; -import com.plexsdk.http.*; -import com.plexsdk.http.util.HttpHeaders; -import com.plexsdk.http.util.HttpUrl; -import com.plexsdk.models.BaseModel; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import okhttp3.Headers; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -public class ActivitiesService extends BaseService implements ActivitiesClient { - - public ActivitiesService(OkHttpClient httpClient, String serverUrl) { - super(httpClient, serverUrl); - } - - /** - * @summary Get Server Activities - */ - public ResponseWithHeaders getServerActivities() - throws ApiException { - String url = HttpUrl.builder(this.serverUrl).addPathParameter("activities").build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - return new ResponseWithHeaders( - ModelConverter.convert( - response, - new com.fasterxml.jackson.core.type.TypeReference< - com.plexsdk.models.GetServerActivitiesResponse - >() {} - ), - response.headers() - ); - } - - /** - * @summary Cancel Server Activities - * @param {String} activityUUID - The UUID of the activity to cancel. - */ - public ResponseWithHeaders cancelServerActivities(String activityUUID) - throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("activities") - .addPathParameter(String.valueOf(activityUUID)) - .build(); - Request request = new Request.Builder().url(url).delete().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/src/main/java/com/plexsdk/services/BaseService.java b/src/main/java/com/plexsdk/services/BaseService.java deleted file mode 100644 index 12a7db63..00000000 --- a/src/main/java/com/plexsdk/services/BaseService.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.plexsdk.services; - -import com.plexsdk.Configuration; -import com.plexsdk.exceptions.ApiException; -import com.plexsdk.http.ModelConverter; -import com.plexsdk.models.*; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -public class BaseService { - - protected OkHttpClient httpClient; - protected String serverUrl; - - public BaseService(OkHttpClient httpClient, String serverUrl) { - this.httpClient = httpClient; - this.serverUrl = serverUrl; - } - - public void setBaseUrl(String serverUrl) { - this.serverUrl = serverUrl; - } - - protected Response execute(Request request) throws ApiException { - Response response; - try { - response = this.httpClient.newCall(request).execute(); - } catch (IOException e) { - ApiException apiException = new ApiException(e.getMessage()); - - throw apiException; - } - if (response.isSuccessful()) { - return response; - } else { - ApiException apiException = new ApiException(response.code()); - - throw apiException; - } - } -} diff --git a/src/main/java/com/plexsdk/services/ButlerService.java b/src/main/java/com/plexsdk/services/ButlerService.java deleted file mode 100644 index 0e767f2c..00000000 --- a/src/main/java/com/plexsdk/services/ButlerService.java +++ /dev/null @@ -1,137 +0,0 @@ -package com.plexsdk.services; - -import com.plexsdk.exceptions.ApiException; -import com.plexsdk.http.*; -import com.plexsdk.http.util.HttpHeaders; -import com.plexsdk.http.util.HttpUrl; -import com.plexsdk.models.BaseModel; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import okhttp3.Headers; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -public class ButlerService extends BaseService implements ButlerClient { - - public ButlerService(OkHttpClient httpClient, String serverUrl) { - super(httpClient, serverUrl); - } - - /** - * @summary Get Butler tasks - */ - public ResponseWithHeaders getButlerTasks() - throws ApiException { - String url = HttpUrl.builder(this.serverUrl).addPathParameter("butler").build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - return new ResponseWithHeaders( - ModelConverter.convert( - response, - new com.fasterxml.jackson.core.type.TypeReference< - com.plexsdk.models.GetButlerTasksResponse - >() {} - ), - response.headers() - ); - } - - /** - * @summary Start all Butler tasks - */ - public ResponseWithHeaders startAllTasks() throws ApiException { - String url = HttpUrl.builder(this.serverUrl).addPathParameter("butler").build(); - RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); - Request request = new Request.Builder().url(url).post(requestBody).build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Stop all Butler tasks - */ - public ResponseWithHeaders stopAllTasks() throws ApiException { - String url = HttpUrl.builder(this.serverUrl).addPathParameter("butler").build(); - Request request = new Request.Builder().url(url).delete().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Start a single Butler task - * @param {String} taskName - the name of the task to be started. - */ - public ResponseWithHeaders startTask(String taskName) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("butler") - .addPathParameter(String.valueOf(taskName)) - .build(); - RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); - Request request = new Request.Builder().url(url).post(requestBody).build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Stop a single Butler task - * @param {String} taskName - The name of the task to be started. - */ - public ResponseWithHeaders stopTask(String taskName) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("butler") - .addPathParameter(String.valueOf(taskName)) - .build(); - Request request = new Request.Builder().url(url).delete().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/src/main/java/com/plexsdk/services/HubsService.java b/src/main/java/com/plexsdk/services/HubsService.java deleted file mode 100644 index 35284d52..00000000 --- a/src/main/java/com/plexsdk/services/HubsService.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.plexsdk.services; - -import com.plexsdk.exceptions.ApiException; -import com.plexsdk.http.*; -import com.plexsdk.http.util.HttpHeaders; -import com.plexsdk.http.util.HttpUrl; -import com.plexsdk.models.BaseModel; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import okhttp3.Headers; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -public class HubsService extends BaseService implements HubsClient { - - public HubsService(OkHttpClient httpClient, String serverUrl) { - super(httpClient, serverUrl); - } - - /** - * @summary Get Global Hubs - * @param {Number} [count] - The number of items to return with each hub. - * @param {Number} [onlyTransient] - Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). - */ - public ResponseWithHeaders getGlobalHubs(Float count, Float onlyTransient) - throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("hubs") - .addOptionalQueryParameter("count", count) - .addOptionalQueryParameter("onlyTransient", onlyTransient) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Get library specific hubs - * @param {Number} sectionId - the Id of the library to query - * @param {Number} [count] - The number of items to return with each hub. - * @param {Number} [onlyTransient] - Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). - */ - public ResponseWithHeaders getLibraryHubs( - Float sectionId, - Float count, - Float onlyTransient - ) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("hubs") - .addPathParameter("sections") - .addPathParameter(String.valueOf(sectionId)) - .addOptionalQueryParameter("count", count) - .addOptionalQueryParameter("onlyTransient", onlyTransient) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/src/main/java/com/plexsdk/services/LibraryService.java b/src/main/java/com/plexsdk/services/LibraryService.java deleted file mode 100644 index 0fb72da1..00000000 --- a/src/main/java/com/plexsdk/services/LibraryService.java +++ /dev/null @@ -1,349 +0,0 @@ -package com.plexsdk.services; - -import com.plexsdk.exceptions.ApiException; -import com.plexsdk.http.*; -import com.plexsdk.http.util.HttpHeaders; -import com.plexsdk.http.util.HttpUrl; -import com.plexsdk.models.BaseModel; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import okhttp3.Headers; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -public class LibraryService extends BaseService implements LibraryClient { - - public LibraryService(OkHttpClient httpClient, String serverUrl) { - super(httpClient, serverUrl); - } - - /** - * @summary Get Hash Value - * @param {String} url - This is the path to the local file, must be prefixed by `file://` - * @param {Number} [type] - Item type - */ - public ResponseWithHeaders getFileHash(String url, Float type) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("library") - .addPathParameter("hashes") - .addRequiredQueryParameter("url", url) - .addOptionalQueryParameter("type", type) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Get Recently Added - */ - public ResponseWithHeaders getRecentlyAdded() - throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("library") - .addPathParameter("recentlyAdded") - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - return new ResponseWithHeaders( - ModelConverter.convert( - response, - new com.fasterxml.jackson.core.type.TypeReference< - com.plexsdk.models.GetRecentlyAddedResponse - >() {} - ), - response.headers() - ); - } - - /** - * @summary Get All Libraries - */ - public ResponseWithHeaders getLibraries() throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("library") - .addPathParameter("sections") - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Get Library Details - * @param {Number} sectionId - the Id of the library to query - * @param {Number} [includeDetails] - Whether or not to include details for a section (types, filters, and sorts). -Only exists for backwards compatibility, media providers other than the server libraries have it on always. - - */ - public ResponseWithHeaders getLibrary(Float sectionId, Float includeDetails) - throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("library") - .addPathParameter("sections") - .addPathParameter(String.valueOf(sectionId)) - .addOptionalQueryParameter("includeDetails", includeDetails) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Delete Library Section - * @param {Number} sectionId - the Id of the library to query - */ - public ResponseWithHeaders deleteLibrary(Float sectionId) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("library") - .addPathParameter("sections") - .addPathParameter(String.valueOf(sectionId)) - .build(); - Request request = new Request.Builder().url(url).delete().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Get Library Items - * @param {Number} sectionId - the Id of the library to query - * @param {Number} [type] - item type - * @param {String} [filter] - the filter parameter - */ - public ResponseWithHeaders getLibraryItems(Float sectionId, Float type, String filter) - throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("library") - .addPathParameter("sections") - .addPathParameter(String.valueOf(sectionId)) - .addPathParameter("all") - .addOptionalQueryParameter("type", type) - .addOptionalQueryParameter("filter", filter) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Refresh Library - * @param {Number} sectionId - the Id of the library to refresh - */ - public ResponseWithHeaders refreshLibrary(Float sectionId) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("library") - .addPathParameter("sections") - .addPathParameter(String.valueOf(sectionId)) - .addPathParameter("refresh") - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Get Latest Library Items - * @param {Number} sectionId - the Id of the library to query - * @param {Number} type - item type - * @param {String} [filter] - the filter parameter - */ - public ResponseWithHeaders getLatestLibraryItems( - Float sectionId, - Float type, - String filter - ) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("library") - .addPathParameter("sections") - .addPathParameter(String.valueOf(sectionId)) - .addPathParameter("latest") - .addRequiredQueryParameter("type", type) - .addOptionalQueryParameter("filter", filter) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Get Common Library Items - * @param {Number} sectionId - the Id of the library to query - * @param {Number} type - item type - * @param {String} [filter] - the filter parameter - */ - public ResponseWithHeaders getCommonLibraryItems( - Float sectionId, - Float type, - String filter - ) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("library") - .addPathParameter("sections") - .addPathParameter(String.valueOf(sectionId)) - .addPathParameter("common") - .addRequiredQueryParameter("type", type) - .addOptionalQueryParameter("filter", filter) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Get Items Metadata - * @param {Number} ratingKey - the id of the library item to return the children of. - */ - public ResponseWithHeaders getMetadata(Float ratingKey) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("library") - .addPathParameter("metadata") - .addPathParameter(String.valueOf(ratingKey)) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Get Items Children - * @param {Number} ratingKey - the id of the library item to return the children of. - */ - public ResponseWithHeaders getMetadataChildren(Float ratingKey) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("library") - .addPathParameter("metadata") - .addPathParameter(String.valueOf(ratingKey)) - .addPathParameter("children") - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Get On Deck - */ - public ResponseWithHeaders getOnDeck() throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("library") - .addPathParameter("onDeck") - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - return new ResponseWithHeaders( - ModelConverter.convert( - response, - new com.fasterxml.jackson.core.type.TypeReference() {} - ), - response.headers() - ); - } -} diff --git a/src/main/java/com/plexsdk/services/LogService.java b/src/main/java/com/plexsdk/services/LogService.java deleted file mode 100644 index 29bcfad6..00000000 --- a/src/main/java/com/plexsdk/services/LogService.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.plexsdk.services; - -import com.plexsdk.exceptions.ApiException; -import com.plexsdk.http.*; -import com.plexsdk.http.util.HttpHeaders; -import com.plexsdk.http.util.HttpUrl; -import com.plexsdk.models.BaseModel; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import okhttp3.Headers; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -public class LogService extends BaseService implements LogClient { - - public LogService(OkHttpClient httpClient, String serverUrl) { - super(httpClient, serverUrl); - } - - /** - * @summary Logging a single line message. - * @param {Number} level - An integer log level to write to the PMS log with. -0: Error -1: Warning -2: Info -3: Debug -4: Verbose - - * @param {String} message - The text of the message to write to the log. - * @param {String} source - a string indicating the source of the message. - */ - public ResponseWithHeaders logLine(Float level, String message, String source) - throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("log") - .addRequiredQueryParameter("level", level) - .addRequiredQueryParameter("message", message) - .addRequiredQueryParameter("source", source) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Logging a multi-line message - */ - public ResponseWithHeaders logMultiLine() throws ApiException { - String url = HttpUrl.builder(this.serverUrl).addPathParameter("log").build(); - RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); - Request request = new Request.Builder().url(url).post(requestBody).build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Enabling Papertrail - */ - public ResponseWithHeaders enablePaperTrail() throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("log") - .addPathParameter("networked") - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/src/main/java/com/plexsdk/services/MediaService.java b/src/main/java/com/plexsdk/services/MediaService.java deleted file mode 100644 index c1707441..00000000 --- a/src/main/java/com/plexsdk/services/MediaService.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.plexsdk.services; - -import com.plexsdk.exceptions.ApiException; -import com.plexsdk.http.*; -import com.plexsdk.http.util.HttpHeaders; -import com.plexsdk.http.util.HttpUrl; -import com.plexsdk.models.BaseModel; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import okhttp3.Headers; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -public class MediaService extends BaseService implements MediaClient { - - public MediaService(OkHttpClient httpClient, String serverUrl) { - super(httpClient, serverUrl); - } - - /** - * @summary Mark Media Played - * @param {Number} key - The media key to mark as played - */ - public ResponseWithHeaders markPlayed(Float key) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter(":") - .addPathParameter("scrobble") - .addRequiredQueryParameter("key", key) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Mark Media Unplayed - * @param {Number} key - The media key to mark as Unplayed - */ - public ResponseWithHeaders markUnplayed(Float key) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter(":") - .addPathParameter("unscrobble") - .addRequiredQueryParameter("key", key) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Update Media Play Progress - * @param {String} key - the media key - * @param {Number} time - The time, in milliseconds, used to set the media playback progress. - * @param {String} state - The playback state of the media item. - */ - public ResponseWithHeaders updatePlayProgress(String key, Float time, String state) - throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter(":") - .addPathParameter("progress") - .addRequiredQueryParameter("key", key) - .addRequiredQueryParameter("time", time) - .addRequiredQueryParameter("state", state) - .build(); - RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); - Request request = new Request.Builder().url(url).post(requestBody).build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/src/main/java/com/plexsdk/services/PlaylistsService.java b/src/main/java/com/plexsdk/services/PlaylistsService.java deleted file mode 100644 index 1570e805..00000000 --- a/src/main/java/com/plexsdk/services/PlaylistsService.java +++ /dev/null @@ -1,298 +0,0 @@ -package com.plexsdk.services; - -import com.plexsdk.exceptions.ApiException; -import com.plexsdk.http.*; -import com.plexsdk.http.util.HttpHeaders; -import com.plexsdk.http.util.HttpUrl; -import com.plexsdk.models.BaseModel; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import okhttp3.Headers; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -public class PlaylistsService extends BaseService implements PlaylistsClient { - - public PlaylistsService(OkHttpClient httpClient, String serverUrl) { - super(httpClient, serverUrl); - } - - /** - * @summary Create a Playlist - * @param {String} title - name of the playlist - * @param {String} type - type of playlist to create - * @param {Number} smart - whether the playlist is smart or not - * @param {String} [uri] - the content URI for the playlist - * @param {Number} [playQueueID] - the play queue to copy to a playlist - */ - public ResponseWithHeaders createPlaylist( - String title, - String type, - Float smart, - String uri, - Float playQueueID - ) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("playlists") - .addRequiredQueryParameter("title", title) - .addRequiredQueryParameter("type", type) - .addRequiredQueryParameter("smart", smart) - .addOptionalQueryParameter("uri", uri) - .addOptionalQueryParameter("playQueueID", playQueueID) - .build(); - RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); - Request request = new Request.Builder().url(url).post(requestBody).build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Get All Playlists - * @param {String} [playlistType] - limit to a type of playlist. - * @param {Number} [smart] - type of playlists to return (default is all). - */ - public ResponseWithHeaders getPlaylists(String playlistType, Float smart) - throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("playlists") - .addPathParameter("all") - .addOptionalQueryParameter("playlistType", playlistType) - .addOptionalQueryParameter("smart", smart) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Retrieve Playlist - * @param {Number} playlistID - the ID of the playlist - */ - public ResponseWithHeaders getPlaylist(Float playlistID) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("playlists") - .addPathParameter(String.valueOf(playlistID)) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Update a Playlist - * @param {Number} playlistID - the ID of the playlist - */ - public ResponseWithHeaders updatePlaylist(Float playlistID) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("playlists") - .addPathParameter(String.valueOf(playlistID)) - .build(); - RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); - Request request = new Request.Builder().url(url).put(requestBody).build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Deletes a Playlist - * @param {Number} playlistID - the ID of the playlist - */ - public ResponseWithHeaders deletePlaylist(Float playlistID) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("playlists") - .addPathParameter(String.valueOf(playlistID)) - .build(); - Request request = new Request.Builder().url(url).delete().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Retrieve Playlist Contents - * @param {Number} playlistID - the ID of the playlist - * @param {Number} type - the metadata type of the item to return - */ - public ResponseWithHeaders getPlaylistContents(Float playlistID, Float type) - throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("playlists") - .addPathParameter(String.valueOf(playlistID)) - .addPathParameter("items") - .addRequiredQueryParameter("type", type) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Adding to a Playlist - * @param {Number} playlistID - the ID of the playlist - * @param {String} uri - the content URI for the playlist - * @param {Number} playQueueID - the play queue to add to a playlist - */ - public ResponseWithHeaders addPlaylistContents( - Float playlistID, - String uri, - Float playQueueID - ) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("playlists") - .addPathParameter(String.valueOf(playlistID)) - .addPathParameter("items") - .addRequiredQueryParameter("uri", uri) - .addRequiredQueryParameter("playQueueID", playQueueID) - .build(); - RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); - Request request = new Request.Builder().url(url).put(requestBody).build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Delete Playlist Contents - * @param {Number} playlistID - the ID of the playlist - */ - public ResponseWithHeaders clearPlaylistContents(Float playlistID) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("playlists") - .addPathParameter(String.valueOf(playlistID)) - .addPathParameter("items") - .build(); - Request request = new Request.Builder().url(url).delete().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Upload Playlist - * @param {String} path - absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server. -If the `path` argument is a directory, that path will be scanned for playlist files to be processed. -Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it. -The GUID of each playlist is based on the filename. -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. -The GUID of each playlist is based on the filename. - - * @param {Number} force - force overwriting of duplicate playlists. By default, a playlist file uploaded with the same path will overwrite the existing playlist. -The `force` argument is used to disable overwriting. 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. - - */ - public ResponseWithHeaders uploadPlaylist(String path, Float force) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("playlists") - .addPathParameter("upload") - .addRequiredQueryParameter("path", path) - .addRequiredQueryParameter("force", force) - .build(); - RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); - Request request = new Request.Builder().url(url).post(requestBody).build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/src/main/java/com/plexsdk/services/README.md b/src/main/java/com/plexsdk/services/README.md deleted file mode 100644 index 5e339c45..00000000 --- a/src/main/java/com/plexsdk/services/README.md +++ /dev/null @@ -1,2606 +0,0 @@ -# PlexSDK Services -A list of all services and services methods. -- Services - - - [Server](#server) - - - [Media](#media) - - - [Activities](#activities) - - - [Butler](#butler) - - - [Hubs](#hubs) - - - [Search](#search) - - - [Library](#library) - - - [Log](#log) - - - [Playlists](#playlists) - - - [Security](#security) - - - [Sessions](#sessions) - - - [Updater](#updater) - - - [Video](#video) -- [All Methods](#all-methods) - - -## Server - -| Method | Description| -| :-------- | :----------| -| [getServerCapabilities](#getservercapabilities) | Server Capabilities | -| [getServerPreferences](#getserverpreferences) | Get Server Preferences | -| [getAvailableClients](#getavailableclients) | Get Available Clients | -| [getDevices](#getdevices) | Get Devices | -| [getServerIdentity](#getserveridentity) | Get Server Identity | -| [getMyPlexAccount](#getmyplexaccount) | Get MyPlex Account | -| [getResizedPhoto](#getresizedphoto) | Get a Resized Photo | -| [getServerList](#getserverlist) | Get Server List | - - -## Media - -| Method | Description| -| :-------- | :----------| -| [markPlayed](#markplayed) | Mark Media Played | -| [markUnplayed](#markunplayed) | Mark Media Unplayed | -| [updatePlayProgress](#updateplayprogress) | Update Media Play Progress | - - -## Activities - -| Method | Description| -| :-------- | :----------| -| [getServerActivities](#getserveractivities) | Get Server Activities | -| [cancelServerActivities](#cancelserveractivities) | Cancel Server Activities | - - -## Butler - -| Method | Description| -| :-------- | :----------| -| [startAllTasks](#startalltasks) | Start all Butler tasks | -| [getButlerTasks](#getbutlertasks) | Get Butler tasks | -| [stopAllTasks](#stopalltasks) | Stop all Butler tasks | -| [startTask](#starttask) | Start a single Butler task | -| [stopTask](#stoptask) | Stop a single Butler task | - - -## Hubs - -| Method | Description| -| :-------- | :----------| -| [getGlobalHubs](#getglobalhubs) | Get Global Hubs | -| [getLibraryHubs](#getlibraryhubs) | Get library specific hubs | - - -## Search - -| Method | Description| -| :-------- | :----------| -| [performSearch](#performsearch) | Perform a search | -| [performVoiceSearch](#performvoicesearch) | Perform a voice search | -| [getSearchResults](#getsearchresults) | Get Search Results | - - -## Library - -| Method | Description| -| :-------- | :----------| -| [getFileHash](#getfilehash) | Get Hash Value | -| [getRecentlyAdded](#getrecentlyadded) | Get Recently Added | -| [getLibraries](#getlibraries) | Get All Libraries | -| [getLibrary](#getlibrary) | Get Library Details | -| [deleteLibrary](#deletelibrary) | Delete Library Section | -| [getLibraryItems](#getlibraryitems) | Get Library Items | -| [refreshLibrary](#refreshlibrary) | Refresh Library | -| [getLatestLibraryItems](#getlatestlibraryitems) | Get Latest Library Items | -| [getCommonLibraryItems](#getcommonlibraryitems) | Get Common Library Items | -| [getMetadata](#getmetadata) | Get Items Metadata | -| [getMetadataChildren](#getmetadatachildren) | Get Items Children | -| [getOnDeck](#getondeck) | Get On Deck | - - -## Log - -| Method | Description| -| :-------- | :----------| -| [logMultiLine](#logmultiline) | Logging a multi-line message | -| [logLine](#logline) | Logging a single line message. | -| [enablePaperTrail](#enablepapertrail) | Enabling Papertrail | - - -## Playlists - -| Method | Description| -| :-------- | :----------| -| [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 | - - -## Security - -| Method | Description| -| :-------- | :----------| -| [getTransientToken](#gettransienttoken) | Get a Transient Token. | -| [getSourceConnectionInformation](#getsourceconnectioninformation) | Get Source Connection Information | - - -## Sessions - -| Method | Description| -| :-------- | :----------| -| [getSessions](#getsessions) | Get Active Sessions | -| [getSessionHistory](#getsessionhistory) | Get Session History | -| [getTranscodeSessions](#gettranscodesessions) | Get Transcode Sessions | -| [stopTranscodeSession](#stoptranscodesession) | Stop a Transcode Session | - - -## Updater - -| Method | Description| -| :-------- | :----------| -| [getUpdateStatus](#getupdatestatus) | Querying status of updates | -| [checkForUpdates](#checkforupdates) | Checking for updates | -| [applyUpdates](#applyupdates) | Apply Updates | - - -## Video - -| Method | Description| -| :-------- | :----------| -| [startUniversalTranscode](#startuniversaltranscode) | Start Universal Transcode | -| [getTimeline](#gettimeline) | Get the timeline for a media item | - - -## All Methods - - -### **getServerCapabilities** -Server Capabilities -- HTTP Method: GET -- Endpoint: / - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetServerCapabilitiesResponse](/src/main/java/io/plexsdk/models/README.md#getservercapabilitiesresponse) - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.serverService.getServerCapabilities(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getServerPreferences** -Get Server Preferences -- HTTP Method: GET -- Endpoint: /:/prefs - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.serverService.getServerPreferences(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getAvailableClients** -Get Available Clients -- HTTP Method: GET -- Endpoint: /clients - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetAvailableClientsResponse](/src/main/java/io/plexsdk/models/README.md#getavailableclientsresponse) - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.serverService.getAvailableClients(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getDevices** -Get Devices -- HTTP Method: GET -- Endpoint: /devices - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetDevicesResponse](/src/main/java/io/plexsdk/models/README.md#getdevicesresponse) - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.serverService.getDevices(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getServerIdentity** -Get Server Identity -- HTTP Method: GET -- Endpoint: /identity - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetServerIdentityResponse](/src/main/java/io/plexsdk/models/README.md#getserveridentityresponse) - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.serverService.getServerIdentity(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getMyPlexAccount** -Get MyPlex Account -- HTTP Method: GET -- Endpoint: /myplex/account - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetMyPlexAccountResponse](/src/main/java/io/plexsdk/models/README.md#getmyplexaccountresponse) - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.serverService.getMyPlexAccount(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getResizedPhoto** -Get a Resized Photo -- HTTP Method: GET -- Endpoint: /photo/:/transcode - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| width | Float | Required | The width for the resized photo | -| height | Float | Required | The height for the resized photo | -| opacity | Integer | Required | The opacity for the resized photo | -| blur | Float | Required | The width for the resized photo | -| minSize | [MinSize](/src/main/java/io/plexsdk/models/README.md#minsize) | Required | images are always scaled proportionally. A value of '1' in minSize will make the smaller native dimension the dimension resized against. | -| upscale | [Upscale](/src/main/java/io/plexsdk/models/README.md#upscale) | Required | allow images to be resized beyond native dimensions. | -| url | String | Required | path to image within Plex | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.serverService.getResizedPhoto( - 502208579, - 4, - 5, - 7, - 3, - 4, - "urlSampleValue" - ); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getServerList** -Get Server List -- HTTP Method: GET -- Endpoint: /servers - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetServerListResponse](/src/main/java/io/plexsdk/models/README.md#getserverlistresponse) - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.serverService.getServerList(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **markPlayed** -Mark Media Played -- HTTP Method: GET -- Endpoint: /:/scrobble - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| key | Float | Required | The media key to mark as played | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.mediaService.markPlayed(9); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **markUnplayed** -Mark Media Unplayed -- HTTP Method: GET -- Endpoint: /:/unscrobble - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| key | Float | Required | The media key to mark as Unplayed | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.mediaService.markUnplayed(2); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **updatePlayProgress** -Update Media Play Progress -- HTTP Method: POST -- Endpoint: /:/progress - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| key | String | Required | the media key | -| time | Float | Required | The time, in milliseconds, used to set the media playback progress. | -| state | String | Required | The playback state of the media item. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.mediaService.updatePlayProgress( - "keySampleValue", - 1, - "stateSampleValue" - ); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **getServerActivities** -Get Server Activities -- HTTP Method: GET -- Endpoint: /activities - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetServerActivitiesResponse](/src/main/java/io/plexsdk/models/README.md#getserveractivitiesresponse) - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.activitiesService.getServerActivities(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **cancelServerActivities** -Cancel Server Activities -- HTTP Method: DELETE -- Endpoint: /activities/{activityUUID} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| activityUuid | String | Required | The UUID of the activity to cancel. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.activitiesService.cancelServerActivities("activityUUIDSampleValue"); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **startAllTasks** -Start all Butler tasks -- HTTP Method: POST -- Endpoint: /butler - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.butlerService.startAllTasks(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getButlerTasks** -Get Butler tasks -- HTTP Method: GET -- Endpoint: /butler - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetButlerTasksResponse](/src/main/java/io/plexsdk/models/README.md#getbutlertasksresponse) - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.butlerService.getButlerTasks(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **stopAllTasks** -Stop all Butler tasks -- HTTP Method: DELETE -- Endpoint: /butler - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.butlerService.stopAllTasks(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **startTask** -Start a single Butler task -- HTTP Method: POST -- Endpoint: /butler/{taskName} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| taskName | [TaskName](/src/main/java/io/plexsdk/models/README.md#taskname) | Required | the name of the task to be started. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.butlerService.startTask("taskNameSampleValue"); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **stopTask** -Stop a single Butler task -- HTTP Method: DELETE -- Endpoint: /butler/{taskName} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| taskName | [TaskName](/src/main/java/io/plexsdk/models/README.md#taskname) | Required | The name of the task to be started. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.butlerService.stopTask("taskNameSampleValue"); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **getGlobalHubs** -Get Global Hubs -- HTTP Method: GET -- Endpoint: /hubs - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| count | Float | Optional | The number of items to return with each hub. | -| onlyTransient | [OnlyTransient](/src/main/java/io/plexsdk/models/README.md#onlytransient) | Optional | Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.hubsService.getGlobalHubs(4, 9); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getLibraryHubs** -Get library specific hubs -- HTTP Method: GET -- Endpoint: /hubs/sections/{sectionId} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| sectionId | Float | Required | the Id of the library to query | -| count | Float | Optional | The number of items to return with each hub. | -| onlyTransient | [OnlyTransient](/src/main/java/io/plexsdk/models/README.md#onlytransient) | Optional | Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.hubsService.getLibraryHubs(4, 3, 3); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **performSearch** -Perform a search -- HTTP Method: GET -- Endpoint: /hubs/search - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| query | String | Required | The query term | -| sectionId | Float | Optional | This gives context to the search, and can result in re-ordering of search result hubs | -| limit | Float | Optional | The number of items to return per hub | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.searchService.performSearch("querySampleValue", 4, 8); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **performVoiceSearch** -Perform a voice search -- HTTP Method: GET -- Endpoint: /hubs/search/voice - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| query | String | Required | The query term | -| sectionId | Float | Optional | This gives context to the search, and can result in re-ordering of search result hubs | -| limit | Float | Optional | The number of items to return per hub | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.searchService.performVoiceSearch("querySampleValue", 7, 7); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getSearchResults** -Get Search Results -- HTTP Method: GET -- Endpoint: /search - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| query | String | Required | The search query string to use | - -**Return Type** - -[GetSearchResultsResponse](/src/main/java/io/plexsdk/models/README.md#getsearchresultsresponse) - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.searchService.getSearchResults("querySampleValue"); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **getFileHash** -Get Hash Value -- HTTP Method: GET -- Endpoint: /library/hashes - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| url | String | Required | This is the path to the local file, must be prefixed by `file://` | -| type | Float | Optional | Item type | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.libraryService.getFileHash("urlSampleValue", 1); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getRecentlyAdded** -Get Recently Added -- HTTP Method: GET -- Endpoint: /library/recentlyAdded - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetRecentlyAddedResponse](/src/main/java/io/plexsdk/models/README.md#getrecentlyaddedresponse) - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.libraryService.getRecentlyAdded(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getLibraries** -Get All Libraries -- HTTP Method: GET -- Endpoint: /library/sections - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.libraryService.getLibraries(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getLibrary** -Get Library Details -- HTTP Method: GET -- Endpoint: /library/sections/{sectionId} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| sectionId | Float | Required | the Id of the library to query | -| includeDetails | [IncludeDetails](/src/main/java/io/plexsdk/models/README.md#includedetails) | Optional | Whether or not to include details for a section (types, filters, and sorts).
Only exists for backwards compatibility, media providers other than the server libraries have it on always.
| - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.libraryService.getLibrary(5, 7); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **deleteLibrary** -Delete Library Section -- HTTP Method: DELETE -- Endpoint: /library/sections/{sectionId} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| sectionId | Float | Required | the Id of the library to query | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.libraryService.deleteLibrary(4); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getLibraryItems** -Get Library Items -- HTTP Method: GET -- Endpoint: /library/sections/{sectionId}/all - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| sectionId | Float | Required | the Id of the library to query | -| type | Float | Optional | item type | -| filter | String | Optional | the filter parameter | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.libraryService.getLibraryItems(4, 5, "filterSampleValue"); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **refreshLibrary** -Refresh Library -- HTTP Method: GET -- Endpoint: /library/sections/{sectionId}/refresh - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| sectionId | Float | Required | the Id of the library to refresh | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.libraryService.refreshLibrary(6); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getLatestLibraryItems** -Get Latest Library Items -- HTTP Method: GET -- Endpoint: /library/sections/{sectionId}/latest - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| sectionId | Float | Required | the Id of the library to query | -| type | Float | Required | item type | -| filter | String | Optional | the filter parameter | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.libraryService.getLatestLibraryItems(6, 1, "filterSampleValue"); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getCommonLibraryItems** -Get Common Library Items -- HTTP Method: GET -- Endpoint: /library/sections/{sectionId}/common - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| sectionId | Float | Required | the Id of the library to query | -| type | Float | Required | item type | -| filter | String | Optional | the filter parameter | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.libraryService.getCommonLibraryItems(5, 1, "filterSampleValue"); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getMetadata** -Get Items Metadata -- HTTP Method: GET -- Endpoint: /library/metadata/{ratingKey} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| ratingKey | Float | Required | the id of the library item to return the children of. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.libraryService.getMetadata(4); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getMetadataChildren** -Get Items Children -- HTTP Method: GET -- Endpoint: /library/metadata/{ratingKey}/children - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| ratingKey | Float | Required | the id of the library item to return the children of. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.libraryService.getMetadataChildren(8); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getOnDeck** -Get On Deck -- HTTP Method: GET -- Endpoint: /library/onDeck - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetOnDeckResponse](/src/main/java/io/plexsdk/models/README.md#getondeckresponse) - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.libraryService.getOnDeck(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **logMultiLine** -Logging a multi-line message -- HTTP Method: POST -- Endpoint: /log - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.logService.logMultiLine(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **logLine** -Logging a single line message. -- HTTP Method: GET -- Endpoint: /log - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| level | [Level](/src/main/java/io/plexsdk/models/README.md#level) | Required | An integer log level to write to the PMS log with.
0: Error
1: Warning
2: Info
3: Debug
4: Verbose
| -| message | String | Required | The text of the message to write to the log. | -| source | String | Required | a string indicating the source of the message. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.logService.logLine(5, "messageSampleValue", "sourceSampleValue"); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **enablePaperTrail** -Enabling Papertrail -- HTTP Method: GET -- Endpoint: /log/networked - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.logService.enablePaperTrail(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **createPlaylist** -Create a Playlist -- HTTP Method: POST -- Endpoint: /playlists - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| title | String | Required | name of the playlist | -| type | [Type](/src/main/java/io/plexsdk/models/README.md#type) | Required | type of playlist to create | -| smart | [Smart](/src/main/java/io/plexsdk/models/README.md#smart) | Required | whether the playlist is smart or not | -| uri | String | Optional | the content URI for the playlist | -| playQueueId | Float | Optional | the play queue to copy to a playlist | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.playlistsService.createPlaylist( - "titleSampleValue", - "typeSampleValue", - 7, - "uriSampleValue", - 2 - ); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getPlaylists** -Get All Playlists -- HTTP Method: GET -- Endpoint: /playlists/all - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| playlistType | [PlaylistType](/src/main/java/io/plexsdk/models/README.md#playlisttype) | Optional | limit to a type of playlist. | -| smart | [Smart](/src/main/java/io/plexsdk/models/README.md#smart) | Optional | type of playlists to return (default is all). | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.playlistsService.getPlaylists("playlistTypeSampleValue", 4); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getPlaylist** -Retrieve Playlist -- HTTP Method: GET -- Endpoint: /playlists/{playlistID} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| playlistId | Float | Required | the ID of the playlist | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.playlistsService.getPlaylist(1); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **deletePlaylist** -Deletes a Playlist -- HTTP Method: DELETE -- Endpoint: /playlists/{playlistID} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| playlistId | Float | Required | the ID of the playlist | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.playlistsService.deletePlaylist(5); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **updatePlaylist** -Update a Playlist -- HTTP Method: PUT -- Endpoint: /playlists/{playlistID} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| playlistId | Float | Required | the ID of the playlist | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.playlistsService.updatePlaylist(7); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getPlaylistContents** -Retrieve Playlist Contents -- HTTP Method: GET -- Endpoint: /playlists/{playlistID}/items - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| playlistId | Float | Required | the ID of the playlist | -| type | Float | Required | the metadata type of the item to return | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.playlistsService.getPlaylistContents(9, 5); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **clearPlaylistContents** -Delete Playlist Contents -- HTTP Method: DELETE -- Endpoint: /playlists/{playlistID}/items - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| playlistId | Float | Required | the ID of the playlist | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.playlistsService.clearPlaylistContents(1); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **addPlaylistContents** -Adding to a Playlist -- HTTP Method: PUT -- Endpoint: /playlists/{playlistID}/items - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| playlistId | Float | Required | the ID of the playlist | -| uri | String | Required | the content URI for the playlist | -| playQueueId | Float | Required | the play queue to add to a playlist | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.playlistsService.addPlaylistContents(1, "uriSampleValue", 7); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **uploadPlaylist** -Upload Playlist -- HTTP Method: POST -- Endpoint: /playlists/upload - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| path | String | Required | absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
The GUID of each playlist is based on the filename.
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.
The GUID of each playlist is based on the filename.
| -| force | [Force](/src/main/java/io/plexsdk/models/README.md#force) | Required | force overwriting of duplicate playlists. By default, a playlist file uploaded with the same path will overwrite the existing playlist.
The `force` argument is used to disable overwriting. 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.
| - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.playlistsService.uploadPlaylist("pathSampleValue", 7); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **getTransientToken** -Get a Transient Token. -- HTTP Method: GET -- Endpoint: /security/token - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| type | [SecurityType](/src/main/java/io/plexsdk/models/README.md#securitytype) | Required | `delegation` - This is the only supported `type` parameter. | -| scope | [Scope](/src/main/java/io/plexsdk/models/README.md#scope) | Required | `all` - This is the only supported `scope` parameter. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.securityService.getTransientToken( - "typeSampleValue", - "scopeSampleValue" - ); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getSourceConnectionInformation** -Get Source Connection Information -- HTTP Method: GET -- Endpoint: /security/resources - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| source | String | Required | The source identifier with an included prefix. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.securityService.getSourceConnectionInformation("sourceSampleValue"); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **getSessions** -Get Active Sessions -- HTTP Method: GET -- Endpoint: /status/sessions - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.sessionsService.getSessions(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getSessionHistory** -Get Session History -- HTTP Method: GET -- Endpoint: /status/sessions/history/all - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.sessionsService.getSessionHistory(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getTranscodeSessions** -Get Transcode Sessions -- HTTP Method: GET -- Endpoint: /transcode/sessions - - -**Parameters** - -This method has no parameters. - -**Return Type** - -[GetTranscodeSessionsResponse](/src/main/java/io/plexsdk/models/README.md#gettranscodesessionsresponse) - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.sessionsService.getTranscodeSessions(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **stopTranscodeSession** -Stop a Transcode Session -- HTTP Method: DELETE -- Endpoint: /transcode/sessions/{sessionKey} - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| sessionKey | String | Required | the Key of the transcode session to stop | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.sessionsService.stopTranscodeSession("sessionKeySampleValue"); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **getUpdateStatus** -Querying status of updates -- HTTP Method: GET -- Endpoint: /updater/status - - -**Parameters** - -This method has no parameters. - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.updaterService.getUpdateStatus(); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **checkForUpdates** -Checking for updates -- HTTP Method: PUT -- Endpoint: /updater/check - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| download | [Download](/src/main/java/io/plexsdk/models/README.md#download) | Optional | Indicate that you want to start download any updates found. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.updaterService.checkForUpdates(null); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **applyUpdates** -Apply Updates -- HTTP Method: PUT -- Endpoint: /updater/apply - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| tonight | [Tonight](/src/main/java/io/plexsdk/models/README.md#tonight) | Optional | 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 | -| skip | [Skip](/src/main/java/io/plexsdk/models/README.md#skip) | Optional | Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.updaterService.applyUpdates(null, null); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - -### **startUniversalTranscode** -Start Universal Transcode -- HTTP Method: GET -- Endpoint: /video/:/transcode/universal/start.mpd - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| hasMde | Float | Required | Whether the media item has MDE | -| path | String | Required | The path to the media item to transcode | -| mediaIndex | Float | Required | The index of the media item to transcode | -| partIndex | Float | Required | The index of the part to transcode | -| protocol | String | Required | The protocol to use for the transcode session | -| fastSeek | Float | Optional | Whether to use fast seek or not | -| directPlay | Float | Optional | Whether to use direct play or not | -| directStream | Float | Optional | Whether to use direct stream or not | -| subtitleSize | Float | Optional | The size of the subtitles | -| subtites | String | Optional | The subtitles | -| audioBoost | Float | Optional | The audio boost | -| location | String | Optional | The location of the transcode session | -| mediaBufferSize | Float | Optional | The size of the media buffer | -| session | String | Optional | The session ID | -| addDebugOverlay | Float | Optional | Whether to add a debug overlay or not | -| autoAdjustQuality | Float | Optional | Whether to auto adjust quality or not | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.videoService.startUniversalTranscode( - 9, - "pathSampleValue", - 7, - 2, - "protocolSampleValue", - 7, - 1, - 2, - 8, - "subtitesSampleValue", - 1, - "locationSampleValue", - 2, - "sessionSampleValue", - 5, - 1 - ); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - -### **getTimeline** -Get the timeline for a media item -- HTTP Method: GET -- Endpoint: /:/timeline - - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| ratingKey | Float | Required | The rating key of the media item | -| key | String | Required | The key of the media item to get the timeline for | -| state | [State](/src/main/java/io/plexsdk/models/README.md#state) | Required | The state of the media item | -| hasMde | Float | Required | Whether the media item has MDE | -| time | Float | Required | The time of the media item | -| duration | Float | Required | The duration of the media item | -| context | String | Required | The context of the media item | -| playQueueItemId | Float | Required | The play queue item ID of the media item | -| playBackTime | Float | Required | The playback time of the media item | -| row | Float | Required | The row of the media item | - -**Return Type** - -Returns a dict object. - -**Example Usage Code Snippet** -```Java -package com.plexsdk.examples; - -import com.plexsdk.PlexSDK; -import com.plexsdk.exceptions.ApiException; - -public class Main { - - public static void main(String[] args) { - PlexSDK client = new PlexSDK( - System.getenv("PLEXSDK_API_KEY"), - System.getenv("PLEXSDK_API_KEY_HEADER") - ); - try { - Object response = client.videoService.getTimeline( - 6, - "keySampleValue", - "stateSampleValue", - 8, - 5, - 1, - "contextSampleValue", - 4, - 3, - 3 - ); - System.out.println(response); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} - -``` - - - diff --git a/src/main/java/com/plexsdk/services/SearchService.java b/src/main/java/com/plexsdk/services/SearchService.java deleted file mode 100644 index b5e9c923..00000000 --- a/src/main/java/com/plexsdk/services/SearchService.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.plexsdk.services; - -import com.plexsdk.exceptions.ApiException; -import com.plexsdk.http.*; -import com.plexsdk.http.util.HttpHeaders; -import com.plexsdk.http.util.HttpUrl; -import com.plexsdk.models.BaseModel; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import okhttp3.Headers; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -public class SearchService extends BaseService implements SearchClient { - - public SearchService(OkHttpClient httpClient, String serverUrl) { - super(httpClient, serverUrl); - } - - /** - * @summary Perform a search - * @param {String} query - The query term - * @param {Number} [sectionId] - This gives context to the search, and can result in re-ordering of search result hubs - * @param {Number} [limit] - The number of items to return per hub - */ - public ResponseWithHeaders performSearch(String query, Float sectionId, Float limit) - throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("hubs") - .addPathParameter("search") - .addRequiredQueryParameter("query", query) - .addOptionalQueryParameter("sectionId", sectionId) - .addOptionalQueryParameter("limit", limit) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Perform a voice search - * @param {String} query - The query term - * @param {Number} [sectionId] - This gives context to the search, and can result in re-ordering of search result hubs - * @param {Number} [limit] - The number of items to return per hub - */ - public ResponseWithHeaders performVoiceSearch(String query, Float sectionId, Float limit) - throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("hubs") - .addPathParameter("search") - .addPathParameter("voice") - .addRequiredQueryParameter("query", query) - .addOptionalQueryParameter("sectionId", sectionId) - .addOptionalQueryParameter("limit", limit) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Get Search Results - * @param {String} query - The search query string to use - */ - public ResponseWithHeaders getSearchResults( - String query - ) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("search") - .addRequiredQueryParameter("query", query) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - return new ResponseWithHeaders( - ModelConverter.convert( - response, - new com.fasterxml.jackson.core.type.TypeReference< - com.plexsdk.models.GetSearchResultsResponse - >() {} - ), - response.headers() - ); - } -} diff --git a/src/main/java/com/plexsdk/services/SecurityService.java b/src/main/java/com/plexsdk/services/SecurityService.java deleted file mode 100644 index 18dcd3e1..00000000 --- a/src/main/java/com/plexsdk/services/SecurityService.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.plexsdk.services; - -import com.plexsdk.exceptions.ApiException; -import com.plexsdk.http.*; -import com.plexsdk.http.util.HttpHeaders; -import com.plexsdk.http.util.HttpUrl; -import com.plexsdk.models.BaseModel; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import okhttp3.Headers; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -public class SecurityService extends BaseService implements SecurityClient { - - public SecurityService(OkHttpClient httpClient, String serverUrl) { - super(httpClient, serverUrl); - } - - /** - * @summary Get a Transient Token. - * @param {String} type - `delegation` - This is the only supported `type` parameter. - * @param {String} scope - `all` - This is the only supported `scope` parameter. - */ - public ResponseWithHeaders getTransientToken(String type, String scope) - throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("security") - .addPathParameter("token") - .addRequiredQueryParameter("type", type) - .addRequiredQueryParameter("scope", scope) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Get Source Connection Information - * @param {String} source - The source identifier with an included prefix. - */ - public ResponseWithHeaders getSourceConnectionInformation(String source) - throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("security") - .addPathParameter("resources") - .addRequiredQueryParameter("source", source) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/src/main/java/com/plexsdk/services/ServerService.java b/src/main/java/com/plexsdk/services/ServerService.java deleted file mode 100644 index 46b0a6f2..00000000 --- a/src/main/java/com/plexsdk/services/ServerService.java +++ /dev/null @@ -1,218 +0,0 @@ -package com.plexsdk.services; - -import com.plexsdk.exceptions.ApiException; -import com.plexsdk.http.*; -import com.plexsdk.http.util.HttpHeaders; -import com.plexsdk.http.util.HttpUrl; -import com.plexsdk.models.BaseModel; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import okhttp3.Headers; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -public class ServerService extends BaseService implements ServerClient { - - public ServerService(OkHttpClient httpClient, String serverUrl) { - super(httpClient, serverUrl); - } - - /** - * @summary Server Capabilities - */ - public ResponseWithHeaders< - com.plexsdk.models.GetServerCapabilitiesResponse - > getServerCapabilities() throws ApiException { - String url = HttpUrl.builder(this.serverUrl).build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - return new ResponseWithHeaders( - ModelConverter.convert( - response, - new com.fasterxml.jackson.core.type.TypeReference< - com.plexsdk.models.GetServerCapabilitiesResponse - >() {} - ), - response.headers() - ); - } - - /** - * @summary Get Server Preferences - */ - public ResponseWithHeaders getServerPreferences() throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter(":") - .addPathParameter("prefs") - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Get Available Clients - */ - public ResponseWithHeaders< - java.util.List - > getAvailableClients() throws ApiException { - String url = HttpUrl.builder(this.serverUrl).addPathParameter("clients").build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - return new ResponseWithHeaders>( - ModelConverter.convert( - response, - new com.fasterxml.jackson.core.type.TypeReference< - java.util.List - >() {} - ), - response.headers() - ); - } - - /** - * @summary Get Devices - */ - public ResponseWithHeaders getDevices() - throws ApiException { - String url = HttpUrl.builder(this.serverUrl).addPathParameter("devices").build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - return new ResponseWithHeaders( - ModelConverter.convert( - response, - new com.fasterxml.jackson.core.type.TypeReference< - com.plexsdk.models.GetDevicesResponse - >() {} - ), - response.headers() - ); - } - - /** - * @summary Get Server Identity - */ - public ResponseWithHeaders getServerIdentity() - throws ApiException { - String url = HttpUrl.builder(this.serverUrl).addPathParameter("identity").build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - return new ResponseWithHeaders( - ModelConverter.convert( - response, - new com.fasterxml.jackson.core.type.TypeReference< - com.plexsdk.models.GetServerIdentityResponse - >() {} - ), - response.headers() - ); - } - - /** - * @summary Get MyPlex Account - */ - public ResponseWithHeaders getMyPlexAccount() - throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("myplex") - .addPathParameter("account") - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - return new ResponseWithHeaders( - ModelConverter.convert( - response, - new com.fasterxml.jackson.core.type.TypeReference< - com.plexsdk.models.GetMyPlexAccountResponse - >() {} - ), - response.headers() - ); - } - - /** - * @summary Get a Resized Photo - * @param {Number} width - The width for the resized photo - * @param {Number} height - The height for the resized photo - * @param {Integer} opacity - The opacity for the resized photo - * @param {Number} blur - The width for the resized photo - * @param {Number} minSize - images are always scaled proportionally. A value of '1' in minSize will make the smaller native dimension the dimension resized against. - * @param {Number} upscale - allow images to be resized beyond native dimensions. - * @param {String} url - path to image within Plex - */ - public ResponseWithHeaders getResizedPhoto( - Float width, - Float height, - Integer opacity, - Float blur, - Float minSize, - Float upscale, - String url - ) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("photo") - .addPathParameter(":") - .addPathParameter("transcode") - .addRequiredQueryParameter("width", width) - .addRequiredQueryParameter("height", height) - .addRequiredQueryParameter("opacity", opacity) - .addRequiredQueryParameter("blur", blur) - .addRequiredQueryParameter("minSize", minSize) - .addRequiredQueryParameter("upscale", upscale) - .addRequiredQueryParameter("url", url) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Get Server List - */ - public ResponseWithHeaders getServerList() - throws ApiException { - String url = HttpUrl.builder(this.serverUrl).addPathParameter("servers").build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - return new ResponseWithHeaders( - ModelConverter.convert( - response, - new com.fasterxml.jackson.core.type.TypeReference< - com.plexsdk.models.GetServerListResponse - >() {} - ), - response.headers() - ); - } -} diff --git a/src/main/java/com/plexsdk/services/SessionsService.java b/src/main/java/com/plexsdk/services/SessionsService.java deleted file mode 100644 index 73836dbb..00000000 --- a/src/main/java/com/plexsdk/services/SessionsService.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.plexsdk.services; - -import com.plexsdk.exceptions.ApiException; -import com.plexsdk.http.*; -import com.plexsdk.http.util.HttpHeaders; -import com.plexsdk.http.util.HttpUrl; -import com.plexsdk.models.BaseModel; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import okhttp3.Headers; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -public class SessionsService extends BaseService implements SessionsClient { - - public SessionsService(OkHttpClient httpClient, String serverUrl) { - super(httpClient, serverUrl); - } - - /** - * @summary Get Active Sessions - */ - public ResponseWithHeaders getSessions() throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("status") - .addPathParameter("sessions") - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Get Session History - */ - public ResponseWithHeaders getSessionHistory() throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("status") - .addPathParameter("sessions") - .addPathParameter("history") - .addPathParameter("all") - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Get Transcode Sessions - */ - public ResponseWithHeaders< - com.plexsdk.models.GetTranscodeSessionsResponse - > getTranscodeSessions() throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("transcode") - .addPathParameter("sessions") - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - return new ResponseWithHeaders( - ModelConverter.convert( - response, - new com.fasterxml.jackson.core.type.TypeReference< - com.plexsdk.models.GetTranscodeSessionsResponse - >() {} - ), - response.headers() - ); - } - - /** - * @summary Stop a Transcode Session - * @param {String} sessionKey - the Key of the transcode session to stop - */ - public ResponseWithHeaders stopTranscodeSession(String sessionKey) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("transcode") - .addPathParameter("sessions") - .addPathParameter(String.valueOf(sessionKey)) - .build(); - Request request = new Request.Builder().url(url).delete().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/src/main/java/com/plexsdk/services/UpdaterService.java b/src/main/java/com/plexsdk/services/UpdaterService.java deleted file mode 100644 index ba7d9cd4..00000000 --- a/src/main/java/com/plexsdk/services/UpdaterService.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.plexsdk.services; - -import com.plexsdk.exceptions.ApiException; -import com.plexsdk.http.*; -import com.plexsdk.http.util.HttpHeaders; -import com.plexsdk.http.util.HttpUrl; -import com.plexsdk.models.BaseModel; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import okhttp3.Headers; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -public class UpdaterService extends BaseService implements UpdaterClient { - - public UpdaterService(OkHttpClient httpClient, String serverUrl) { - super(httpClient, serverUrl); - } - - /** - * @summary Querying status of updates - */ - public ResponseWithHeaders getUpdateStatus() throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("updater") - .addPathParameter("status") - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Checking for updates - * @param {Download} [download] - Indicate that you want to start download any updates found. - */ - public ResponseWithHeaders checkForUpdates(String download) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("updater") - .addPathParameter("check") - .addOptionalQueryParameter("download", download) - .build(); - RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); - Request request = new Request.Builder().url(url).put(requestBody).build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Apply Updates - * @param {Tonight} [tonight] - 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 - * @param {Skip} [skip] - Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. - */ - public ResponseWithHeaders applyUpdates(String tonight, String skip) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("updater") - .addPathParameter("apply") - .addOptionalQueryParameter("tonight", tonight) - .addOptionalQueryParameter("skip", skip) - .build(); - RequestBody requestBody = RequestBody.create( - Objects.requireNonNull(ModelConverter.modelToJson(new BaseModel() {})), - okhttp3.MediaType.parse("application/json; charset=utf-8") - ); - Request request = new Request.Builder().url(url).put(requestBody).build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/src/main/java/com/plexsdk/services/VideoService.java b/src/main/java/com/plexsdk/services/VideoService.java deleted file mode 100644 index 1d00c24f..00000000 --- a/src/main/java/com/plexsdk/services/VideoService.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.plexsdk.services; - -import com.plexsdk.exceptions.ApiException; -import com.plexsdk.http.*; -import com.plexsdk.http.util.HttpHeaders; -import com.plexsdk.http.util.HttpUrl; -import com.plexsdk.models.BaseModel; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import okhttp3.Headers; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -public class VideoService extends BaseService implements VideoClient { - - public VideoService(OkHttpClient httpClient, String serverUrl) { - super(httpClient, serverUrl); - } - - /** - * @summary Start Universal Transcode - * @param {Number} hasMDE - Whether the media item has MDE - * @param {String} path - The path to the media item to transcode - * @param {Number} mediaIndex - The index of the media item to transcode - * @param {Number} partIndex - The index of the part to transcode - * @param {String} protocol - The protocol to use for the transcode session - * @param {Number} [fastSeek] - Whether to use fast seek or not - * @param {Number} [directPlay] - Whether to use direct play or not - * @param {Number} [directStream] - Whether to use direct stream or not - * @param {Number} [subtitleSize] - The size of the subtitles - * @param {String} [subtites] - The subtitles - * @param {Number} [audioBoost] - The audio boost - * @param {String} [location] - The location of the transcode session - * @param {Number} [mediaBufferSize] - The size of the media buffer - * @param {String} [session] - The session ID - * @param {Number} [addDebugOverlay] - Whether to add a debug overlay or not - * @param {Number} [autoAdjustQuality] - Whether to auto adjust quality or not - */ - public ResponseWithHeaders startUniversalTranscode( - Float hasMDE, - String path, - Float mediaIndex, - Float partIndex, - String protocol, - Float fastSeek, - Float directPlay, - Float directStream, - Float subtitleSize, - String subtites, - Float audioBoost, - String location, - Float mediaBufferSize, - String session, - Float addDebugOverlay, - Float autoAdjustQuality - ) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter("video") - .addPathParameter(":") - .addPathParameter("transcode") - .addPathParameter("universal") - .addPathParameter("start.mpd") - .addRequiredQueryParameter("hasMDE", hasMDE) - .addRequiredQueryParameter("path", path) - .addRequiredQueryParameter("mediaIndex", mediaIndex) - .addRequiredQueryParameter("partIndex", partIndex) - .addRequiredQueryParameter("protocol", protocol) - .addOptionalQueryParameter("fastSeek", fastSeek) - .addOptionalQueryParameter("directPlay", directPlay) - .addOptionalQueryParameter("directStream", directStream) - .addOptionalQueryParameter("subtitleSize", subtitleSize) - .addOptionalQueryParameter("subtites", subtites) - .addOptionalQueryParameter("audioBoost", audioBoost) - .addOptionalQueryParameter("location", location) - .addOptionalQueryParameter("mediaBufferSize", mediaBufferSize) - .addOptionalQueryParameter("session", session) - .addOptionalQueryParameter("addDebugOverlay", addDebugOverlay) - .addOptionalQueryParameter("autoAdjustQuality", autoAdjustQuality) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @summary Get the timeline for a media item - * @param {Number} ratingKey - The rating key of the media item - * @param {String} key - The key of the media item to get the timeline for - * @param {String} state - The state of the media item - * @param {Number} hasMDE - Whether the media item has MDE - * @param {Number} time - The time of the media item - * @param {Number} duration - The duration of the media item - * @param {String} context - The context of the media item - * @param {Number} playQueueItemID - The play queue item ID of the media item - * @param {Number} playBackTime - The playback time of the media item - * @param {Number} row - The row of the media item - */ - public ResponseWithHeaders getTimeline( - Float ratingKey, - String key, - String state, - Float hasMDE, - Float time, - Float duration, - String context, - Float playQueueItemID, - Float playBackTime, - Float row - ) throws ApiException { - String url = HttpUrl - .builder(this.serverUrl) - .addPathParameter(":") - .addPathParameter("timeline") - .addRequiredQueryParameter("ratingKey", ratingKey) - .addRequiredQueryParameter("key", key) - .addRequiredQueryParameter("state", state) - .addRequiredQueryParameter("hasMDE", hasMDE) - .addRequiredQueryParameter("time", time) - .addRequiredQueryParameter("duration", duration) - .addRequiredQueryParameter("context", context) - .addRequiredQueryParameter("playQueueItemID", playQueueItemID) - .addRequiredQueryParameter("playBackTime", playBackTime) - .addRequiredQueryParameter("row", row) - .build(); - Request request = new Request.Builder().url(url).get().build(); - Response response = this.execute(request); - - try { - return new ResponseWithHeaders( - response.body().string(), - response.headers() - ); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/src/main/java/lukehagar/plexapi/plexapi/SDKConfiguration.java b/src/main/java/lukehagar/plexapi/plexapi/SDKConfiguration.java index f8747371..f17687b3 100644 --- a/src/main/java/lukehagar/plexapi/plexapi/SDKConfiguration.java +++ b/src/main/java/lukehagar/plexapi/plexapi/SDKConfiguration.java @@ -33,8 +33,8 @@ class SDKConfiguration { public String language = "java"; public String openapiDocVersion = "0.0.3"; public String sdkVersion = "0.1.1"; - public String genVersion = "2.354.2"; - public String userAgent = "speakeasy-sdk/java 0.1.1 2.354.2 0.0.3 lukehagar.plexapi.plexapi"; + public String genVersion = "2.356.0"; + public String userAgent = "speakeasy-sdk/java 0.1.1 2.356.0 0.0.3 lukehagar.plexapi.plexapi"; private lukehagar.plexapi.plexapi.utils.Hooks _hooks = createHooks(); diff --git a/src/test/java/47/one0/TestTest.java b/src/test/java/47/one0/TestTest.java deleted file mode 100644 index ecaff14c..00000000 --- a/src/test/java/47/one0/TestTest.java +++ /dev/null @@ -1,12 +0,0 @@ -package 47.one0; - -import org.junit.jupiter.api.*; -import static org.junit.Assert.assertTrue; - -public class TestTest { - @Test - @DisplayName("Tests that JUnit is working") - public void test() { - assertTrue(true); - } -} diff --git a/src/test/java/47/one0/helpers/TestModel.java b/src/test/java/47/one0/helpers/TestModel.java deleted file mode 100644 index 28f3f087..00000000 --- a/src/test/java/47/one0/helpers/TestModel.java +++ /dev/null @@ -1,16 +0,0 @@ -package 47.one0.helpers; - -import com.fasterxml.jackson.annotation.JsonProperty; -import 47.one0.models.BaseModel; - -public class TestModel extends BaseModel { - public String testString; - public int testInt; - public boolean testBoolean; - - public TestModel(@JsonProperty("testString") String testString, @JsonProperty("testInt") int testInt, @JsonProperty("testBoolean") boolean testBoolean) { - this.testString = testString; - this.testInt = testInt; - this.testBoolean = testBoolean; - } -} diff --git a/src/test/java/47/one0/http/ModelConverterTest.java b/src/test/java/47/one0/http/ModelConverterTest.java deleted file mode 100644 index 90a8547f..00000000 --- a/src/test/java/47/one0/http/ModelConverterTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package 47.one0.http; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import org.junit.jupiter.api.*; - -import 47.one0.helpers.TestModel; - -public class ModelConverterTest { - @Test - @DisplayName("Testing ModelConverter.modelToJson()") - public void testModelToJson() { - TestModel testModel = new TestModel("testString", 1, true); - String json = ModelConverter.modelToJson(testModel); - assertEquals(json, "{\"testString\":\"testString\",\"testInt\":1,\"testBoolean\":true}"); - } - - @Test - @DisplayName("Testing ModelConverter.jsonToModel()") - public void testJsonToModel() { - String json = "{\"testString\":\"testString\",\"testInt\":1,\"testBoolean\":true}"; - TestModel testModel = ModelConverter.convert(json, TestModel.class); - assertEquals(testModel.testString, "testString"); - assertEquals(testModel.testInt, 1); - assertTrue(testModel.testBoolean); - } - - @Test - @DisplayName("Testing ModelConverter.convert() and ModelConverter.modelToJson() are congruent") - public void congruency(){ - TestModel testModel = new TestModel("testString", 1, true); - String json = ModelConverter.modelToJson(testModel); - TestModel testModel2 = ModelConverter.convert(json, TestModel.class); - assertEquals(testModel.testString, testModel2.testString); - assertEquals(testModel.testInt, testModel2.testInt); - assertTrue(testModel.testBoolean == testModel2.testBoolean); - } - -} diff --git a/src/test/java/47/one0/models/ModelOneOfTests.java b/src/test/java/47/one0/models/ModelOneOfTests.java deleted file mode 100644 index 2eeb1505..00000000 --- a/src/test/java/47/one0/models/ModelOneOfTests.java +++ /dev/null @@ -1,138 +0,0 @@ -package 47.one0.models; - -import java.util.Set; - -import org.junit.Assert; -import org.junit.jupiter.api.Test; -import utils.ArrayUtils; - -public class ModelOneOfTests { - @Test - void testWithEmptyObject() { - BaseModel.Builder builder = - new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) { - @Override - protected Set getNonNullInstanceFieldNames() { - return ArrayUtils.arrayToSet(new java.lang.String[] {}); - } - - @Override - protected Set> getRequiredFieldsGroups() { - return ArrayUtils.arraysToSets( - new java.lang.String[][] { - new java.lang.String[] {"foo", "bar", "baz"}, - }); - } - }; - - Assert.assertEquals("Object fails OneOf validation.", builder.validate()); - } - - @Test - void testWithEmptyObjectWithNoRequiredFields() { - BaseModel.Builder builder = - new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) { - @Override - protected Set getNonNullInstanceFieldNames() { - return ArrayUtils.arrayToSet(new java.lang.String[] {}); - } - - @Override - protected Set> getRequiredFieldsGroups() { - return ArrayUtils.arraysToSets( - new java.lang.String[][] { - new java.lang.String[] {}, - }); - } - }; - - Assert.assertNull(builder.validate()); - } - - @Test - void testWithNoRequiredFields() { - BaseModel.Builder builder = - new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) { - @Override - protected Set getNonNullInstanceFieldNames() { - return ArrayUtils.arrayToSet(new java.lang.String[] {"foo", "bar", "baz"}); - } - - @Override - protected Set> getRequiredFieldsGroups() { - return ArrayUtils.arraysToSets(new java.lang.String[][] {}); - } - }; - - Assert.assertNull(builder.validate()); - } - - @Test - void testWithRequiredFieldsMatching() { - BaseModel.Builder builder = - new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) { - @Override - protected Set getNonNullInstanceFieldNames() { - return ArrayUtils.arrayToSet(new java.lang.String[] {"foo", "bar", "baz"}); - } - - @Override - protected Set> getRequiredFieldsGroups() { - return ArrayUtils.arraysToSets( - new java.lang.String[][] { - new String[] {"fizz", "buzz"}, - new String[] {"foo", "bar", "baz"}, - new String[] {"fish"} - }); - } - }; - - Assert.assertNull(builder.validate()); - } - - @Test - void testWithRequiredFieldsNotMatching() { - BaseModel.Builder builder = - new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) { - @Override - protected Set getNonNullInstanceFieldNames() { - return ArrayUtils.arrayToSet(new java.lang.String[] {"alpha", "bravo", "charlie"}); - } - - @Override - protected Set> getRequiredFieldsGroups() { - return ArrayUtils.arraysToSets( - new java.lang.String[][] { - new String[] {"fizz", "buzz"}, - new String[] {"foo", "bar", "baz"}, - new String[] {"fish"} - }); - } - }; - - Assert.assertEquals("Object fails OneOf validation.", builder.validate()); - } - - @Test - void testWithRequiredFieldsPartiallyMatching() { - BaseModel.Builder builder = - new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) { - @Override - protected Set getNonNullInstanceFieldNames() { - return ArrayUtils.arrayToSet(new java.lang.String[] {"foo", "bar", "charlie"}); - } - - @Override - protected Set> getRequiredFieldsGroups() { - return ArrayUtils.arraysToSets( - new java.lang.String[][] { - new String[] {"fizz", "buzz"}, - new String[] {"foo", "bar", "baz"}, - new String[] {"fish"} - }); - } - }; - - Assert.assertEquals("Object fails OneOf validation.", builder.validate()); - } -} diff --git a/src/test/java/47/one0/services/ActivitiesServiceTest.java b/src/test/java/47/one0/services/ActivitiesServiceTest.java deleted file mode 100644 index 8ba739eb..00000000 --- a/src/test/java/47/one0/services/ActivitiesServiceTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package 47.one0.services; - -import static org.junit.Assert.assertTrue; - -import org.junit.jupiter.api.*; - -import 47.one0.models.*; - -class ActivitiesServiceTest { - - // @ActivitiesServiceTest - - // @DisplayName("Test that Activities is working") - - // public void test() {} - - // TODO: Write tests for getServerActivities - - // TODO: Write tests for cancelServerActivities - -} \ No newline at end of file diff --git a/src/test/java/47/one0/services/BaseServiceTest.java b/src/test/java/47/one0/services/BaseServiceTest.java deleted file mode 100644 index ef322613..00000000 --- a/src/test/java/47/one0/services/BaseServiceTest.java +++ /dev/null @@ -1,12 +0,0 @@ -package 47.one0.services; - -import static org.junit.Assert.assertTrue; - -import org.junit.jupiter.api.*; - -public class BaseServiceTest { - //@BaseServiceTest - //@DisplayName("BaseServiceTest that base service is working") - //public void test() {} - // TODO: Add base service test code here -} diff --git a/src/test/java/47/one0/services/ButlerServiceTest.java b/src/test/java/47/one0/services/ButlerServiceTest.java deleted file mode 100644 index 485d8783..00000000 --- a/src/test/java/47/one0/services/ButlerServiceTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package 47.one0.services; - -import static org.junit.Assert.assertTrue; - -import org.junit.jupiter.api.*; - -import 47.one0.models.*; - -class ButlerServiceTest { - - // @ButlerServiceTest - - // @DisplayName("Test that Butler is working") - - // public void test() {} - - // TODO: Write tests for getButlerTasks - - // TODO: Write tests for startAllTasks - - // TODO: Write tests for stopAllTasks - - // TODO: Write tests for startTask - - // TODO: Write tests for stopTask - -} \ No newline at end of file diff --git a/src/test/java/47/one0/services/HubsServiceTest.java b/src/test/java/47/one0/services/HubsServiceTest.java deleted file mode 100644 index 67a4c578..00000000 --- a/src/test/java/47/one0/services/HubsServiceTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package 47.one0.services; - -import static org.junit.Assert.assertTrue; - -import org.junit.jupiter.api.*; - -import 47.one0.models.*; - -class HubsServiceTest { - - // @HubsServiceTest - - // @DisplayName("Test that Hubs is working") - - // public void test() {} - - // TODO: Write tests for getGlobalHubs - - // TODO: Write tests for getLibraryHubs - -} \ No newline at end of file diff --git a/src/test/java/47/one0/services/LibraryServiceTest.java b/src/test/java/47/one0/services/LibraryServiceTest.java deleted file mode 100644 index faf37730..00000000 --- a/src/test/java/47/one0/services/LibraryServiceTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package 47.one0.services; - -import static org.junit.Assert.assertTrue; - -import org.junit.jupiter.api.*; - -import 47.one0.models.*; - -class LibraryServiceTest { - - // @LibraryServiceTest - - // @DisplayName("Test that Library is working") - - // public void test() {} - - // TODO: Write tests for getFileHash - - // TODO: Write tests for getRecentlyAdded - - // TODO: Write tests for getLibraries - - // TODO: Write tests for getLibrary - - // TODO: Write tests for deleteLibrary - - // TODO: Write tests for getLibraryItems - - // TODO: Write tests for refreshLibrary - - // TODO: Write tests for getLatestLibraryItems - - // TODO: Write tests for getCommonLibraryItems - - // TODO: Write tests for getMetadata - - // TODO: Write tests for getMetadataChildren - - // TODO: Write tests for getOnDeck - -} \ No newline at end of file diff --git a/src/test/java/47/one0/services/LogServiceTest.java b/src/test/java/47/one0/services/LogServiceTest.java deleted file mode 100644 index 01d0c6b4..00000000 --- a/src/test/java/47/one0/services/LogServiceTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package 47.one0.services; - -import static org.junit.Assert.assertTrue; - -import org.junit.jupiter.api.*; - -import 47.one0.models.*; - -class LogServiceTest { - - // @LogServiceTest - - // @DisplayName("Test that Log is working") - - // public void test() {} - - // TODO: Write tests for logLine - - // TODO: Write tests for logMultiLine - - // TODO: Write tests for enablePaperTrail - -} \ No newline at end of file diff --git a/src/test/java/47/one0/services/MediaServiceTest.java b/src/test/java/47/one0/services/MediaServiceTest.java deleted file mode 100644 index 0be87bb5..00000000 --- a/src/test/java/47/one0/services/MediaServiceTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package 47.one0.services; - -import static org.junit.Assert.assertTrue; - -import org.junit.jupiter.api.*; - -import 47.one0.models.*; - -class MediaServiceTest { - - // @MediaServiceTest - - // @DisplayName("Test that Media is working") - - // public void test() {} - - // TODO: Write tests for markPlayed - - // TODO: Write tests for markUnplayed - - // TODO: Write tests for updatePlayProgress - -} \ No newline at end of file diff --git a/src/test/java/47/one0/services/PlaylistsServiceTest.java b/src/test/java/47/one0/services/PlaylistsServiceTest.java deleted file mode 100644 index ae022895..00000000 --- a/src/test/java/47/one0/services/PlaylistsServiceTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package 47.one0.services; - -import static org.junit.Assert.assertTrue; - -import org.junit.jupiter.api.*; - -import 47.one0.models.*; - -class PlaylistsServiceTest { - - // @PlaylistsServiceTest - - // @DisplayName("Test that Playlists is working") - - // public void test() {} - - // TODO: Write tests for createPlaylist - - // TODO: Write tests for getPlaylists - - // TODO: Write tests for getPlaylist - - // TODO: Write tests for updatePlaylist - - // TODO: Write tests for deletePlaylist - - // TODO: Write tests for getPlaylistContents - - // TODO: Write tests for addPlaylistContents - - // TODO: Write tests for clearPlaylistContents - - // TODO: Write tests for uploadPlaylist - -} \ No newline at end of file diff --git a/src/test/java/47/one0/services/SearchServiceTest.java b/src/test/java/47/one0/services/SearchServiceTest.java deleted file mode 100644 index 90c43eb0..00000000 --- a/src/test/java/47/one0/services/SearchServiceTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package 47.one0.services; - -import static org.junit.Assert.assertTrue; - -import org.junit.jupiter.api.*; - -import 47.one0.models.*; - -class SearchServiceTest { - - // @SearchServiceTest - - // @DisplayName("Test that Search is working") - - // public void test() {} - - // TODO: Write tests for performSearch - - // TODO: Write tests for performVoiceSearch - - // TODO: Write tests for getSearchResults - -} \ No newline at end of file diff --git a/src/test/java/47/one0/services/SecurityServiceTest.java b/src/test/java/47/one0/services/SecurityServiceTest.java deleted file mode 100644 index e9e6ecd2..00000000 --- a/src/test/java/47/one0/services/SecurityServiceTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package 47.one0.services; - -import static org.junit.Assert.assertTrue; - -import org.junit.jupiter.api.*; - -import 47.one0.models.*; - -class SecurityServiceTest { - - // @SecurityServiceTest - - // @DisplayName("Test that Security is working") - - // public void test() {} - - // TODO: Write tests for getTransientToken - - // TODO: Write tests for getSourceConnectionInformation - -} \ No newline at end of file diff --git a/src/test/java/47/one0/services/ServerServiceTest.java b/src/test/java/47/one0/services/ServerServiceTest.java deleted file mode 100644 index f1e5d4ab..00000000 --- a/src/test/java/47/one0/services/ServerServiceTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package 47.one0.services; - -import static org.junit.Assert.assertTrue; - -import org.junit.jupiter.api.*; - -import 47.one0.models.*; - -class ServerServiceTest { - - // @ServerServiceTest - - // @DisplayName("Test that Server is working") - - // public void test() {} - - // TODO: Write tests for getServerCapabilities - - // TODO: Write tests for getServerPreferences - - // TODO: Write tests for getAvailableClients - - // TODO: Write tests for getDevices - - // TODO: Write tests for getServerIdentity - - // TODO: Write tests for getMyPlexAccount - - // TODO: Write tests for getResizedPhoto - - // TODO: Write tests for getServerList - -} \ No newline at end of file diff --git a/src/test/java/47/one0/services/SessionsServiceTest.java b/src/test/java/47/one0/services/SessionsServiceTest.java deleted file mode 100644 index 7fb81368..00000000 --- a/src/test/java/47/one0/services/SessionsServiceTest.java +++ /dev/null @@ -1,25 +0,0 @@ -package 47.one0.services; - -import static org.junit.Assert.assertTrue; - -import org.junit.jupiter.api.*; - -import 47.one0.models.*; - -class SessionsServiceTest { - - // @SessionsServiceTest - - // @DisplayName("Test that Sessions is working") - - // public void test() {} - - // TODO: Write tests for getSessions - - // TODO: Write tests for getSessionHistory - - // TODO: Write tests for getTranscodeSessions - - // TODO: Write tests for stopTranscodeSession - -} \ No newline at end of file diff --git a/src/test/java/47/one0/services/UpdaterServiceTest.java b/src/test/java/47/one0/services/UpdaterServiceTest.java deleted file mode 100644 index ce52ac70..00000000 --- a/src/test/java/47/one0/services/UpdaterServiceTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package 47.one0.services; - -import static org.junit.Assert.assertTrue; - -import org.junit.jupiter.api.*; - -import 47.one0.models.*; - -class UpdaterServiceTest { - - // @UpdaterServiceTest - - // @DisplayName("Test that Updater is working") - - // public void test() {} - - // TODO: Write tests for getUpdateStatus - - // TODO: Write tests for checkForUpdates - - // TODO: Write tests for applyUpdates - -} \ No newline at end of file diff --git a/src/test/java/47/one0/services/VideoServiceTest.java b/src/test/java/47/one0/services/VideoServiceTest.java deleted file mode 100644 index 0aade824..00000000 --- a/src/test/java/47/one0/services/VideoServiceTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package 47.one0.services; - -import static org.junit.Assert.assertTrue; - -import org.junit.jupiter.api.*; - -import 47.one0.models.*; - -class VideoServiceTest { - - // @VideoServiceTest - - // @DisplayName("Test that Video is working") - - // public void test() {} - - // TODO: Write tests for startUniversalTranscode - - // TODO: Write tests for getTimeline - -} \ No newline at end of file diff --git a/src/test/java/com/plexsdk/TestTest.java b/src/test/java/com/plexsdk/TestTest.java deleted file mode 100644 index 7fc8f585..00000000 --- a/src/test/java/com/plexsdk/TestTest.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.plexsdk; - -import static org.junit.Assert.assertTrue; - -import org.junit.jupiter.api.*; - -public class TestTest { - - @Test - @DisplayName("Tests that JUnit is working") - public void test() { - assertTrue(true); - } -} diff --git a/src/test/java/com/plexsdk/helpers/TestModel.java b/src/test/java/com/plexsdk/helpers/TestModel.java deleted file mode 100644 index e8f339e1..00000000 --- a/src/test/java/com/plexsdk/helpers/TestModel.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.plexsdk.helpers; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.plexsdk.models.BaseModel; - -public class TestModel extends BaseModel { - - public String testString; - public int testInt; - public boolean testBoolean; - - public TestModel( - @JsonProperty("testString") String testString, - @JsonProperty("testInt") int testInt, - @JsonProperty("testBoolean") boolean testBoolean - ) { - this.testString = testString; - this.testInt = testInt; - this.testBoolean = testBoolean; - } -} diff --git a/src/test/java/com/plexsdk/http/ModelConverterTest.java b/src/test/java/com/plexsdk/http/ModelConverterTest.java deleted file mode 100644 index 3aa652a3..00000000 --- a/src/test/java/com/plexsdk/http/ModelConverterTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.plexsdk.http; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import com.plexsdk.helpers.TestModel; -import org.junit.jupiter.api.*; - -public class ModelConverterTest { - - @Test - @DisplayName("Testing ModelConverter.modelToJson()") - public void testModelToJson() { - TestModel testModel = new TestModel("testString", 1, true); - String json = ModelConverter.modelToJson(testModel); - assertEquals(json, "{\"testString\":\"testString\",\"testInt\":1,\"testBoolean\":true}"); - } - - @Test - @DisplayName("Testing ModelConverter.jsonToModel()") - public void testJsonToModel() { - String json = "{\"testString\":\"testString\",\"testInt\":1,\"testBoolean\":true}"; - TestModel testModel = ModelConverter.convert(json, TestModel.class); - assertEquals(testModel.testString, "testString"); - assertEquals(testModel.testInt, 1); - assertTrue(testModel.testBoolean); - } - - @Test - @DisplayName("Testing ModelConverter.convert() and ModelConverter.modelToJson() are congruent") - public void congruency() { - TestModel testModel = new TestModel("testString", 1, true); - String json = ModelConverter.modelToJson(testModel); - TestModel testModel2 = ModelConverter.convert(json, TestModel.class); - assertEquals(testModel.testString, testModel2.testString); - assertEquals(testModel.testInt, testModel2.testInt); - assertTrue(testModel.testBoolean == testModel2.testBoolean); - } -} diff --git a/src/test/java/com/plexsdk/models/ModelOneOfTests.java b/src/test/java/com/plexsdk/models/ModelOneOfTests.java deleted file mode 100644 index e224ebee..00000000 --- a/src/test/java/com/plexsdk/models/ModelOneOfTests.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.plexsdk.models; - -import java.util.Set; -import org.junit.Assert; -import org.junit.jupiter.api.Test; -import utils.ArrayUtils; - -public class ModelOneOfTests { - - @Test - void testWithEmptyObject() { - BaseModel.Builder builder = new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) { - @Override - protected Set getNonNullInstanceFieldNames() { - return ArrayUtils.arrayToSet(new java.lang.String[] {}); - } - - @Override - protected Set> getRequiredFieldsGroups() { - return ArrayUtils.arraysToSets( - new java.lang.String[][] { new java.lang.String[] { "foo", "bar", "baz" } } - ); - } - }; - - Assert.assertEquals("Object fails OneOf validation.", builder.validate()); - } - - @Test - void testWithEmptyObjectWithNoRequiredFields() { - BaseModel.Builder builder = new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) { - @Override - protected Set getNonNullInstanceFieldNames() { - return ArrayUtils.arrayToSet(new java.lang.String[] {}); - } - - @Override - protected Set> getRequiredFieldsGroups() { - return ArrayUtils.arraysToSets(new java.lang.String[][] { new java.lang.String[] {} }); - } - }; - - Assert.assertNull(builder.validate()); - } - - @Test - void testWithNoRequiredFields() { - BaseModel.Builder builder = new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) { - @Override - protected Set getNonNullInstanceFieldNames() { - return ArrayUtils.arrayToSet(new java.lang.String[] { "foo", "bar", "baz" }); - } - - @Override - protected Set> getRequiredFieldsGroups() { - return ArrayUtils.arraysToSets(new java.lang.String[][] {}); - } - }; - - Assert.assertNull(builder.validate()); - } - - @Test - void testWithRequiredFieldsMatching() { - BaseModel.Builder builder = new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) { - @Override - protected Set getNonNullInstanceFieldNames() { - return ArrayUtils.arrayToSet(new java.lang.String[] { "foo", "bar", "baz" }); - } - - @Override - protected Set> getRequiredFieldsGroups() { - return ArrayUtils.arraysToSets( - new java.lang.String[][] { - new String[] { "fizz", "buzz" }, - new String[] { "foo", "bar", "baz" }, - new String[] { "fish" }, - } - ); - } - }; - - Assert.assertNull(builder.validate()); - } - - @Test - void testWithRequiredFieldsNotMatching() { - BaseModel.Builder builder = new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) { - @Override - protected Set getNonNullInstanceFieldNames() { - return ArrayUtils.arrayToSet(new java.lang.String[] { "alpha", "bravo", "charlie" }); - } - - @Override - protected Set> getRequiredFieldsGroups() { - return ArrayUtils.arraysToSets( - new java.lang.String[][] { - new String[] { "fizz", "buzz" }, - new String[] { "foo", "bar", "baz" }, - new String[] { "fish" }, - } - ); - } - }; - - Assert.assertEquals("Object fails OneOf validation.", builder.validate()); - } - - @Test - void testWithRequiredFieldsPartiallyMatching() { - BaseModel.Builder builder = new BaseModel.Builder(BaseModel.Builder.ValidationType.ONE_OF) { - @Override - protected Set getNonNullInstanceFieldNames() { - return ArrayUtils.arrayToSet(new java.lang.String[] { "foo", "bar", "charlie" }); - } - - @Override - protected Set> getRequiredFieldsGroups() { - return ArrayUtils.arraysToSets( - new java.lang.String[][] { - new String[] { "fizz", "buzz" }, - new String[] { "foo", "bar", "baz" }, - new String[] { "fish" }, - } - ); - } - }; - - Assert.assertEquals("Object fails OneOf validation.", builder.validate()); - } -} diff --git a/src/test/java/com/plexsdk/services/ActivitiesServiceTest.java b/src/test/java/com/plexsdk/services/ActivitiesServiceTest.java deleted file mode 100644 index 1ecfffe7..00000000 --- a/src/test/java/com/plexsdk/services/ActivitiesServiceTest.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.plexsdk.services; - -import static org.junit.Assert.assertTrue; - -import com.plexsdk.models.*; -import org.junit.jupiter.api.*; - -class ActivitiesServiceTest { - // @ActivitiesServiceTest - - // @DisplayName("Test that Activities is working") - - // public void test() {} - - // TODO: Write tests for getServerActivities - - // TODO: Write tests for cancelServerActivities - -} diff --git a/src/test/java/com/plexsdk/services/BaseServiceTest.java b/src/test/java/com/plexsdk/services/BaseServiceTest.java deleted file mode 100644 index bc548fdf..00000000 --- a/src/test/java/com/plexsdk/services/BaseServiceTest.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.plexsdk.services; - -import static org.junit.Assert.assertTrue; - -import org.junit.jupiter.api.*; - -public class BaseServiceTest { - //@BaseServiceTest - //@DisplayName("BaseServiceTest that base service is working") - //public void test() {} - // TODO: Add base service test code here -} diff --git a/src/test/java/com/plexsdk/services/ButlerServiceTest.java b/src/test/java/com/plexsdk/services/ButlerServiceTest.java deleted file mode 100644 index 414e74c6..00000000 --- a/src/test/java/com/plexsdk/services/ButlerServiceTest.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.plexsdk.services; - -import static org.junit.Assert.assertTrue; - -import com.plexsdk.models.*; -import org.junit.jupiter.api.*; - -class ButlerServiceTest { - // @ButlerServiceTest - - // @DisplayName("Test that Butler is working") - - // public void test() {} - - // TODO: Write tests for getButlerTasks - - // TODO: Write tests for startAllTasks - - // TODO: Write tests for stopAllTasks - - // TODO: Write tests for startTask - - // TODO: Write tests for stopTask - -} diff --git a/src/test/java/com/plexsdk/services/HubsServiceTest.java b/src/test/java/com/plexsdk/services/HubsServiceTest.java deleted file mode 100644 index 6941fc07..00000000 --- a/src/test/java/com/plexsdk/services/HubsServiceTest.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.plexsdk.services; - -import static org.junit.Assert.assertTrue; - -import com.plexsdk.models.*; -import org.junit.jupiter.api.*; - -class HubsServiceTest { - // @HubsServiceTest - - // @DisplayName("Test that Hubs is working") - - // public void test() {} - - // TODO: Write tests for getGlobalHubs - - // TODO: Write tests for getLibraryHubs - -} diff --git a/src/test/java/com/plexsdk/services/LibraryServiceTest.java b/src/test/java/com/plexsdk/services/LibraryServiceTest.java deleted file mode 100644 index 98fb3881..00000000 --- a/src/test/java/com/plexsdk/services/LibraryServiceTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.plexsdk.services; - -import static org.junit.Assert.assertTrue; - -import com.plexsdk.models.*; -import org.junit.jupiter.api.*; - -class LibraryServiceTest { - // @LibraryServiceTest - - // @DisplayName("Test that Library is working") - - // public void test() {} - - // TODO: Write tests for getFileHash - - // TODO: Write tests for getRecentlyAdded - - // TODO: Write tests for getLibraries - - // TODO: Write tests for getLibrary - - // TODO: Write tests for deleteLibrary - - // TODO: Write tests for getLibraryItems - - // TODO: Write tests for refreshLibrary - - // TODO: Write tests for getLatestLibraryItems - - // TODO: Write tests for getCommonLibraryItems - - // TODO: Write tests for getMetadata - - // TODO: Write tests for getMetadataChildren - - // TODO: Write tests for getOnDeck - -} diff --git a/src/test/java/com/plexsdk/services/LogServiceTest.java b/src/test/java/com/plexsdk/services/LogServiceTest.java deleted file mode 100644 index fcc6baa2..00000000 --- a/src/test/java/com/plexsdk/services/LogServiceTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.plexsdk.services; - -import static org.junit.Assert.assertTrue; - -import com.plexsdk.models.*; -import org.junit.jupiter.api.*; - -class LogServiceTest { - // @LogServiceTest - - // @DisplayName("Test that Log is working") - - // public void test() {} - - // TODO: Write tests for logLine - - // TODO: Write tests for logMultiLine - - // TODO: Write tests for enablePaperTrail - -} diff --git a/src/test/java/com/plexsdk/services/MediaServiceTest.java b/src/test/java/com/plexsdk/services/MediaServiceTest.java deleted file mode 100644 index 34aacccf..00000000 --- a/src/test/java/com/plexsdk/services/MediaServiceTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.plexsdk.services; - -import static org.junit.Assert.assertTrue; - -import com.plexsdk.models.*; -import org.junit.jupiter.api.*; - -class MediaServiceTest { - // @MediaServiceTest - - // @DisplayName("Test that Media is working") - - // public void test() {} - - // TODO: Write tests for markPlayed - - // TODO: Write tests for markUnplayed - - // TODO: Write tests for updatePlayProgress - -} diff --git a/src/test/java/com/plexsdk/services/PlaylistsServiceTest.java b/src/test/java/com/plexsdk/services/PlaylistsServiceTest.java deleted file mode 100644 index 49441202..00000000 --- a/src/test/java/com/plexsdk/services/PlaylistsServiceTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.plexsdk.services; - -import static org.junit.Assert.assertTrue; - -import com.plexsdk.models.*; -import org.junit.jupiter.api.*; - -class PlaylistsServiceTest { - // @PlaylistsServiceTest - - // @DisplayName("Test that Playlists is working") - - // public void test() {} - - // TODO: Write tests for createPlaylist - - // TODO: Write tests for getPlaylists - - // TODO: Write tests for getPlaylist - - // TODO: Write tests for updatePlaylist - - // TODO: Write tests for deletePlaylist - - // TODO: Write tests for getPlaylistContents - - // TODO: Write tests for addPlaylistContents - - // TODO: Write tests for clearPlaylistContents - - // TODO: Write tests for uploadPlaylist - -} diff --git a/src/test/java/com/plexsdk/services/SearchServiceTest.java b/src/test/java/com/plexsdk/services/SearchServiceTest.java deleted file mode 100644 index 0f32c37f..00000000 --- a/src/test/java/com/plexsdk/services/SearchServiceTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.plexsdk.services; - -import static org.junit.Assert.assertTrue; - -import com.plexsdk.models.*; -import org.junit.jupiter.api.*; - -class SearchServiceTest { - // @SearchServiceTest - - // @DisplayName("Test that Search is working") - - // public void test() {} - - // TODO: Write tests for performSearch - - // TODO: Write tests for performVoiceSearch - - // TODO: Write tests for getSearchResults - -} diff --git a/src/test/java/com/plexsdk/services/SecurityServiceTest.java b/src/test/java/com/plexsdk/services/SecurityServiceTest.java deleted file mode 100644 index f4bc0a5a..00000000 --- a/src/test/java/com/plexsdk/services/SecurityServiceTest.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.plexsdk.services; - -import static org.junit.Assert.assertTrue; - -import com.plexsdk.models.*; -import org.junit.jupiter.api.*; - -class SecurityServiceTest { - // @SecurityServiceTest - - // @DisplayName("Test that Security is working") - - // public void test() {} - - // TODO: Write tests for getTransientToken - - // TODO: Write tests for getSourceConnectionInformation - -} diff --git a/src/test/java/com/plexsdk/services/ServerServiceTest.java b/src/test/java/com/plexsdk/services/ServerServiceTest.java deleted file mode 100644 index 91894e08..00000000 --- a/src/test/java/com/plexsdk/services/ServerServiceTest.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.plexsdk.services; - -import static org.junit.Assert.assertTrue; - -import com.plexsdk.models.*; -import org.junit.jupiter.api.*; - -class ServerServiceTest { - // @ServerServiceTest - - // @DisplayName("Test that Server is working") - - // public void test() {} - - // TODO: Write tests for getServerCapabilities - - // TODO: Write tests for getServerPreferences - - // TODO: Write tests for getAvailableClients - - // TODO: Write tests for getDevices - - // TODO: Write tests for getServerIdentity - - // TODO: Write tests for getMyPlexAccount - - // TODO: Write tests for getResizedPhoto - - // TODO: Write tests for getServerList - -} diff --git a/src/test/java/com/plexsdk/services/SessionsServiceTest.java b/src/test/java/com/plexsdk/services/SessionsServiceTest.java deleted file mode 100644 index 19496c59..00000000 --- a/src/test/java/com/plexsdk/services/SessionsServiceTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.plexsdk.services; - -import static org.junit.Assert.assertTrue; - -import com.plexsdk.models.*; -import org.junit.jupiter.api.*; - -class SessionsServiceTest { - // @SessionsServiceTest - - // @DisplayName("Test that Sessions is working") - - // public void test() {} - - // TODO: Write tests for getSessions - - // TODO: Write tests for getSessionHistory - - // TODO: Write tests for getTranscodeSessions - - // TODO: Write tests for stopTranscodeSession - -} diff --git a/src/test/java/com/plexsdk/services/UpdaterServiceTest.java b/src/test/java/com/plexsdk/services/UpdaterServiceTest.java deleted file mode 100644 index 2f4ada0d..00000000 --- a/src/test/java/com/plexsdk/services/UpdaterServiceTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.plexsdk.services; - -import static org.junit.Assert.assertTrue; - -import com.plexsdk.models.*; -import org.junit.jupiter.api.*; - -class UpdaterServiceTest { - // @UpdaterServiceTest - - // @DisplayName("Test that Updater is working") - - // public void test() {} - - // TODO: Write tests for getUpdateStatus - - // TODO: Write tests for checkForUpdates - - // TODO: Write tests for applyUpdates - -} diff --git a/src/test/java/com/plexsdk/services/VideoServiceTest.java b/src/test/java/com/plexsdk/services/VideoServiceTest.java deleted file mode 100644 index adcb912e..00000000 --- a/src/test/java/com/plexsdk/services/VideoServiceTest.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.plexsdk.services; - -import static org.junit.Assert.assertTrue; - -import com.plexsdk.models.*; -import org.junit.jupiter.api.*; - -class VideoServiceTest { - // @VideoServiceTest - - // @DisplayName("Test that Video is working") - - // public void test() {} - - // TODO: Write tests for startUniversalTranscode - - // TODO: Write tests for getTimeline - -} diff --git a/src/test/java/utils/ArrayUtils.java b/src/test/java/utils/ArrayUtils.java deleted file mode 100644 index 3ecb9f89..00000000 --- a/src/test/java/utils/ArrayUtils.java +++ /dev/null @@ -1,21 +0,0 @@ -package utils; - -import java.util.Arrays; -import java.util.Set; -import java.util.stream.Collectors; - -public final class ArrayUtils { - - private ArrayUtils() {} - - public static Set arrayToSet(T[] array) { - return Arrays.stream(array).collect(Collectors.toSet()); - } - - public static Set> arraysToSets(T[][] arrays) { - return Arrays - .stream(arrays) - .map(array -> Arrays.stream(array).collect(Collectors.toSet())) - .collect(Collectors.toSet()); - } -}