Compare commits

..

4 Commits

Author SHA1 Message Date
speakeasybot
0077561a6a ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.535.1 2025-04-19 00:29:11 +00:00
speakeasybot
4b28ca3416 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.531.4 2025-04-14 00:32:09 +00:00
speakeasybot
dd781d1e27 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.529.1 2025-04-06 00:31:55 +00:00
speakeasybot
dcdcafc044 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.528.1 2025-04-03 00:29:22 +00:00
143 changed files with 13663 additions and 1537 deletions

3
.gitattributes vendored
View File

@@ -8,5 +8,4 @@
*.bat text eol=crlf
# This allows generated code to be indexed correctly
*.java linguist-generated=false
*.java linguist-generated=false

File diff suppressed because one or more lines are too long

View File

@@ -15,7 +15,7 @@ generation:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
java:
version: 0.14.0
version: 0.16.0
additionalDependencies: []
additionalPlugins: []
artifactID: plexapi

View File

@@ -1,4 +1,4 @@
speakeasyVersion: 1.526.6
speakeasyVersion: 1.535.1
sources:
my-source:
sourceNamespace: my-source
@@ -8,19 +8,19 @@ sources:
- latest
plexapi:
sourceNamespace: plexapi
sourceRevisionDigest: sha256:cffb18feaa0523b300655a6f0073caad99133b143f5a420fddbb1e1efe47bcaf
sourceBlobDigest: sha256:1737023e29cd9cf36c07ccd8c8c48c47e14f47ce22b4d6ba9ee241afbbd8f351
sourceRevisionDigest: sha256:b2f9599237ceb13cf8f9c1693e38b290177b65fb389cebf0c3c60b8ef4778615
sourceBlobDigest: sha256:f8df9ef88ada992cd981d601e6c0b45cc82db76aba3d915c2f9d08f90c81ced9
tags:
- latest
- speakeasy-sdk-regen-1743440866
- speakeasy-sdk-regen-1745022464
targets:
plexjava:
source: plexapi
sourceNamespace: plexapi
sourceRevisionDigest: sha256:cffb18feaa0523b300655a6f0073caad99133b143f5a420fddbb1e1efe47bcaf
sourceBlobDigest: sha256:1737023e29cd9cf36c07ccd8c8c48c47e14f47ce22b4d6ba9ee241afbbd8f351
sourceRevisionDigest: sha256:b2f9599237ceb13cf8f9c1693e38b290177b65fb389cebf0c3c60b8ef4778615
sourceBlobDigest: sha256:f8df9ef88ada992cd981d601e6c0b45cc82db76aba3d915c2f9d08f90c81ced9
codeSamplesNamespace: code-samples-java-plexjava
codeSamplesRevisionDigest: sha256:efd9a529c906a73b2d32257e52235b87cdb19f16486800f6eb2172eec9454726
codeSamplesRevisionDigest: sha256:7d8c3b846b1e7bfd87558d16b7a6daceae1f8e2a3628296155e438ed1cd72721
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest

View File

@@ -69,7 +69,7 @@ The samples below show how a published SDK artifact is used:
Gradle:
```groovy
implementation 'dev.plexapi:plexapi:0.14.0'
implementation 'dev.plexapi:plexapi:0.16.0'
```
Maven:
@@ -77,7 +77,7 @@ Maven:
<dependency>
<groupId>dev.plexapi</groupId>
<artifactId>plexapi</artifactId>
<version>0.14.0</version>
<version>0.16.0</version>
</dependency>
```
@@ -94,6 +94,29 @@ On Windows:
```bash
gradlew.bat publishToMavenLocal -Pskip.signing
```
### Logging
A logging framework/facade has not yet been adopted but is under consideration.
For request and response logging (especially json bodies) use:
```java
SpeakeasyHTTPClient.setDebugLogging(true); // experimental API only (may change without warning)
```
Example output:
```
Sending request: http://localhost:35123/bearer#global GET
Request headers: {Accept=[application/json], Authorization=[******], Client-Level-Header=[added by client], Idempotency-Key=[some-key], x-speakeasy-user-agent=[speakeasy-sdk/java 0.0.1 internal 0.1.0 org.openapis.openapi]}
Received response: (GET http://localhost:35123/bearer#global) 200
Response headers: {access-control-allow-credentials=[true], access-control-allow-origin=[*], connection=[keep-alive], content-length=[50], content-type=[application/json], date=[Wed, 09 Apr 2025 01:43:29 GMT], server=[gunicorn/19.9.0]}
Response body:
{
"authenticated": true,
"token": "global"
}
```
WARNING: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. <i>Authorization</i> headers are redacted by default and there is the ability to specify redacted header names via `SpeakeasyHTTPClient.setRedactedHeaders`.
Another option is to set the System property `-Djdk.httpclient.HttpClient.log=all`. However, this second option does not log bodies.
<!-- End SDK Installation [installation] -->
<!-- Start SDK Example Usage [usage] -->
@@ -177,6 +200,10 @@ public class Application {
* [getActorsLibrary](docs/sdks/library/README.md#getactorslibrary) - Get Actors of library media
* [getSearchAllLibraries](docs/sdks/library/README.md#getsearchalllibraries) - Search All Libraries
* [getMediaMetaData](docs/sdks/library/README.md#getmediametadata) - Get Media Metadata
* [getMediaArts](docs/sdks/library/README.md#getmediaarts) - Get Media Background Artwork
* [postMediaArts](docs/sdks/library/README.md#postmediaarts) - Upload Media Background Artwork
* [getMediaPosters](docs/sdks/library/README.md#getmediaposters) - Get Media Posters
* [postMediaPoster](docs/sdks/library/README.md#postmediaposter) - Upload Media Poster
* [getMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children
* [getTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content

View File

@@ -288,4 +288,44 @@ Based on:
### Generated
- [java v0.14.0] .
### Releases
- [Maven Central v0.14.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.14.0 - .
- [Maven Central v0.14.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.14.0 - .
## 2025-04-03 00:27:41
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.528.1 (2.565.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [java v0.14.1] .
### Releases
- [Maven Central v0.14.1] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.14.1 - .
## 2025-04-06 00:30:19
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.529.1 (2.566.5) https://github.com/speakeasy-api/speakeasy
### Generated
- [java v0.14.2] .
### Releases
- [Maven Central v0.14.2] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.14.2 - .
## 2025-04-14 00:30:37
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.531.4 (2.570.4) https://github.com/speakeasy-api/speakeasy
### Generated
- [java v0.15.0] .
### Releases
- [Maven Central v0.15.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.15.0 - .
## 2025-04-19 00:27:27
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.535.1 (2.585.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [java v0.16.0] .
### Releases
- [Maven Central v0.16.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.16.0 - .

View File

@@ -103,7 +103,7 @@ publishing {
// https://github.com/gradle/gradle/issues/18619
groupId = "dev.plexapi"
artifactId = "plexapi"
version = "0.14.0"
version = "0.16.0"
from components.java

File diff suppressed because it is too large Load Diff

View File

@@ -3,26 +3,26 @@
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
| `allowSync` | *boolean* | :heavy_check_mark: | N/A | true |
| `art` | *String* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg |
| `composite` | *String* | :heavy_check_mark: | N/A | /library/sections/1/composite/1705615584 |
| `filters` | *boolean* | :heavy_check_mark: | N/A | true |
| `refreshing` | *boolean* | :heavy_check_mark: | N/A | false |
| `thumb` | *String* | :heavy_check_mark: | N/A | /:/resources/movie.png |
| `key` | *String* | :heavy_check_mark: | N/A | 1 |
| `type` | *String* | :heavy_check_mark: | N/A | movie |
| `title` | *String* | :heavy_check_mark: | N/A | Movies |
| `agent` | *String* | :heavy_check_mark: | N/A | tv.plex.agents.movie |
| `scanner` | *String* | :heavy_check_mark: | N/A | Plex Movie |
| `language` | *String* | :heavy_check_mark: | N/A | en-US |
| `uuid` | *String* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 |
| `updatedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `createdAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `scannedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `content` | *boolean* | :heavy_check_mark: | N/A | true |
| `directory` | *boolean* | :heavy_check_mark: | N/A | true |
| `contentChangedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `hidden` | *int* | :heavy_check_mark: | N/A | 0 |
| `location` | List\<[GetAllLibrariesLocation](../../models/operations/GetAllLibrariesLocation.md)> | :heavy_check_mark: | N/A | |
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `allowSync` | *boolean* | :heavy_check_mark: | Indicates whether syncing is allowed. | false |
| `art` | *String* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg |
| `composite` | *String* | :heavy_check_mark: | The relative path to the composite media item. | /library/sections/1/composite/1743824484 |
| `filters` | *boolean* | :heavy_check_mark: | UNKNOWN | true |
| `refreshing` | *boolean* | :heavy_check_mark: | Indicates whether the library is currently being refreshed or updated | true |
| `thumb` | *String* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png |
| `key` | *String* | :heavy_check_mark: | The library key representing the unique identifier | 1 |
| `type` | [GetAllLibrariesType](../../models/operations/GetAllLibrariesType.md) | :heavy_check_mark: | N/A | movie |
| `title` | *String* | :heavy_check_mark: | The title of the library | Movies |
| `agent` | *String* | :heavy_check_mark: | The Plex agent used to match and retrieve media metadata. | tv.plex.agents.movie |
| `scanner` | *String* | :heavy_check_mark: | UNKNOWN | Plex Movie |
| `language` | *String* | :heavy_check_mark: | The Plex library language that has been set | en-US |
| `uuid` | *String* | :heavy_check_mark: | The universally unique identifier for the library. | e69655a2-ef48-4aba-bb19-01e7d3cc34d6 |
| `updatedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `createdAt` | *Optional\<Long>* | :heavy_minus_sign: | N/A | 1556281940 |
| `scannedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `content` | *boolean* | :heavy_check_mark: | UNKNOWN | true |
| `directory` | *boolean* | :heavy_check_mark: | UNKNOWN | true |
| `contentChangedAt` | *long* | :heavy_check_mark: | Timestamp (in seconds) representing the last time the content was modified.<br/>NOTE: Some Plex server have some absurd values for this field, like 8457612157633039800 so it should be int64<br/> | 9173960 |
| `hidden` | [Optional\<Hidden>](../../models/operations/Hidden.md) | :heavy_minus_sign: | N/A | 1 |
| `location` | List\<[GetAllLibrariesLocation](../../models/operations/GetAllLibrariesLocation.md)> | :heavy_check_mark: | N/A | |

View File

@@ -3,7 +3,7 @@
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `id` | *int* | :heavy_check_mark: | N/A | 1 |
| `path` | *String* | :heavy_check_mark: | N/A | /movies |
| Field | Type | Required | Description | Example |
| --------------------------- | --------------------------- | --------------------------- | --------------------------- | --------------------------- |
| `id` | *int* | :heavy_check_mark: | The ID of the location. | 1 |
| `path` | *String* | :heavy_check_mark: | The path to the media item. | /Movies |

View File

@@ -5,7 +5,7 @@
| Field | Type | Required | Description | Example |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `size` | *int* | :heavy_check_mark: | N/A | 5 |
| `allowSync` | *boolean* | :heavy_check_mark: | N/A | false |
| `title1` | *String* | :heavy_check_mark: | N/A | Plex Library |
| `directory` | List\<[GetAllLibrariesDirectory](../../models/operations/GetAllLibrariesDirectory.md)> | :heavy_check_mark: | N/A | |
| `size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
| `allowSync` | *boolean* | :heavy_check_mark: | Indicates whether syncing is allowed. | false |
| `title1` | *String* | :heavy_check_mark: | The primary title of the media container. | TV Series |
| `directory` | List\<[GetAllLibrariesDirectory](../../models/operations/GetAllLibrariesDirectory.md)> | :heavy_minus_sign: | N/A | |

View File

@@ -5,6 +5,6 @@ The libraries available on the Server
## Fields
| Field | Type | Required | Description |
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `mediaContainer` | [GetAllLibrariesMediaContainer](../../models/operations/GetAllLibrariesMediaContainer.md) | :heavy_check_mark: | N/A |
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `mediaContainer` | [Optional\<GetAllLibrariesMediaContainer>](../../models/operations/GetAllLibrariesMediaContainer.md) | :heavy_minus_sign: | N/A |

View File

@@ -0,0 +1,15 @@
# GetAllLibrariesType
The library type
## Values
| Name | Value |
| --------- | --------- |
| `Movie` | movie |
| `TvShow` | show |
| `Season` | season |
| `Episode` | episode |
| `Artist` | artist |
| `Album` | album |

View File

@@ -3,7 +3,7 @@
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `includeDetails` | [Optional\<IncludeDetails>](../../models/operations/IncludeDetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts). <br/>Only exists for backwards compatibility, media providers other than the server libraries have it on always.<br/> | |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `includeDetails` | [Optional\<IncludeDetails>](../../models/operations/IncludeDetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts).<br/>Only exists for backwards compatibility, media providers other than the server libraries have it on always.<br/> | |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |

View File

@@ -0,0 +1,12 @@
# GetMediaArtsMediaContainer
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| `size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
| `mediaTagVersion` | *long* | :heavy_check_mark: | The version number for media tags. | 1734362201 |
| `mediaTagPrefix` | *String* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ |
| `identifier` | *String* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library |
| `metadata` | List\<[GetMediaArtsMetadata](../../models/operations/GetMediaArtsMetadata.md)> | :heavy_check_mark: | N/A | |

View File

@@ -0,0 +1,12 @@
# GetMediaArtsMetadata
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `key` | *String* | :heavy_check_mark: | The URL of the artwork. | https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg |
| `provider` | *Optional\<String>* | :heavy_minus_sign: | The provider of the artwork. | tmdb |
| `ratingKey` | *String* | :heavy_check_mark: | The URL of the artwork. | https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg |
| `selected` | *boolean* | :heavy_check_mark: | Whether this is the selected artwork. | true |
| `thumb` | *String* | :heavy_check_mark: | The URL of the artwork thumbnail. | https://images.plex.tv/photo?height=270&width=480&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FixgFmf1X59PUZam2qbAfskx2gQr%2Ejpg |

View File

@@ -0,0 +1,8 @@
# GetMediaArtsRequest
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
| `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the artwork of. | 16099 |

View File

@@ -0,0 +1,11 @@
# GetMediaArtsResponse
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation |
| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
| `rawResponse` | [HttpResponse\<InputStream>](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
| `object` | [Optional\<GetMediaArtsResponseBody>](../../models/operations/GetMediaArtsResponseBody.md) | :heavy_minus_sign: | The available background artwork for the library item. |

View File

@@ -0,0 +1,10 @@
# GetMediaArtsResponseBody
The available background artwork for the library item.
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `mediaContainer` | [Optional\<GetMediaArtsMediaContainer>](../../models/operations/GetMediaArtsMediaContainer.md) | :heavy_minus_sign: | N/A |

View File

@@ -0,0 +1,12 @@
# GetMediaPostersMediaContainer
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
| `size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
| `mediaTagVersion` | *long* | :heavy_check_mark: | The version number for media tags. | 1734362201 |
| `mediaTagPrefix` | *String* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ |
| `identifier` | *String* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library |
| `metadata` | List\<[GetMediaPostersMetadata](../../models/operations/GetMediaPostersMetadata.md)> | :heavy_check_mark: | N/A | |

View File

@@ -0,0 +1,12 @@
# GetMediaPostersMetadata
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `key` | *String* | :heavy_check_mark: | The URL of the poster. | https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg |
| `provider` | *Optional\<String>* | :heavy_minus_sign: | The provider of the poster. | tmdb |
| `ratingKey` | *String* | :heavy_check_mark: | The URL of the poster. | https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg |
| `selected` | *boolean* | :heavy_check_mark: | Whether this is the selected poster. | true |
| `thumb` | *String* | :heavy_check_mark: | The URL of the poster thumbnail. | https://images.plex.tv/photo?height=336&width=225&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FhntBJjqbv4m0Iyniqaztv9xaudI%2Ejpg |

View File

@@ -0,0 +1,8 @@
# GetMediaPostersRequest
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
| `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the posters of. | 16099 |

View File

@@ -0,0 +1,11 @@
# GetMediaPostersResponse
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation |
| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
| `rawResponse` | [HttpResponse\<InputStream>](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
| `object` | [Optional\<GetMediaPostersResponseBody>](../../models/operations/GetMediaPostersResponseBody.md) | :heavy_minus_sign: | The available posters for the library item. |

View File

@@ -0,0 +1,10 @@
# GetMediaPostersResponseBody
The available posters for the library item.
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `mediaContainer` | [Optional\<GetMediaPostersMediaContainer>](../../models/operations/GetMediaPostersMediaContainer.md) | :heavy_minus_sign: | N/A |

View File

@@ -0,0 +1,11 @@
# Hidden
UNKNOWN
## Values
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -1,6 +1,6 @@
# IncludeDetails
Whether or not to include details for a section (types, filters, and sorts).
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.

View File

@@ -1,10 +1,10 @@
# Level
An integer log level to write to the PMS log with.
0: Error
1: Warning
2: Info
3: Debug
An integer log level to write to the PMS log with.
0: Error
1: Warning
2: Info
3: Debug
4: Verbose

View File

@@ -3,8 +3,8 @@
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `level` | [Level](../../models/operations/Level.md) | :heavy_check_mark: | An integer log level to write to the PMS log with. <br/>0: Error <br/>1: Warning <br/>2: Info <br/>3: Debug <br/>4: Verbose<br/> | |
| `message` | *String* | :heavy_check_mark: | The text of the message to write to the log. | Test log message |
| `source` | *String* | :heavy_check_mark: | a string indicating the source of the message. | Postman |
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `level` | [Level](../../models/operations/Level.md) | :heavy_check_mark: | An integer log level to write to the PMS log with.<br/>0: Error<br/>1: Warning<br/>2: Info<br/>3: Debug<br/>4: Verbose<br/> | |
| `message` | *String* | :heavy_check_mark: | The text of the message to write to the log. | Test log message |
| `source` | *String* | :heavy_check_mark: | a string indicating the source of the message. | Postman |

View File

@@ -0,0 +1,10 @@
# PostMediaArtsRequest
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
| `url` | *Optional\<String>* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
| `requestBody` | *Optional\<byte[]>* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |

View File

@@ -0,0 +1,10 @@
# PostMediaArtsResponse
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation |
| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
| `rawResponse` | [HttpResponse\<InputStream>](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |

View File

@@ -0,0 +1,10 @@
# PostMediaPosterRequest
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
| `url` | *Optional\<String>* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
| `requestBody` | *Optional\<byte[]>* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |

View File

@@ -0,0 +1,10 @@
# PostMediaPosterResponse
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation |
| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
| `rawResponse` | [HttpResponse\<InputStream>](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |

View File

@@ -1,8 +1,8 @@
# QueryParamForce
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.
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.

View File

@@ -3,8 +3,8 @@
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `path` | *String* | :heavy_check_mark: | absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server. <br/>If the `path` argument is a directory, that path will be scanned for playlist files to be processed. <br/>Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it. <br/>The GUID of each playlist is based on the filename. <br/>If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it. <br/>The GUID of each playlist is based on the filename.<br/> | /home/barkley/playlist.m3u |
| `force` | [QueryParamForce](../../models/operations/QueryParamForce.md) | :heavy_check_mark: | Force overwriting of duplicate playlists. <br/>By default, a playlist file uploaded with the same path will overwrite the existing playlist. <br/>The `force` argument is used to disable overwriting. <br/>If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.<br/> | |
| `sectionID` | *long* | :heavy_check_mark: | Possibly the section ID to upload the playlist to, we are not certain. | 1 |
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `path` | *String* | :heavy_check_mark: | absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.<br/>If the `path` argument is a directory, that path will be scanned for playlist files to be processed.<br/>Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.<br/>The GUID of each playlist is based on the filename.<br/>If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.<br/>The GUID of each playlist is based on the filename.<br/> | /home/barkley/playlist.m3u |
| `force` | [QueryParamForce](../../models/operations/QueryParamForce.md) | :heavy_check_mark: | Force overwriting of duplicate playlists.<br/>By default, a playlist file uploaded with the same path will overwrite the existing playlist.<br/>The `force` argument is used to disable overwriting.<br/>If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.<br/> | |
| `sectionID` | *long* | :heavy_check_mark: | Possibly the section ID to upload the playlist to, we are not certain. | 1 |

View File

@@ -25,7 +25,6 @@ import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetGlobalHubsBadRequest;
import dev.plexapi.sdk.models.errors.GetGlobalHubsUnauthorized;
import dev.plexapi.sdk.models.operations.GetGlobalHubsResponse;
import dev.plexapi.sdk.models.operations.OnlyTransient;
import java.lang.Exception;
public class Application {
@@ -37,8 +36,6 @@ public class Application {
.build();
GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs()
.count(1262.49)
.onlyTransient(OnlyTransient.ONE)
.call();
if (res.object().isPresent()) {
@@ -136,7 +133,6 @@ import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetLibraryHubsBadRequest;
import dev.plexapi.sdk.models.errors.GetLibraryHubsUnauthorized;
import dev.plexapi.sdk.models.operations.GetLibraryHubsResponse;
import dev.plexapi.sdk.models.operations.QueryParamOnlyTransient;
import java.lang.Exception;
public class Application {
@@ -149,8 +145,6 @@ public class Application {
GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs()
.sectionId(6728.76)
.count(6728.76)
.onlyTransient(QueryParamOnlyTransient.ZERO)
.call();
if (res.object().isPresent()) {

View File

@@ -22,6 +22,10 @@ API Calls interacting with Plex Media Server Libraries
* [getActorsLibrary](#getactorslibrary) - Get Actors of library media
* [getSearchAllLibraries](#getsearchalllibraries) - Search All Libraries
* [getMediaMetaData](#getmediametadata) - Get Media Metadata
* [getMediaArts](#getmediaarts) - Get Media Background Artwork
* [postMediaArts](#postmediaarts) - Upload Media Background Artwork
* [getMediaPosters](#getmediaposters) - Get Media Posters
* [postMediaPoster](#postmediaposter) - Upload Media Poster
* [getMetadataChildren](#getmetadatachildren) - Get Items Children
* [getTopWatchedContent](#gettopwatchedcontent) - Get Top Watched Content
@@ -50,7 +54,6 @@ public class Application {
GetFileHashResponse res = sdk.library().getFileHash()
.url("file://C:\Image.png&type=13")
.type(4462.17)
.call();
// handle response
@@ -205,14 +208,14 @@ public class Application {
## Library Details Endpoint
This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself.
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**:
- **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.
@@ -253,7 +256,6 @@ import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetLibraryDetailsBadRequest;
import dev.plexapi.sdk.models.errors.GetLibraryDetailsUnauthorized;
import dev.plexapi.sdk.models.operations.GetLibraryDetailsResponse;
import dev.plexapi.sdk.models.operations.IncludeDetails;
import java.lang.Exception;
public class Application {
@@ -265,7 +267,6 @@ public class Application {
.build();
GetLibraryDetailsResponse res = sdk.library().getLibraryDetails()
.includeDetails(IncludeDetails.ZERO)
.sectionKey(9518)
.call();
@@ -278,10 +279,10 @@ public class Application {
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `includeDetails` | [Optional\<IncludeDetails>](../../models/operations/IncludeDetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts). <br/>Only exists for backwards compatibility, media providers other than the server libraries have it on always.<br/> | |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
| Parameter | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `includeDetails` | [Optional\<IncludeDetails>](../../models/operations/IncludeDetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts).<br/>Only exists for backwards compatibility, media providers other than the server libraries have it on always.<br/> | |
| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
### Response
@@ -909,6 +910,200 @@ public class Application {
| models/errors/GetMediaMetaDataUnauthorized | 401 | application/json |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getMediaArts
Returns the background artwork for a library item.
### Example Usage
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetMediaArtsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.build();
GetMediaArtsResponse res = sdk.library().getMediaArts()
.ratingKey(16099L)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
| `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the artwork of. | 16099 |
### Response
**[GetMediaArtsResponse](../../models/operations/GetMediaArtsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## postMediaArts
Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL
### Example Usage
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.PostMediaArtsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.build();
PostMediaArtsResponse res = sdk.library().postMediaArts()
.ratingKey(2268L)
.url("https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b")
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
| `url` | *Optional\<String>* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
| `requestBody` | *Optional\<byte[]>* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |
### Response
**[PostMediaArtsResponse](../../models/operations/PostMediaArtsResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getMediaPosters
Returns the available posters for a library item.
### Example Usage
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetMediaPostersResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.build();
GetMediaPostersResponse res = sdk.library().getMediaPosters()
.ratingKey(16099L)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
| `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the posters of. | 16099 |
### Response
**[GetMediaPostersResponse](../../models/operations/GetMediaPostersResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## postMediaPoster
Uploads a poster to a library item, either from a local file or a remote URL
### Example Usage
```java
package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.PostMediaPosterResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.build();
PostMediaPosterResponse res = sdk.library().postMediaPoster()
.ratingKey(2268L)
.url("https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b")
.call();
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
| `url` | *Optional\<String>* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
| `requestBody` | *Optional\<byte[]>* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |
### Response
**[PostMediaPosterResponse](../../models/operations/PostMediaPosterResponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| models/errors/SDKError | 4XX, 5XX | \*/\* |
## getMetadataChildren
This endpoint will return the children of of a library item specified with the ratingKey.

View File

@@ -50,11 +50,11 @@ public class Application {
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `level` | [Level](../../models/operations/Level.md) | :heavy_check_mark: | An integer log level to write to the PMS log with. <br/>0: Error <br/>1: Warning <br/>2: Info <br/>3: Debug <br/>4: Verbose<br/> | |
| `message` | *String* | :heavy_check_mark: | The text of the message to write to the log. | Test log message |
| `source` | *String* | :heavy_check_mark: | a string indicating the source of the message. | Postman |
| Parameter | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `level` | [Level](../../models/operations/Level.md) | :heavy_check_mark: | An integer log level to write to the PMS log with.<br/>0: Error<br/>1: Warning<br/>2: Info<br/>3: Debug<br/>4: Verbose<br/> | |
| `message` | *String* | :heavy_check_mark: | The text of the message to write to the log. | Test log message |
| `source` | *String* | :heavy_check_mark: | a string indicating the source of the message. | Postman |
### Response
@@ -70,13 +70,13 @@ public class Application {
## 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'.
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.
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.

View File

@@ -3,9 +3,9 @@
## 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").
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.
Retrieving a playlist, or its items, will trigger a refresh of its metadata.
This may cause the duration and number of items to change.
@@ -95,7 +95,7 @@ package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetPlaylistsBadRequest;
import dev.plexapi.sdk.models.errors.GetPlaylistsUnauthorized;
import dev.plexapi.sdk.models.operations.*;
import dev.plexapi.sdk.models.operations.GetPlaylistsResponse;
import java.lang.Exception;
public class Application {
@@ -107,8 +107,6 @@ public class Application {
.build();
GetPlaylistsResponse res = sdk.playlists().getPlaylists()
.playlistType(PlaylistType.AUDIO)
.smart(QueryParamSmart.ZERO)
.call();
if (res.object().isPresent()) {
@@ -268,8 +266,6 @@ public class Application {
UpdatePlaylistResponse res = sdk.playlists().updatePlaylist()
.playlistID(3915)
.title("<value>")
.summary("<value>")
.call();
// handle response
@@ -503,11 +499,11 @@ public class Application {
### Parameters
| Parameter | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `path` | *String* | :heavy_check_mark: | absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server. <br/>If the `path` argument is a directory, that path will be scanned for playlist files to be processed. <br/>Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it. <br/>The GUID of each playlist is based on the filename. <br/>If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it. <br/>The GUID of each playlist is based on the filename.<br/> | /home/barkley/playlist.m3u |
| `force` | [QueryParamForce](../../models/operations/QueryParamForce.md) | :heavy_check_mark: | Force overwriting of duplicate playlists. <br/>By default, a playlist file uploaded with the same path will overwrite the existing playlist. <br/>The `force` argument is used to disable overwriting. <br/>If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.<br/> | |
| `sectionID` | *long* | :heavy_check_mark: | Possibly the section ID to upload the playlist to, we are not certain. | 1 |
| Parameter | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `path` | *String* | :heavy_check_mark: | absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.<br/>If the `path` argument is a directory, that path will be scanned for playlist files to be processed.<br/>Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.<br/>The GUID of each playlist is based on the filename.<br/>If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.<br/>The GUID of each playlist is based on the filename.<br/> | /home/barkley/playlist.m3u |
| `force` | [QueryParamForce](../../models/operations/QueryParamForce.md) | :heavy_check_mark: | Force overwriting of duplicate playlists.<br/>By default, a playlist file uploaded with the same path will overwrite the existing playlist.<br/>The `force` argument is used to disable overwriting.<br/>If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.<br/> | |
| `sectionID` | *long* | :heavy_check_mark: | Possibly the section ID to upload the playlist to, we are not certain. | 1 |
### Response

View File

@@ -225,7 +225,7 @@ package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.errors.GetServerResourcesBadRequest;
import dev.plexapi.sdk.models.errors.GetServerResourcesUnauthorized;
import dev.plexapi.sdk.models.operations.*;
import dev.plexapi.sdk.models.operations.GetServerResourcesResponse;
import java.lang.Exception;
public class Application {
@@ -237,9 +237,6 @@ public class Application {
.build();
GetServerResourcesResponse res = sdk.plex().getServerResources()
.includeHttps(IncludeHttps.Enable)
.includeRelay(IncludeRelay.Enable)
.includeIPv6(IncludeIPv6.Enable)
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
.call();

View File

@@ -49,8 +49,6 @@ public class Application {
PerformSearchResponse res = sdk.search().performSearch()
.query("dylan")
.sectionId(9487.88)
.limit(5)
.call();
// handle response
@@ -107,8 +105,6 @@ public class Application {
PerformVoiceSearchResponse res = sdk.search().performVoiceSearch()
.query("dead+poop")
.sectionId(4094.8)
.limit(5)
.call();
// handle response

View File

@@ -1,3 +1,3 @@
groupId=dev.plexapi
artifactId=plexapi
version=0.14.0
version=0.16.0

View File

@@ -30,8 +30,6 @@ import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* 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.

View File

@@ -47,8 +47,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Optional;
/**
* API Calls regarding authentication for Plex Media Server
*/

View File

@@ -45,8 +45,6 @@ import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* Butler is the task manager of the Plex Media Server Ecosystem.
*/

View File

@@ -39,8 +39,6 @@ import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
*/

View File

@@ -74,10 +74,18 @@ import dev.plexapi.sdk.models.operations.GetLibraryItemsRequest;
import dev.plexapi.sdk.models.operations.GetLibraryItemsRequestBuilder;
import dev.plexapi.sdk.models.operations.GetLibraryItemsResponse;
import dev.plexapi.sdk.models.operations.GetLibraryItemsResponseBody;
import dev.plexapi.sdk.models.operations.GetMediaArtsRequest;
import dev.plexapi.sdk.models.operations.GetMediaArtsRequestBuilder;
import dev.plexapi.sdk.models.operations.GetMediaArtsResponse;
import dev.plexapi.sdk.models.operations.GetMediaArtsResponseBody;
import dev.plexapi.sdk.models.operations.GetMediaMetaDataRequest;
import dev.plexapi.sdk.models.operations.GetMediaMetaDataRequestBuilder;
import dev.plexapi.sdk.models.operations.GetMediaMetaDataResponse;
import dev.plexapi.sdk.models.operations.GetMediaMetaDataResponseBody;
import dev.plexapi.sdk.models.operations.GetMediaPostersRequest;
import dev.plexapi.sdk.models.operations.GetMediaPostersRequestBuilder;
import dev.plexapi.sdk.models.operations.GetMediaPostersResponse;
import dev.plexapi.sdk.models.operations.GetMediaPostersResponseBody;
import dev.plexapi.sdk.models.operations.GetMetadataChildrenRequest;
import dev.plexapi.sdk.models.operations.GetMetadataChildrenRequestBuilder;
import dev.plexapi.sdk.models.operations.GetMetadataChildrenResponse;
@@ -104,25 +112,32 @@ import dev.plexapi.sdk.models.operations.GetTopWatchedContentRequestBuilder;
import dev.plexapi.sdk.models.operations.GetTopWatchedContentResponse;
import dev.plexapi.sdk.models.operations.GetTopWatchedContentResponseBody;
import dev.plexapi.sdk.models.operations.IncludeDetails;
import dev.plexapi.sdk.models.operations.PostMediaArtsRequest;
import dev.plexapi.sdk.models.operations.PostMediaArtsRequestBuilder;
import dev.plexapi.sdk.models.operations.PostMediaArtsResponse;
import dev.plexapi.sdk.models.operations.PostMediaPosterRequest;
import dev.plexapi.sdk.models.operations.PostMediaPosterRequestBuilder;
import dev.plexapi.sdk.models.operations.PostMediaPosterResponse;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.SerializedBody;
import dev.plexapi.sdk.utils.Utils.JsonShape;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Double;
import java.lang.Exception;
import java.lang.Long;
import java.lang.Object;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* API Calls interacting with Plex Media Server Libraries
*/
@@ -141,6 +156,10 @@ public class Library implements
MethodCallGetActorsLibrary,
MethodCallGetSearchAllLibraries,
MethodCallGetMediaMetaData,
MethodCallGetMediaArts,
MethodCallPostMediaArts,
MethodCallGetMediaPosters,
MethodCallPostMediaPoster,
MethodCallGetMetadataChildren,
MethodCallGetTopWatchedContent {
@@ -681,14 +700,14 @@ public class Library implements
*
* <p>## Library Details Endpoint
*
* <p>This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself.
* <p>This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself.
*
* <p>The details include:
*
* <p>### Directories
* Organized into three categories:
*
* <p>- **Primary Directories**:
* <p>- **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.
@@ -730,14 +749,14 @@ public class Library implements
*
* <p>## Library Details Endpoint
*
* <p>This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself.
* <p>This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself.
*
* <p>The details include:
*
* <p>### Directories
* Organized into three categories:
*
* <p>- **Primary Directories**:
* <p>- **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.
@@ -784,14 +803,14 @@ public class Library implements
*
* <p>## Library Details Endpoint
*
* <p>This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself.
* <p>This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself.
*
* <p>The details include:
*
* <p>### Directories
* Organized into three categories:
*
* <p>- **Primary Directories**:
* <p>- **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.
@@ -822,7 +841,7 @@ public class Library implements
*
* <p>&gt; **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.
*
* @param includeDetails Whether or not to include details for a section (types, filters, and sorts).
* @param 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.
*
* @param sectionKey The unique key of the Plex library.
@@ -2860,6 +2879,618 @@ public class Library implements
/**
* Get Media Background Artwork
*
* <p>Returns the background artwork for a library item.
*
* @return The call builder
*/
public GetMediaArtsRequestBuilder getMediaArts() {
return new GetMediaArtsRequestBuilder(this);
}
/**
* Get Media Background Artwork
*
* <p>Returns the background artwork for a library item.
*
* @param ratingKey the id of the library item to return the artwork of.
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetMediaArtsResponse getMediaArts(
long ratingKey) throws Exception {
GetMediaArtsRequest request =
GetMediaArtsRequest
.builder()
.ratingKey(ratingKey)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
GetMediaArtsRequest.class,
_baseUrl,
"/library/metadata/{ratingKey}/arts",
request, null);
HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "application/json")
.addHeader("user-agent",
SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
_baseUrl,
"get-media-arts",
Optional.of(List.of()),
_hookSecuritySource),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
_baseUrl,
"get-media-arts",
Optional.of(List.of()),
_hookSecuritySource),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
_baseUrl,
"get-media-arts",
Optional.of(List.of()),
_hookSecuritySource),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
_baseUrl,
"get-media-arts",
Optional.of(List.of()),
_hookSecuritySource),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetMediaArtsResponse.Builder _resBuilder =
GetMediaArtsResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
GetMediaArtsResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetMediaArtsResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetMediaArtsResponseBody>() {});
_res.withObject(Optional.ofNullable(_out));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Upload Media Background Artwork
*
* <p>Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL
*
* @return The call builder
*/
public PostMediaArtsRequestBuilder postMediaArts() {
return new PostMediaArtsRequestBuilder(this);
}
/**
* Upload Media Background Artwork
*
* <p>Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL
*
* @param ratingKey the id of the library item to return the posters of.
* @return The response from the API call
* @throws Exception if the API call fails
*/
public PostMediaArtsResponse postMediaArts(
long ratingKey) throws Exception {
return postMediaArts(ratingKey, Optional.empty(), Optional.empty());
}
/**
* Upload Media Background Artwork
*
* <p>Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL
*
* @param ratingKey the id of the library item to return the posters of.
* @param url The URL of the image, if uploading a remote image
* @param requestBody The contents of the image, if uploading a local file
* @return The response from the API call
* @throws Exception if the API call fails
*/
public PostMediaArtsResponse postMediaArts(
long ratingKey,
Optional<String> url,
Optional<byte[]> requestBody) throws Exception {
PostMediaArtsRequest request =
PostMediaArtsRequest
.builder()
.ratingKey(ratingKey)
.url(url)
.requestBody(requestBody)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
PostMediaArtsRequest.class,
_baseUrl,
"/library/metadata/{ratingKey}/arts",
request, null);
HTTPRequest _req = new HTTPRequest(_url, "POST");
Object _convertedRequest = Utils.convertToShape(
request,
JsonShape.DEFAULT,
new TypeReference<Object>() {});
SerializedBody _serializedRequestBody = Utils.serializeRequestBody(
_convertedRequest,
"requestBody",
"raw",
false);
_req.setBody(Optional.ofNullable(_serializedRequestBody));
_req.addHeader("Accept", "*/*")
.addHeader("user-agent",
SDKConfiguration.USER_AGENT);
_req.addQueryParams(Utils.getQueryParams(
PostMediaArtsRequest.class,
request,
null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
_baseUrl,
"post-media-arts",
Optional.of(List.of()),
_hookSecuritySource),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
_baseUrl,
"post-media-arts",
Optional.of(List.of()),
_hookSecuritySource),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
_baseUrl,
"post-media-arts",
Optional.of(List.of()),
_hookSecuritySource),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
_baseUrl,
"post-media-arts",
Optional.of(List.of()),
_hookSecuritySource),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
PostMediaArtsResponse.Builder _resBuilder =
PostMediaArtsResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
PostMediaArtsResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
// no content
return _res;
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Get Media Posters
*
* <p>Returns the available posters for a library item.
*
* @return The call builder
*/
public GetMediaPostersRequestBuilder getMediaPosters() {
return new GetMediaPostersRequestBuilder(this);
}
/**
* Get Media Posters
*
* <p>Returns the available posters for a library item.
*
* @param ratingKey the id of the library item to return the posters of.
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetMediaPostersResponse getMediaPosters(
long ratingKey) throws Exception {
GetMediaPostersRequest request =
GetMediaPostersRequest
.builder()
.ratingKey(ratingKey)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
GetMediaPostersRequest.class,
_baseUrl,
"/library/metadata/{ratingKey}/posters",
request, null);
HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "application/json")
.addHeader("user-agent",
SDKConfiguration.USER_AGENT);
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
_baseUrl,
"get-media-posters",
Optional.of(List.of()),
_hookSecuritySource),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
_baseUrl,
"get-media-posters",
Optional.of(List.of()),
_hookSecuritySource),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
_baseUrl,
"get-media-posters",
Optional.of(List.of()),
_hookSecuritySource),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
_baseUrl,
"get-media-posters",
Optional.of(List.of()),
_hookSecuritySource),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetMediaPostersResponse.Builder _resBuilder =
GetMediaPostersResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
GetMediaPostersResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetMediaPostersResponseBody _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetMediaPostersResponseBody>() {});
_res.withObject(Optional.ofNullable(_out));
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Upload Media Poster
*
* <p>Uploads a poster to a library item, either from a local file or a remote URL
*
* @return The call builder
*/
public PostMediaPosterRequestBuilder postMediaPoster() {
return new PostMediaPosterRequestBuilder(this);
}
/**
* Upload Media Poster
*
* <p>Uploads a poster to a library item, either from a local file or a remote URL
*
* @param ratingKey the id of the library item to return the posters of.
* @return The response from the API call
* @throws Exception if the API call fails
*/
public PostMediaPosterResponse postMediaPoster(
long ratingKey) throws Exception {
return postMediaPoster(ratingKey, Optional.empty(), Optional.empty());
}
/**
* Upload Media Poster
*
* <p>Uploads a poster to a library item, either from a local file or a remote URL
*
* @param ratingKey the id of the library item to return the posters of.
* @param url The URL of the image, if uploading a remote image
* @param requestBody The contents of the image, if uploading a local file
* @return The response from the API call
* @throws Exception if the API call fails
*/
public PostMediaPosterResponse postMediaPoster(
long ratingKey,
Optional<String> url,
Optional<byte[]> requestBody) throws Exception {
PostMediaPosterRequest request =
PostMediaPosterRequest
.builder()
.ratingKey(ratingKey)
.url(url)
.requestBody(requestBody)
.build();
String _baseUrl = Utils.templateUrl(
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
String _url = Utils.generateURL(
PostMediaPosterRequest.class,
_baseUrl,
"/library/metadata/{ratingKey}/posters",
request, null);
HTTPRequest _req = new HTTPRequest(_url, "POST");
Object _convertedRequest = Utils.convertToShape(
request,
JsonShape.DEFAULT,
new TypeReference<Object>() {});
SerializedBody _serializedRequestBody = Utils.serializeRequestBody(
_convertedRequest,
"requestBody",
"raw",
false);
_req.setBody(Optional.ofNullable(_serializedRequestBody));
_req.addHeader("Accept", "*/*")
.addHeader("user-agent",
SDKConfiguration.USER_AGENT);
_req.addQueryParams(Utils.getQueryParams(
PostMediaPosterRequest.class,
request,
null));
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
Utils.configureSecurity(_req,
this.sdkConfiguration.securitySource.getSecurity());
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
_baseUrl,
"post-media-poster",
Optional.of(List.of()),
_hookSecuritySource),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
_baseUrl,
"post-media-poster",
Optional.of(List.of()),
_hookSecuritySource),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
_baseUrl,
"post-media-poster",
Optional.of(List.of()),
_hookSecuritySource),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
_baseUrl,
"post-media-poster",
Optional.of(List.of()),
_hookSecuritySource),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
PostMediaPosterResponse.Builder _resBuilder =
PostMediaPosterResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
PostMediaPosterResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
// no content
return _res;
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
/**
* Get Items Children
*

View File

@@ -37,8 +37,6 @@ import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* Submit logs to the Log Handler for Plex Media Server
*/
@@ -70,11 +68,11 @@ public class Log implements
*
* <p>This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.
*
* @param level An integer log level to write to the PMS log with.
* 0: Error
* 1: Warning
* 2: Info
* 3: Debug
* @param level An integer log level to write to the PMS log with.
* 0: Error
* 1: Warning
* 2: Info
* 3: Debug
* 4: Verbose
*
* @param message The text of the message to write to the log.
@@ -234,13 +232,13 @@ public class Log implements
/**
* Logging a multi-line message
*
* <p>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'.
* <p>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'.
*
* <p>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.
* <p>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.
*
* <p>The 'level' parameter specifies the log entry's severity or importance, with the following integer values:
* - `0`: Error - Critical issues that require immediate attention.
@@ -265,13 +263,13 @@ public class Log implements
/**
* Logging a multi-line message
*
* <p>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'.
* <p>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'.
*
* <p>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.
* <p>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.
*
* <p>The 'level' parameter specifies the log entry's severity or importance, with the following integer values:
* - `0`: Error - Critical issues that require immediate attention.

View File

@@ -45,8 +45,6 @@ import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* API Calls interacting with Plex Media Server Media
*/

View File

@@ -75,12 +75,10 @@ import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* 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").
* 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.
* Retrieving a playlist, or its items, will trigger a refresh of its metadata.
* This may cause the duration and number of items to change.
*/
public class Playlists implements
@@ -1564,16 +1562,16 @@ public class Playlists implements
*
* <p>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.
*
* @param 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.
* @param 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 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.
* @param 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.
*
* @param sectionID Possibly the section ID to upload the playlist to, we are not certain.

View File

@@ -61,8 +61,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Optional;
/**
* API Calls that perform operations directly against https://Plex.tv
*/

View File

@@ -14,8 +14,6 @@ import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;
/**
* Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
*
@@ -54,7 +52,7 @@ public class PlexAPI {
/**
* The full address of your Plex Server
*/
"{protocol}://{ip}:{port}",
"https://10.10.10.47:32400",
};
/**
@@ -119,9 +117,9 @@ public class PlexAPI {
private final Log log;
/**
* 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").
* 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.
* Retrieving a playlist, or its items, will trigger a refresh of its metadata.
* This may cause the duration and number of items to change.
*/
private final Playlists playlists;
@@ -233,9 +231,9 @@ public class PlexAPI {
}
/**
* 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").
* 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.
* Retrieving a playlist, or its items, will trigger a refresh of its metadata.
* This may cause the duration and number of items to change.
*/
public Playlists playlists() {
@@ -510,4 +508,5 @@ public class PlexAPI {
this.updater = new Updater(sdkConfiguration);
this.users = new Users(sdkConfiguration);
this.sdkConfiguration.initialize();
}}
}
}

View File

@@ -17,8 +17,6 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
class SDKConfiguration {
public SecuritySource securitySource;
@@ -44,8 +42,8 @@ class SDKConfiguration {
} };
private static final String LANGUAGE = "java";
public static final String OPENAPI_DOC_VERSION = "0.0.3";
public static final String SDK_VERSION = "0.14.0";
public static final String GEN_VERSION = "2.563.1";
public static final String SDK_VERSION = "0.16.0";
public static final String GEN_VERSION = "2.585.2";
private static final String BASE_PACKAGE = "dev.plexapi.sdk";
public static final String USER_AGENT =
String.format("speakeasy-sdk/%s %s %s %s %s",

View File

@@ -37,8 +37,6 @@ import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* API Calls that perform search operations with Plex Media Server
*/

View File

@@ -5,8 +5,6 @@ package dev.plexapi.sdk;
import dev.plexapi.sdk.utils.HasSecurity;
public interface SecuritySource {
HasSecurity getSecurity();

View File

@@ -65,8 +65,6 @@ import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* Operations against the Plex Media Server System.
*/

View File

@@ -43,8 +43,6 @@ import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* API Calls that perform search operations with Plex Media Server Sessions
*/

View File

@@ -39,8 +39,6 @@ import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* API Calls that perform operations with Plex Media Server Statistics
*/

View File

@@ -38,8 +38,6 @@ import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* 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.

View File

@@ -26,8 +26,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Optional;
public class Users implements
MethodCallGetUsers {

View File

@@ -30,8 +30,6 @@ import java.net.http.HttpResponse;
import java.util.List;
import java.util.Optional;
/**
* API Calls that perform operations with Plex Media Server Videos
*/

View File

@@ -27,8 +27,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Optional;
/**
* API Calls that perform operations with Plex Media Server Watchlists
*/

View File

@@ -3,39 +3,186 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* CreatePlaylistQueryParamType
*
* <p>type of playlist to create
*/
public enum CreatePlaylistQueryParamType {
AUDIO("audio"),
VIDEO("video"),
PHOTO("photo");
@JsonDeserialize(using = CreatePlaylistQueryParamType._Deserializer.class)
@JsonSerialize(using = CreatePlaylistQueryParamType._Serializer.class)
public class CreatePlaylistQueryParamType {
public static final CreatePlaylistQueryParamType AUDIO = new CreatePlaylistQueryParamType("audio");
public static final CreatePlaylistQueryParamType VIDEO = new CreatePlaylistQueryParamType("video");
public static final CreatePlaylistQueryParamType PHOTO = new CreatePlaylistQueryParamType("photo");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, CreatePlaylistQueryParamType> values = createValuesMap();
private static final Map<String, CreatePlaylistQueryParamTypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private CreatePlaylistQueryParamType(String value) {
this.value = value;
}
/**
* Returns a CreatePlaylistQueryParamType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as CreatePlaylistQueryParamType
*/
public static CreatePlaylistQueryParamType of(String value) {
synchronized (CreatePlaylistQueryParamType.class) {
return values.computeIfAbsent(value, v -> new CreatePlaylistQueryParamType(v));
}
}
public String value() {
return value;
}
public static Optional<CreatePlaylistQueryParamType> fromValue(String value) {
for (CreatePlaylistQueryParamType o: CreatePlaylistQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<CreatePlaylistQueryParamTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CreatePlaylistQueryParamType other = (CreatePlaylistQueryParamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "CreatePlaylistQueryParamType [value=" + value + "]";
}
// return an array just like an enum
public static CreatePlaylistQueryParamType[] values() {
synchronized (CreatePlaylistQueryParamType.class) {
return values.values().toArray(new CreatePlaylistQueryParamType[] {});
}
}
private static final Map<String, CreatePlaylistQueryParamType> createValuesMap() {
Map<String, CreatePlaylistQueryParamType> map = new LinkedHashMap<>();
map.put("audio", AUDIO);
map.put("video", VIDEO);
map.put("photo", PHOTO);
return map;
}
private static final Map<String, CreatePlaylistQueryParamTypeEnum> createEnumsMap() {
Map<String, CreatePlaylistQueryParamTypeEnum> map = new HashMap<>();
map.put("audio", CreatePlaylistQueryParamTypeEnum.AUDIO);
map.put("video", CreatePlaylistQueryParamTypeEnum.VIDEO);
map.put("photo", CreatePlaylistQueryParamTypeEnum.PHOTO);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<CreatePlaylistQueryParamType> {
protected _Serializer() {
super(CreatePlaylistQueryParamType.class);
}
@Override
public void serialize(CreatePlaylistQueryParamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<CreatePlaylistQueryParamType> {
protected _Deserializer() {
super(CreatePlaylistQueryParamType.class);
}
@Override
public CreatePlaylistQueryParamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return CreatePlaylistQueryParamType.of(v);
}
}
public enum CreatePlaylistQueryParamTypeEnum {
AUDIO("audio"),
VIDEO("video"),
PHOTO("photo"),;
private final String value;
private CreatePlaylistQueryParamTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,38 +3,182 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* EnableCreditsMarkerGeneration
*
* <p>Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
*/
public enum EnableCreditsMarkerGeneration {
LibraryDefault("-1"),
Disabled("0");
@JsonDeserialize(using = EnableCreditsMarkerGeneration._Deserializer.class)
@JsonSerialize(using = EnableCreditsMarkerGeneration._Serializer.class)
public class EnableCreditsMarkerGeneration {
public static final EnableCreditsMarkerGeneration LibraryDefault = new EnableCreditsMarkerGeneration("-1");
public static final EnableCreditsMarkerGeneration Disabled = new EnableCreditsMarkerGeneration("0");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, EnableCreditsMarkerGeneration> values = createValuesMap();
private static final Map<String, EnableCreditsMarkerGenerationEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private EnableCreditsMarkerGeneration(String value) {
this.value = value;
}
/**
* Returns a EnableCreditsMarkerGeneration with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as EnableCreditsMarkerGeneration
*/
public static EnableCreditsMarkerGeneration of(String value) {
synchronized (EnableCreditsMarkerGeneration.class) {
return values.computeIfAbsent(value, v -> new EnableCreditsMarkerGeneration(v));
}
}
public String value() {
return value;
}
public static Optional<EnableCreditsMarkerGeneration> fromValue(String value) {
for (EnableCreditsMarkerGeneration o: EnableCreditsMarkerGeneration.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<EnableCreditsMarkerGenerationEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
EnableCreditsMarkerGeneration other = (EnableCreditsMarkerGeneration) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "EnableCreditsMarkerGeneration [value=" + value + "]";
}
// return an array just like an enum
public static EnableCreditsMarkerGeneration[] values() {
synchronized (EnableCreditsMarkerGeneration.class) {
return values.values().toArray(new EnableCreditsMarkerGeneration[] {});
}
}
private static final Map<String, EnableCreditsMarkerGeneration> createValuesMap() {
Map<String, EnableCreditsMarkerGeneration> map = new LinkedHashMap<>();
map.put("-1", LibraryDefault);
map.put("0", Disabled);
return map;
}
private static final Map<String, EnableCreditsMarkerGenerationEnum> createEnumsMap() {
Map<String, EnableCreditsMarkerGenerationEnum> map = new HashMap<>();
map.put("-1", EnableCreditsMarkerGenerationEnum.LibraryDefault);
map.put("0", EnableCreditsMarkerGenerationEnum.Disabled);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<EnableCreditsMarkerGeneration> {
protected _Serializer() {
super(EnableCreditsMarkerGeneration.class);
}
@Override
public void serialize(EnableCreditsMarkerGeneration value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<EnableCreditsMarkerGeneration> {
protected _Deserializer() {
super(EnableCreditsMarkerGeneration.class);
}
@Override
public EnableCreditsMarkerGeneration deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return EnableCreditsMarkerGeneration.of(v);
}
}
public enum EnableCreditsMarkerGenerationEnum {
LibraryDefault("-1"),
Disabled("0"),;
private final String value;
private EnableCreditsMarkerGenerationEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,39 +3,186 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* EpisodeSort
*
* <p>Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
*/
public enum EpisodeSort {
LibraryDefault("-1"),
OldestFirst("0"),
NewestFirst("1");
@JsonDeserialize(using = EpisodeSort._Deserializer.class)
@JsonSerialize(using = EpisodeSort._Serializer.class)
public class EpisodeSort {
public static final EpisodeSort LibraryDefault = new EpisodeSort("-1");
public static final EpisodeSort OldestFirst = new EpisodeSort("0");
public static final EpisodeSort NewestFirst = new EpisodeSort("1");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, EpisodeSort> values = createValuesMap();
private static final Map<String, EpisodeSortEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private EpisodeSort(String value) {
this.value = value;
}
/**
* Returns a EpisodeSort with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as EpisodeSort
*/
public static EpisodeSort of(String value) {
synchronized (EpisodeSort.class) {
return values.computeIfAbsent(value, v -> new EpisodeSort(v));
}
}
public String value() {
return value;
}
public static Optional<EpisodeSort> fromValue(String value) {
for (EpisodeSort o: EpisodeSort.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<EpisodeSortEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
EpisodeSort other = (EpisodeSort) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "EpisodeSort [value=" + value + "]";
}
// return an array just like an enum
public static EpisodeSort[] values() {
synchronized (EpisodeSort.class) {
return values.values().toArray(new EpisodeSort[] {});
}
}
private static final Map<String, EpisodeSort> createValuesMap() {
Map<String, EpisodeSort> map = new LinkedHashMap<>();
map.put("-1", LibraryDefault);
map.put("0", OldestFirst);
map.put("1", NewestFirst);
return map;
}
private static final Map<String, EpisodeSortEnum> createEnumsMap() {
Map<String, EpisodeSortEnum> map = new HashMap<>();
map.put("-1", EpisodeSortEnum.LibraryDefault);
map.put("0", EpisodeSortEnum.OldestFirst);
map.put("1", EpisodeSortEnum.NewestFirst);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<EpisodeSort> {
protected _Serializer() {
super(EpisodeSort.class);
}
@Override
public void serialize(EpisodeSort value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<EpisodeSort> {
protected _Deserializer() {
super(EpisodeSort.class);
}
@Override
public EpisodeSort deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return EpisodeSort.of(v);
}
}
public enum EpisodeSortEnum {
LibraryDefault("-1"),
OldestFirst("0"),
NewestFirst("1"),;
private final String value;
private EpisodeSortEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,39 +3,186 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* Filter
*
* <p>Filter
*/
public enum Filter {
ALL("all"),
AVAILABLE("available"),
RELEASED("released");
@JsonDeserialize(using = Filter._Deserializer.class)
@JsonSerialize(using = Filter._Serializer.class)
public class Filter {
public static final Filter ALL = new Filter("all");
public static final Filter AVAILABLE = new Filter("available");
public static final Filter RELEASED = new Filter("released");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, Filter> values = createValuesMap();
private static final Map<String, FilterEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private Filter(String value) {
this.value = value;
}
/**
* Returns a Filter with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as Filter
*/
public static Filter of(String value) {
synchronized (Filter.class) {
return values.computeIfAbsent(value, v -> new Filter(v));
}
}
public String value() {
return value;
}
public static Optional<Filter> fromValue(String value) {
for (Filter o: Filter.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<FilterEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Filter other = (Filter) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "Filter [value=" + value + "]";
}
// return an array just like an enum
public static Filter[] values() {
synchronized (Filter.class) {
return values.values().toArray(new Filter[] {});
}
}
private static final Map<String, Filter> createValuesMap() {
Map<String, Filter> map = new LinkedHashMap<>();
map.put("all", ALL);
map.put("available", AVAILABLE);
map.put("released", RELEASED);
return map;
}
private static final Map<String, FilterEnum> createEnumsMap() {
Map<String, FilterEnum> map = new HashMap<>();
map.put("all", FilterEnum.ALL);
map.put("available", FilterEnum.AVAILABLE);
map.put("released", FilterEnum.RELEASED);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<Filter> {
protected _Serializer() {
super(Filter.class);
}
@Override
public void serialize(Filter value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<Filter> {
protected _Deserializer() {
super(Filter.class);
}
@Override
public Filter deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return Filter.of(v);
}
}
public enum FilterEnum {
ALL("all"),
AVAILABLE("available"),
RELEASED("released"),;
private final String value;
private FilterEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,39 +3,186 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* FlattenSeasons
*
* <p>Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
*/
public enum FlattenSeasons {
LibraryDefault("-1"),
Hide("0"),
Show("1");
@JsonDeserialize(using = FlattenSeasons._Deserializer.class)
@JsonSerialize(using = FlattenSeasons._Serializer.class)
public class FlattenSeasons {
public static final FlattenSeasons LibraryDefault = new FlattenSeasons("-1");
public static final FlattenSeasons Hide = new FlattenSeasons("0");
public static final FlattenSeasons Show = new FlattenSeasons("1");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, FlattenSeasons> values = createValuesMap();
private static final Map<String, FlattenSeasonsEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private FlattenSeasons(String value) {
this.value = value;
}
/**
* Returns a FlattenSeasons with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as FlattenSeasons
*/
public static FlattenSeasons of(String value) {
synchronized (FlattenSeasons.class) {
return values.computeIfAbsent(value, v -> new FlattenSeasons(v));
}
}
public String value() {
return value;
}
public static Optional<FlattenSeasons> fromValue(String value) {
for (FlattenSeasons o: FlattenSeasons.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<FlattenSeasonsEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
FlattenSeasons other = (FlattenSeasons) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "FlattenSeasons [value=" + value + "]";
}
// return an array just like an enum
public static FlattenSeasons[] values() {
synchronized (FlattenSeasons.class) {
return values.values().toArray(new FlattenSeasons[] {});
}
}
private static final Map<String, FlattenSeasons> createValuesMap() {
Map<String, FlattenSeasons> map = new LinkedHashMap<>();
map.put("-1", LibraryDefault);
map.put("0", Hide);
map.put("1", Show);
return map;
}
private static final Map<String, FlattenSeasonsEnum> createEnumsMap() {
Map<String, FlattenSeasonsEnum> map = new HashMap<>();
map.put("-1", FlattenSeasonsEnum.LibraryDefault);
map.put("0", FlattenSeasonsEnum.Hide);
map.put("1", FlattenSeasonsEnum.Show);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<FlattenSeasons> {
protected _Serializer() {
super(FlattenSeasons.class);
}
@Override
public void serialize(FlattenSeasons value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<FlattenSeasons> {
protected _Deserializer() {
super(FlattenSeasons.class);
}
@Override
public FlattenSeasons deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return FlattenSeasons.of(v);
}
}
public enum FlattenSeasonsEnum {
LibraryDefault("-1"),
Hide("0"),
Show("1"),;
private final String value;
private FlattenSeasonsEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,10 +3,45 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetActorsLibraryQueryParamType
*
@@ -17,33 +52,159 @@ import java.util.Optional;
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
public enum GetActorsLibraryQueryParamType {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L);
@JsonDeserialize(using = GetActorsLibraryQueryParamType._Deserializer.class)
@JsonSerialize(using = GetActorsLibraryQueryParamType._Serializer.class)
public class GetActorsLibraryQueryParamType {
public static final GetActorsLibraryQueryParamType Movie = new GetActorsLibraryQueryParamType(1L);
public static final GetActorsLibraryQueryParamType TvShow = new GetActorsLibraryQueryParamType(2L);
public static final GetActorsLibraryQueryParamType Season = new GetActorsLibraryQueryParamType(3L);
public static final GetActorsLibraryQueryParamType Episode = new GetActorsLibraryQueryParamType(4L);
public static final GetActorsLibraryQueryParamType Audio = new GetActorsLibraryQueryParamType(8L);
public static final GetActorsLibraryQueryParamType Album = new GetActorsLibraryQueryParamType(9L);
public static final GetActorsLibraryQueryParamType Track = new GetActorsLibraryQueryParamType(10L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, GetActorsLibraryQueryParamType> values = createValuesMap();
private static final Map<Long, GetActorsLibraryQueryParamTypeEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private GetActorsLibraryQueryParamType(long value) {
this.value = value;
}
/**
* Returns a GetActorsLibraryQueryParamType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetActorsLibraryQueryParamType
*/
public static GetActorsLibraryQueryParamType of(long value) {
synchronized (GetActorsLibraryQueryParamType.class) {
return values.computeIfAbsent(value, v -> new GetActorsLibraryQueryParamType(v));
}
}
public long value() {
return value;
}
public static Optional<GetActorsLibraryQueryParamType> fromValue(long value) {
for (GetActorsLibraryQueryParamType o: GetActorsLibraryQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetActorsLibraryQueryParamTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetActorsLibraryQueryParamType other = (GetActorsLibraryQueryParamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetActorsLibraryQueryParamType [value=" + value + "]";
}
// return an array just like an enum
public static GetActorsLibraryQueryParamType[] values() {
synchronized (GetActorsLibraryQueryParamType.class) {
return values.values().toArray(new GetActorsLibraryQueryParamType[] {});
}
}
private static final Map<Long, GetActorsLibraryQueryParamType> createValuesMap() {
Map<Long, GetActorsLibraryQueryParamType> map = new LinkedHashMap<>();
map.put(1L, Movie);
map.put(2L, TvShow);
map.put(3L, Season);
map.put(4L, Episode);
map.put(8L, Audio);
map.put(9L, Album);
map.put(10L, Track);
return map;
}
private static final Map<Long, GetActorsLibraryQueryParamTypeEnum> createEnumsMap() {
Map<Long, GetActorsLibraryQueryParamTypeEnum> map = new HashMap<>();
map.put(1L, GetActorsLibraryQueryParamTypeEnum.Movie);
map.put(2L, GetActorsLibraryQueryParamTypeEnum.TvShow);
map.put(3L, GetActorsLibraryQueryParamTypeEnum.Season);
map.put(4L, GetActorsLibraryQueryParamTypeEnum.Episode);
map.put(8L, GetActorsLibraryQueryParamTypeEnum.Audio);
map.put(9L, GetActorsLibraryQueryParamTypeEnum.Album);
map.put(10L, GetActorsLibraryQueryParamTypeEnum.Track);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetActorsLibraryQueryParamType> {
protected _Serializer() {
super(GetActorsLibraryQueryParamType.class);
}
@Override
public void serialize(GetActorsLibraryQueryParamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetActorsLibraryQueryParamType> {
protected _Deserializer() {
super(GetActorsLibraryQueryParamType.class);
}
@Override
public GetActorsLibraryQueryParamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return GetActorsLibraryQueryParamType.of(v);
}
}
public enum GetActorsLibraryQueryParamTypeEnum {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L),;
private final long value;
private GetActorsLibraryQueryParamTypeEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -5,54 +5,95 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.utils.LazySingletonValue;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
public class GetAllLibrariesDirectory {
/**
* Indicates whether syncing is allowed.
*/
@JsonProperty("allowSync")
private boolean allowSync;
/**
* URL for the background artwork of the media container.
*/
@JsonProperty("art")
private String art;
/**
* The relative path to the composite media item.
*/
@JsonProperty("composite")
private String composite;
/**
* UNKNOWN
*/
@JsonProperty("filters")
private boolean filters;
/**
* Indicates whether the library is currently being refreshed or updated
*/
@JsonProperty("refreshing")
private boolean refreshing;
/**
* URL for the thumbnail image of the media container.
*/
@JsonProperty("thumb")
private String thumb;
/**
* The library key representing the unique identifier
*/
@JsonProperty("key")
private String key;
@JsonProperty("type")
private String type;
private GetAllLibrariesType type;
/**
* The title of the library
*/
@JsonProperty("title")
private String title;
/**
* The Plex agent used to match and retrieve media metadata.
*/
@JsonProperty("agent")
private String agent;
/**
* UNKNOWN
*/
@JsonProperty("scanner")
private String scanner;
/**
* The Plex library language that has been set
*/
@JsonProperty("language")
private String language;
/**
* The universally unique identifier for the library.
*/
@JsonProperty("uuid")
private String uuid;
@@ -62,11 +103,9 @@ public class GetAllLibrariesDirectory {
@JsonProperty("updatedAt")
private long updatedAt;
/**
* Unix epoch datetime in seconds
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("createdAt")
private long createdAt;
private Optional<Long> createdAt;
/**
* Unix epoch datetime in seconds
@@ -74,20 +113,28 @@ public class GetAllLibrariesDirectory {
@JsonProperty("scannedAt")
private long scannedAt;
/**
* UNKNOWN
*/
@JsonProperty("content")
private boolean content;
/**
* UNKNOWN
*/
@JsonProperty("directory")
private boolean directory;
/**
* Unix epoch datetime in seconds
* Timestamp (in seconds) representing the last time the content was modified.
* NOTE: Some Plex server have some absurd values for this field, like 8457612157633039800 so it should be int64
*/
@JsonProperty("contentChangedAt")
private long contentChangedAt;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("hidden")
private int hidden;
private Optional<? extends Hidden> hidden;
@JsonProperty("Location")
private List<GetAllLibrariesLocation> location;
@@ -101,19 +148,19 @@ public class GetAllLibrariesDirectory {
@JsonProperty("refreshing") boolean refreshing,
@JsonProperty("thumb") String thumb,
@JsonProperty("key") String key,
@JsonProperty("type") String type,
@JsonProperty("type") GetAllLibrariesType type,
@JsonProperty("title") String title,
@JsonProperty("agent") String agent,
@JsonProperty("scanner") String scanner,
@JsonProperty("language") String language,
@JsonProperty("uuid") String uuid,
@JsonProperty("updatedAt") long updatedAt,
@JsonProperty("createdAt") long createdAt,
@JsonProperty("createdAt") Optional<Long> createdAt,
@JsonProperty("scannedAt") long scannedAt,
@JsonProperty("content") boolean content,
@JsonProperty("directory") boolean directory,
@JsonProperty("contentChangedAt") long contentChangedAt,
@JsonProperty("hidden") int hidden,
@JsonProperty("hidden") Optional<? extends Hidden> hidden,
@JsonProperty("Location") List<GetAllLibrariesLocation> location) {
Utils.checkNotNull(allowSync, "allowSync");
Utils.checkNotNull(art, "art");
@@ -158,67 +205,126 @@ public class GetAllLibrariesDirectory {
this.hidden = hidden;
this.location = location;
}
public GetAllLibrariesDirectory(
boolean allowSync,
String art,
String composite,
boolean filters,
boolean refreshing,
String thumb,
String key,
GetAllLibrariesType type,
String title,
String agent,
String scanner,
String language,
String uuid,
long updatedAt,
long scannedAt,
boolean content,
boolean directory,
long contentChangedAt,
List<GetAllLibrariesLocation> location) {
this(allowSync, art, composite, filters, refreshing, thumb, key, type, title, agent, scanner, language, uuid, updatedAt, Optional.empty(), scannedAt, content, directory, contentChangedAt, Optional.empty(), location);
}
/**
* Indicates whether syncing is allowed.
*/
@JsonIgnore
public boolean allowSync() {
return allowSync;
}
/**
* URL for the background artwork of the media container.
*/
@JsonIgnore
public String art() {
return art;
}
/**
* The relative path to the composite media item.
*/
@JsonIgnore
public String composite() {
return composite;
}
/**
* UNKNOWN
*/
@JsonIgnore
public boolean filters() {
return filters;
}
/**
* Indicates whether the library is currently being refreshed or updated
*/
@JsonIgnore
public boolean refreshing() {
return refreshing;
}
/**
* URL for the thumbnail image of the media container.
*/
@JsonIgnore
public String thumb() {
return thumb;
}
/**
* The library key representing the unique identifier
*/
@JsonIgnore
public String key() {
return key;
}
@JsonIgnore
public String type() {
public GetAllLibrariesType type() {
return type;
}
/**
* The title of the library
*/
@JsonIgnore
public String title() {
return title;
}
/**
* The Plex agent used to match and retrieve media metadata.
*/
@JsonIgnore
public String agent() {
return agent;
}
/**
* UNKNOWN
*/
@JsonIgnore
public String scanner() {
return scanner;
}
/**
* The Plex library language that has been set
*/
@JsonIgnore
public String language() {
return language;
}
/**
* The universally unique identifier for the library.
*/
@JsonIgnore
public String uuid() {
return uuid;
@@ -232,11 +338,8 @@ public class GetAllLibrariesDirectory {
return updatedAt;
}
/**
* Unix epoch datetime in seconds
*/
@JsonIgnore
public long createdAt() {
public Optional<Long> createdAt() {
return createdAt;
}
@@ -248,27 +351,35 @@ public class GetAllLibrariesDirectory {
return scannedAt;
}
/**
* UNKNOWN
*/
@JsonIgnore
public boolean content() {
return content;
}
/**
* UNKNOWN
*/
@JsonIgnore
public boolean directory() {
return directory;
}
/**
* Unix epoch datetime in seconds
* Timestamp (in seconds) representing the last time the content was modified.
* NOTE: Some Plex server have some absurd values for this field, like 8457612157633039800 so it should be int64
*/
@JsonIgnore
public long contentChangedAt() {
return contentChangedAt;
}
@SuppressWarnings("unchecked")
@JsonIgnore
public int hidden() {
return hidden;
public Optional<Hidden> hidden() {
return (Optional<Hidden>) hidden;
}
@JsonIgnore
@@ -280,78 +391,114 @@ public class GetAllLibrariesDirectory {
return new Builder();
}
/**
* Indicates whether syncing is allowed.
*/
public GetAllLibrariesDirectory withAllowSync(boolean allowSync) {
Utils.checkNotNull(allowSync, "allowSync");
this.allowSync = allowSync;
return this;
}
/**
* URL for the background artwork of the media container.
*/
public GetAllLibrariesDirectory withArt(String art) {
Utils.checkNotNull(art, "art");
this.art = art;
return this;
}
/**
* The relative path to the composite media item.
*/
public GetAllLibrariesDirectory withComposite(String composite) {
Utils.checkNotNull(composite, "composite");
this.composite = composite;
return this;
}
/**
* UNKNOWN
*/
public GetAllLibrariesDirectory withFilters(boolean filters) {
Utils.checkNotNull(filters, "filters");
this.filters = filters;
return this;
}
/**
* Indicates whether the library is currently being refreshed or updated
*/
public GetAllLibrariesDirectory withRefreshing(boolean refreshing) {
Utils.checkNotNull(refreshing, "refreshing");
this.refreshing = refreshing;
return this;
}
/**
* URL for the thumbnail image of the media container.
*/
public GetAllLibrariesDirectory withThumb(String thumb) {
Utils.checkNotNull(thumb, "thumb");
this.thumb = thumb;
return this;
}
/**
* The library key representing the unique identifier
*/
public GetAllLibrariesDirectory withKey(String key) {
Utils.checkNotNull(key, "key");
this.key = key;
return this;
}
public GetAllLibrariesDirectory withType(String type) {
public GetAllLibrariesDirectory withType(GetAllLibrariesType type) {
Utils.checkNotNull(type, "type");
this.type = type;
return this;
}
/**
* The title of the library
*/
public GetAllLibrariesDirectory withTitle(String title) {
Utils.checkNotNull(title, "title");
this.title = title;
return this;
}
/**
* The Plex agent used to match and retrieve media metadata.
*/
public GetAllLibrariesDirectory withAgent(String agent) {
Utils.checkNotNull(agent, "agent");
this.agent = agent;
return this;
}
/**
* UNKNOWN
*/
public GetAllLibrariesDirectory withScanner(String scanner) {
Utils.checkNotNull(scanner, "scanner");
this.scanner = scanner;
return this;
}
/**
* The Plex library language that has been set
*/
public GetAllLibrariesDirectory withLanguage(String language) {
Utils.checkNotNull(language, "language");
this.language = language;
return this;
}
/**
* The universally unique identifier for the library.
*/
public GetAllLibrariesDirectory withUuid(String uuid) {
Utils.checkNotNull(uuid, "uuid");
this.uuid = uuid;
@@ -367,10 +514,13 @@ public class GetAllLibrariesDirectory {
return this;
}
/**
* Unix epoch datetime in seconds
*/
public GetAllLibrariesDirectory withCreatedAt(long createdAt) {
Utils.checkNotNull(createdAt, "createdAt");
this.createdAt = Optional.ofNullable(createdAt);
return this;
}
public GetAllLibrariesDirectory withCreatedAt(Optional<Long> createdAt) {
Utils.checkNotNull(createdAt, "createdAt");
this.createdAt = createdAt;
return this;
@@ -385,12 +535,18 @@ public class GetAllLibrariesDirectory {
return this;
}
/**
* UNKNOWN
*/
public GetAllLibrariesDirectory withContent(boolean content) {
Utils.checkNotNull(content, "content");
this.content = content;
return this;
}
/**
* UNKNOWN
*/
public GetAllLibrariesDirectory withDirectory(boolean directory) {
Utils.checkNotNull(directory, "directory");
this.directory = directory;
@@ -398,7 +554,8 @@ public class GetAllLibrariesDirectory {
}
/**
* Unix epoch datetime in seconds
* Timestamp (in seconds) representing the last time the content was modified.
* NOTE: Some Plex server have some absurd values for this field, like 8457612157633039800 so it should be int64
*/
public GetAllLibrariesDirectory withContentChangedAt(long contentChangedAt) {
Utils.checkNotNull(contentChangedAt, "contentChangedAt");
@@ -406,7 +563,13 @@ public class GetAllLibrariesDirectory {
return this;
}
public GetAllLibrariesDirectory withHidden(int hidden) {
public GetAllLibrariesDirectory withHidden(Hidden hidden) {
Utils.checkNotNull(hidden, "hidden");
this.hidden = Optional.ofNullable(hidden);
return this;
}
public GetAllLibrariesDirectory withHidden(Optional<? extends Hidden> hidden) {
Utils.checkNotNull(hidden, "hidden");
this.hidden = hidden;
return this;
@@ -520,7 +683,7 @@ public class GetAllLibrariesDirectory {
private String key;
private String type;
private GetAllLibrariesType type;
private String title;
@@ -534,7 +697,7 @@ public class GetAllLibrariesDirectory {
private Long updatedAt;
private Long createdAt;
private Optional<Long> createdAt = Optional.empty();
private Long scannedAt;
@@ -544,7 +707,7 @@ public class GetAllLibrariesDirectory {
private Long contentChangedAt;
private Integer hidden;
private Optional<? extends Hidden> hidden;
private List<GetAllLibrariesLocation> location;
@@ -552,78 +715,114 @@ public class GetAllLibrariesDirectory {
// force use of static builder() method
}
/**
* Indicates whether syncing is allowed.
*/
public Builder allowSync(boolean allowSync) {
Utils.checkNotNull(allowSync, "allowSync");
this.allowSync = allowSync;
return this;
}
/**
* URL for the background artwork of the media container.
*/
public Builder art(String art) {
Utils.checkNotNull(art, "art");
this.art = art;
return this;
}
/**
* The relative path to the composite media item.
*/
public Builder composite(String composite) {
Utils.checkNotNull(composite, "composite");
this.composite = composite;
return this;
}
/**
* UNKNOWN
*/
public Builder filters(boolean filters) {
Utils.checkNotNull(filters, "filters");
this.filters = filters;
return this;
}
/**
* Indicates whether the library is currently being refreshed or updated
*/
public Builder refreshing(boolean refreshing) {
Utils.checkNotNull(refreshing, "refreshing");
this.refreshing = refreshing;
return this;
}
/**
* URL for the thumbnail image of the media container.
*/
public Builder thumb(String thumb) {
Utils.checkNotNull(thumb, "thumb");
this.thumb = thumb;
return this;
}
/**
* The library key representing the unique identifier
*/
public Builder key(String key) {
Utils.checkNotNull(key, "key");
this.key = key;
return this;
}
public Builder type(String type) {
public Builder type(GetAllLibrariesType type) {
Utils.checkNotNull(type, "type");
this.type = type;
return this;
}
/**
* The title of the library
*/
public Builder title(String title) {
Utils.checkNotNull(title, "title");
this.title = title;
return this;
}
/**
* The Plex agent used to match and retrieve media metadata.
*/
public Builder agent(String agent) {
Utils.checkNotNull(agent, "agent");
this.agent = agent;
return this;
}
/**
* UNKNOWN
*/
public Builder scanner(String scanner) {
Utils.checkNotNull(scanner, "scanner");
this.scanner = scanner;
return this;
}
/**
* The Plex library language that has been set
*/
public Builder language(String language) {
Utils.checkNotNull(language, "language");
this.language = language;
return this;
}
/**
* The universally unique identifier for the library.
*/
public Builder uuid(String uuid) {
Utils.checkNotNull(uuid, "uuid");
this.uuid = uuid;
@@ -639,10 +838,13 @@ public class GetAllLibrariesDirectory {
return this;
}
/**
* Unix epoch datetime in seconds
*/
public Builder createdAt(long createdAt) {
Utils.checkNotNull(createdAt, "createdAt");
this.createdAt = Optional.ofNullable(createdAt);
return this;
}
public Builder createdAt(Optional<Long> createdAt) {
Utils.checkNotNull(createdAt, "createdAt");
this.createdAt = createdAt;
return this;
@@ -657,12 +859,18 @@ public class GetAllLibrariesDirectory {
return this;
}
/**
* UNKNOWN
*/
public Builder content(boolean content) {
Utils.checkNotNull(content, "content");
this.content = content;
return this;
}
/**
* UNKNOWN
*/
public Builder directory(boolean directory) {
Utils.checkNotNull(directory, "directory");
this.directory = directory;
@@ -670,7 +878,8 @@ public class GetAllLibrariesDirectory {
}
/**
* Unix epoch datetime in seconds
* Timestamp (in seconds) representing the last time the content was modified.
* NOTE: Some Plex server have some absurd values for this field, like 8457612157633039800 so it should be int64
*/
public Builder contentChangedAt(long contentChangedAt) {
Utils.checkNotNull(contentChangedAt, "contentChangedAt");
@@ -678,7 +887,13 @@ public class GetAllLibrariesDirectory {
return this;
}
public Builder hidden(int hidden) {
public Builder hidden(Hidden hidden) {
Utils.checkNotNull(hidden, "hidden");
this.hidden = Optional.ofNullable(hidden);
return this;
}
public Builder hidden(Optional<? extends Hidden> hidden) {
Utils.checkNotNull(hidden, "hidden");
this.hidden = hidden;
return this;
@@ -691,6 +906,9 @@ public class GetAllLibrariesDirectory {
}
public GetAllLibrariesDirectory build() {
if (hidden == null) {
hidden = _SINGLETON_VALUE_Hidden.value();
}
return new GetAllLibrariesDirectory(
allowSync,
art,
@@ -714,5 +932,11 @@ public class GetAllLibrariesDirectory {
hidden,
location);
}
private static final LazySingletonValue<Optional<? extends Hidden>> _SINGLETON_VALUE_Hidden =
new LazySingletonValue<>(
"hidden",
"0",
new TypeReference<Optional<? extends Hidden>>() {});
}
}

View File

@@ -14,9 +14,15 @@ import java.util.Objects;
public class GetAllLibrariesLocation {
/**
* The ID of the location.
*/
@JsonProperty("id")
private int id;
/**
* The path to the media item.
*/
@JsonProperty("path")
private String path;
@@ -30,11 +36,17 @@ public class GetAllLibrariesLocation {
this.path = path;
}
/**
* The ID of the location.
*/
@JsonIgnore
public int id() {
return id;
}
/**
* The path to the media item.
*/
@JsonIgnore
public String path() {
return path;
@@ -44,12 +56,18 @@ public class GetAllLibrariesLocation {
return new Builder();
}
/**
* The ID of the location.
*/
public GetAllLibrariesLocation withId(int id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
/**
* The path to the media item.
*/
public GetAllLibrariesLocation withPath(String path) {
Utils.checkNotNull(path, "path");
this.path = path;
@@ -95,12 +113,18 @@ public class GetAllLibrariesLocation {
// force use of static builder() method
}
/**
* The ID of the location.
*/
public Builder id(int id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
/**
* The path to the media item.
*/
public Builder path(String path) {
Utils.checkNotNull(path, "path");
this.path = path;

View File

@@ -5,35 +5,49 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
public class GetAllLibrariesMediaContainer {
/**
* Number of media items returned in this response.
*/
@JsonProperty("size")
private int size;
/**
* Indicates whether syncing is allowed.
*/
@JsonProperty("allowSync")
private boolean allowSync;
/**
* The primary title of the media container.
*/
@JsonProperty("title1")
private String title1;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("Directory")
private List<GetAllLibrariesDirectory> directory;
private Optional<? extends List<GetAllLibrariesDirectory>> directory;
@JsonCreator
public GetAllLibrariesMediaContainer(
@JsonProperty("size") int size,
@JsonProperty("allowSync") boolean allowSync,
@JsonProperty("title1") String title1,
@JsonProperty("Directory") List<GetAllLibrariesDirectory> directory) {
@JsonProperty("Directory") Optional<? extends List<GetAllLibrariesDirectory>> directory) {
Utils.checkNotNull(size, "size");
Utils.checkNotNull(allowSync, "allowSync");
Utils.checkNotNull(title1, "title1");
@@ -43,43 +57,69 @@ public class GetAllLibrariesMediaContainer {
this.title1 = title1;
this.directory = directory;
}
public GetAllLibrariesMediaContainer(
int size,
boolean allowSync,
String title1) {
this(size, allowSync, title1, Optional.empty());
}
/**
* Number of media items returned in this response.
*/
@JsonIgnore
public int size() {
return size;
}
/**
* Indicates whether syncing is allowed.
*/
@JsonIgnore
public boolean allowSync() {
return allowSync;
}
/**
* The primary title of the media container.
*/
@JsonIgnore
public String title1() {
return title1;
}
@SuppressWarnings("unchecked")
@JsonIgnore
public List<GetAllLibrariesDirectory> directory() {
return directory;
public Optional<List<GetAllLibrariesDirectory>> directory() {
return (Optional<List<GetAllLibrariesDirectory>>) directory;
}
public final static Builder builder() {
return new Builder();
}
/**
* Number of media items returned in this response.
*/
public GetAllLibrariesMediaContainer withSize(int size) {
Utils.checkNotNull(size, "size");
this.size = size;
return this;
}
/**
* Indicates whether syncing is allowed.
*/
public GetAllLibrariesMediaContainer withAllowSync(boolean allowSync) {
Utils.checkNotNull(allowSync, "allowSync");
this.allowSync = allowSync;
return this;
}
/**
* The primary title of the media container.
*/
public GetAllLibrariesMediaContainer withTitle1(String title1) {
Utils.checkNotNull(title1, "title1");
this.title1 = title1;
@@ -87,6 +127,12 @@ public class GetAllLibrariesMediaContainer {
}
public GetAllLibrariesMediaContainer withDirectory(List<GetAllLibrariesDirectory> directory) {
Utils.checkNotNull(directory, "directory");
this.directory = Optional.ofNullable(directory);
return this;
}
public GetAllLibrariesMediaContainer withDirectory(Optional<? extends List<GetAllLibrariesDirectory>> directory) {
Utils.checkNotNull(directory, "directory");
this.directory = directory;
return this;
@@ -135,24 +181,33 @@ public class GetAllLibrariesMediaContainer {
private String title1;
private List<GetAllLibrariesDirectory> directory;
private Optional<? extends List<GetAllLibrariesDirectory>> directory = Optional.empty();
private Builder() {
// force use of static builder() method
}
/**
* Number of media items returned in this response.
*/
public Builder size(int size) {
Utils.checkNotNull(size, "size");
this.size = size;
return this;
}
/**
* Indicates whether syncing is allowed.
*/
public Builder allowSync(boolean allowSync) {
Utils.checkNotNull(allowSync, "allowSync");
this.allowSync = allowSync;
return this;
}
/**
* The primary title of the media container.
*/
public Builder title1(String title1) {
Utils.checkNotNull(title1, "title1");
this.title1 = title1;
@@ -160,6 +215,12 @@ public class GetAllLibrariesMediaContainer {
}
public Builder directory(List<GetAllLibrariesDirectory> directory) {
Utils.checkNotNull(directory, "directory");
this.directory = Optional.ofNullable(directory);
return this;
}
public Builder directory(Optional<? extends List<GetAllLibrariesDirectory>> directory) {
Utils.checkNotNull(directory, "directory");
this.directory = directory;
return this;

View File

@@ -5,11 +5,15 @@ package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Objects;
import java.util.Optional;
/**
* GetAllLibrariesResponseBody
@@ -18,19 +22,25 @@ import java.util.Objects;
*/
public class GetAllLibrariesResponseBody {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("MediaContainer")
private GetAllLibrariesMediaContainer mediaContainer;
private Optional<? extends GetAllLibrariesMediaContainer> mediaContainer;
@JsonCreator
public GetAllLibrariesResponseBody(
@JsonProperty("MediaContainer") GetAllLibrariesMediaContainer mediaContainer) {
@JsonProperty("MediaContainer") Optional<? extends GetAllLibrariesMediaContainer> mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = mediaContainer;
}
public GetAllLibrariesResponseBody() {
this(Optional.empty());
}
@SuppressWarnings("unchecked")
@JsonIgnore
public GetAllLibrariesMediaContainer mediaContainer() {
return mediaContainer;
public Optional<GetAllLibrariesMediaContainer> mediaContainer() {
return (Optional<GetAllLibrariesMediaContainer>) mediaContainer;
}
public final static Builder builder() {
@@ -38,6 +48,12 @@ public class GetAllLibrariesResponseBody {
}
public GetAllLibrariesResponseBody withMediaContainer(GetAllLibrariesMediaContainer mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = Optional.ofNullable(mediaContainer);
return this;
}
public GetAllLibrariesResponseBody withMediaContainer(Optional<? extends GetAllLibrariesMediaContainer> mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = mediaContainer;
return this;
@@ -71,13 +87,19 @@ public class GetAllLibrariesResponseBody {
public final static class Builder {
private GetAllLibrariesMediaContainer mediaContainer;
private Optional<? extends GetAllLibrariesMediaContainer> mediaContainer = Optional.empty();
private Builder() {
// force use of static builder() method
}
public Builder mediaContainer(GetAllLibrariesMediaContainer mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = Optional.ofNullable(mediaContainer);
return this;
}
public Builder mediaContainer(Optional<? extends GetAllLibrariesMediaContainer> mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = mediaContainer;
return this;

View File

@@ -0,0 +1,200 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetAllLibrariesType
*
* <p>The library type
*/
@JsonDeserialize(using = GetAllLibrariesType._Deserializer.class)
@JsonSerialize(using = GetAllLibrariesType._Serializer.class)
public class GetAllLibrariesType {
public static final GetAllLibrariesType Movie = new GetAllLibrariesType("movie");
public static final GetAllLibrariesType TvShow = new GetAllLibrariesType("show");
public static final GetAllLibrariesType Season = new GetAllLibrariesType("season");
public static final GetAllLibrariesType Episode = new GetAllLibrariesType("episode");
public static final GetAllLibrariesType Artist = new GetAllLibrariesType("artist");
public static final GetAllLibrariesType Album = new GetAllLibrariesType("album");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetAllLibrariesType> values = createValuesMap();
private static final Map<String, GetAllLibrariesTypeEnum> enums = createEnumsMap();
private final String value;
private GetAllLibrariesType(String value) {
this.value = value;
}
/**
* Returns a GetAllLibrariesType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetAllLibrariesType
*/
public static GetAllLibrariesType of(String value) {
synchronized (GetAllLibrariesType.class) {
return values.computeIfAbsent(value, v -> new GetAllLibrariesType(v));
}
}
public String value() {
return value;
}
public Optional<GetAllLibrariesTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetAllLibrariesType other = (GetAllLibrariesType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetAllLibrariesType [value=" + value + "]";
}
// return an array just like an enum
public static GetAllLibrariesType[] values() {
synchronized (GetAllLibrariesType.class) {
return values.values().toArray(new GetAllLibrariesType[] {});
}
}
private static final Map<String, GetAllLibrariesType> createValuesMap() {
Map<String, GetAllLibrariesType> map = new LinkedHashMap<>();
map.put("movie", Movie);
map.put("show", TvShow);
map.put("season", Season);
map.put("episode", Episode);
map.put("artist", Artist);
map.put("album", Album);
return map;
}
private static final Map<String, GetAllLibrariesTypeEnum> createEnumsMap() {
Map<String, GetAllLibrariesTypeEnum> map = new HashMap<>();
map.put("movie", GetAllLibrariesTypeEnum.Movie);
map.put("show", GetAllLibrariesTypeEnum.TvShow);
map.put("season", GetAllLibrariesTypeEnum.Season);
map.put("episode", GetAllLibrariesTypeEnum.Episode);
map.put("artist", GetAllLibrariesTypeEnum.Artist);
map.put("album", GetAllLibrariesTypeEnum.Album);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetAllLibrariesType> {
protected _Serializer() {
super(GetAllLibrariesType.class);
}
@Override
public void serialize(GetAllLibrariesType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetAllLibrariesType> {
protected _Deserializer() {
super(GetAllLibrariesType.class);
}
@Override
public GetAllLibrariesType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetAllLibrariesType.of(v);
}
}
public enum GetAllLibrariesTypeEnum {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album"),;
private final String value;
private GetAllLibrariesTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
}
}

View File

@@ -3,35 +3,185 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
public enum GetAllMediaLibraryLibraryResponseType {
COVER_POSTER("coverPoster"),
BACKGROUND("background"),
SNAPSHOT("snapshot"),
CLEAR_LOGO("clearLogo");
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
@JsonDeserialize(using = GetAllMediaLibraryLibraryResponseType._Deserializer.class)
@JsonSerialize(using = GetAllMediaLibraryLibraryResponseType._Serializer.class)
public class GetAllMediaLibraryLibraryResponseType {
public static final GetAllMediaLibraryLibraryResponseType COVER_POSTER = new GetAllMediaLibraryLibraryResponseType("coverPoster");
public static final GetAllMediaLibraryLibraryResponseType BACKGROUND = new GetAllMediaLibraryLibraryResponseType("background");
public static final GetAllMediaLibraryLibraryResponseType SNAPSHOT = new GetAllMediaLibraryLibraryResponseType("snapshot");
public static final GetAllMediaLibraryLibraryResponseType CLEAR_LOGO = new GetAllMediaLibraryLibraryResponseType("clearLogo");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetAllMediaLibraryLibraryResponseType> values = createValuesMap();
private static final Map<String, GetAllMediaLibraryLibraryResponseTypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetAllMediaLibraryLibraryResponseType(String value) {
this.value = value;
}
/**
* Returns a GetAllMediaLibraryLibraryResponseType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetAllMediaLibraryLibraryResponseType
*/
public static GetAllMediaLibraryLibraryResponseType of(String value) {
synchronized (GetAllMediaLibraryLibraryResponseType.class) {
return values.computeIfAbsent(value, v -> new GetAllMediaLibraryLibraryResponseType(v));
}
}
public String value() {
return value;
}
public static Optional<GetAllMediaLibraryLibraryResponseType> fromValue(String value) {
for (GetAllMediaLibraryLibraryResponseType o: GetAllMediaLibraryLibraryResponseType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetAllMediaLibraryLibraryResponseTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetAllMediaLibraryLibraryResponseType other = (GetAllMediaLibraryLibraryResponseType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetAllMediaLibraryLibraryResponseType [value=" + value + "]";
}
// return an array just like an enum
public static GetAllMediaLibraryLibraryResponseType[] values() {
synchronized (GetAllMediaLibraryLibraryResponseType.class) {
return values.values().toArray(new GetAllMediaLibraryLibraryResponseType[] {});
}
}
private static final Map<String, GetAllMediaLibraryLibraryResponseType> createValuesMap() {
Map<String, GetAllMediaLibraryLibraryResponseType> map = new LinkedHashMap<>();
map.put("coverPoster", COVER_POSTER);
map.put("background", BACKGROUND);
map.put("snapshot", SNAPSHOT);
map.put("clearLogo", CLEAR_LOGO);
return map;
}
private static final Map<String, GetAllMediaLibraryLibraryResponseTypeEnum> createEnumsMap() {
Map<String, GetAllMediaLibraryLibraryResponseTypeEnum> map = new HashMap<>();
map.put("coverPoster", GetAllMediaLibraryLibraryResponseTypeEnum.COVER_POSTER);
map.put("background", GetAllMediaLibraryLibraryResponseTypeEnum.BACKGROUND);
map.put("snapshot", GetAllMediaLibraryLibraryResponseTypeEnum.SNAPSHOT);
map.put("clearLogo", GetAllMediaLibraryLibraryResponseTypeEnum.CLEAR_LOGO);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetAllMediaLibraryLibraryResponseType> {
protected _Serializer() {
super(GetAllMediaLibraryLibraryResponseType.class);
}
@Override
public void serialize(GetAllMediaLibraryLibraryResponseType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetAllMediaLibraryLibraryResponseType> {
protected _Deserializer() {
super(GetAllMediaLibraryLibraryResponseType.class);
}
@Override
public GetAllMediaLibraryLibraryResponseType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetAllMediaLibraryLibraryResponseType.of(v);
}
}
public enum GetAllMediaLibraryLibraryResponseTypeEnum {
COVER_POSTER("coverPoster"),
BACKGROUND("background"),
SNAPSHOT("snapshot"),
CLEAR_LOGO("clearLogo"),;
private final String value;
private GetAllMediaLibraryLibraryResponseTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,42 +3,198 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetAllMediaLibraryLibraryType
*
* <p>The type of media content
*/
public enum GetAllMediaLibraryLibraryType {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album");
@JsonDeserialize(using = GetAllMediaLibraryLibraryType._Deserializer.class)
@JsonSerialize(using = GetAllMediaLibraryLibraryType._Serializer.class)
public class GetAllMediaLibraryLibraryType {
public static final GetAllMediaLibraryLibraryType Movie = new GetAllMediaLibraryLibraryType("movie");
public static final GetAllMediaLibraryLibraryType TvShow = new GetAllMediaLibraryLibraryType("show");
public static final GetAllMediaLibraryLibraryType Season = new GetAllMediaLibraryLibraryType("season");
public static final GetAllMediaLibraryLibraryType Episode = new GetAllMediaLibraryLibraryType("episode");
public static final GetAllMediaLibraryLibraryType Artist = new GetAllMediaLibraryLibraryType("artist");
public static final GetAllMediaLibraryLibraryType Album = new GetAllMediaLibraryLibraryType("album");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetAllMediaLibraryLibraryType> values = createValuesMap();
private static final Map<String, GetAllMediaLibraryLibraryTypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetAllMediaLibraryLibraryType(String value) {
this.value = value;
}
/**
* Returns a GetAllMediaLibraryLibraryType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetAllMediaLibraryLibraryType
*/
public static GetAllMediaLibraryLibraryType of(String value) {
synchronized (GetAllMediaLibraryLibraryType.class) {
return values.computeIfAbsent(value, v -> new GetAllMediaLibraryLibraryType(v));
}
}
public String value() {
return value;
}
public static Optional<GetAllMediaLibraryLibraryType> fromValue(String value) {
for (GetAllMediaLibraryLibraryType o: GetAllMediaLibraryLibraryType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetAllMediaLibraryLibraryTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetAllMediaLibraryLibraryType other = (GetAllMediaLibraryLibraryType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetAllMediaLibraryLibraryType [value=" + value + "]";
}
// return an array just like an enum
public static GetAllMediaLibraryLibraryType[] values() {
synchronized (GetAllMediaLibraryLibraryType.class) {
return values.values().toArray(new GetAllMediaLibraryLibraryType[] {});
}
}
private static final Map<String, GetAllMediaLibraryLibraryType> createValuesMap() {
Map<String, GetAllMediaLibraryLibraryType> map = new LinkedHashMap<>();
map.put("movie", Movie);
map.put("show", TvShow);
map.put("season", Season);
map.put("episode", Episode);
map.put("artist", Artist);
map.put("album", Album);
return map;
}
private static final Map<String, GetAllMediaLibraryLibraryTypeEnum> createEnumsMap() {
Map<String, GetAllMediaLibraryLibraryTypeEnum> map = new HashMap<>();
map.put("movie", GetAllMediaLibraryLibraryTypeEnum.Movie);
map.put("show", GetAllMediaLibraryLibraryTypeEnum.TvShow);
map.put("season", GetAllMediaLibraryLibraryTypeEnum.Season);
map.put("episode", GetAllMediaLibraryLibraryTypeEnum.Episode);
map.put("artist", GetAllMediaLibraryLibraryTypeEnum.Artist);
map.put("album", GetAllMediaLibraryLibraryTypeEnum.Album);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetAllMediaLibraryLibraryType> {
protected _Serializer() {
super(GetAllMediaLibraryLibraryType.class);
}
@Override
public void serialize(GetAllMediaLibraryLibraryType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetAllMediaLibraryLibraryType> {
protected _Deserializer() {
super(GetAllMediaLibraryLibraryType.class);
}
@Override
public GetAllMediaLibraryLibraryType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetAllMediaLibraryLibraryType.of(v);
}
}
public enum GetAllMediaLibraryLibraryTypeEnum {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album"),;
private final String value;
private GetAllMediaLibraryLibraryTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,10 +3,45 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetAllMediaLibraryQueryParamType
*
@@ -17,33 +52,159 @@ import java.util.Optional;
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
public enum GetAllMediaLibraryQueryParamType {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L);
@JsonDeserialize(using = GetAllMediaLibraryQueryParamType._Deserializer.class)
@JsonSerialize(using = GetAllMediaLibraryQueryParamType._Serializer.class)
public class GetAllMediaLibraryQueryParamType {
public static final GetAllMediaLibraryQueryParamType Movie = new GetAllMediaLibraryQueryParamType(1L);
public static final GetAllMediaLibraryQueryParamType TvShow = new GetAllMediaLibraryQueryParamType(2L);
public static final GetAllMediaLibraryQueryParamType Season = new GetAllMediaLibraryQueryParamType(3L);
public static final GetAllMediaLibraryQueryParamType Episode = new GetAllMediaLibraryQueryParamType(4L);
public static final GetAllMediaLibraryQueryParamType Audio = new GetAllMediaLibraryQueryParamType(8L);
public static final GetAllMediaLibraryQueryParamType Album = new GetAllMediaLibraryQueryParamType(9L);
public static final GetAllMediaLibraryQueryParamType Track = new GetAllMediaLibraryQueryParamType(10L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, GetAllMediaLibraryQueryParamType> values = createValuesMap();
private static final Map<Long, GetAllMediaLibraryQueryParamTypeEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private GetAllMediaLibraryQueryParamType(long value) {
this.value = value;
}
/**
* Returns a GetAllMediaLibraryQueryParamType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetAllMediaLibraryQueryParamType
*/
public static GetAllMediaLibraryQueryParamType of(long value) {
synchronized (GetAllMediaLibraryQueryParamType.class) {
return values.computeIfAbsent(value, v -> new GetAllMediaLibraryQueryParamType(v));
}
}
public long value() {
return value;
}
public static Optional<GetAllMediaLibraryQueryParamType> fromValue(long value) {
for (GetAllMediaLibraryQueryParamType o: GetAllMediaLibraryQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetAllMediaLibraryQueryParamTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetAllMediaLibraryQueryParamType other = (GetAllMediaLibraryQueryParamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetAllMediaLibraryQueryParamType [value=" + value + "]";
}
// return an array just like an enum
public static GetAllMediaLibraryQueryParamType[] values() {
synchronized (GetAllMediaLibraryQueryParamType.class) {
return values.values().toArray(new GetAllMediaLibraryQueryParamType[] {});
}
}
private static final Map<Long, GetAllMediaLibraryQueryParamType> createValuesMap() {
Map<Long, GetAllMediaLibraryQueryParamType> map = new LinkedHashMap<>();
map.put(1L, Movie);
map.put(2L, TvShow);
map.put(3L, Season);
map.put(4L, Episode);
map.put(8L, Audio);
map.put(9L, Album);
map.put(10L, Track);
return map;
}
private static final Map<Long, GetAllMediaLibraryQueryParamTypeEnum> createEnumsMap() {
Map<Long, GetAllMediaLibraryQueryParamTypeEnum> map = new HashMap<>();
map.put(1L, GetAllMediaLibraryQueryParamTypeEnum.Movie);
map.put(2L, GetAllMediaLibraryQueryParamTypeEnum.TvShow);
map.put(3L, GetAllMediaLibraryQueryParamTypeEnum.Season);
map.put(4L, GetAllMediaLibraryQueryParamTypeEnum.Episode);
map.put(8L, GetAllMediaLibraryQueryParamTypeEnum.Audio);
map.put(9L, GetAllMediaLibraryQueryParamTypeEnum.Album);
map.put(10L, GetAllMediaLibraryQueryParamTypeEnum.Track);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetAllMediaLibraryQueryParamType> {
protected _Serializer() {
super(GetAllMediaLibraryQueryParamType.class);
}
@Override
public void serialize(GetAllMediaLibraryQueryParamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetAllMediaLibraryQueryParamType> {
protected _Deserializer() {
super(GetAllMediaLibraryQueryParamType.class);
}
@Override
public GetAllMediaLibraryQueryParamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return GetAllMediaLibraryQueryParamType.of(v);
}
}
public enum GetAllMediaLibraryQueryParamTypeEnum {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L),;
private final long value;
private GetAllMediaLibraryQueryParamTypeEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,10 +3,45 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetCountriesLibraryQueryParamType
*
@@ -17,33 +52,159 @@ import java.util.Optional;
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
public enum GetCountriesLibraryQueryParamType {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L);
@JsonDeserialize(using = GetCountriesLibraryQueryParamType._Deserializer.class)
@JsonSerialize(using = GetCountriesLibraryQueryParamType._Serializer.class)
public class GetCountriesLibraryQueryParamType {
public static final GetCountriesLibraryQueryParamType Movie = new GetCountriesLibraryQueryParamType(1L);
public static final GetCountriesLibraryQueryParamType TvShow = new GetCountriesLibraryQueryParamType(2L);
public static final GetCountriesLibraryQueryParamType Season = new GetCountriesLibraryQueryParamType(3L);
public static final GetCountriesLibraryQueryParamType Episode = new GetCountriesLibraryQueryParamType(4L);
public static final GetCountriesLibraryQueryParamType Audio = new GetCountriesLibraryQueryParamType(8L);
public static final GetCountriesLibraryQueryParamType Album = new GetCountriesLibraryQueryParamType(9L);
public static final GetCountriesLibraryQueryParamType Track = new GetCountriesLibraryQueryParamType(10L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, GetCountriesLibraryQueryParamType> values = createValuesMap();
private static final Map<Long, GetCountriesLibraryQueryParamTypeEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private GetCountriesLibraryQueryParamType(long value) {
this.value = value;
}
/**
* Returns a GetCountriesLibraryQueryParamType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetCountriesLibraryQueryParamType
*/
public static GetCountriesLibraryQueryParamType of(long value) {
synchronized (GetCountriesLibraryQueryParamType.class) {
return values.computeIfAbsent(value, v -> new GetCountriesLibraryQueryParamType(v));
}
}
public long value() {
return value;
}
public static Optional<GetCountriesLibraryQueryParamType> fromValue(long value) {
for (GetCountriesLibraryQueryParamType o: GetCountriesLibraryQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetCountriesLibraryQueryParamTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetCountriesLibraryQueryParamType other = (GetCountriesLibraryQueryParamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetCountriesLibraryQueryParamType [value=" + value + "]";
}
// return an array just like an enum
public static GetCountriesLibraryQueryParamType[] values() {
synchronized (GetCountriesLibraryQueryParamType.class) {
return values.values().toArray(new GetCountriesLibraryQueryParamType[] {});
}
}
private static final Map<Long, GetCountriesLibraryQueryParamType> createValuesMap() {
Map<Long, GetCountriesLibraryQueryParamType> map = new LinkedHashMap<>();
map.put(1L, Movie);
map.put(2L, TvShow);
map.put(3L, Season);
map.put(4L, Episode);
map.put(8L, Audio);
map.put(9L, Album);
map.put(10L, Track);
return map;
}
private static final Map<Long, GetCountriesLibraryQueryParamTypeEnum> createEnumsMap() {
Map<Long, GetCountriesLibraryQueryParamTypeEnum> map = new HashMap<>();
map.put(1L, GetCountriesLibraryQueryParamTypeEnum.Movie);
map.put(2L, GetCountriesLibraryQueryParamTypeEnum.TvShow);
map.put(3L, GetCountriesLibraryQueryParamTypeEnum.Season);
map.put(4L, GetCountriesLibraryQueryParamTypeEnum.Episode);
map.put(8L, GetCountriesLibraryQueryParamTypeEnum.Audio);
map.put(9L, GetCountriesLibraryQueryParamTypeEnum.Album);
map.put(10L, GetCountriesLibraryQueryParamTypeEnum.Track);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetCountriesLibraryQueryParamType> {
protected _Serializer() {
super(GetCountriesLibraryQueryParamType.class);
}
@Override
public void serialize(GetCountriesLibraryQueryParamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetCountriesLibraryQueryParamType> {
protected _Deserializer() {
super(GetCountriesLibraryQueryParamType.class);
}
@Override
public GetCountriesLibraryQueryParamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return GetCountriesLibraryQueryParamType.of(v);
}
}
public enum GetCountriesLibraryQueryParamTypeEnum {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L),;
private final long value;
private GetCountriesLibraryQueryParamTypeEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,10 +3,45 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetGenresLibraryQueryParamType
*
@@ -17,33 +52,159 @@ import java.util.Optional;
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
public enum GetGenresLibraryQueryParamType {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L);
@JsonDeserialize(using = GetGenresLibraryQueryParamType._Deserializer.class)
@JsonSerialize(using = GetGenresLibraryQueryParamType._Serializer.class)
public class GetGenresLibraryQueryParamType {
public static final GetGenresLibraryQueryParamType Movie = new GetGenresLibraryQueryParamType(1L);
public static final GetGenresLibraryQueryParamType TvShow = new GetGenresLibraryQueryParamType(2L);
public static final GetGenresLibraryQueryParamType Season = new GetGenresLibraryQueryParamType(3L);
public static final GetGenresLibraryQueryParamType Episode = new GetGenresLibraryQueryParamType(4L);
public static final GetGenresLibraryQueryParamType Audio = new GetGenresLibraryQueryParamType(8L);
public static final GetGenresLibraryQueryParamType Album = new GetGenresLibraryQueryParamType(9L);
public static final GetGenresLibraryQueryParamType Track = new GetGenresLibraryQueryParamType(10L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, GetGenresLibraryQueryParamType> values = createValuesMap();
private static final Map<Long, GetGenresLibraryQueryParamTypeEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private GetGenresLibraryQueryParamType(long value) {
this.value = value;
}
/**
* Returns a GetGenresLibraryQueryParamType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetGenresLibraryQueryParamType
*/
public static GetGenresLibraryQueryParamType of(long value) {
synchronized (GetGenresLibraryQueryParamType.class) {
return values.computeIfAbsent(value, v -> new GetGenresLibraryQueryParamType(v));
}
}
public long value() {
return value;
}
public static Optional<GetGenresLibraryQueryParamType> fromValue(long value) {
for (GetGenresLibraryQueryParamType o: GetGenresLibraryQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetGenresLibraryQueryParamTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetGenresLibraryQueryParamType other = (GetGenresLibraryQueryParamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetGenresLibraryQueryParamType [value=" + value + "]";
}
// return an array just like an enum
public static GetGenresLibraryQueryParamType[] values() {
synchronized (GetGenresLibraryQueryParamType.class) {
return values.values().toArray(new GetGenresLibraryQueryParamType[] {});
}
}
private static final Map<Long, GetGenresLibraryQueryParamType> createValuesMap() {
Map<Long, GetGenresLibraryQueryParamType> map = new LinkedHashMap<>();
map.put(1L, Movie);
map.put(2L, TvShow);
map.put(3L, Season);
map.put(4L, Episode);
map.put(8L, Audio);
map.put(9L, Album);
map.put(10L, Track);
return map;
}
private static final Map<Long, GetGenresLibraryQueryParamTypeEnum> createEnumsMap() {
Map<Long, GetGenresLibraryQueryParamTypeEnum> map = new HashMap<>();
map.put(1L, GetGenresLibraryQueryParamTypeEnum.Movie);
map.put(2L, GetGenresLibraryQueryParamTypeEnum.TvShow);
map.put(3L, GetGenresLibraryQueryParamTypeEnum.Season);
map.put(4L, GetGenresLibraryQueryParamTypeEnum.Episode);
map.put(8L, GetGenresLibraryQueryParamTypeEnum.Audio);
map.put(9L, GetGenresLibraryQueryParamTypeEnum.Album);
map.put(10L, GetGenresLibraryQueryParamTypeEnum.Track);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetGenresLibraryQueryParamType> {
protected _Serializer() {
super(GetGenresLibraryQueryParamType.class);
}
@Override
public void serialize(GetGenresLibraryQueryParamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetGenresLibraryQueryParamType> {
protected _Deserializer() {
super(GetGenresLibraryQueryParamType.class);
}
@Override
public GetGenresLibraryQueryParamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return GetGenresLibraryQueryParamType.of(v);
}
}
public enum GetGenresLibraryQueryParamTypeEnum {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L),;
private final long value;
private GetGenresLibraryQueryParamTypeEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -19,7 +19,7 @@ import java.util.Optional;
public class GetLibraryDetailsRequest {
/**
* Whether or not to include details for a section (types, filters, and sorts).
* 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.
*/
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeDetails")
@@ -48,7 +48,7 @@ public class GetLibraryDetailsRequest {
}
/**
* Whether or not to include details for a section (types, filters, and sorts).
* 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.
*/
@SuppressWarnings("unchecked")
@@ -71,7 +71,7 @@ public class GetLibraryDetailsRequest {
}
/**
* Whether or not to include details for a section (types, filters, and sorts).
* 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 GetLibraryDetailsRequest withIncludeDetails(IncludeDetails includeDetails) {
@@ -81,7 +81,7 @@ public class GetLibraryDetailsRequest {
}
/**
* Whether or not to include details for a section (types, filters, and sorts).
* 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 GetLibraryDetailsRequest withIncludeDetails(Optional<? extends IncludeDetails> includeDetails) {
@@ -140,7 +140,7 @@ public class GetLibraryDetailsRequest {
}
/**
* Whether or not to include details for a section (types, filters, and sorts).
* 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 Builder includeDetails(IncludeDetails includeDetails) {
@@ -150,7 +150,7 @@ public class GetLibraryDetailsRequest {
}
/**
* Whether or not to include details for a section (types, filters, and sorts).
* 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 Builder includeDetails(Optional<? extends IncludeDetails> includeDetails) {

View File

@@ -3,35 +3,185 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
public enum GetLibraryItemsLibraryResponse200Type {
COVER_POSTER("coverPoster"),
BACKGROUND("background"),
SNAPSHOT("snapshot"),
CLEAR_LOGO("clearLogo");
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
@JsonDeserialize(using = GetLibraryItemsLibraryResponse200Type._Deserializer.class)
@JsonSerialize(using = GetLibraryItemsLibraryResponse200Type._Serializer.class)
public class GetLibraryItemsLibraryResponse200Type {
public static final GetLibraryItemsLibraryResponse200Type COVER_POSTER = new GetLibraryItemsLibraryResponse200Type("coverPoster");
public static final GetLibraryItemsLibraryResponse200Type BACKGROUND = new GetLibraryItemsLibraryResponse200Type("background");
public static final GetLibraryItemsLibraryResponse200Type SNAPSHOT = new GetLibraryItemsLibraryResponse200Type("snapshot");
public static final GetLibraryItemsLibraryResponse200Type CLEAR_LOGO = new GetLibraryItemsLibraryResponse200Type("clearLogo");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetLibraryItemsLibraryResponse200Type> values = createValuesMap();
private static final Map<String, GetLibraryItemsLibraryResponse200TypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetLibraryItemsLibraryResponse200Type(String value) {
this.value = value;
}
/**
* Returns a GetLibraryItemsLibraryResponse200Type with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetLibraryItemsLibraryResponse200Type
*/
public static GetLibraryItemsLibraryResponse200Type of(String value) {
synchronized (GetLibraryItemsLibraryResponse200Type.class) {
return values.computeIfAbsent(value, v -> new GetLibraryItemsLibraryResponse200Type(v));
}
}
public String value() {
return value;
}
public static Optional<GetLibraryItemsLibraryResponse200Type> fromValue(String value) {
for (GetLibraryItemsLibraryResponse200Type o: GetLibraryItemsLibraryResponse200Type.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetLibraryItemsLibraryResponse200TypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetLibraryItemsLibraryResponse200Type other = (GetLibraryItemsLibraryResponse200Type) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetLibraryItemsLibraryResponse200Type [value=" + value + "]";
}
// return an array just like an enum
public static GetLibraryItemsLibraryResponse200Type[] values() {
synchronized (GetLibraryItemsLibraryResponse200Type.class) {
return values.values().toArray(new GetLibraryItemsLibraryResponse200Type[] {});
}
}
private static final Map<String, GetLibraryItemsLibraryResponse200Type> createValuesMap() {
Map<String, GetLibraryItemsLibraryResponse200Type> map = new LinkedHashMap<>();
map.put("coverPoster", COVER_POSTER);
map.put("background", BACKGROUND);
map.put("snapshot", SNAPSHOT);
map.put("clearLogo", CLEAR_LOGO);
return map;
}
private static final Map<String, GetLibraryItemsLibraryResponse200TypeEnum> createEnumsMap() {
Map<String, GetLibraryItemsLibraryResponse200TypeEnum> map = new HashMap<>();
map.put("coverPoster", GetLibraryItemsLibraryResponse200TypeEnum.COVER_POSTER);
map.put("background", GetLibraryItemsLibraryResponse200TypeEnum.BACKGROUND);
map.put("snapshot", GetLibraryItemsLibraryResponse200TypeEnum.SNAPSHOT);
map.put("clearLogo", GetLibraryItemsLibraryResponse200TypeEnum.CLEAR_LOGO);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetLibraryItemsLibraryResponse200Type> {
protected _Serializer() {
super(GetLibraryItemsLibraryResponse200Type.class);
}
@Override
public void serialize(GetLibraryItemsLibraryResponse200Type value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetLibraryItemsLibraryResponse200Type> {
protected _Deserializer() {
super(GetLibraryItemsLibraryResponse200Type.class);
}
@Override
public GetLibraryItemsLibraryResponse200Type deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetLibraryItemsLibraryResponse200Type.of(v);
}
}
public enum GetLibraryItemsLibraryResponse200TypeEnum {
COVER_POSTER("coverPoster"),
BACKGROUND("background"),
SNAPSHOT("snapshot"),
CLEAR_LOGO("clearLogo"),;
private final String value;
private GetLibraryItemsLibraryResponse200TypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,42 +3,198 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetLibraryItemsLibraryType
*
* <p>The type of media content
*/
public enum GetLibraryItemsLibraryType {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album");
@JsonDeserialize(using = GetLibraryItemsLibraryType._Deserializer.class)
@JsonSerialize(using = GetLibraryItemsLibraryType._Serializer.class)
public class GetLibraryItemsLibraryType {
public static final GetLibraryItemsLibraryType Movie = new GetLibraryItemsLibraryType("movie");
public static final GetLibraryItemsLibraryType TvShow = new GetLibraryItemsLibraryType("show");
public static final GetLibraryItemsLibraryType Season = new GetLibraryItemsLibraryType("season");
public static final GetLibraryItemsLibraryType Episode = new GetLibraryItemsLibraryType("episode");
public static final GetLibraryItemsLibraryType Artist = new GetLibraryItemsLibraryType("artist");
public static final GetLibraryItemsLibraryType Album = new GetLibraryItemsLibraryType("album");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetLibraryItemsLibraryType> values = createValuesMap();
private static final Map<String, GetLibraryItemsLibraryTypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetLibraryItemsLibraryType(String value) {
this.value = value;
}
/**
* Returns a GetLibraryItemsLibraryType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetLibraryItemsLibraryType
*/
public static GetLibraryItemsLibraryType of(String value) {
synchronized (GetLibraryItemsLibraryType.class) {
return values.computeIfAbsent(value, v -> new GetLibraryItemsLibraryType(v));
}
}
public String value() {
return value;
}
public static Optional<GetLibraryItemsLibraryType> fromValue(String value) {
for (GetLibraryItemsLibraryType o: GetLibraryItemsLibraryType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetLibraryItemsLibraryTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetLibraryItemsLibraryType other = (GetLibraryItemsLibraryType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetLibraryItemsLibraryType [value=" + value + "]";
}
// return an array just like an enum
public static GetLibraryItemsLibraryType[] values() {
synchronized (GetLibraryItemsLibraryType.class) {
return values.values().toArray(new GetLibraryItemsLibraryType[] {});
}
}
private static final Map<String, GetLibraryItemsLibraryType> createValuesMap() {
Map<String, GetLibraryItemsLibraryType> map = new LinkedHashMap<>();
map.put("movie", Movie);
map.put("show", TvShow);
map.put("season", Season);
map.put("episode", Episode);
map.put("artist", Artist);
map.put("album", Album);
return map;
}
private static final Map<String, GetLibraryItemsLibraryTypeEnum> createEnumsMap() {
Map<String, GetLibraryItemsLibraryTypeEnum> map = new HashMap<>();
map.put("movie", GetLibraryItemsLibraryTypeEnum.Movie);
map.put("show", GetLibraryItemsLibraryTypeEnum.TvShow);
map.put("season", GetLibraryItemsLibraryTypeEnum.Season);
map.put("episode", GetLibraryItemsLibraryTypeEnum.Episode);
map.put("artist", GetLibraryItemsLibraryTypeEnum.Artist);
map.put("album", GetLibraryItemsLibraryTypeEnum.Album);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetLibraryItemsLibraryType> {
protected _Serializer() {
super(GetLibraryItemsLibraryType.class);
}
@Override
public void serialize(GetLibraryItemsLibraryType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetLibraryItemsLibraryType> {
protected _Deserializer() {
super(GetLibraryItemsLibraryType.class);
}
@Override
public GetLibraryItemsLibraryType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetLibraryItemsLibraryType.of(v);
}
}
public enum GetLibraryItemsLibraryTypeEnum {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album"),;
private final String value;
private GetLibraryItemsLibraryTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,10 +3,45 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetLibraryItemsQueryParamType
*
@@ -17,33 +52,159 @@ import java.util.Optional;
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
public enum GetLibraryItemsQueryParamType {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L);
@JsonDeserialize(using = GetLibraryItemsQueryParamType._Deserializer.class)
@JsonSerialize(using = GetLibraryItemsQueryParamType._Serializer.class)
public class GetLibraryItemsQueryParamType {
public static final GetLibraryItemsQueryParamType Movie = new GetLibraryItemsQueryParamType(1L);
public static final GetLibraryItemsQueryParamType TvShow = new GetLibraryItemsQueryParamType(2L);
public static final GetLibraryItemsQueryParamType Season = new GetLibraryItemsQueryParamType(3L);
public static final GetLibraryItemsQueryParamType Episode = new GetLibraryItemsQueryParamType(4L);
public static final GetLibraryItemsQueryParamType Audio = new GetLibraryItemsQueryParamType(8L);
public static final GetLibraryItemsQueryParamType Album = new GetLibraryItemsQueryParamType(9L);
public static final GetLibraryItemsQueryParamType Track = new GetLibraryItemsQueryParamType(10L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, GetLibraryItemsQueryParamType> values = createValuesMap();
private static final Map<Long, GetLibraryItemsQueryParamTypeEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private GetLibraryItemsQueryParamType(long value) {
this.value = value;
}
/**
* Returns a GetLibraryItemsQueryParamType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetLibraryItemsQueryParamType
*/
public static GetLibraryItemsQueryParamType of(long value) {
synchronized (GetLibraryItemsQueryParamType.class) {
return values.computeIfAbsent(value, v -> new GetLibraryItemsQueryParamType(v));
}
}
public long value() {
return value;
}
public static Optional<GetLibraryItemsQueryParamType> fromValue(long value) {
for (GetLibraryItemsQueryParamType o: GetLibraryItemsQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetLibraryItemsQueryParamTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetLibraryItemsQueryParamType other = (GetLibraryItemsQueryParamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetLibraryItemsQueryParamType [value=" + value + "]";
}
// return an array just like an enum
public static GetLibraryItemsQueryParamType[] values() {
synchronized (GetLibraryItemsQueryParamType.class) {
return values.values().toArray(new GetLibraryItemsQueryParamType[] {});
}
}
private static final Map<Long, GetLibraryItemsQueryParamType> createValuesMap() {
Map<Long, GetLibraryItemsQueryParamType> map = new LinkedHashMap<>();
map.put(1L, Movie);
map.put(2L, TvShow);
map.put(3L, Season);
map.put(4L, Episode);
map.put(8L, Audio);
map.put(9L, Album);
map.put(10L, Track);
return map;
}
private static final Map<Long, GetLibraryItemsQueryParamTypeEnum> createEnumsMap() {
Map<Long, GetLibraryItemsQueryParamTypeEnum> map = new HashMap<>();
map.put(1L, GetLibraryItemsQueryParamTypeEnum.Movie);
map.put(2L, GetLibraryItemsQueryParamTypeEnum.TvShow);
map.put(3L, GetLibraryItemsQueryParamTypeEnum.Season);
map.put(4L, GetLibraryItemsQueryParamTypeEnum.Episode);
map.put(8L, GetLibraryItemsQueryParamTypeEnum.Audio);
map.put(9L, GetLibraryItemsQueryParamTypeEnum.Album);
map.put(10L, GetLibraryItemsQueryParamTypeEnum.Track);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetLibraryItemsQueryParamType> {
protected _Serializer() {
super(GetLibraryItemsQueryParamType.class);
}
@Override
public void serialize(GetLibraryItemsQueryParamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetLibraryItemsQueryParamType> {
protected _Deserializer() {
super(GetLibraryItemsQueryParamType.class);
}
@Override
public GetLibraryItemsQueryParamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return GetLibraryItemsQueryParamType.of(v);
}
}
public enum GetLibraryItemsQueryParamTypeEnum {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L),;
private final long value;
private GetLibraryItemsQueryParamTypeEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -0,0 +1,253 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Integer;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.util.List;
import java.util.Objects;
public class GetMediaArtsMediaContainer {
/**
* Number of media items returned in this response.
*/
@JsonProperty("size")
private int size;
/**
* The version number for media tags.
*/
@JsonProperty("mediaTagVersion")
private long mediaTagVersion;
/**
* The prefix used for media tag resource paths.
*/
@JsonProperty("mediaTagPrefix")
private String mediaTagPrefix;
/**
* An plugin identifier for the media container.
*/
@JsonProperty("identifier")
private String identifier;
@JsonProperty("Metadata")
private List<GetMediaArtsMetadata> metadata;
@JsonCreator
public GetMediaArtsMediaContainer(
@JsonProperty("size") int size,
@JsonProperty("mediaTagVersion") long mediaTagVersion,
@JsonProperty("mediaTagPrefix") String mediaTagPrefix,
@JsonProperty("identifier") String identifier,
@JsonProperty("Metadata") List<GetMediaArtsMetadata> metadata) {
Utils.checkNotNull(size, "size");
Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
Utils.checkNotNull(identifier, "identifier");
Utils.checkNotNull(metadata, "metadata");
this.size = size;
this.mediaTagVersion = mediaTagVersion;
this.mediaTagPrefix = mediaTagPrefix;
this.identifier = identifier;
this.metadata = metadata;
}
/**
* Number of media items returned in this response.
*/
@JsonIgnore
public int size() {
return size;
}
/**
* The version number for media tags.
*/
@JsonIgnore
public long mediaTagVersion() {
return mediaTagVersion;
}
/**
* The prefix used for media tag resource paths.
*/
@JsonIgnore
public String mediaTagPrefix() {
return mediaTagPrefix;
}
/**
* An plugin identifier for the media container.
*/
@JsonIgnore
public String identifier() {
return identifier;
}
@JsonIgnore
public List<GetMediaArtsMetadata> metadata() {
return metadata;
}
public final static Builder builder() {
return new Builder();
}
/**
* Number of media items returned in this response.
*/
public GetMediaArtsMediaContainer withSize(int size) {
Utils.checkNotNull(size, "size");
this.size = size;
return this;
}
/**
* The version number for media tags.
*/
public GetMediaArtsMediaContainer withMediaTagVersion(long mediaTagVersion) {
Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
this.mediaTagVersion = mediaTagVersion;
return this;
}
/**
* The prefix used for media tag resource paths.
*/
public GetMediaArtsMediaContainer withMediaTagPrefix(String mediaTagPrefix) {
Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
this.mediaTagPrefix = mediaTagPrefix;
return this;
}
/**
* An plugin identifier for the media container.
*/
public GetMediaArtsMediaContainer withIdentifier(String identifier) {
Utils.checkNotNull(identifier, "identifier");
this.identifier = identifier;
return this;
}
public GetMediaArtsMediaContainer withMetadata(List<GetMediaArtsMetadata> metadata) {
Utils.checkNotNull(metadata, "metadata");
this.metadata = metadata;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetMediaArtsMediaContainer other = (GetMediaArtsMediaContainer) o;
return
Objects.deepEquals(this.size, other.size) &&
Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) &&
Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) &&
Objects.deepEquals(this.identifier, other.identifier) &&
Objects.deepEquals(this.metadata, other.metadata);
}
@Override
public int hashCode() {
return Objects.hash(
size,
mediaTagVersion,
mediaTagPrefix,
identifier,
metadata);
}
@Override
public String toString() {
return Utils.toString(GetMediaArtsMediaContainer.class,
"size", size,
"mediaTagVersion", mediaTagVersion,
"mediaTagPrefix", mediaTagPrefix,
"identifier", identifier,
"metadata", metadata);
}
public final static class Builder {
private Integer size;
private Long mediaTagVersion;
private String mediaTagPrefix;
private String identifier;
private List<GetMediaArtsMetadata> metadata;
private Builder() {
// force use of static builder() method
}
/**
* Number of media items returned in this response.
*/
public Builder size(int size) {
Utils.checkNotNull(size, "size");
this.size = size;
return this;
}
/**
* The version number for media tags.
*/
public Builder mediaTagVersion(long mediaTagVersion) {
Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
this.mediaTagVersion = mediaTagVersion;
return this;
}
/**
* The prefix used for media tag resource paths.
*/
public Builder mediaTagPrefix(String mediaTagPrefix) {
Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
this.mediaTagPrefix = mediaTagPrefix;
return this;
}
/**
* An plugin identifier for the media container.
*/
public Builder identifier(String identifier) {
Utils.checkNotNull(identifier, "identifier");
this.identifier = identifier;
return this;
}
public Builder metadata(List<GetMediaArtsMetadata> metadata) {
Utils.checkNotNull(metadata, "metadata");
this.metadata = metadata;
return this;
}
public GetMediaArtsMediaContainer build() {
return new GetMediaArtsMediaContainer(
size,
mediaTagVersion,
mediaTagPrefix,
identifier,
metadata);
}
}
}

View File

@@ -0,0 +1,293 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Boolean;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetMediaArtsMetadata {
/**
* The URL of the artwork.
*/
@JsonProperty("key")
private String key;
/**
* The provider of the artwork.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("provider")
private Optional<String> provider;
/**
* The URL of the artwork.
*/
@JsonProperty("ratingKey")
private String ratingKey;
/**
* Whether this is the selected artwork.
*/
@JsonProperty("selected")
private boolean selected;
/**
* The URL of the artwork thumbnail.
*/
@JsonProperty("thumb")
private String thumb;
@JsonCreator
public GetMediaArtsMetadata(
@JsonProperty("key") String key,
@JsonProperty("provider") Optional<String> provider,
@JsonProperty("ratingKey") String ratingKey,
@JsonProperty("selected") boolean selected,
@JsonProperty("thumb") String thumb) {
Utils.checkNotNull(key, "key");
Utils.checkNotNull(provider, "provider");
Utils.checkNotNull(ratingKey, "ratingKey");
Utils.checkNotNull(selected, "selected");
Utils.checkNotNull(thumb, "thumb");
this.key = key;
this.provider = provider;
this.ratingKey = ratingKey;
this.selected = selected;
this.thumb = thumb;
}
public GetMediaArtsMetadata(
String key,
String ratingKey,
boolean selected,
String thumb) {
this(key, Optional.empty(), ratingKey, selected, thumb);
}
/**
* The URL of the artwork.
*/
@JsonIgnore
public String key() {
return key;
}
/**
* The provider of the artwork.
*/
@JsonIgnore
public Optional<String> provider() {
return provider;
}
/**
* The URL of the artwork.
*/
@JsonIgnore
public String ratingKey() {
return ratingKey;
}
/**
* Whether this is the selected artwork.
*/
@JsonIgnore
public boolean selected() {
return selected;
}
/**
* The URL of the artwork thumbnail.
*/
@JsonIgnore
public String thumb() {
return thumb;
}
public final static Builder builder() {
return new Builder();
}
/**
* The URL of the artwork.
*/
public GetMediaArtsMetadata withKey(String key) {
Utils.checkNotNull(key, "key");
this.key = key;
return this;
}
/**
* The provider of the artwork.
*/
public GetMediaArtsMetadata withProvider(String provider) {
Utils.checkNotNull(provider, "provider");
this.provider = Optional.ofNullable(provider);
return this;
}
/**
* The provider of the artwork.
*/
public GetMediaArtsMetadata withProvider(Optional<String> provider) {
Utils.checkNotNull(provider, "provider");
this.provider = provider;
return this;
}
/**
* The URL of the artwork.
*/
public GetMediaArtsMetadata withRatingKey(String ratingKey) {
Utils.checkNotNull(ratingKey, "ratingKey");
this.ratingKey = ratingKey;
return this;
}
/**
* Whether this is the selected artwork.
*/
public GetMediaArtsMetadata withSelected(boolean selected) {
Utils.checkNotNull(selected, "selected");
this.selected = selected;
return this;
}
/**
* The URL of the artwork thumbnail.
*/
public GetMediaArtsMetadata withThumb(String thumb) {
Utils.checkNotNull(thumb, "thumb");
this.thumb = thumb;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetMediaArtsMetadata other = (GetMediaArtsMetadata) o;
return
Objects.deepEquals(this.key, other.key) &&
Objects.deepEquals(this.provider, other.provider) &&
Objects.deepEquals(this.ratingKey, other.ratingKey) &&
Objects.deepEquals(this.selected, other.selected) &&
Objects.deepEquals(this.thumb, other.thumb);
}
@Override
public int hashCode() {
return Objects.hash(
key,
provider,
ratingKey,
selected,
thumb);
}
@Override
public String toString() {
return Utils.toString(GetMediaArtsMetadata.class,
"key", key,
"provider", provider,
"ratingKey", ratingKey,
"selected", selected,
"thumb", thumb);
}
public final static class Builder {
private String key;
private Optional<String> provider = Optional.empty();
private String ratingKey;
private Boolean selected;
private String thumb;
private Builder() {
// force use of static builder() method
}
/**
* The URL of the artwork.
*/
public Builder key(String key) {
Utils.checkNotNull(key, "key");
this.key = key;
return this;
}
/**
* The provider of the artwork.
*/
public Builder provider(String provider) {
Utils.checkNotNull(provider, "provider");
this.provider = Optional.ofNullable(provider);
return this;
}
/**
* The provider of the artwork.
*/
public Builder provider(Optional<String> provider) {
Utils.checkNotNull(provider, "provider");
this.provider = provider;
return this;
}
/**
* The URL of the artwork.
*/
public Builder ratingKey(String ratingKey) {
Utils.checkNotNull(ratingKey, "ratingKey");
this.ratingKey = ratingKey;
return this;
}
/**
* Whether this is the selected artwork.
*/
public Builder selected(boolean selected) {
Utils.checkNotNull(selected, "selected");
this.selected = selected;
return this;
}
/**
* The URL of the artwork thumbnail.
*/
public Builder thumb(String thumb) {
Utils.checkNotNull(thumb, "thumb");
this.thumb = thumb;
return this;
}
public GetMediaArtsMetadata build() {
return new GetMediaArtsMetadata(
key,
provider,
ratingKey,
selected,
thumb);
}
}
}

View File

@@ -0,0 +1,99 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import dev.plexapi.sdk.utils.SpeakeasyMetadata;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
public class GetMediaArtsRequest {
/**
* the id of the library item to return the artwork of.
*/
@SpeakeasyMetadata("pathParam:style=simple,explode=false,name=ratingKey")
private long ratingKey;
@JsonCreator
public GetMediaArtsRequest(
long ratingKey) {
Utils.checkNotNull(ratingKey, "ratingKey");
this.ratingKey = ratingKey;
}
/**
* the id of the library item to return the artwork of.
*/
@JsonIgnore
public long ratingKey() {
return ratingKey;
}
public final static Builder builder() {
return new Builder();
}
/**
* the id of the library item to return the artwork of.
*/
public GetMediaArtsRequest withRatingKey(long ratingKey) {
Utils.checkNotNull(ratingKey, "ratingKey");
this.ratingKey = ratingKey;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetMediaArtsRequest other = (GetMediaArtsRequest) o;
return
Objects.deepEquals(this.ratingKey, other.ratingKey);
}
@Override
public int hashCode() {
return Objects.hash(
ratingKey);
}
@Override
public String toString() {
return Utils.toString(GetMediaArtsRequest.class,
"ratingKey", ratingKey);
}
public final static class Builder {
private Long ratingKey;
private Builder() {
// force use of static builder() method
}
/**
* the id of the library item to return the artwork of.
*/
public Builder ratingKey(long ratingKey) {
Utils.checkNotNull(ratingKey, "ratingKey");
this.ratingKey = ratingKey;
return this;
}
public GetMediaArtsRequest build() {
return new GetMediaArtsRequest(
ratingKey);
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Exception;
import java.lang.Long;
public class GetMediaArtsRequestBuilder {
private Long ratingKey;
private final SDKMethodInterfaces.MethodCallGetMediaArts sdk;
public GetMediaArtsRequestBuilder(SDKMethodInterfaces.MethodCallGetMediaArts sdk) {
this.sdk = sdk;
}
public GetMediaArtsRequestBuilder ratingKey(long ratingKey) {
Utils.checkNotNull(ratingKey, "ratingKey");
this.ratingKey = ratingKey;
return this;
}
public GetMediaArtsResponse call() throws Exception {
return sdk.getMediaArts(
ratingKey);
}
}

View File

@@ -0,0 +1,248 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import dev.plexapi.sdk.utils.Response;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Integer;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.Objects;
import java.util.Optional;
public class GetMediaArtsResponse implements Response {
/**
* HTTP response content type for this operation
*/
private String contentType;
/**
* HTTP response status code for this operation
*/
private int statusCode;
/**
* Raw HTTP response; suitable for custom response parsing
*/
private HttpResponse<InputStream> rawResponse;
/**
* The available background artwork for the library item.
*/
private Optional<? extends GetMediaArtsResponseBody> object;
@JsonCreator
public GetMediaArtsResponse(
String contentType,
int statusCode,
HttpResponse<InputStream> rawResponse,
Optional<? extends GetMediaArtsResponseBody> object) {
Utils.checkNotNull(contentType, "contentType");
Utils.checkNotNull(statusCode, "statusCode");
Utils.checkNotNull(rawResponse, "rawResponse");
Utils.checkNotNull(object, "object");
this.contentType = contentType;
this.statusCode = statusCode;
this.rawResponse = rawResponse;
this.object = object;
}
public GetMediaArtsResponse(
String contentType,
int statusCode,
HttpResponse<InputStream> rawResponse) {
this(contentType, statusCode, rawResponse, Optional.empty());
}
/**
* HTTP response content type for this operation
*/
@JsonIgnore
public String contentType() {
return contentType;
}
/**
* HTTP response status code for this operation
*/
@JsonIgnore
public int statusCode() {
return statusCode;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonIgnore
public HttpResponse<InputStream> rawResponse() {
return rawResponse;
}
/**
* The available background artwork for the library item.
*/
@SuppressWarnings("unchecked")
@JsonIgnore
public Optional<GetMediaArtsResponseBody> object() {
return (Optional<GetMediaArtsResponseBody>) object;
}
public final static Builder builder() {
return new Builder();
}
/**
* HTTP response content type for this operation
*/
public GetMediaArtsResponse withContentType(String contentType) {
Utils.checkNotNull(contentType, "contentType");
this.contentType = contentType;
return this;
}
/**
* HTTP response status code for this operation
*/
public GetMediaArtsResponse withStatusCode(int statusCode) {
Utils.checkNotNull(statusCode, "statusCode");
this.statusCode = statusCode;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetMediaArtsResponse withRawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = rawResponse;
return this;
}
/**
* The available background artwork for the library item.
*/
public GetMediaArtsResponse withObject(GetMediaArtsResponseBody object) {
Utils.checkNotNull(object, "object");
this.object = Optional.ofNullable(object);
return this;
}
/**
* The available background artwork for the library item.
*/
public GetMediaArtsResponse withObject(Optional<? extends GetMediaArtsResponseBody> object) {
Utils.checkNotNull(object, "object");
this.object = object;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetMediaArtsResponse other = (GetMediaArtsResponse) o;
return
Objects.deepEquals(this.contentType, other.contentType) &&
Objects.deepEquals(this.statusCode, other.statusCode) &&
Objects.deepEquals(this.rawResponse, other.rawResponse) &&
Objects.deepEquals(this.object, other.object);
}
@Override
public int hashCode() {
return Objects.hash(
contentType,
statusCode,
rawResponse,
object);
}
@Override
public String toString() {
return Utils.toString(GetMediaArtsResponse.class,
"contentType", contentType,
"statusCode", statusCode,
"rawResponse", rawResponse,
"object", object);
}
public final static class Builder {
private String contentType;
private Integer statusCode;
private HttpResponse<InputStream> rawResponse;
private Optional<? extends GetMediaArtsResponseBody> object = Optional.empty();
private Builder() {
// force use of static builder() method
}
/**
* HTTP response content type for this operation
*/
public Builder contentType(String contentType) {
Utils.checkNotNull(contentType, "contentType");
this.contentType = contentType;
return this;
}
/**
* HTTP response status code for this operation
*/
public Builder statusCode(int statusCode) {
Utils.checkNotNull(statusCode, "statusCode");
this.statusCode = statusCode;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public Builder rawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = rawResponse;
return this;
}
/**
* The available background artwork for the library item.
*/
public Builder object(GetMediaArtsResponseBody object) {
Utils.checkNotNull(object, "object");
this.object = Optional.ofNullable(object);
return this;
}
/**
* The available background artwork for the library item.
*/
public Builder object(Optional<? extends GetMediaArtsResponseBody> object) {
Utils.checkNotNull(object, "object");
this.object = object;
return this;
}
public GetMediaArtsResponse build() {
return new GetMediaArtsResponse(
contentType,
statusCode,
rawResponse,
object);
}
}
}

View File

@@ -0,0 +1,113 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Objects;
import java.util.Optional;
/**
* GetMediaArtsResponseBody
*
* <p>The available background artwork for the library item.
*/
public class GetMediaArtsResponseBody {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("MediaContainer")
private Optional<? extends GetMediaArtsMediaContainer> mediaContainer;
@JsonCreator
public GetMediaArtsResponseBody(
@JsonProperty("MediaContainer") Optional<? extends GetMediaArtsMediaContainer> mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = mediaContainer;
}
public GetMediaArtsResponseBody() {
this(Optional.empty());
}
@SuppressWarnings("unchecked")
@JsonIgnore
public Optional<GetMediaArtsMediaContainer> mediaContainer() {
return (Optional<GetMediaArtsMediaContainer>) mediaContainer;
}
public final static Builder builder() {
return new Builder();
}
public GetMediaArtsResponseBody withMediaContainer(GetMediaArtsMediaContainer mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = Optional.ofNullable(mediaContainer);
return this;
}
public GetMediaArtsResponseBody withMediaContainer(Optional<? extends GetMediaArtsMediaContainer> mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = mediaContainer;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetMediaArtsResponseBody other = (GetMediaArtsResponseBody) o;
return
Objects.deepEquals(this.mediaContainer, other.mediaContainer);
}
@Override
public int hashCode() {
return Objects.hash(
mediaContainer);
}
@Override
public String toString() {
return Utils.toString(GetMediaArtsResponseBody.class,
"mediaContainer", mediaContainer);
}
public final static class Builder {
private Optional<? extends GetMediaArtsMediaContainer> mediaContainer = Optional.empty();
private Builder() {
// force use of static builder() method
}
public Builder mediaContainer(GetMediaArtsMediaContainer mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = Optional.ofNullable(mediaContainer);
return this;
}
public Builder mediaContainer(Optional<? extends GetMediaArtsMediaContainer> mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = mediaContainer;
return this;
}
public GetMediaArtsResponseBody build() {
return new GetMediaArtsResponseBody(
mediaContainer);
}
}
}

View File

@@ -0,0 +1,253 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Integer;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.util.List;
import java.util.Objects;
public class GetMediaPostersMediaContainer {
/**
* Number of media items returned in this response.
*/
@JsonProperty("size")
private int size;
/**
* The version number for media tags.
*/
@JsonProperty("mediaTagVersion")
private long mediaTagVersion;
/**
* The prefix used for media tag resource paths.
*/
@JsonProperty("mediaTagPrefix")
private String mediaTagPrefix;
/**
* An plugin identifier for the media container.
*/
@JsonProperty("identifier")
private String identifier;
@JsonProperty("Metadata")
private List<GetMediaPostersMetadata> metadata;
@JsonCreator
public GetMediaPostersMediaContainer(
@JsonProperty("size") int size,
@JsonProperty("mediaTagVersion") long mediaTagVersion,
@JsonProperty("mediaTagPrefix") String mediaTagPrefix,
@JsonProperty("identifier") String identifier,
@JsonProperty("Metadata") List<GetMediaPostersMetadata> metadata) {
Utils.checkNotNull(size, "size");
Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
Utils.checkNotNull(identifier, "identifier");
Utils.checkNotNull(metadata, "metadata");
this.size = size;
this.mediaTagVersion = mediaTagVersion;
this.mediaTagPrefix = mediaTagPrefix;
this.identifier = identifier;
this.metadata = metadata;
}
/**
* Number of media items returned in this response.
*/
@JsonIgnore
public int size() {
return size;
}
/**
* The version number for media tags.
*/
@JsonIgnore
public long mediaTagVersion() {
return mediaTagVersion;
}
/**
* The prefix used for media tag resource paths.
*/
@JsonIgnore
public String mediaTagPrefix() {
return mediaTagPrefix;
}
/**
* An plugin identifier for the media container.
*/
@JsonIgnore
public String identifier() {
return identifier;
}
@JsonIgnore
public List<GetMediaPostersMetadata> metadata() {
return metadata;
}
public final static Builder builder() {
return new Builder();
}
/**
* Number of media items returned in this response.
*/
public GetMediaPostersMediaContainer withSize(int size) {
Utils.checkNotNull(size, "size");
this.size = size;
return this;
}
/**
* The version number for media tags.
*/
public GetMediaPostersMediaContainer withMediaTagVersion(long mediaTagVersion) {
Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
this.mediaTagVersion = mediaTagVersion;
return this;
}
/**
* The prefix used for media tag resource paths.
*/
public GetMediaPostersMediaContainer withMediaTagPrefix(String mediaTagPrefix) {
Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
this.mediaTagPrefix = mediaTagPrefix;
return this;
}
/**
* An plugin identifier for the media container.
*/
public GetMediaPostersMediaContainer withIdentifier(String identifier) {
Utils.checkNotNull(identifier, "identifier");
this.identifier = identifier;
return this;
}
public GetMediaPostersMediaContainer withMetadata(List<GetMediaPostersMetadata> metadata) {
Utils.checkNotNull(metadata, "metadata");
this.metadata = metadata;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetMediaPostersMediaContainer other = (GetMediaPostersMediaContainer) o;
return
Objects.deepEquals(this.size, other.size) &&
Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) &&
Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) &&
Objects.deepEquals(this.identifier, other.identifier) &&
Objects.deepEquals(this.metadata, other.metadata);
}
@Override
public int hashCode() {
return Objects.hash(
size,
mediaTagVersion,
mediaTagPrefix,
identifier,
metadata);
}
@Override
public String toString() {
return Utils.toString(GetMediaPostersMediaContainer.class,
"size", size,
"mediaTagVersion", mediaTagVersion,
"mediaTagPrefix", mediaTagPrefix,
"identifier", identifier,
"metadata", metadata);
}
public final static class Builder {
private Integer size;
private Long mediaTagVersion;
private String mediaTagPrefix;
private String identifier;
private List<GetMediaPostersMetadata> metadata;
private Builder() {
// force use of static builder() method
}
/**
* Number of media items returned in this response.
*/
public Builder size(int size) {
Utils.checkNotNull(size, "size");
this.size = size;
return this;
}
/**
* The version number for media tags.
*/
public Builder mediaTagVersion(long mediaTagVersion) {
Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
this.mediaTagVersion = mediaTagVersion;
return this;
}
/**
* The prefix used for media tag resource paths.
*/
public Builder mediaTagPrefix(String mediaTagPrefix) {
Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
this.mediaTagPrefix = mediaTagPrefix;
return this;
}
/**
* An plugin identifier for the media container.
*/
public Builder identifier(String identifier) {
Utils.checkNotNull(identifier, "identifier");
this.identifier = identifier;
return this;
}
public Builder metadata(List<GetMediaPostersMetadata> metadata) {
Utils.checkNotNull(metadata, "metadata");
this.metadata = metadata;
return this;
}
public GetMediaPostersMediaContainer build() {
return new GetMediaPostersMediaContainer(
size,
mediaTagVersion,
mediaTagPrefix,
identifier,
metadata);
}
}
}

View File

@@ -0,0 +1,293 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Boolean;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetMediaPostersMetadata {
/**
* The URL of the poster.
*/
@JsonProperty("key")
private String key;
/**
* The provider of the poster.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("provider")
private Optional<String> provider;
/**
* The URL of the poster.
*/
@JsonProperty("ratingKey")
private String ratingKey;
/**
* Whether this is the selected poster.
*/
@JsonProperty("selected")
private boolean selected;
/**
* The URL of the poster thumbnail.
*/
@JsonProperty("thumb")
private String thumb;
@JsonCreator
public GetMediaPostersMetadata(
@JsonProperty("key") String key,
@JsonProperty("provider") Optional<String> provider,
@JsonProperty("ratingKey") String ratingKey,
@JsonProperty("selected") boolean selected,
@JsonProperty("thumb") String thumb) {
Utils.checkNotNull(key, "key");
Utils.checkNotNull(provider, "provider");
Utils.checkNotNull(ratingKey, "ratingKey");
Utils.checkNotNull(selected, "selected");
Utils.checkNotNull(thumb, "thumb");
this.key = key;
this.provider = provider;
this.ratingKey = ratingKey;
this.selected = selected;
this.thumb = thumb;
}
public GetMediaPostersMetadata(
String key,
String ratingKey,
boolean selected,
String thumb) {
this(key, Optional.empty(), ratingKey, selected, thumb);
}
/**
* The URL of the poster.
*/
@JsonIgnore
public String key() {
return key;
}
/**
* The provider of the poster.
*/
@JsonIgnore
public Optional<String> provider() {
return provider;
}
/**
* The URL of the poster.
*/
@JsonIgnore
public String ratingKey() {
return ratingKey;
}
/**
* Whether this is the selected poster.
*/
@JsonIgnore
public boolean selected() {
return selected;
}
/**
* The URL of the poster thumbnail.
*/
@JsonIgnore
public String thumb() {
return thumb;
}
public final static Builder builder() {
return new Builder();
}
/**
* The URL of the poster.
*/
public GetMediaPostersMetadata withKey(String key) {
Utils.checkNotNull(key, "key");
this.key = key;
return this;
}
/**
* The provider of the poster.
*/
public GetMediaPostersMetadata withProvider(String provider) {
Utils.checkNotNull(provider, "provider");
this.provider = Optional.ofNullable(provider);
return this;
}
/**
* The provider of the poster.
*/
public GetMediaPostersMetadata withProvider(Optional<String> provider) {
Utils.checkNotNull(provider, "provider");
this.provider = provider;
return this;
}
/**
* The URL of the poster.
*/
public GetMediaPostersMetadata withRatingKey(String ratingKey) {
Utils.checkNotNull(ratingKey, "ratingKey");
this.ratingKey = ratingKey;
return this;
}
/**
* Whether this is the selected poster.
*/
public GetMediaPostersMetadata withSelected(boolean selected) {
Utils.checkNotNull(selected, "selected");
this.selected = selected;
return this;
}
/**
* The URL of the poster thumbnail.
*/
public GetMediaPostersMetadata withThumb(String thumb) {
Utils.checkNotNull(thumb, "thumb");
this.thumb = thumb;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetMediaPostersMetadata other = (GetMediaPostersMetadata) o;
return
Objects.deepEquals(this.key, other.key) &&
Objects.deepEquals(this.provider, other.provider) &&
Objects.deepEquals(this.ratingKey, other.ratingKey) &&
Objects.deepEquals(this.selected, other.selected) &&
Objects.deepEquals(this.thumb, other.thumb);
}
@Override
public int hashCode() {
return Objects.hash(
key,
provider,
ratingKey,
selected,
thumb);
}
@Override
public String toString() {
return Utils.toString(GetMediaPostersMetadata.class,
"key", key,
"provider", provider,
"ratingKey", ratingKey,
"selected", selected,
"thumb", thumb);
}
public final static class Builder {
private String key;
private Optional<String> provider = Optional.empty();
private String ratingKey;
private Boolean selected;
private String thumb;
private Builder() {
// force use of static builder() method
}
/**
* The URL of the poster.
*/
public Builder key(String key) {
Utils.checkNotNull(key, "key");
this.key = key;
return this;
}
/**
* The provider of the poster.
*/
public Builder provider(String provider) {
Utils.checkNotNull(provider, "provider");
this.provider = Optional.ofNullable(provider);
return this;
}
/**
* The provider of the poster.
*/
public Builder provider(Optional<String> provider) {
Utils.checkNotNull(provider, "provider");
this.provider = provider;
return this;
}
/**
* The URL of the poster.
*/
public Builder ratingKey(String ratingKey) {
Utils.checkNotNull(ratingKey, "ratingKey");
this.ratingKey = ratingKey;
return this;
}
/**
* Whether this is the selected poster.
*/
public Builder selected(boolean selected) {
Utils.checkNotNull(selected, "selected");
this.selected = selected;
return this;
}
/**
* The URL of the poster thumbnail.
*/
public Builder thumb(String thumb) {
Utils.checkNotNull(thumb, "thumb");
this.thumb = thumb;
return this;
}
public GetMediaPostersMetadata build() {
return new GetMediaPostersMetadata(
key,
provider,
ratingKey,
selected,
thumb);
}
}
}

View File

@@ -0,0 +1,99 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import dev.plexapi.sdk.utils.SpeakeasyMetadata;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
public class GetMediaPostersRequest {
/**
* the id of the library item to return the posters of.
*/
@SpeakeasyMetadata("pathParam:style=simple,explode=false,name=ratingKey")
private long ratingKey;
@JsonCreator
public GetMediaPostersRequest(
long ratingKey) {
Utils.checkNotNull(ratingKey, "ratingKey");
this.ratingKey = ratingKey;
}
/**
* the id of the library item to return the posters of.
*/
@JsonIgnore
public long ratingKey() {
return ratingKey;
}
public final static Builder builder() {
return new Builder();
}
/**
* the id of the library item to return the posters of.
*/
public GetMediaPostersRequest withRatingKey(long ratingKey) {
Utils.checkNotNull(ratingKey, "ratingKey");
this.ratingKey = ratingKey;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetMediaPostersRequest other = (GetMediaPostersRequest) o;
return
Objects.deepEquals(this.ratingKey, other.ratingKey);
}
@Override
public int hashCode() {
return Objects.hash(
ratingKey);
}
@Override
public String toString() {
return Utils.toString(GetMediaPostersRequest.class,
"ratingKey", ratingKey);
}
public final static class Builder {
private Long ratingKey;
private Builder() {
// force use of static builder() method
}
/**
* the id of the library item to return the posters of.
*/
public Builder ratingKey(long ratingKey) {
Utils.checkNotNull(ratingKey, "ratingKey");
this.ratingKey = ratingKey;
return this;
}
public GetMediaPostersRequest build() {
return new GetMediaPostersRequest(
ratingKey);
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Exception;
import java.lang.Long;
public class GetMediaPostersRequestBuilder {
private Long ratingKey;
private final SDKMethodInterfaces.MethodCallGetMediaPosters sdk;
public GetMediaPostersRequestBuilder(SDKMethodInterfaces.MethodCallGetMediaPosters sdk) {
this.sdk = sdk;
}
public GetMediaPostersRequestBuilder ratingKey(long ratingKey) {
Utils.checkNotNull(ratingKey, "ratingKey");
this.ratingKey = ratingKey;
return this;
}
public GetMediaPostersResponse call() throws Exception {
return sdk.getMediaPosters(
ratingKey);
}
}

View File

@@ -0,0 +1,248 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import dev.plexapi.sdk.utils.Response;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Integer;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.Objects;
import java.util.Optional;
public class GetMediaPostersResponse implements Response {
/**
* HTTP response content type for this operation
*/
private String contentType;
/**
* HTTP response status code for this operation
*/
private int statusCode;
/**
* Raw HTTP response; suitable for custom response parsing
*/
private HttpResponse<InputStream> rawResponse;
/**
* The available posters for the library item.
*/
private Optional<? extends GetMediaPostersResponseBody> object;
@JsonCreator
public GetMediaPostersResponse(
String contentType,
int statusCode,
HttpResponse<InputStream> rawResponse,
Optional<? extends GetMediaPostersResponseBody> object) {
Utils.checkNotNull(contentType, "contentType");
Utils.checkNotNull(statusCode, "statusCode");
Utils.checkNotNull(rawResponse, "rawResponse");
Utils.checkNotNull(object, "object");
this.contentType = contentType;
this.statusCode = statusCode;
this.rawResponse = rawResponse;
this.object = object;
}
public GetMediaPostersResponse(
String contentType,
int statusCode,
HttpResponse<InputStream> rawResponse) {
this(contentType, statusCode, rawResponse, Optional.empty());
}
/**
* HTTP response content type for this operation
*/
@JsonIgnore
public String contentType() {
return contentType;
}
/**
* HTTP response status code for this operation
*/
@JsonIgnore
public int statusCode() {
return statusCode;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonIgnore
public HttpResponse<InputStream> rawResponse() {
return rawResponse;
}
/**
* The available posters for the library item.
*/
@SuppressWarnings("unchecked")
@JsonIgnore
public Optional<GetMediaPostersResponseBody> object() {
return (Optional<GetMediaPostersResponseBody>) object;
}
public final static Builder builder() {
return new Builder();
}
/**
* HTTP response content type for this operation
*/
public GetMediaPostersResponse withContentType(String contentType) {
Utils.checkNotNull(contentType, "contentType");
this.contentType = contentType;
return this;
}
/**
* HTTP response status code for this operation
*/
public GetMediaPostersResponse withStatusCode(int statusCode) {
Utils.checkNotNull(statusCode, "statusCode");
this.statusCode = statusCode;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetMediaPostersResponse withRawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = rawResponse;
return this;
}
/**
* The available posters for the library item.
*/
public GetMediaPostersResponse withObject(GetMediaPostersResponseBody object) {
Utils.checkNotNull(object, "object");
this.object = Optional.ofNullable(object);
return this;
}
/**
* The available posters for the library item.
*/
public GetMediaPostersResponse withObject(Optional<? extends GetMediaPostersResponseBody> object) {
Utils.checkNotNull(object, "object");
this.object = object;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetMediaPostersResponse other = (GetMediaPostersResponse) o;
return
Objects.deepEquals(this.contentType, other.contentType) &&
Objects.deepEquals(this.statusCode, other.statusCode) &&
Objects.deepEquals(this.rawResponse, other.rawResponse) &&
Objects.deepEquals(this.object, other.object);
}
@Override
public int hashCode() {
return Objects.hash(
contentType,
statusCode,
rawResponse,
object);
}
@Override
public String toString() {
return Utils.toString(GetMediaPostersResponse.class,
"contentType", contentType,
"statusCode", statusCode,
"rawResponse", rawResponse,
"object", object);
}
public final static class Builder {
private String contentType;
private Integer statusCode;
private HttpResponse<InputStream> rawResponse;
private Optional<? extends GetMediaPostersResponseBody> object = Optional.empty();
private Builder() {
// force use of static builder() method
}
/**
* HTTP response content type for this operation
*/
public Builder contentType(String contentType) {
Utils.checkNotNull(contentType, "contentType");
this.contentType = contentType;
return this;
}
/**
* HTTP response status code for this operation
*/
public Builder statusCode(int statusCode) {
Utils.checkNotNull(statusCode, "statusCode");
this.statusCode = statusCode;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public Builder rawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = rawResponse;
return this;
}
/**
* The available posters for the library item.
*/
public Builder object(GetMediaPostersResponseBody object) {
Utils.checkNotNull(object, "object");
this.object = Optional.ofNullable(object);
return this;
}
/**
* The available posters for the library item.
*/
public Builder object(Optional<? extends GetMediaPostersResponseBody> object) {
Utils.checkNotNull(object, "object");
this.object = object;
return this;
}
public GetMediaPostersResponse build() {
return new GetMediaPostersResponse(
contentType,
statusCode,
rawResponse,
object);
}
}
}

View File

@@ -0,0 +1,113 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Objects;
import java.util.Optional;
/**
* GetMediaPostersResponseBody
*
* <p>The available posters for the library item.
*/
public class GetMediaPostersResponseBody {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("MediaContainer")
private Optional<? extends GetMediaPostersMediaContainer> mediaContainer;
@JsonCreator
public GetMediaPostersResponseBody(
@JsonProperty("MediaContainer") Optional<? extends GetMediaPostersMediaContainer> mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = mediaContainer;
}
public GetMediaPostersResponseBody() {
this(Optional.empty());
}
@SuppressWarnings("unchecked")
@JsonIgnore
public Optional<GetMediaPostersMediaContainer> mediaContainer() {
return (Optional<GetMediaPostersMediaContainer>) mediaContainer;
}
public final static Builder builder() {
return new Builder();
}
public GetMediaPostersResponseBody withMediaContainer(GetMediaPostersMediaContainer mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = Optional.ofNullable(mediaContainer);
return this;
}
public GetMediaPostersResponseBody withMediaContainer(Optional<? extends GetMediaPostersMediaContainer> mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = mediaContainer;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetMediaPostersResponseBody other = (GetMediaPostersResponseBody) o;
return
Objects.deepEquals(this.mediaContainer, other.mediaContainer);
}
@Override
public int hashCode() {
return Objects.hash(
mediaContainer);
}
@Override
public String toString() {
return Utils.toString(GetMediaPostersResponseBody.class,
"mediaContainer", mediaContainer);
}
public final static class Builder {
private Optional<? extends GetMediaPostersMediaContainer> mediaContainer = Optional.empty();
private Builder() {
// force use of static builder() method
}
public Builder mediaContainer(GetMediaPostersMediaContainer mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = Optional.ofNullable(mediaContainer);
return this;
}
public Builder mediaContainer(Optional<? extends GetMediaPostersMediaContainer> mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = mediaContainer;
return this;
}
public GetMediaPostersResponseBody build() {
return new GetMediaPostersResponseBody(
mediaContainer);
}
}
}

View File

@@ -3,10 +3,45 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetPlaylistContentsQueryParamType
*
@@ -17,33 +52,159 @@ import java.util.Optional;
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
public enum GetPlaylistContentsQueryParamType {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L);
@JsonDeserialize(using = GetPlaylistContentsQueryParamType._Deserializer.class)
@JsonSerialize(using = GetPlaylistContentsQueryParamType._Serializer.class)
public class GetPlaylistContentsQueryParamType {
public static final GetPlaylistContentsQueryParamType Movie = new GetPlaylistContentsQueryParamType(1L);
public static final GetPlaylistContentsQueryParamType TvShow = new GetPlaylistContentsQueryParamType(2L);
public static final GetPlaylistContentsQueryParamType Season = new GetPlaylistContentsQueryParamType(3L);
public static final GetPlaylistContentsQueryParamType Episode = new GetPlaylistContentsQueryParamType(4L);
public static final GetPlaylistContentsQueryParamType Audio = new GetPlaylistContentsQueryParamType(8L);
public static final GetPlaylistContentsQueryParamType Album = new GetPlaylistContentsQueryParamType(9L);
public static final GetPlaylistContentsQueryParamType Track = new GetPlaylistContentsQueryParamType(10L);
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<Long, GetPlaylistContentsQueryParamType> values = createValuesMap();
private static final Map<Long, GetPlaylistContentsQueryParamTypeEnum> enums = createEnumsMap();
@JsonValue
private final long value;
private GetPlaylistContentsQueryParamType(long value) {
this.value = value;
}
/**
* Returns a GetPlaylistContentsQueryParamType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetPlaylistContentsQueryParamType
*/
public static GetPlaylistContentsQueryParamType of(long value) {
synchronized (GetPlaylistContentsQueryParamType.class) {
return values.computeIfAbsent(value, v -> new GetPlaylistContentsQueryParamType(v));
}
}
public long value() {
return value;
}
public static Optional<GetPlaylistContentsQueryParamType> fromValue(long value) {
for (GetPlaylistContentsQueryParamType o: GetPlaylistContentsQueryParamType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetPlaylistContentsQueryParamTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetPlaylistContentsQueryParamType other = (GetPlaylistContentsQueryParamType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetPlaylistContentsQueryParamType [value=" + value + "]";
}
// return an array just like an enum
public static GetPlaylistContentsQueryParamType[] values() {
synchronized (GetPlaylistContentsQueryParamType.class) {
return values.values().toArray(new GetPlaylistContentsQueryParamType[] {});
}
}
private static final Map<Long, GetPlaylistContentsQueryParamType> createValuesMap() {
Map<Long, GetPlaylistContentsQueryParamType> map = new LinkedHashMap<>();
map.put(1L, Movie);
map.put(2L, TvShow);
map.put(3L, Season);
map.put(4L, Episode);
map.put(8L, Audio);
map.put(9L, Album);
map.put(10L, Track);
return map;
}
private static final Map<Long, GetPlaylistContentsQueryParamTypeEnum> createEnumsMap() {
Map<Long, GetPlaylistContentsQueryParamTypeEnum> map = new HashMap<>();
map.put(1L, GetPlaylistContentsQueryParamTypeEnum.Movie);
map.put(2L, GetPlaylistContentsQueryParamTypeEnum.TvShow);
map.put(3L, GetPlaylistContentsQueryParamTypeEnum.Season);
map.put(4L, GetPlaylistContentsQueryParamTypeEnum.Episode);
map.put(8L, GetPlaylistContentsQueryParamTypeEnum.Audio);
map.put(9L, GetPlaylistContentsQueryParamTypeEnum.Album);
map.put(10L, GetPlaylistContentsQueryParamTypeEnum.Track);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetPlaylistContentsQueryParamType> {
protected _Serializer() {
super(GetPlaylistContentsQueryParamType.class);
}
@Override
public void serialize(GetPlaylistContentsQueryParamType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetPlaylistContentsQueryParamType> {
protected _Deserializer() {
super(GetPlaylistContentsQueryParamType.class);
}
@Override
public GetPlaylistContentsQueryParamType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
long v = p.readValueAs(new TypeReference<Long>() {});
// use the factory method to ensure we get singletons
return GetPlaylistContentsQueryParamType.of(v);
}
}
public enum GetPlaylistContentsQueryParamTypeEnum {
Movie(1L),
TvShow(2L),
Season(3L),
Episode(4L),
Audio(8L),
Album(9L),
Track(10L),;
private final long value;
private GetPlaylistContentsQueryParamTypeEnum(long value) {
this.value = value;
}
public long value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,35 +3,185 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
public enum GetRecentlyAddedHubsResponseType {
COVER_POSTER("coverPoster"),
BACKGROUND("background"),
SNAPSHOT("snapshot"),
CLEAR_LOGO("clearLogo");
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
@JsonDeserialize(using = GetRecentlyAddedHubsResponseType._Deserializer.class)
@JsonSerialize(using = GetRecentlyAddedHubsResponseType._Serializer.class)
public class GetRecentlyAddedHubsResponseType {
public static final GetRecentlyAddedHubsResponseType COVER_POSTER = new GetRecentlyAddedHubsResponseType("coverPoster");
public static final GetRecentlyAddedHubsResponseType BACKGROUND = new GetRecentlyAddedHubsResponseType("background");
public static final GetRecentlyAddedHubsResponseType SNAPSHOT = new GetRecentlyAddedHubsResponseType("snapshot");
public static final GetRecentlyAddedHubsResponseType CLEAR_LOGO = new GetRecentlyAddedHubsResponseType("clearLogo");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetRecentlyAddedHubsResponseType> values = createValuesMap();
private static final Map<String, GetRecentlyAddedHubsResponseTypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetRecentlyAddedHubsResponseType(String value) {
this.value = value;
}
/**
* Returns a GetRecentlyAddedHubsResponseType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetRecentlyAddedHubsResponseType
*/
public static GetRecentlyAddedHubsResponseType of(String value) {
synchronized (GetRecentlyAddedHubsResponseType.class) {
return values.computeIfAbsent(value, v -> new GetRecentlyAddedHubsResponseType(v));
}
}
public String value() {
return value;
}
public static Optional<GetRecentlyAddedHubsResponseType> fromValue(String value) {
for (GetRecentlyAddedHubsResponseType o: GetRecentlyAddedHubsResponseType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetRecentlyAddedHubsResponseTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetRecentlyAddedHubsResponseType other = (GetRecentlyAddedHubsResponseType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetRecentlyAddedHubsResponseType [value=" + value + "]";
}
// return an array just like an enum
public static GetRecentlyAddedHubsResponseType[] values() {
synchronized (GetRecentlyAddedHubsResponseType.class) {
return values.values().toArray(new GetRecentlyAddedHubsResponseType[] {});
}
}
private static final Map<String, GetRecentlyAddedHubsResponseType> createValuesMap() {
Map<String, GetRecentlyAddedHubsResponseType> map = new LinkedHashMap<>();
map.put("coverPoster", COVER_POSTER);
map.put("background", BACKGROUND);
map.put("snapshot", SNAPSHOT);
map.put("clearLogo", CLEAR_LOGO);
return map;
}
private static final Map<String, GetRecentlyAddedHubsResponseTypeEnum> createEnumsMap() {
Map<String, GetRecentlyAddedHubsResponseTypeEnum> map = new HashMap<>();
map.put("coverPoster", GetRecentlyAddedHubsResponseTypeEnum.COVER_POSTER);
map.put("background", GetRecentlyAddedHubsResponseTypeEnum.BACKGROUND);
map.put("snapshot", GetRecentlyAddedHubsResponseTypeEnum.SNAPSHOT);
map.put("clearLogo", GetRecentlyAddedHubsResponseTypeEnum.CLEAR_LOGO);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetRecentlyAddedHubsResponseType> {
protected _Serializer() {
super(GetRecentlyAddedHubsResponseType.class);
}
@Override
public void serialize(GetRecentlyAddedHubsResponseType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetRecentlyAddedHubsResponseType> {
protected _Deserializer() {
super(GetRecentlyAddedHubsResponseType.class);
}
@Override
public GetRecentlyAddedHubsResponseType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetRecentlyAddedHubsResponseType.of(v);
}
}
public enum GetRecentlyAddedHubsResponseTypeEnum {
COVER_POSTER("coverPoster"),
BACKGROUND("background"),
SNAPSHOT("snapshot"),
CLEAR_LOGO("clearLogo"),;
private final String value;
private GetRecentlyAddedHubsResponseTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,42 +3,198 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetRecentlyAddedHubsType
*
* <p>The type of media content
*/
public enum GetRecentlyAddedHubsType {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album");
@JsonDeserialize(using = GetRecentlyAddedHubsType._Deserializer.class)
@JsonSerialize(using = GetRecentlyAddedHubsType._Serializer.class)
public class GetRecentlyAddedHubsType {
public static final GetRecentlyAddedHubsType Movie = new GetRecentlyAddedHubsType("movie");
public static final GetRecentlyAddedHubsType TvShow = new GetRecentlyAddedHubsType("show");
public static final GetRecentlyAddedHubsType Season = new GetRecentlyAddedHubsType("season");
public static final GetRecentlyAddedHubsType Episode = new GetRecentlyAddedHubsType("episode");
public static final GetRecentlyAddedHubsType Artist = new GetRecentlyAddedHubsType("artist");
public static final GetRecentlyAddedHubsType Album = new GetRecentlyAddedHubsType("album");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetRecentlyAddedHubsType> values = createValuesMap();
private static final Map<String, GetRecentlyAddedHubsTypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetRecentlyAddedHubsType(String value) {
this.value = value;
}
/**
* Returns a GetRecentlyAddedHubsType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetRecentlyAddedHubsType
*/
public static GetRecentlyAddedHubsType of(String value) {
synchronized (GetRecentlyAddedHubsType.class) {
return values.computeIfAbsent(value, v -> new GetRecentlyAddedHubsType(v));
}
}
public String value() {
return value;
}
public static Optional<GetRecentlyAddedHubsType> fromValue(String value) {
for (GetRecentlyAddedHubsType o: GetRecentlyAddedHubsType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetRecentlyAddedHubsTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetRecentlyAddedHubsType other = (GetRecentlyAddedHubsType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetRecentlyAddedHubsType [value=" + value + "]";
}
// return an array just like an enum
public static GetRecentlyAddedHubsType[] values() {
synchronized (GetRecentlyAddedHubsType.class) {
return values.values().toArray(new GetRecentlyAddedHubsType[] {});
}
}
private static final Map<String, GetRecentlyAddedHubsType> createValuesMap() {
Map<String, GetRecentlyAddedHubsType> map = new LinkedHashMap<>();
map.put("movie", Movie);
map.put("show", TvShow);
map.put("season", Season);
map.put("episode", Episode);
map.put("artist", Artist);
map.put("album", Album);
return map;
}
private static final Map<String, GetRecentlyAddedHubsTypeEnum> createEnumsMap() {
Map<String, GetRecentlyAddedHubsTypeEnum> map = new HashMap<>();
map.put("movie", GetRecentlyAddedHubsTypeEnum.Movie);
map.put("show", GetRecentlyAddedHubsTypeEnum.TvShow);
map.put("season", GetRecentlyAddedHubsTypeEnum.Season);
map.put("episode", GetRecentlyAddedHubsTypeEnum.Episode);
map.put("artist", GetRecentlyAddedHubsTypeEnum.Artist);
map.put("album", GetRecentlyAddedHubsTypeEnum.Album);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetRecentlyAddedHubsType> {
protected _Serializer() {
super(GetRecentlyAddedHubsType.class);
}
@Override
public void serialize(GetRecentlyAddedHubsType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetRecentlyAddedHubsType> {
protected _Deserializer() {
super(GetRecentlyAddedHubsType.class);
}
@Override
public GetRecentlyAddedHubsType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetRecentlyAddedHubsType.of(v);
}
}
public enum GetRecentlyAddedHubsTypeEnum {
Movie("movie"),
TvShow("show"),
Season("season"),
Episode("episode"),
Artist("artist"),
Album("album"),;
private final String value;
private GetRecentlyAddedHubsTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,38 +3,182 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetSearchAllLibrariesEnableCreditsMarkerGeneration
*
* <p>Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
*/
public enum GetSearchAllLibrariesEnableCreditsMarkerGeneration {
LibraryDefault("-1"),
Disabled("0");
@JsonDeserialize(using = GetSearchAllLibrariesEnableCreditsMarkerGeneration._Deserializer.class)
@JsonSerialize(using = GetSearchAllLibrariesEnableCreditsMarkerGeneration._Serializer.class)
public class GetSearchAllLibrariesEnableCreditsMarkerGeneration {
public static final GetSearchAllLibrariesEnableCreditsMarkerGeneration LibraryDefault = new GetSearchAllLibrariesEnableCreditsMarkerGeneration("-1");
public static final GetSearchAllLibrariesEnableCreditsMarkerGeneration Disabled = new GetSearchAllLibrariesEnableCreditsMarkerGeneration("0");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetSearchAllLibrariesEnableCreditsMarkerGeneration> values = createValuesMap();
private static final Map<String, GetSearchAllLibrariesEnableCreditsMarkerGenerationEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetSearchAllLibrariesEnableCreditsMarkerGeneration(String value) {
this.value = value;
}
/**
* Returns a GetSearchAllLibrariesEnableCreditsMarkerGeneration with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetSearchAllLibrariesEnableCreditsMarkerGeneration
*/
public static GetSearchAllLibrariesEnableCreditsMarkerGeneration of(String value) {
synchronized (GetSearchAllLibrariesEnableCreditsMarkerGeneration.class) {
return values.computeIfAbsent(value, v -> new GetSearchAllLibrariesEnableCreditsMarkerGeneration(v));
}
}
public String value() {
return value;
}
public static Optional<GetSearchAllLibrariesEnableCreditsMarkerGeneration> fromValue(String value) {
for (GetSearchAllLibrariesEnableCreditsMarkerGeneration o: GetSearchAllLibrariesEnableCreditsMarkerGeneration.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetSearchAllLibrariesEnableCreditsMarkerGenerationEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetSearchAllLibrariesEnableCreditsMarkerGeneration other = (GetSearchAllLibrariesEnableCreditsMarkerGeneration) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetSearchAllLibrariesEnableCreditsMarkerGeneration [value=" + value + "]";
}
// return an array just like an enum
public static GetSearchAllLibrariesEnableCreditsMarkerGeneration[] values() {
synchronized (GetSearchAllLibrariesEnableCreditsMarkerGeneration.class) {
return values.values().toArray(new GetSearchAllLibrariesEnableCreditsMarkerGeneration[] {});
}
}
private static final Map<String, GetSearchAllLibrariesEnableCreditsMarkerGeneration> createValuesMap() {
Map<String, GetSearchAllLibrariesEnableCreditsMarkerGeneration> map = new LinkedHashMap<>();
map.put("-1", LibraryDefault);
map.put("0", Disabled);
return map;
}
private static final Map<String, GetSearchAllLibrariesEnableCreditsMarkerGenerationEnum> createEnumsMap() {
Map<String, GetSearchAllLibrariesEnableCreditsMarkerGenerationEnum> map = new HashMap<>();
map.put("-1", GetSearchAllLibrariesEnableCreditsMarkerGenerationEnum.LibraryDefault);
map.put("0", GetSearchAllLibrariesEnableCreditsMarkerGenerationEnum.Disabled);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetSearchAllLibrariesEnableCreditsMarkerGeneration> {
protected _Serializer() {
super(GetSearchAllLibrariesEnableCreditsMarkerGeneration.class);
}
@Override
public void serialize(GetSearchAllLibrariesEnableCreditsMarkerGeneration value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetSearchAllLibrariesEnableCreditsMarkerGeneration> {
protected _Deserializer() {
super(GetSearchAllLibrariesEnableCreditsMarkerGeneration.class);
}
@Override
public GetSearchAllLibrariesEnableCreditsMarkerGeneration deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetSearchAllLibrariesEnableCreditsMarkerGeneration.of(v);
}
}
public enum GetSearchAllLibrariesEnableCreditsMarkerGenerationEnum {
LibraryDefault("-1"),
Disabled("0"),;
private final String value;
private GetSearchAllLibrariesEnableCreditsMarkerGenerationEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,39 +3,186 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetSearchAllLibrariesEpisodeSort
*
* <p>Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
*/
public enum GetSearchAllLibrariesEpisodeSort {
LibraryDefault("-1"),
OldestFirst("0"),
NewestFirst("1");
@JsonDeserialize(using = GetSearchAllLibrariesEpisodeSort._Deserializer.class)
@JsonSerialize(using = GetSearchAllLibrariesEpisodeSort._Serializer.class)
public class GetSearchAllLibrariesEpisodeSort {
public static final GetSearchAllLibrariesEpisodeSort LibraryDefault = new GetSearchAllLibrariesEpisodeSort("-1");
public static final GetSearchAllLibrariesEpisodeSort OldestFirst = new GetSearchAllLibrariesEpisodeSort("0");
public static final GetSearchAllLibrariesEpisodeSort NewestFirst = new GetSearchAllLibrariesEpisodeSort("1");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetSearchAllLibrariesEpisodeSort> values = createValuesMap();
private static final Map<String, GetSearchAllLibrariesEpisodeSortEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetSearchAllLibrariesEpisodeSort(String value) {
this.value = value;
}
/**
* Returns a GetSearchAllLibrariesEpisodeSort with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetSearchAllLibrariesEpisodeSort
*/
public static GetSearchAllLibrariesEpisodeSort of(String value) {
synchronized (GetSearchAllLibrariesEpisodeSort.class) {
return values.computeIfAbsent(value, v -> new GetSearchAllLibrariesEpisodeSort(v));
}
}
public String value() {
return value;
}
public static Optional<GetSearchAllLibrariesEpisodeSort> fromValue(String value) {
for (GetSearchAllLibrariesEpisodeSort o: GetSearchAllLibrariesEpisodeSort.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetSearchAllLibrariesEpisodeSortEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetSearchAllLibrariesEpisodeSort other = (GetSearchAllLibrariesEpisodeSort) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetSearchAllLibrariesEpisodeSort [value=" + value + "]";
}
// return an array just like an enum
public static GetSearchAllLibrariesEpisodeSort[] values() {
synchronized (GetSearchAllLibrariesEpisodeSort.class) {
return values.values().toArray(new GetSearchAllLibrariesEpisodeSort[] {});
}
}
private static final Map<String, GetSearchAllLibrariesEpisodeSort> createValuesMap() {
Map<String, GetSearchAllLibrariesEpisodeSort> map = new LinkedHashMap<>();
map.put("-1", LibraryDefault);
map.put("0", OldestFirst);
map.put("1", NewestFirst);
return map;
}
private static final Map<String, GetSearchAllLibrariesEpisodeSortEnum> createEnumsMap() {
Map<String, GetSearchAllLibrariesEpisodeSortEnum> map = new HashMap<>();
map.put("-1", GetSearchAllLibrariesEpisodeSortEnum.LibraryDefault);
map.put("0", GetSearchAllLibrariesEpisodeSortEnum.OldestFirst);
map.put("1", GetSearchAllLibrariesEpisodeSortEnum.NewestFirst);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetSearchAllLibrariesEpisodeSort> {
protected _Serializer() {
super(GetSearchAllLibrariesEpisodeSort.class);
}
@Override
public void serialize(GetSearchAllLibrariesEpisodeSort value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetSearchAllLibrariesEpisodeSort> {
protected _Deserializer() {
super(GetSearchAllLibrariesEpisodeSort.class);
}
@Override
public GetSearchAllLibrariesEpisodeSort deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetSearchAllLibrariesEpisodeSort.of(v);
}
}
public enum GetSearchAllLibrariesEpisodeSortEnum {
LibraryDefault("-1"),
OldestFirst("0"),
NewestFirst("1"),;
private final String value;
private GetSearchAllLibrariesEpisodeSortEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,39 +3,186 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
/**
* GetSearchAllLibrariesFlattenSeasons
*
* <p>Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
*/
public enum GetSearchAllLibrariesFlattenSeasons {
LibraryDefault("-1"),
Hide("0"),
Show("1");
@JsonDeserialize(using = GetSearchAllLibrariesFlattenSeasons._Deserializer.class)
@JsonSerialize(using = GetSearchAllLibrariesFlattenSeasons._Serializer.class)
public class GetSearchAllLibrariesFlattenSeasons {
public static final GetSearchAllLibrariesFlattenSeasons LibraryDefault = new GetSearchAllLibrariesFlattenSeasons("-1");
public static final GetSearchAllLibrariesFlattenSeasons Hide = new GetSearchAllLibrariesFlattenSeasons("0");
public static final GetSearchAllLibrariesFlattenSeasons Show = new GetSearchAllLibrariesFlattenSeasons("1");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetSearchAllLibrariesFlattenSeasons> values = createValuesMap();
private static final Map<String, GetSearchAllLibrariesFlattenSeasonsEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetSearchAllLibrariesFlattenSeasons(String value) {
this.value = value;
}
/**
* Returns a GetSearchAllLibrariesFlattenSeasons with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetSearchAllLibrariesFlattenSeasons
*/
public static GetSearchAllLibrariesFlattenSeasons of(String value) {
synchronized (GetSearchAllLibrariesFlattenSeasons.class) {
return values.computeIfAbsent(value, v -> new GetSearchAllLibrariesFlattenSeasons(v));
}
}
public String value() {
return value;
}
public static Optional<GetSearchAllLibrariesFlattenSeasons> fromValue(String value) {
for (GetSearchAllLibrariesFlattenSeasons o: GetSearchAllLibrariesFlattenSeasons.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetSearchAllLibrariesFlattenSeasonsEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetSearchAllLibrariesFlattenSeasons other = (GetSearchAllLibrariesFlattenSeasons) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetSearchAllLibrariesFlattenSeasons [value=" + value + "]";
}
// return an array just like an enum
public static GetSearchAllLibrariesFlattenSeasons[] values() {
synchronized (GetSearchAllLibrariesFlattenSeasons.class) {
return values.values().toArray(new GetSearchAllLibrariesFlattenSeasons[] {});
}
}
private static final Map<String, GetSearchAllLibrariesFlattenSeasons> createValuesMap() {
Map<String, GetSearchAllLibrariesFlattenSeasons> map = new LinkedHashMap<>();
map.put("-1", LibraryDefault);
map.put("0", Hide);
map.put("1", Show);
return map;
}
private static final Map<String, GetSearchAllLibrariesFlattenSeasonsEnum> createEnumsMap() {
Map<String, GetSearchAllLibrariesFlattenSeasonsEnum> map = new HashMap<>();
map.put("-1", GetSearchAllLibrariesFlattenSeasonsEnum.LibraryDefault);
map.put("0", GetSearchAllLibrariesFlattenSeasonsEnum.Hide);
map.put("1", GetSearchAllLibrariesFlattenSeasonsEnum.Show);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetSearchAllLibrariesFlattenSeasons> {
protected _Serializer() {
super(GetSearchAllLibrariesFlattenSeasons.class);
}
@Override
public void serialize(GetSearchAllLibrariesFlattenSeasons value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetSearchAllLibrariesFlattenSeasons> {
protected _Deserializer() {
super(GetSearchAllLibrariesFlattenSeasons.class);
}
@Override
public GetSearchAllLibrariesFlattenSeasons deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetSearchAllLibrariesFlattenSeasons.of(v);
}
}
public enum GetSearchAllLibrariesFlattenSeasonsEnum {
LibraryDefault("-1"),
Hide("0"),
Show("1"),;
private final String value;
private GetSearchAllLibrariesFlattenSeasonsEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

View File

@@ -3,35 +3,185 @@
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
public enum GetSearchAllLibrariesLibraryType {
COVER_POSTER("coverPoster"),
BACKGROUND("background"),
SNAPSHOT("snapshot"),
CLEAR_LOGO("clearLogo");
/**
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
* to evolve (particularly with the addition of enum members over time). If an
* open enum is used then the appearance of unexpected enum values (say in a
* response from an updated an API) will not bring about a runtime error thus
* ensuring that non-updated client versions can continue to work without error.
*
* <p>Note that instances are immutable and are singletons (an internal thread-safe
* cache is maintained to ensure that). As a consequence instances created with the
* same value will satisfy reference equality (via {@code ==}).
*
* <p>This class is intended to emulate an enum (in terms of common usage and with
* reference equality) but with the ability to carry unknown values. Unfortunately
* Java does not permit the use of an instance in a switch expression but you can
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
*
*/
@JsonDeserialize(using = GetSearchAllLibrariesLibraryType._Deserializer.class)
@JsonSerialize(using = GetSearchAllLibrariesLibraryType._Serializer.class)
public class GetSearchAllLibrariesLibraryType {
public static final GetSearchAllLibrariesLibraryType COVER_POSTER = new GetSearchAllLibrariesLibraryType("coverPoster");
public static final GetSearchAllLibrariesLibraryType BACKGROUND = new GetSearchAllLibrariesLibraryType("background");
public static final GetSearchAllLibrariesLibraryType SNAPSHOT = new GetSearchAllLibrariesLibraryType("snapshot");
public static final GetSearchAllLibrariesLibraryType CLEAR_LOGO = new GetSearchAllLibrariesLibraryType("clearLogo");
// This map will grow whenever a Color gets created with a new
// unrecognized value (a potential memory leak if the user is not
// careful). Keep this field lower case to avoid clashing with
// generated member names which will always be upper cased (Java
// convention)
private static final Map<String, GetSearchAllLibrariesLibraryType> values = createValuesMap();
private static final Map<String, GetSearchAllLibrariesLibraryTypeEnum> enums = createEnumsMap();
@JsonValue
private final String value;
private GetSearchAllLibrariesLibraryType(String value) {
this.value = value;
}
/**
* Returns a GetSearchAllLibrariesLibraryType with the given value. For a specific value the
* returned object will always be a singleton so reference equality
* is satisfied when the values are the same.
*
* @param value value to be wrapped as GetSearchAllLibrariesLibraryType
*/
public static GetSearchAllLibrariesLibraryType of(String value) {
synchronized (GetSearchAllLibrariesLibraryType.class) {
return values.computeIfAbsent(value, v -> new GetSearchAllLibrariesLibraryType(v));
}
}
public String value() {
return value;
}
public static Optional<GetSearchAllLibrariesLibraryType> fromValue(String value) {
for (GetSearchAllLibrariesLibraryType o: GetSearchAllLibrariesLibraryType.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
public Optional<GetSearchAllLibrariesLibraryTypeEnum> asEnum() {
return Optional.ofNullable(enums.getOrDefault(value, null));
}
public boolean isKnown() {
return asEnum().isPresent();
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GetSearchAllLibrariesLibraryType other = (GetSearchAllLibrariesLibraryType) obj;
return Objects.equals(value, other.value);
}
@Override
public String toString() {
return "GetSearchAllLibrariesLibraryType [value=" + value + "]";
}
// return an array just like an enum
public static GetSearchAllLibrariesLibraryType[] values() {
synchronized (GetSearchAllLibrariesLibraryType.class) {
return values.values().toArray(new GetSearchAllLibrariesLibraryType[] {});
}
}
private static final Map<String, GetSearchAllLibrariesLibraryType> createValuesMap() {
Map<String, GetSearchAllLibrariesLibraryType> map = new LinkedHashMap<>();
map.put("coverPoster", COVER_POSTER);
map.put("background", BACKGROUND);
map.put("snapshot", SNAPSHOT);
map.put("clearLogo", CLEAR_LOGO);
return map;
}
private static final Map<String, GetSearchAllLibrariesLibraryTypeEnum> createEnumsMap() {
Map<String, GetSearchAllLibrariesLibraryTypeEnum> map = new HashMap<>();
map.put("coverPoster", GetSearchAllLibrariesLibraryTypeEnum.COVER_POSTER);
map.put("background", GetSearchAllLibrariesLibraryTypeEnum.BACKGROUND);
map.put("snapshot", GetSearchAllLibrariesLibraryTypeEnum.SNAPSHOT);
map.put("clearLogo", GetSearchAllLibrariesLibraryTypeEnum.CLEAR_LOGO);
return map;
}
@SuppressWarnings("serial")
public static final class _Serializer extends StdSerializer<GetSearchAllLibrariesLibraryType> {
protected _Serializer() {
super(GetSearchAllLibrariesLibraryType.class);
}
@Override
public void serialize(GetSearchAllLibrariesLibraryType value, JsonGenerator g, SerializerProvider provider)
throws IOException, JsonProcessingException {
g.writeObject(value.value);
}
}
@SuppressWarnings("serial")
public static final class _Deserializer extends StdDeserializer<GetSearchAllLibrariesLibraryType> {
protected _Deserializer() {
super(GetSearchAllLibrariesLibraryType.class);
}
@Override
public GetSearchAllLibrariesLibraryType deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JacksonException {
String v = p.readValueAs(new TypeReference<String>() {});
// use the factory method to ensure we get singletons
return GetSearchAllLibrariesLibraryType.of(v);
}
}
public enum GetSearchAllLibrariesLibraryTypeEnum {
COVER_POSTER("coverPoster"),
BACKGROUND("background"),
SNAPSHOT("snapshot"),
CLEAR_LOGO("clearLogo"),;
private final String value;
private GetSearchAllLibrariesLibraryTypeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
return Optional.empty();
}
}

Some files were not shown because too many files have changed in this diff Show More