mirror of
https://github.com/LukeHagar/plexjava.git
synced 2025-12-06 12:37:47 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0e915da8b | ||
|
|
0077561a6a |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
**/.speakeasy/temp/
|
||||||
|
**/.speakeasy/logs/
|
||||||
.speakeasy/reports
|
.speakeasy/reports
|
||||||
# Ignore Gradle project-specific cache directory
|
# Ignore Gradle project-specific cache directory
|
||||||
.gradle
|
.gradle
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -11,11 +11,12 @@ generation:
|
|||||||
parameterOrderingFeb2024: true
|
parameterOrderingFeb2024: true
|
||||||
requestResponseComponentNamesFeb2024: true
|
requestResponseComponentNamesFeb2024: true
|
||||||
securityFeb2025: false
|
securityFeb2025: false
|
||||||
|
sharedErrorComponentsApr2025: false
|
||||||
auth:
|
auth:
|
||||||
oAuth2ClientCredentialsEnabled: true
|
oAuth2ClientCredentialsEnabled: true
|
||||||
oAuth2PasswordEnabled: false
|
oAuth2PasswordEnabled: false
|
||||||
java:
|
java:
|
||||||
version: 0.15.0
|
version: 0.16.1
|
||||||
additionalDependencies: []
|
additionalDependencies: []
|
||||||
additionalPlugins: []
|
additionalPlugins: []
|
||||||
artifactID: plexapi
|
artifactID: plexapi
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
speakeasyVersion: 1.531.4
|
speakeasyVersion: 1.541.2
|
||||||
sources:
|
sources:
|
||||||
my-source:
|
my-source:
|
||||||
sourceNamespace: my-source
|
sourceNamespace: my-source
|
||||||
@@ -8,19 +8,19 @@ sources:
|
|||||||
- latest
|
- latest
|
||||||
plexapi:
|
plexapi:
|
||||||
sourceNamespace: plexapi
|
sourceNamespace: plexapi
|
||||||
sourceRevisionDigest: sha256:db75a06885b897418dcb580679b5f744348573ad317155172346d32442420e5e
|
sourceRevisionDigest: sha256:31ab7b2e65ccf1e0349bcd8b35791d1ce80091313481874749163fc0c80fd8ed
|
||||||
sourceBlobDigest: sha256:ac0a3c3a6df002378b3522325c2330ba4309fbbbfa503a04b8267398f20033f5
|
sourceBlobDigest: sha256:d971fff9723c626fe70403a2a83d813c396a20b06ccd6b899263762038cfdbb0
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- speakeasy-sdk-regen-1744590653
|
- speakeasy-sdk-regen-1746059587
|
||||||
targets:
|
targets:
|
||||||
plexjava:
|
plexjava:
|
||||||
source: plexapi
|
source: plexapi
|
||||||
sourceNamespace: plexapi
|
sourceNamespace: plexapi
|
||||||
sourceRevisionDigest: sha256:db75a06885b897418dcb580679b5f744348573ad317155172346d32442420e5e
|
sourceRevisionDigest: sha256:31ab7b2e65ccf1e0349bcd8b35791d1ce80091313481874749163fc0c80fd8ed
|
||||||
sourceBlobDigest: sha256:ac0a3c3a6df002378b3522325c2330ba4309fbbbfa503a04b8267398f20033f5
|
sourceBlobDigest: sha256:d971fff9723c626fe70403a2a83d813c396a20b06ccd6b899263762038cfdbb0
|
||||||
codeSamplesNamespace: code-samples-java-plexjava
|
codeSamplesNamespace: code-samples-java-plexjava
|
||||||
codeSamplesRevisionDigest: sha256:da1aba30a925f7fffb273f3f1f7d25920debd20e62c974ad4a6904a98697c8db
|
codeSamplesRevisionDigest: sha256:7014061698c081192d583b95c5cdcb4120fd314b9e0963b81fb16e74b320b426
|
||||||
workflow:
|
workflow:
|
||||||
workflowVersion: 1.0.0
|
workflowVersion: 1.0.0
|
||||||
speakeasyVersion: latest
|
speakeasyVersion: latest
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ The samples below show how a published SDK artifact is used:
|
|||||||
|
|
||||||
Gradle:
|
Gradle:
|
||||||
```groovy
|
```groovy
|
||||||
implementation 'dev.plexapi:plexapi:0.15.0'
|
implementation 'dev.plexapi:plexapi:0.16.1'
|
||||||
```
|
```
|
||||||
|
|
||||||
Maven:
|
Maven:
|
||||||
@@ -77,7 +77,7 @@ Maven:
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>dev.plexapi</groupId>
|
<groupId>dev.plexapi</groupId>
|
||||||
<artifactId>plexapi</artifactId>
|
<artifactId>plexapi</artifactId>
|
||||||
<version>0.15.0</version>
|
<version>0.16.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
20
RELEASES.md
20
RELEASES.md
@@ -319,3 +319,23 @@ Based on:
|
|||||||
- [java v0.15.0] .
|
- [java v0.15.0] .
|
||||||
### Releases
|
### Releases
|
||||||
- [Maven Central v0.15.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.15.0 - .
|
- [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 - .
|
||||||
|
|
||||||
|
## 2025-05-01 00:32:51
|
||||||
|
### Changes
|
||||||
|
Based on:
|
||||||
|
- OpenAPI Doc
|
||||||
|
- Speakeasy CLI 1.541.2 (2.595.4) https://github.com/speakeasy-api/speakeasy
|
||||||
|
### Generated
|
||||||
|
- [java v0.16.1] .
|
||||||
|
### Releases
|
||||||
|
- [Maven Central v0.16.1] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.16.1 - .
|
||||||
@@ -103,7 +103,7 @@ publishing {
|
|||||||
// https://github.com/gradle/gradle/issues/18619
|
// https://github.com/gradle/gradle/issues/18619
|
||||||
groupId = "dev.plexapi"
|
groupId = "dev.plexapi"
|
||||||
artifactId = "plexapi"
|
artifactId = "plexapi"
|
||||||
version = "0.15.0"
|
version = "0.16.1"
|
||||||
|
|
||||||
from components.java
|
from components.java
|
||||||
|
|
||||||
|
|||||||
11
docs/models/operations/Attributes.md
Normal file
11
docs/models/operations/Attributes.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Attributes
|
||||||
|
|
||||||
|
Attributes associated with the marker.
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
|
||||||
|
| `id` | *long* | :heavy_check_mark: | The identifier for the attributes. | 306970 |
|
||||||
|
| `version` | *Optional\<Long>* | :heavy_minus_sign: | The version number of the marker attributes. | 4 |
|
||||||
15
docs/models/operations/Chapter.md
Normal file
15
docs/models/operations/Chapter.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Chapter
|
||||||
|
|
||||||
|
The thumbnail for the chapter
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ |
|
||||||
|
| `id` | *long* | :heavy_check_mark: | N/A | 4 |
|
||||||
|
| `filter` | *String* | :heavy_check_mark: | N/A | thumb=4 |
|
||||||
|
| `index` | *long* | :heavy_check_mark: | N/A | 1 |
|
||||||
|
| `startTimeOffset` | *long* | :heavy_check_mark: | N/A | 0 |
|
||||||
|
| `endTimeOffset` | *long* | :heavy_check_mark: | N/A | 100100 |
|
||||||
|
| `thumb` | *String* | :heavy_check_mark: | N/A | /library/media/46883/chapterImages/1 |
|
||||||
@@ -7,6 +7,6 @@ The filter query string for country media items.
|
|||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
||||||
| `id` | *long* | :heavy_check_mark: | N/A | 259 |
|
| `id` | *int* | :heavy_check_mark: | N/A | 259 |
|
||||||
| `tag` | *String* | :heavy_check_mark: | The country of origin of this media item | United States of America |
|
| `tag` | *String* | :heavy_check_mark: | The country of origin of this media item | United States of America |
|
||||||
| `filter` | *Optional\<String>* | :heavy_minus_sign: | N/A | country=19 |
|
| `filter` | *Optional\<String>* | :heavy_minus_sign: | N/A | country=19 |
|
||||||
8
docs/models/operations/Extras.md
Normal file
8
docs/models/operations/Extras.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Extras
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ----------------------- | ----------------------- | ----------------------- | ----------------------- | ----------------------- |
|
||||||
|
| `size` | *Optional\<Long>* | :heavy_minus_sign: | The size of the extras. | 1 |
|
||||||
@@ -3,54 +3,56 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
|
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
|
||||||
| `id` | *long* | :heavy_check_mark: | Unique stream identifier. | 1002625 |
|
| `id` | *long* | :heavy_check_mark: | Unique stream identifier. | 1002625 |
|
||||||
| `streamType` | *int* | :heavy_check_mark: | Stream type (1=video, 2=audio, 3=subtitle). | 1 |
|
| `streamType` | [GetAllMediaLibraryStreamType](../../models/operations/GetAllMediaLibraryStreamType.md) | :heavy_check_mark: | Stream type:<br/> - 1 = video<br/> - 2 = audio<br/> - 3 = subtitle<br/> | 1 |
|
||||||
| `default_` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if this stream is default. | true |
|
| `format` | *Optional\<String>* | :heavy_minus_sign: | Format of the stream (e.g., srt). | srt |
|
||||||
| `codec` | *String* | :heavy_check_mark: | Codec used by the stream. | hevc |
|
| `default_` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if this stream is default. | true |
|
||||||
| `index` | *int* | :heavy_check_mark: | Index of the stream. | 0 |
|
| `codec` | *String* | :heavy_check_mark: | Codec used by the stream. | hevc |
|
||||||
| `bitrate` | *Optional\<Integer>* | :heavy_minus_sign: | Bitrate of the stream. | 24743 |
|
| `index` | *Optional\<Integer>* | :heavy_minus_sign: | Index of the stream. | 0 |
|
||||||
| `language` | *Optional\<String>* | :heavy_minus_sign: | Language of the stream. | English |
|
| `bitrate` | *Optional\<Integer>* | :heavy_minus_sign: | Bitrate of the stream. | 24743 |
|
||||||
| `languageTag` | *Optional\<String>* | :heavy_minus_sign: | Language tag (e.g., en). | en |
|
| `language` | *Optional\<String>* | :heavy_minus_sign: | Language of the stream. | English |
|
||||||
| `languageCode` | *Optional\<String>* | :heavy_minus_sign: | ISO language code. | eng |
|
| `languageTag` | *Optional\<String>* | :heavy_minus_sign: | Language tag (e.g., en). | en |
|
||||||
| `headerCompression` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates whether header compression is enabled. | true |
|
| `languageCode` | *Optional\<String>* | :heavy_minus_sign: | ISO language code. | eng |
|
||||||
| `doviblCompatID` | *Optional\<Integer>* | :heavy_minus_sign: | Dolby Vision BL compatibility ID. | 1 |
|
| `headerCompression` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates whether header compression is enabled. | true |
|
||||||
| `doviblPresent` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if Dolby Vision BL is present. | true |
|
| `doviblCompatID` | *Optional\<Integer>* | :heavy_minus_sign: | Dolby Vision BL compatibility ID. | 1 |
|
||||||
| `dovielPresent` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if Dolby Vision EL is present. | false |
|
| `doviblPresent` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if Dolby Vision BL is present. | true |
|
||||||
| `doviLevel` | *Optional\<Integer>* | :heavy_minus_sign: | Dolby Vision level. | 6 |
|
| `dovielPresent` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if Dolby Vision EL is present. | false |
|
||||||
| `doviPresent` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if Dolby Vision is present. | true |
|
| `doviLevel` | *Optional\<Integer>* | :heavy_minus_sign: | Dolby Vision level. | 6 |
|
||||||
| `doviProfile` | *Optional\<Integer>* | :heavy_minus_sign: | Dolby Vision profile. | 8 |
|
| `doviPresent` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if Dolby Vision is present. | true |
|
||||||
| `dovirpuPresent` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if Dolby Vision RPU is present. | true |
|
| `doviProfile` | *Optional\<Integer>* | :heavy_minus_sign: | Dolby Vision profile. | 8 |
|
||||||
| `doviVersion` | *Optional\<String>* | :heavy_minus_sign: | Dolby Vision version. | 1.0 |
|
| `dovirpuPresent` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if Dolby Vision RPU is present. | true |
|
||||||
| `bitDepth` | *Optional\<Integer>* | :heavy_minus_sign: | Bit depth of the video stream. | 10 |
|
| `doviVersion` | *Optional\<String>* | :heavy_minus_sign: | Dolby Vision version. | 1.0 |
|
||||||
| `chromaLocation` | *Optional\<String>* | :heavy_minus_sign: | Chroma sample location. | topleft |
|
| `bitDepth` | *Optional\<Integer>* | :heavy_minus_sign: | Bit depth of the video stream. | 10 |
|
||||||
| `chromaSubsampling` | *Optional\<String>* | :heavy_minus_sign: | Chroma subsampling format. | 4:2:0 |
|
| `chromaLocation` | *Optional\<String>* | :heavy_minus_sign: | Chroma sample location. | topleft |
|
||||||
| `codedHeight` | *Optional\<Integer>* | :heavy_minus_sign: | Coded video height. | 1608 |
|
| `chromaSubsampling` | *Optional\<String>* | :heavy_minus_sign: | Chroma subsampling format. | 4:2:0 |
|
||||||
| `codedWidth` | *Optional\<Integer>* | :heavy_minus_sign: | Coded video width. | 3840 |
|
| `codedHeight` | *Optional\<Integer>* | :heavy_minus_sign: | Coded video height. | 1608 |
|
||||||
| `closedCaptions` | *Optional\<Boolean>* | :heavy_minus_sign: | N/A | true |
|
| `codedWidth` | *Optional\<Integer>* | :heavy_minus_sign: | Coded video width. | 3840 |
|
||||||
| `colorPrimaries` | *Optional\<String>* | :heavy_minus_sign: | Color primaries used. | bt2020 |
|
| `closedCaptions` | *Optional\<Boolean>* | :heavy_minus_sign: | N/A | true |
|
||||||
| `colorRange` | *Optional\<String>* | :heavy_minus_sign: | Color range (e.g., tv). | tv |
|
| `colorPrimaries` | *Optional\<String>* | :heavy_minus_sign: | Color primaries used. | bt2020 |
|
||||||
| `colorSpace` | *Optional\<String>* | :heavy_minus_sign: | Color space. | bt2020nc |
|
| `colorRange` | *Optional\<String>* | :heavy_minus_sign: | Color range (e.g., tv). | tv |
|
||||||
| `colorTrc` | *Optional\<String>* | :heavy_minus_sign: | Color transfer characteristics. | smpte2084 |
|
| `colorSpace` | *Optional\<String>* | :heavy_minus_sign: | Color space. | bt2020nc |
|
||||||
| `frameRate` | *Optional\<Float>* | :heavy_minus_sign: | Frame rate of the stream. | 23.976 |
|
| `colorTrc` | *Optional\<String>* | :heavy_minus_sign: | Color transfer characteristics. | smpte2084 |
|
||||||
| `height` | *Optional\<Integer>* | :heavy_minus_sign: | Height of the video stream. | 1602 |
|
| `frameRate` | *Optional\<Float>* | :heavy_minus_sign: | Frame rate of the stream. | 23.976 |
|
||||||
| `level` | *Optional\<Integer>* | :heavy_minus_sign: | Video level. | 150 |
|
| `key` | *Optional\<String>* | :heavy_minus_sign: | Key to access this stream part. | /library/streams/216389 |
|
||||||
| `original` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if this is the original stream. | true |
|
| `height` | *Optional\<Integer>* | :heavy_minus_sign: | Height of the video stream. | 1602 |
|
||||||
| `hasScalingMatrix` | *Optional\<Boolean>* | :heavy_minus_sign: | N/A | false |
|
| `level` | *Optional\<Integer>* | :heavy_minus_sign: | Video level. | 150 |
|
||||||
| `profile` | *Optional\<String>* | :heavy_minus_sign: | Video profile. | main 10 |
|
| `original` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if this is the original stream. | true |
|
||||||
| `scanType` | *Optional\<String>* | :heavy_minus_sign: | N/A | progressive |
|
| `hasScalingMatrix` | *Optional\<Boolean>* | :heavy_minus_sign: | N/A | false |
|
||||||
| `embeddedInVideo` | *Optional\<String>* | :heavy_minus_sign: | N/A | progressive |
|
| `profile` | *Optional\<String>* | :heavy_minus_sign: | Video profile. | main 10 |
|
||||||
| `refFrames` | *Optional\<Integer>* | :heavy_minus_sign: | Number of reference frames. | 1 |
|
| `scanType` | *Optional\<String>* | :heavy_minus_sign: | N/A | progressive |
|
||||||
| `width` | *Optional\<Integer>* | :heavy_minus_sign: | Width of the video stream. | 3840 |
|
| `embeddedInVideo` | *Optional\<String>* | :heavy_minus_sign: | N/A | progressive |
|
||||||
| `displayTitle` | *String* | :heavy_check_mark: | Display title for the stream. | 4K DoVi/HDR10 (HEVC Main 10) |
|
| `refFrames` | *Optional\<Integer>* | :heavy_minus_sign: | Number of reference frames. | 1 |
|
||||||
| `extendedDisplayTitle` | *String* | :heavy_check_mark: | Extended display title for the stream. | 4K DoVi/HDR10 (HEVC Main 10) |
|
| `width` | *Optional\<Integer>* | :heavy_minus_sign: | Width of the video stream. | 3840 |
|
||||||
| `selected` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if this stream is selected (applicable for audio streams). | true |
|
| `displayTitle` | *String* | :heavy_check_mark: | Display title for the stream. | 4K DoVi/HDR10 (HEVC Main 10) |
|
||||||
| `forced` | *Optional\<Boolean>* | :heavy_minus_sign: | N/A | true |
|
| `extendedDisplayTitle` | *String* | :heavy_check_mark: | Extended display title for the stream. | 4K DoVi/HDR10 (HEVC Main 10) |
|
||||||
| `channels` | *Optional\<Integer>* | :heavy_minus_sign: | Number of audio channels (for audio streams). | 6 |
|
| `selected` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if this stream is selected (applicable for audio streams). | true |
|
||||||
| `audioChannelLayout` | *Optional\<String>* | :heavy_minus_sign: | Audio channel layout. | 5.1(side) |
|
| `forced` | *Optional\<Boolean>* | :heavy_minus_sign: | N/A | true |
|
||||||
| `samplingRate` | *Optional\<Integer>* | :heavy_minus_sign: | Sampling rate for the audio stream. | 48000 |
|
| `channels` | *Optional\<Integer>* | :heavy_minus_sign: | Number of audio channels (for audio streams). | 6 |
|
||||||
| `canAutoSync` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if the stream can auto-sync. | false |
|
| `audioChannelLayout` | *Optional\<String>* | :heavy_minus_sign: | Audio channel layout. | 5.1(side) |
|
||||||
| `hearingImpaired` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if the stream is for the hearing impaired. | true |
|
| `samplingRate` | *Optional\<Integer>* | :heavy_minus_sign: | Sampling rate for the audio stream. | 48000 |
|
||||||
| `dub` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if the stream is a dub. | true |
|
| `canAutoSync` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if the stream can auto-sync. | false |
|
||||||
| `title` | *Optional\<String>* | :heavy_minus_sign: | Optional title for the stream (e.g., language variant). | SDH |
|
| `hearingImpaired` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if the stream is for the hearing impaired. | true |
|
||||||
|
| `dub` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if the stream is a dub. | true |
|
||||||
|
| `title` | *Optional\<String>* | :heavy_minus_sign: | Optional title for the stream (e.g., language variant). | SDH |
|
||||||
16
docs/models/operations/GetAllMediaLibraryStreamType.md
Normal file
16
docs/models/operations/GetAllMediaLibraryStreamType.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# GetAllMediaLibraryStreamType
|
||||||
|
|
||||||
|
Stream type:
|
||||||
|
- 1 = video
|
||||||
|
- 2 = audio
|
||||||
|
- 3 = subtitle
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ---------- | ---------- |
|
||||||
|
| `Video` | 1 |
|
||||||
|
| `Audio` | 2 |
|
||||||
|
| `Subtitle` | 3 |
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| 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/> | |
|
| `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 |
|
| `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 |
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
# GetMediaMetaDataCountry
|
# GetMediaMetaDataCountry
|
||||||
|
|
||||||
|
The filter query string for country media items.
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- |
|
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
||||||
| `id` | *int* | :heavy_check_mark: | The unique country identifier. | 58591 |
|
| `id` | *int* | :heavy_check_mark: | N/A | 259 |
|
||||||
| `filter` | *String* | :heavy_check_mark: | The filter string for the country. | country=58591 |
|
| `tag` | *String* | :heavy_check_mark: | The country of origin of this media item | United States of America |
|
||||||
| `tag` | *String* | :heavy_check_mark: | The country name. | United States of America |
|
| `filter` | *Optional\<String>* | :heavy_minus_sign: | N/A | country=19 |
|
||||||
@@ -3,11 +3,10 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
|
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
||||||
| `id` | *long* | :heavy_check_mark: | The unique role identifier. | 109501 |
|
| `id` | *int* | :heavy_check_mark: | Unique identifier for the director. | 126522 |
|
||||||
| `filter` | *String* | :heavy_check_mark: | The filter string for the role. | actor=109501 |
|
| `tag` | *String* | :heavy_check_mark: | The role of Director | Danny Boyle |
|
||||||
| `tag` | *String* | :heavy_check_mark: | The actor's name. | Bob Odenkirk |
|
| `filter` | *String* | :heavy_check_mark: | The filter string used to query this director. | director=235876 |
|
||||||
| `tagKey` | *String* | :heavy_check_mark: | A key associated with the actor tag. | 5d77683254f42c001f8c3f69 |
|
| `tagKey` | *Optional\<String>* | :heavy_minus_sign: | A unique key associated with the director's tag, used for internal identification. | 5d776831151a60001f24d031 |
|
||||||
| `role` | *Optional\<String>* | :heavy_minus_sign: | The character name or role. | Jimmy McGill |
|
| `thumb` | *Optional\<String>* | :heavy_minus_sign: | The URL of the thumbnail image for the director. | https://metadata-static.plex.tv/8/people/8d65fa96804802e08f2de09fe014408e.jpg |
|
||||||
| `thumb` | *Optional\<String>* | :heavy_minus_sign: | URL for the role thumbnail image. | https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg |
|
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
# GetMediaMetaDataGenre
|
# GetMediaMetaDataGenre
|
||||||
|
|
||||||
|
The filter query string for similar items.
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- |
|
| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- |
|
||||||
| `id` | *long* | :heavy_check_mark: | The unique genre identifier. | 1057 |
|
| `id` | *long* | :heavy_check_mark: | N/A | 259 |
|
||||||
| `filter` | *String* | :heavy_check_mark: | The filter string for the genre. | genre=1057 |
|
| `tag` | *String* | :heavy_check_mark: | The genre name of this media-item<br/> | Crime |
|
||||||
| `tag` | *String* | :heavy_check_mark: | The genre name. | Crime |
|
| `filter` | *String* | :heavy_check_mark: | N/A | genre=19 |
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
|
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
||||||
| `alt` | *String* | :heavy_check_mark: | Alternate text for the image. | Better Call Saul |
|
| `alt` | *String* | :heavy_check_mark: | N/A | Episode 1 |
|
||||||
| `type` | *String* | :heavy_check_mark: | The type of image (e.g., coverPoster, background, clearLogo). | coverPoster |
|
| `type` | [GetMediaMetaDataLibraryType](../../models/operations/GetMediaMetaDataLibraryType.md) | :heavy_check_mark: | N/A | background |
|
||||||
| `url` | *String* | :heavy_check_mark: | The URL of the image. | /library/metadata/44288/thumb/1736487993 |
|
| `url` | *String* | :heavy_check_mark: | N/A | /library/metadata/45521/thumb/1644710589 |
|
||||||
11
docs/models/operations/GetMediaMetaDataLibraryType.md
Normal file
11
docs/models/operations/GetMediaMetaDataLibraryType.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetMediaMetaDataLibraryType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------------- | -------------- |
|
||||||
|
| `COVER_POSTER` | coverPoster |
|
||||||
|
| `BACKGROUND` | background |
|
||||||
|
| `SNAPSHOT` | snapshot |
|
||||||
|
| `CLEAR_LOGO` | clearLogo |
|
||||||
@@ -1,68 +1,83 @@
|
|||||||
# GetMediaMetaDataMetadata
|
# GetMediaMetaDataMetadata
|
||||||
|
|
||||||
|
Unknown
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `ratingKey` | *String* | :heavy_check_mark: | The rating key of the metadata item. | 44288 |
|
| `ratingKey` | *String* | :heavy_check_mark: | The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. | 58683 |
|
||||||
| `parentRatingKey` | *Optional\<String>* | :heavy_minus_sign: | The rating key of the parent of this metadata item. | 48047 |
|
| `key` | *String* | :heavy_check_mark: | The unique key for the media item. | /library/metadata/58683 |
|
||||||
| `grandparentRatingKey` | *Optional\<String>* | :heavy_minus_sign: | The rating key of the grandparent of this metadata item. | 45520 |
|
| `guid` | *String* | :heavy_check_mark: | The globally unique identifier for the media item. | plex://movie/5d7768ba96b655001fdc0408 |
|
||||||
| `parentGuid` | *Optional\<String>* | :heavy_minus_sign: | A GUID identifying the parent entity (e.g., season) for the item. | plex://season/618b89208dde18df707ad15c |
|
| `slug` | *String* | :heavy_check_mark: | A URL‐friendly version of the media title. | 4-for-texas |
|
||||||
| `grandparentGuid` | *Optional\<String>* | :heavy_minus_sign: | A GUID identifying the grandparent entity (e.g., show). | plex://show/5e16253691c20300412003a8 |
|
| `studio` | *Optional\<String>* | :heavy_minus_sign: | The studio that produced the media item. | 20th Century Studios |
|
||||||
| `grandparentSlug` | *Optional\<String>* | :heavy_minus_sign: | A URL-friendly identifier (slug) for the grandparent entity. | alice-in-borderland-2020 |
|
| `type` | [GetMediaMetaDataType](../../models/operations/GetMediaMetaDataType.md) | :heavy_check_mark: | N/A | movie |
|
||||||
| `grandparentKey` | *Optional\<String>* | :heavy_minus_sign: | A key identifying the grandparent metadata in the library. | /library/metadata/45520 |
|
| `title` | *String* | :heavy_check_mark: | The title of the media item. | Avatar: The Way of Water |
|
||||||
| `parentKey` | *Optional\<String>* | :heavy_minus_sign: | A key identifying the parent metadata in the library. | /library/metadata/48047 |
|
| `titleSort` | *String* | :heavy_check_mark: | The sort title used for ordering media items. | Whale |
|
||||||
| `key` | *String* | :heavy_check_mark: | The API key to access metadata details. | /library/metadata/44288/children |
|
| `contentRating` | *Optional\<String>* | :heavy_minus_sign: | The content rating for the media item. | PG-13 |
|
||||||
| `guid` | *String* | :heavy_check_mark: | The globally unique identifier for the item. | plex://show/5d9c08254eefaa001f5d6dcb |
|
| `summary` | *String* | :heavy_check_mark: | A synopsis of the media item. | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora.<br/>Once a familiar threat returns to finish what was previously started, Jake must<br/>work with Neytiri and the army of the Na'vi race to protect their home.<br/> |
|
||||||
| `slug` | *Optional\<String>* | :heavy_minus_sign: | A URL-friendly identifier for the item. | better-call-saul |
|
| `rating` | *float* | :heavy_check_mark: | The critic rating for the media item. | 7.6 |
|
||||||
| `studio` | *Optional\<String>* | :heavy_minus_sign: | The studio that produced the content. | Sony Pictures Television |
|
| `audienceRating` | *double* | :heavy_check_mark: | The audience rating for the media item. | 9.2 |
|
||||||
| `type` | *String* | :heavy_check_mark: | The type of content (e.g., show, movie). | show |
|
| `year` | *Optional\<Integer>* | :heavy_minus_sign: | The release year of the media item. | 2022 |
|
||||||
| `title` | *String* | :heavy_check_mark: | The title of the content. | Better Call Saul |
|
| `tagline` | *String* | :heavy_check_mark: | A brief tagline for the media item. | Return to Pandora. |
|
||||||
| `originalTitle` | *Optional\<String>* | :heavy_minus_sign: | The original title of the content. | Wicked: Part I |
|
| `thumb` | *String* | :heavy_check_mark: | The thumbnail image URL for the media item. | /library/metadata/58683/thumb/1703239236 |
|
||||||
| `librarySectionTitle` | *String* | :heavy_check_mark: | The title of the library section. | TV Series |
|
| `art` | *String* | :heavy_check_mark: | The art image URL for the media item. | /library/metadata/58683/art/1703239236 |
|
||||||
| `librarySectionID` | *long* | :heavy_check_mark: | The ID of the library section. | 2 |
|
| `theme` | *String* | :heavy_check_mark: | The theme URL for the media item. | /library/metadata/1/theme/1705636920 |
|
||||||
| `librarySectionKey` | *String* | :heavy_check_mark: | The key of the library section. | /library/sections/2 |
|
| `index` | *int* | :heavy_check_mark: | The index position of the media item. | 1 |
|
||||||
| `contentRating` | *Optional\<String>* | :heavy_minus_sign: | The content rating (e.g., TV-MA). | TV-MA |
|
| `leafCount` | *Optional\<Integer>* | :heavy_minus_sign: | The number of leaf items (end nodes) under this media item. | 14 |
|
||||||
| `summary` | *String* | :heavy_check_mark: | A summary of the content. | Before Saul Goodman, he was Jimmy McGill. And if you're calling Jimmy, you're in real trouble. The prequel to "Breaking Bad" follows small-time attorney, Jimmy McGill, as he transforms into Walter White's morally challenged lawyer, Saul Goodman. |
|
| `viewedLeafCount` | *Optional\<Integer>* | :heavy_minus_sign: | The number of leaf items that have been viewed. | 0 |
|
||||||
| `index` | *Optional\<Long>* | :heavy_minus_sign: | The index or order of the item. | 1 |
|
| `childCount` | *int* | :heavy_check_mark: | The number of child items associated with this media item. | 1 |
|
||||||
| `grandparentTitle` | *Optional\<String>* | :heavy_minus_sign: | The title of the grandparent entity (typically the show's title). | Alice in Borderland |
|
| `seasonCount` | *int* | :heavy_check_mark: | The total number of seasons (for TV shows). | 2022 |
|
||||||
| `parentTitle` | *Optional\<String>* | :heavy_minus_sign: | The title of the parent entity (typically the season's title). | Season 2 |
|
| `duration` | *int* | :heavy_check_mark: | The duration of the media item in milliseconds. | 11558112 |
|
||||||
| `audienceRating` | *Optional\<Float>* | :heavy_minus_sign: | The audience rating for the content. | 8.7 |
|
| `originallyAvailableAt` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_check_mark: | The original release date of the media item. | 2022-12-14 |
|
||||||
| `viewCount` | *Optional\<Long>* | :heavy_minus_sign: | The number of times the item has been viewed. | 4 |
|
| `addedAt` | *long* | :heavy_check_mark: | N/A | 1556281940 |
|
||||||
| `skipCount` | *Optional\<Long>* | :heavy_minus_sign: | The number of times the item has been skipped. | 1 |
|
| `updatedAt` | *Optional\<Long>* | :heavy_minus_sign: | Unix epoch datetime in seconds | 1556281940 |
|
||||||
| `lastViewedAt` | *Optional\<Long>* | :heavy_minus_sign: | Unix timestamp of when the item was last viewed. | 1625764795 |
|
| `audienceRatingImage` | *Optional\<String>* | :heavy_minus_sign: | The URL for the audience rating image. | rottentomatoes://image.rating.upright |
|
||||||
| `year` | *int* | :heavy_check_mark: | The release year. | 2015 |
|
| `chapterSource` | *Optional\<String>* | :heavy_minus_sign: | The source from which chapter data is derived. | media |
|
||||||
| `rating` | *Optional\<Float>* | :heavy_minus_sign: | The general rating | 6 |
|
| `primaryExtraKey` | *Optional\<String>* | :heavy_minus_sign: | The primary extra key associated with this media item. | /library/metadata/58684 |
|
||||||
| `ratingImage` | *Optional\<String>* | :heavy_minus_sign: | The URL or identifier for the rating image (e.g., Rotten Tomatoes rating image). | rottentomatoes://image.rating.ripe |
|
| `originalTitle` | *Optional\<String>* | :heavy_minus_sign: | The original title of the media item (if different). | 映画 ブラッククローバー 魔法帝の剣 |
|
||||||
| `tagline` | *Optional\<String>* | :heavy_minus_sign: | The tagline of the content. | Make the call |
|
| `parentRatingKey` | *Optional\<String>* | :heavy_minus_sign: | The rating key of the parent media item. | 66 |
|
||||||
| `chapterSource` | *Optional\<String>* | :heavy_minus_sign: | N/A | media |
|
| `grandparentRatingKey` | *Optional\<String>* | :heavy_minus_sign: | The rating key of the grandparent media item. | 66 |
|
||||||
| `primaryExtraKey` | *Optional\<String>* | :heavy_minus_sign: | N/A | /library/metadata/134704 |
|
| `parentGuid` | *Optional\<String>* | :heavy_minus_sign: | The GUID of the parent media item. | plex://show/5d9c081b170e24001f2a7be4 |
|
||||||
| `thumb` | *String* | :heavy_check_mark: | URL of the thumbnail image. | /library/metadata/44288/thumb/1736487993 |
|
| `grandparentGuid` | *Optional\<String>* | :heavy_minus_sign: | The GUID of the grandparent media item. | plex://show/5d9c081b170e24001f2a7be4 |
|
||||||
| `art` | *String* | :heavy_check_mark: | URL of the art image. | /library/metadata/44288/art/1736487993 |
|
| `grandparentSlug` | *Optional\<String>* | :heavy_minus_sign: | The slug for the grandparent media item. | alice-in-borderland-2020 |
|
||||||
| `theme` | *Optional\<String>* | :heavy_minus_sign: | URL of the theme image. | /library/metadata/44288/theme/1736487993 |
|
| `grandparentKey` | *Optional\<String>* | :heavy_minus_sign: | The key of the grandparent media item. | /library/metadata/66 |
|
||||||
| `duration` | *int* | :heavy_check_mark: | Duration of the content in milliseconds. | 2700000 |
|
| `parentKey` | *Optional\<String>* | :heavy_minus_sign: | The key of the parent media item. | /library/metadata/66 |
|
||||||
| `originallyAvailableAt` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | The original release date. | 2015-02-08 |
|
| `grandparentTitle` | *Optional\<String>* | :heavy_minus_sign: | The title of the grandparent media item. | Caprica |
|
||||||
| `leafCount` | *Optional\<Long>* | :heavy_minus_sign: | The total number of episodes (or leaves). | 63 |
|
| `grandparentThumb` | *Optional\<String>* | :heavy_minus_sign: | The thumbnail URL for the grandparent media item. | /library/metadata/66/thumb/1705716261 |
|
||||||
| `viewedLeafCount` | *Optional\<Long>* | :heavy_minus_sign: | The number of episodes that have been viewed. | 4 |
|
| `grandparentTheme` | *Optional\<String>* | :heavy_minus_sign: | The theme URL for the grandparent media item. | /library/metadata/66/theme/1705716261 |
|
||||||
| `childCount` | *Optional\<Integer>* | :heavy_minus_sign: | The number of child items. | 6 |
|
| `grandparentArt` | *Optional\<String>* | :heavy_minus_sign: | The art URL for the grandparent media item. | /library/metadata/66/art/1705716261 |
|
||||||
| `addedAt` | *long* | :heavy_check_mark: | N/A | 1556281940 |
|
| `parentTitle` | *Optional\<String>* | :heavy_minus_sign: | The title of the parent media item. | Caprica |
|
||||||
| `updatedAt` | *long* | :heavy_check_mark: | N/A | 1556281940 |
|
| `parentIndex` | *Optional\<Integer>* | :heavy_minus_sign: | The index position of the parent media item. | 1 |
|
||||||
| `audienceRatingImage` | *Optional\<String>* | :heavy_minus_sign: | The URL for the audience rating image. | themoviedb://image.rating |
|
| `parentThumb` | *Optional\<String>* | :heavy_minus_sign: | The thumbnail URL for the parent media item. | /library/metadata/66/thumb/1705716261 |
|
||||||
| `parentIndex` | *Optional\<Long>* | :heavy_minus_sign: | The index number of the parent entity, which could indicate its order or position. | 2 |
|
| `ratingImage` | *Optional\<String>* | :heavy_minus_sign: | The URL for the rating image. | rottentomatoes://image.rating.ripe |
|
||||||
| `parentThumb` | *Optional\<String>* | :heavy_minus_sign: | The URL of the parent's thumbnail image. | /library/metadata/48047/thumb/1671800243 |
|
| `viewCount` | *Optional\<Integer>* | :heavy_minus_sign: | The number of times this media item has been viewed. | 1 |
|
||||||
| `grandparentThumb` | *Optional\<String>* | :heavy_minus_sign: | The URL of the grandparent's thumbnail image. | /library/metadata/45520/thumb/1736488003 |
|
| `viewOffset` | *Optional\<Integer>* | :heavy_minus_sign: | The current playback offset (in milliseconds). | 5222500 |
|
||||||
| `grandparentArt` | *Optional\<String>* | :heavy_minus_sign: | The URL of the grandparent's art image. | /library/metadata/45520/art/1736488003 |
|
| `skipCount` | *Optional\<Integer>* | :heavy_minus_sign: | The number of times this media item has been skipped. | 1 |
|
||||||
| `media` | List\<[GetMediaMetaDataMedia](../../models/operations/GetMediaMetaDataMedia.md)> | :heavy_minus_sign: | N/A | |
|
| `subtype` | *Optional\<String>* | :heavy_minus_sign: | A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. | clip |
|
||||||
| `image` | List\<[GetMediaMetaDataImage](../../models/operations/GetMediaMetaDataImage.md)> | :heavy_check_mark: | An array of image objects. | |
|
| `lastRatedAt` | *Optional\<Long>* | :heavy_minus_sign: | The Unix timestamp representing the last time the item was rated. | 1721813113 |
|
||||||
| `ultraBlurColors` | [GetMediaMetaDataUltraBlurColors](../../models/operations/GetMediaMetaDataUltraBlurColors.md) | :heavy_check_mark: | N/A | |
|
| `createdAtAccuracy` | *Optional\<String>* | :heavy_minus_sign: | The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). | epoch,local |
|
||||||
| `genre` | List\<[GetMediaMetaDataGenre](../../models/operations/GetMediaMetaDataGenre.md)> | :heavy_minus_sign: | An array of genre tags. | |
|
| `createdAtTZOffset` | *Optional\<String>* | :heavy_minus_sign: | The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. | 0 |
|
||||||
| `country` | List\<[GetMediaMetaDataCountry](../../models/operations/GetMediaMetaDataCountry.md)> | :heavy_minus_sign: | An array of country tags. | |
|
| `lastViewedAt` | *Optional\<Integer>* | :heavy_minus_sign: | Unix timestamp for when the media item was last viewed. | 1682752242 |
|
||||||
| `guids` | List\<[GetMediaMetaDataGuids](../../models/operations/GetMediaMetaDataGuids.md)> | :heavy_minus_sign: | An array of GUID objects. | |
|
| `userRating` | *Optional\<Float>* | :heavy_minus_sign: | The rating provided by a user for the item. This value is expressed as a decimal number. | 10 |
|
||||||
| `ratings` | List\<[Ratings](../../models/operations/Ratings.md)> | :heavy_minus_sign: | An array of rating objects. | |
|
| `image` | List\<[GetMediaMetaDataImage](../../models/operations/GetMediaMetaDataImage.md)> | :heavy_minus_sign: | N/A | |
|
||||||
| `role` | List\<[GetMediaMetaDataRole](../../models/operations/GetMediaMetaDataRole.md)> | :heavy_minus_sign: | An array of Actor roles. | |
|
| `ultraBlurColors` | [Optional\<GetMediaMetaDataUltraBlurColors>](../../models/operations/GetMediaMetaDataUltraBlurColors.md) | :heavy_minus_sign: | N/A | |
|
||||||
| `director` | List\<[GetMediaMetaDataDirector](../../models/operations/GetMediaMetaDataDirector.md)> | :heavy_minus_sign: | An array of Director roles. | |
|
| `librarySectionID` | *long* | :heavy_check_mark: | The identifier for the library section. | 1 |
|
||||||
| `writer` | List\<[GetMediaMetaDataWriter](../../models/operations/GetMediaMetaDataWriter.md)> | :heavy_minus_sign: | An array of Writer roles. | |
|
| `librarySectionTitle` | *String* | :heavy_check_mark: | The title of the library section. | Movies |
|
||||||
| `producer` | List\<[GetMediaMetaDataProducer](../../models/operations/GetMediaMetaDataProducer.md)> | :heavy_minus_sign: | An array of Writer roles. | |
|
| `librarySectionKey` | *String* | :heavy_check_mark: | The key corresponding to the library section. | /library/sections/1 |
|
||||||
| `similar` | List\<[GetMediaMetaDataSimilar](../../models/operations/GetMediaMetaDataSimilar.md)> | :heavy_minus_sign: | An array of similar content objects. | |
|
| `media` | List\<[GetMediaMetaDataMedia](../../models/operations/GetMediaMetaDataMedia.md)> | :heavy_minus_sign: | N/A | |
|
||||||
| `location` | List\<[GetMediaMetaDataLocation](../../models/operations/GetMediaMetaDataLocation.md)> | :heavy_minus_sign: | An array of location objects. | |
|
| `genre` | List\<[GetMediaMetaDataGenre](../../models/operations/GetMediaMetaDataGenre.md)> | :heavy_minus_sign: | N/A | |
|
||||||
|
| `country` | List\<[GetMediaMetaDataCountry](../../models/operations/GetMediaMetaDataCountry.md)> | :heavy_minus_sign: | N/A | |
|
||||||
|
| `director` | List\<[GetMediaMetaDataDirector](../../models/operations/GetMediaMetaDataDirector.md)> | :heavy_minus_sign: | N/A | |
|
||||||
|
| `writer` | List\<[GetMediaMetaDataWriter](../../models/operations/GetMediaMetaDataWriter.md)> | :heavy_minus_sign: | N/A | |
|
||||||
|
| `producer` | List\<[GetMediaMetaDataProducer](../../models/operations/GetMediaMetaDataProducer.md)> | :heavy_minus_sign: | N/A | |
|
||||||
|
| `role` | List\<[GetMediaMetaDataRole](../../models/operations/GetMediaMetaDataRole.md)> | :heavy_minus_sign: | N/A | |
|
||||||
|
| `guids` | List\<[GetMediaMetaDataGuids](../../models/operations/GetMediaMetaDataGuids.md)> | :heavy_minus_sign: | N/A | |
|
||||||
|
| `ratings` | List\<[Ratings](../../models/operations/Ratings.md)> | :heavy_minus_sign: | N/A | |
|
||||||
|
| `similar` | List\<[GetMediaMetaDataSimilar](../../models/operations/GetMediaMetaDataSimilar.md)> | :heavy_minus_sign: | N/A | |
|
||||||
|
| `location` | List\<[GetMediaMetaDataLocation](../../models/operations/GetMediaMetaDataLocation.md)> | :heavy_minus_sign: | N/A | |
|
||||||
|
| `chapter` | List\<[Chapter](../../models/operations/Chapter.md)> | :heavy_minus_sign: | N/A | |
|
||||||
|
| `marker` | List\<[Marker](../../models/operations/Marker.md)> | :heavy_minus_sign: | N/A | |
|
||||||
|
| `extras` | [Optional\<Extras>](../../models/operations/Extras.md) | :heavy_minus_sign: | N/A | |
|
||||||
@@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
|
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
||||||
| `id` | *long* | :heavy_check_mark: | The unique role identifier. | 109501 |
|
| `id` | *long* | :heavy_check_mark: | Unique identifier for the actor or role. | 126522 |
|
||||||
| `filter` | *String* | :heavy_check_mark: | The filter string for the role. | actor=109501 |
|
| `tag` | *String* | :heavy_check_mark: | The display tag for the actor (typically the actor's name). | Teller |
|
||||||
| `tag` | *String* | :heavy_check_mark: | The actor's name. | Bob Odenkirk |
|
| `role` | *Optional\<String>* | :heavy_minus_sign: | The role played by the actor in the media item. | Self - Judge |
|
||||||
| `tagKey` | *String* | :heavy_check_mark: | A key associated with the actor tag. | 5d77683254f42c001f8c3f69 |
|
| `filter` | *String* | :heavy_check_mark: | The filter string used to query this actor. For example, it may indicate that this is an actor with a given key. | actor=126522 |
|
||||||
| `role` | *Optional\<String>* | :heavy_minus_sign: | The character name or role. | Jimmy McGill |
|
| `tagKey` | *Optional\<String>* | :heavy_minus_sign: | A unique key associated with the actor's tag, used for internal identification. | 5d77683d85719b001f3a535e |
|
||||||
| `thumb` | *Optional\<String>* | :heavy_minus_sign: | URL for the role thumbnail image. | https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg |
|
| `thumb` | *Optional\<String>* | :heavy_minus_sign: | The URL of the thumbnail image for the actor. | https://metadata-static.plex.tv/7/people/708568fd018d7aa8b1032dcf867747e8.jpg |
|
||||||
@@ -3,54 +3,56 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
|
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
|
||||||
| `id` | *long* | :heavy_check_mark: | Unique stream identifier. | 1002625 |
|
| `id` | *long* | :heavy_check_mark: | Unique stream identifier. | 1002625 |
|
||||||
| `streamType` | *int* | :heavy_check_mark: | Stream type (1=video, 2=audio, 3=subtitle). | 1 |
|
| `streamType` | [GetMediaMetaDataStreamType](../../models/operations/GetMediaMetaDataStreamType.md) | :heavy_check_mark: | Stream type:<br/> - 1 = video<br/> - 2 = audio<br/> - 3 = subtitle<br/> | 1 |
|
||||||
| `default_` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if this stream is default. | true |
|
| `format` | *Optional\<String>* | :heavy_minus_sign: | Format of the stream (e.g., srt). | srt |
|
||||||
| `codec` | *String* | :heavy_check_mark: | Codec used by the stream. | hevc |
|
| `default_` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if this stream is default. | true |
|
||||||
| `index` | *int* | :heavy_check_mark: | Index of the stream. | 0 |
|
| `codec` | *String* | :heavy_check_mark: | Codec used by the stream. | hevc |
|
||||||
| `bitrate` | *Optional\<Integer>* | :heavy_minus_sign: | Bitrate of the stream. | 24743 |
|
| `index` | *Optional\<Integer>* | :heavy_minus_sign: | Index of the stream. | 0 |
|
||||||
| `language` | *Optional\<String>* | :heavy_minus_sign: | Language of the stream. | English |
|
| `bitrate` | *Optional\<Integer>* | :heavy_minus_sign: | Bitrate of the stream. | 24743 |
|
||||||
| `languageTag` | *Optional\<String>* | :heavy_minus_sign: | Language tag (e.g., en). | en |
|
| `language` | *Optional\<String>* | :heavy_minus_sign: | Language of the stream. | English |
|
||||||
| `languageCode` | *Optional\<String>* | :heavy_minus_sign: | ISO language code. | eng |
|
| `languageTag` | *Optional\<String>* | :heavy_minus_sign: | Language tag (e.g., en). | en |
|
||||||
| `headerCompression` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates whether header compression is enabled. | true |
|
| `languageCode` | *Optional\<String>* | :heavy_minus_sign: | ISO language code. | eng |
|
||||||
| `doviblCompatID` | *Optional\<Integer>* | :heavy_minus_sign: | Dolby Vision BL compatibility ID. | 1 |
|
| `headerCompression` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates whether header compression is enabled. | true |
|
||||||
| `doviblPresent` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if Dolby Vision BL is present. | true |
|
| `doviblCompatID` | *Optional\<Integer>* | :heavy_minus_sign: | Dolby Vision BL compatibility ID. | 1 |
|
||||||
| `dovielPresent` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if Dolby Vision EL is present. | false |
|
| `doviblPresent` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if Dolby Vision BL is present. | true |
|
||||||
| `doviLevel` | *Optional\<Integer>* | :heavy_minus_sign: | Dolby Vision level. | 6 |
|
| `dovielPresent` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if Dolby Vision EL is present. | false |
|
||||||
| `doviPresent` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if Dolby Vision is present. | true |
|
| `doviLevel` | *Optional\<Integer>* | :heavy_minus_sign: | Dolby Vision level. | 6 |
|
||||||
| `doviProfile` | *Optional\<Integer>* | :heavy_minus_sign: | Dolby Vision profile. | 8 |
|
| `doviPresent` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if Dolby Vision is present. | true |
|
||||||
| `dovirpuPresent` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if Dolby Vision RPU is present. | true |
|
| `doviProfile` | *Optional\<Integer>* | :heavy_minus_sign: | Dolby Vision profile. | 8 |
|
||||||
| `doviVersion` | *Optional\<String>* | :heavy_minus_sign: | Dolby Vision version. | 1.0 |
|
| `dovirpuPresent` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if Dolby Vision RPU is present. | true |
|
||||||
| `bitDepth` | *Optional\<Integer>* | :heavy_minus_sign: | Bit depth of the video stream. | 10 |
|
| `doviVersion` | *Optional\<String>* | :heavy_minus_sign: | Dolby Vision version. | 1.0 |
|
||||||
| `chromaLocation` | *Optional\<String>* | :heavy_minus_sign: | Chroma sample location. | topleft |
|
| `bitDepth` | *Optional\<Integer>* | :heavy_minus_sign: | Bit depth of the video stream. | 10 |
|
||||||
| `chromaSubsampling` | *Optional\<String>* | :heavy_minus_sign: | Chroma subsampling format. | 4:2:0 |
|
| `chromaLocation` | *Optional\<String>* | :heavy_minus_sign: | Chroma sample location. | topleft |
|
||||||
| `codedHeight` | *Optional\<Integer>* | :heavy_minus_sign: | Coded video height. | 1608 |
|
| `chromaSubsampling` | *Optional\<String>* | :heavy_minus_sign: | Chroma subsampling format. | 4:2:0 |
|
||||||
| `codedWidth` | *Optional\<Integer>* | :heavy_minus_sign: | Coded video width. | 3840 |
|
| `codedHeight` | *Optional\<Integer>* | :heavy_minus_sign: | Coded video height. | 1608 |
|
||||||
| `closedCaptions` | *Optional\<Boolean>* | :heavy_minus_sign: | N/A | true |
|
| `codedWidth` | *Optional\<Integer>* | :heavy_minus_sign: | Coded video width. | 3840 |
|
||||||
| `colorPrimaries` | *Optional\<String>* | :heavy_minus_sign: | Color primaries used. | bt2020 |
|
| `closedCaptions` | *Optional\<Boolean>* | :heavy_minus_sign: | N/A | true |
|
||||||
| `colorRange` | *Optional\<String>* | :heavy_minus_sign: | Color range (e.g., tv). | tv |
|
| `colorPrimaries` | *Optional\<String>* | :heavy_minus_sign: | Color primaries used. | bt2020 |
|
||||||
| `colorSpace` | *Optional\<String>* | :heavy_minus_sign: | Color space. | bt2020nc |
|
| `colorRange` | *Optional\<String>* | :heavy_minus_sign: | Color range (e.g., tv). | tv |
|
||||||
| `colorTrc` | *Optional\<String>* | :heavy_minus_sign: | Color transfer characteristics. | smpte2084 |
|
| `colorSpace` | *Optional\<String>* | :heavy_minus_sign: | Color space. | bt2020nc |
|
||||||
| `frameRate` | *Optional\<Float>* | :heavy_minus_sign: | Frame rate of the stream. | 23.976 |
|
| `colorTrc` | *Optional\<String>* | :heavy_minus_sign: | Color transfer characteristics. | smpte2084 |
|
||||||
| `height` | *Optional\<Integer>* | :heavy_minus_sign: | Height of the video stream. | 1602 |
|
| `frameRate` | *Optional\<Float>* | :heavy_minus_sign: | Frame rate of the stream. | 23.976 |
|
||||||
| `level` | *Optional\<Integer>* | :heavy_minus_sign: | Video level. | 150 |
|
| `key` | *Optional\<String>* | :heavy_minus_sign: | Key to access this stream part. | /library/streams/216389 |
|
||||||
| `original` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if this is the original stream. | true |
|
| `height` | *Optional\<Integer>* | :heavy_minus_sign: | Height of the video stream. | 1602 |
|
||||||
| `hasScalingMatrix` | *Optional\<Boolean>* | :heavy_minus_sign: | N/A | false |
|
| `level` | *Optional\<Integer>* | :heavy_minus_sign: | Video level. | 150 |
|
||||||
| `profile` | *Optional\<String>* | :heavy_minus_sign: | Video profile. | main 10 |
|
| `original` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if this is the original stream. | true |
|
||||||
| `scanType` | *Optional\<String>* | :heavy_minus_sign: | N/A | progressive |
|
| `hasScalingMatrix` | *Optional\<Boolean>* | :heavy_minus_sign: | N/A | false |
|
||||||
| `embeddedInVideo` | *Optional\<String>* | :heavy_minus_sign: | N/A | progressive |
|
| `profile` | *Optional\<String>* | :heavy_minus_sign: | Video profile. | main 10 |
|
||||||
| `refFrames` | *Optional\<Integer>* | :heavy_minus_sign: | Number of reference frames. | 1 |
|
| `scanType` | *Optional\<String>* | :heavy_minus_sign: | N/A | progressive |
|
||||||
| `width` | *Optional\<Integer>* | :heavy_minus_sign: | Width of the video stream. | 3840 |
|
| `embeddedInVideo` | *Optional\<String>* | :heavy_minus_sign: | N/A | progressive |
|
||||||
| `displayTitle` | *String* | :heavy_check_mark: | Display title for the stream. | 4K DoVi/HDR10 (HEVC Main 10) |
|
| `refFrames` | *Optional\<Integer>* | :heavy_minus_sign: | Number of reference frames. | 1 |
|
||||||
| `extendedDisplayTitle` | *String* | :heavy_check_mark: | Extended display title for the stream. | 4K DoVi/HDR10 (HEVC Main 10) |
|
| `width` | *Optional\<Integer>* | :heavy_minus_sign: | Width of the video stream. | 3840 |
|
||||||
| `selected` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if this stream is selected (applicable for audio streams). | true |
|
| `displayTitle` | *String* | :heavy_check_mark: | Display title for the stream. | 4K DoVi/HDR10 (HEVC Main 10) |
|
||||||
| `forced` | *Optional\<Boolean>* | :heavy_minus_sign: | N/A | true |
|
| `extendedDisplayTitle` | *String* | :heavy_check_mark: | Extended display title for the stream. | 4K DoVi/HDR10 (HEVC Main 10) |
|
||||||
| `channels` | *Optional\<Integer>* | :heavy_minus_sign: | Number of audio channels (for audio streams). | 6 |
|
| `selected` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if this stream is selected (applicable for audio streams). | true |
|
||||||
| `audioChannelLayout` | *Optional\<String>* | :heavy_minus_sign: | Audio channel layout. | 5.1(side) |
|
| `forced` | *Optional\<Boolean>* | :heavy_minus_sign: | N/A | true |
|
||||||
| `samplingRate` | *Optional\<Integer>* | :heavy_minus_sign: | Sampling rate for the audio stream. | 48000 |
|
| `channels` | *Optional\<Integer>* | :heavy_minus_sign: | Number of audio channels (for audio streams). | 6 |
|
||||||
| `canAutoSync` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if the stream can auto-sync. | false |
|
| `audioChannelLayout` | *Optional\<String>* | :heavy_minus_sign: | Audio channel layout. | 5.1(side) |
|
||||||
| `hearingImpaired` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if the stream is for the hearing impaired. | true |
|
| `samplingRate` | *Optional\<Integer>* | :heavy_minus_sign: | Sampling rate for the audio stream. | 48000 |
|
||||||
| `dub` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if the stream is a dub. | true |
|
| `canAutoSync` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if the stream can auto-sync. | false |
|
||||||
| `title` | *Optional\<String>* | :heavy_minus_sign: | Optional title for the stream (e.g., language variant). | SDH |
|
| `hearingImpaired` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if the stream is for the hearing impaired. | true |
|
||||||
|
| `dub` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if the stream is a dub. | true |
|
||||||
|
| `title` | *Optional\<String>* | :heavy_minus_sign: | Optional title for the stream (e.g., language variant). | SDH |
|
||||||
16
docs/models/operations/GetMediaMetaDataStreamType.md
Normal file
16
docs/models/operations/GetMediaMetaDataStreamType.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# GetMediaMetaDataStreamType
|
||||||
|
|
||||||
|
Stream type:
|
||||||
|
- 1 = video
|
||||||
|
- 2 = audio
|
||||||
|
- 3 = subtitle
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ---------- | ---------- |
|
||||||
|
| `Video` | 1 |
|
||||||
|
| `Audio` | 2 |
|
||||||
|
| `Subtitle` | 3 |
|
||||||
16
docs/models/operations/GetMediaMetaDataType.md
Normal file
16
docs/models/operations/GetMediaMetaDataType.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# GetMediaMetaDataType
|
||||||
|
|
||||||
|
The type of media content
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| --------- | --------- |
|
||||||
|
| `Movie` | movie |
|
||||||
|
| `TvShow` | show |
|
||||||
|
| `Season` | season |
|
||||||
|
| `Episode` | episode |
|
||||||
|
| `Artist` | artist |
|
||||||
|
| `Album` | album |
|
||||||
@@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- |
|
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
| `topLeft` | *String* | :heavy_check_mark: | The top-left color value. | 11333a |
|
| `topLeft` | *String* | :heavy_check_mark: | N/A | 11333b |
|
||||||
| `topRight` | *String* | :heavy_check_mark: | The top-right color value. | 1d2721 |
|
| `topRight` | *String* | :heavy_check_mark: | N/A | 0a232d |
|
||||||
| `bottomRight` | *String* | :heavy_check_mark: | The bottom-right color value. | 5c451d |
|
| `bottomRight` | *String* | :heavy_check_mark: | N/A | 73958 |
|
||||||
| `bottomLeft` | *String* | :heavy_check_mark: | The bottom-left color value. | 372c10 |
|
| `bottomLeft` | *String* | :heavy_check_mark: | N/A | 1f5066 |
|
||||||
@@ -3,11 +3,10 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
|
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
|
||||||
| `id` | *long* | :heavy_check_mark: | The unique role identifier. | 109501 |
|
| `id` | *int* | :heavy_check_mark: | Unique identifier for the writer. | 126522 |
|
||||||
| `filter` | *String* | :heavy_check_mark: | The filter string for the role. | actor=109501 |
|
| `tag` | *String* | :heavy_check_mark: | The role of Writer | Jamie P. Hanson |
|
||||||
| `tag` | *String* | :heavy_check_mark: | The actor's name. | Bob Odenkirk |
|
| `filter` | *String* | :heavy_check_mark: | The filter string used to query this writer. | writer=126522 |
|
||||||
| `tagKey` | *String* | :heavy_check_mark: | A key associated with the actor tag. | 5d77683254f42c001f8c3f69 |
|
| `thumb` | *Optional\<String>* | :heavy_minus_sign: | The URL of the thumbnail image for the writer. | https://metadata-static.plex.tv/8/people/8d65fa96804802e08f2de09fe014408e.jpg |
|
||||||
| `role` | *Optional\<String>* | :heavy_minus_sign: | The character name or role. | Jimmy McGill |
|
| `tagKey` | *Optional\<String>* | :heavy_minus_sign: | A unique key associated with the writers tag, used for internal identification. | 5d77683d85719b001f3a535e |
|
||||||
| `thumb` | *Optional\<String>* | :heavy_minus_sign: | URL for the role thumbnail image. | https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg |
|
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| 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/> | |
|
| `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 |
|
| `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 |
|
| `source` | *String* | :heavy_check_mark: | a string indicating the source of the message. | Postman |
|
||||||
15
docs/models/operations/Marker.md
Normal file
15
docs/models/operations/Marker.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Marker
|
||||||
|
|
||||||
|
The final status of the marker
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
|
||||||
|
| `id` | *long* | :heavy_check_mark: | N/A | 306970 |
|
||||||
|
| `type` | *String* | :heavy_check_mark: | N/A | credits |
|
||||||
|
| `startTimeOffset` | *long* | :heavy_check_mark: | N/A | 4176050 |
|
||||||
|
| `endTimeOffset` | *long* | :heavy_check_mark: | N/A | 4393389 |
|
||||||
|
| `final_` | *Optional\<Boolean>* | :heavy_minus_sign: | N/A | true |
|
||||||
|
| `attributes` | [Optional\<Attributes>](../../models/operations/Attributes.md) | :heavy_minus_sign: | Attributes associated with the marker. | |
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
||||||
| `id` | *long* | :heavy_check_mark: | Unique identifier for the producer. | 126522 |
|
| `id` | *int* | :heavy_check_mark: | Unique identifier for the producer. | 126522 |
|
||||||
| `filter` | *String* | :heavy_check_mark: | The filter string used to query this producer. | producer=126522 |
|
| `filter` | *String* | :heavy_check_mark: | The filter string used to query this producer. | producer=126522 |
|
||||||
| `tag` | *String* | :heavy_check_mark: | The name of the producer | Amelia Knapp |
|
| `tag` | *String* | :heavy_check_mark: | The name of the producer | Amelia Knapp |
|
||||||
| `tagKey` | *Optional\<String>* | :heavy_minus_sign: | A unique key associated with the producer's tag, used for internal identification. | 5d77683d85719b001f3a535e |
|
| `tagKey` | *Optional\<String>* | :heavy_minus_sign: | A unique key associated with the producer's tag, used for internal identification. | 5d77683d85719b001f3a535e |
|
||||||
|
|||||||
@@ -6,10 +6,11 @@
|
|||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
|
| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
|
||||||
| `id` | *long* | :heavy_check_mark: | Unique stream identifier. | 1002625 |
|
| `id` | *long* | :heavy_check_mark: | Unique stream identifier. | 1002625 |
|
||||||
| `streamType` | *int* | :heavy_check_mark: | Stream type (1=video, 2=audio, 3=subtitle). | 1 |
|
| `streamType` | [StreamType](../../models/operations/StreamType.md) | :heavy_check_mark: | Stream type:<br/> - 1 = video<br/> - 2 = audio<br/> - 3 = subtitle<br/> | 1 |
|
||||||
|
| `format` | *Optional\<String>* | :heavy_minus_sign: | Format of the stream (e.g., srt). | srt |
|
||||||
| `default_` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if this stream is default. | true |
|
| `default_` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if this stream is default. | true |
|
||||||
| `codec` | *String* | :heavy_check_mark: | Codec used by the stream. | hevc |
|
| `codec` | *String* | :heavy_check_mark: | Codec used by the stream. | hevc |
|
||||||
| `index` | *int* | :heavy_check_mark: | Index of the stream. | 0 |
|
| `index` | *Optional\<Integer>* | :heavy_minus_sign: | Index of the stream. | 0 |
|
||||||
| `bitrate` | *Optional\<Integer>* | :heavy_minus_sign: | Bitrate of the stream. | 24743 |
|
| `bitrate` | *Optional\<Integer>* | :heavy_minus_sign: | Bitrate of the stream. | 24743 |
|
||||||
| `language` | *Optional\<String>* | :heavy_minus_sign: | Language of the stream. | English |
|
| `language` | *Optional\<String>* | :heavy_minus_sign: | Language of the stream. | English |
|
||||||
| `languageTag` | *Optional\<String>* | :heavy_minus_sign: | Language tag (e.g., en). | en |
|
| `languageTag` | *Optional\<String>* | :heavy_minus_sign: | Language tag (e.g., en). | en |
|
||||||
@@ -34,6 +35,7 @@
|
|||||||
| `colorSpace` | *Optional\<String>* | :heavy_minus_sign: | Color space. | bt2020nc |
|
| `colorSpace` | *Optional\<String>* | :heavy_minus_sign: | Color space. | bt2020nc |
|
||||||
| `colorTrc` | *Optional\<String>* | :heavy_minus_sign: | Color transfer characteristics. | smpte2084 |
|
| `colorTrc` | *Optional\<String>* | :heavy_minus_sign: | Color transfer characteristics. | smpte2084 |
|
||||||
| `frameRate` | *Optional\<Float>* | :heavy_minus_sign: | Frame rate of the stream. | 23.976 |
|
| `frameRate` | *Optional\<Float>* | :heavy_minus_sign: | Frame rate of the stream. | 23.976 |
|
||||||
|
| `key` | *Optional\<String>* | :heavy_minus_sign: | Key to access this stream part. | /library/streams/216389 |
|
||||||
| `height` | *Optional\<Integer>* | :heavy_minus_sign: | Height of the video stream. | 1602 |
|
| `height` | *Optional\<Integer>* | :heavy_minus_sign: | Height of the video stream. | 1602 |
|
||||||
| `level` | *Optional\<Integer>* | :heavy_minus_sign: | Video level. | 150 |
|
| `level` | *Optional\<Integer>* | :heavy_minus_sign: | Video level. | 150 |
|
||||||
| `original` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if this is the original stream. | true |
|
| `original` | *Optional\<Boolean>* | :heavy_minus_sign: | Indicates if this is the original stream. | true |
|
||||||
|
|||||||
16
docs/models/operations/StreamType.md
Normal file
16
docs/models/operations/StreamType.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# StreamType
|
||||||
|
|
||||||
|
Stream type:
|
||||||
|
- 1 = video
|
||||||
|
- 2 = audio
|
||||||
|
- 3 = subtitle
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ---------- | ---------- |
|
||||||
|
| `Video` | 1 |
|
||||||
|
| `Audio` | 2 |
|
||||||
|
| `Subtitle` | 3 |
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| 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 |
|
| `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/> | |
|
| `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 |
|
| `sectionID` | *long* | :heavy_check_mark: | Possibly the section ID to upload the playlist to, we are not certain. | 1 |
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
|
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
|
||||||
| `id` | *long* | :heavy_check_mark: | Unique identifier for the writer. | 126522 |
|
| `id` | *int* | :heavy_check_mark: | Unique identifier for the writer. | 126522 |
|
||||||
| `filter` | *String* | :heavy_check_mark: | The filter string used to query this writer. | writer=126522 |
|
| `filter` | *String* | :heavy_check_mark: | The filter string used to query this writer. | writer=126522 |
|
||||||
| `tag` | *String* | :heavy_check_mark: | The role of Writer | Jamie P. Hanson |
|
| `tag` | *String* | :heavy_check_mark: | The role of Writer | Jamie P. Hanson |
|
||||||
| `tagKey` | *Optional\<String>* | :heavy_minus_sign: | A unique key associated with the writers tag, used for internal identification. | 5d77683d85719b001f3a535e |
|
| `tagKey` | *Optional\<String>* | :heavy_minus_sign: | A unique key associated with the writers tag, used for internal identification. | 5d77683d85719b001f3a535e |
|
||||||
@@ -279,10 +279,10 @@ public class Application {
|
|||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Parameter | Type | Required | Description | Example |
|
| 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/> | |
|
| `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 |
|
| `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
|
### Response
|
||||||
|
|
||||||
|
|||||||
@@ -50,11 +50,11 @@ public class Application {
|
|||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Parameter | Type | Required | Description | Example |
|
| 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/> | |
|
| `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 |
|
| `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 |
|
| `source` | *String* | :heavy_check_mark: | a string indicating the source of the message. | Postman |
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|
||||||
|
|||||||
@@ -499,11 +499,11 @@ public class Application {
|
|||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Parameter | Type | Required | Description | Example |
|
| 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 |
|
| `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/> | |
|
| `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 |
|
| `sectionID` | *long* | :heavy_check_mark: | Possibly the section ID to upload the playlist to, we are not certain. | 1 |
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
groupId=dev.plexapi
|
groupId=dev.plexapi
|
||||||
artifactId=plexapi
|
artifactId=plexapi
|
||||||
version=0.15.0
|
version=0.16.1
|
||||||
@@ -42,8 +42,8 @@ class SDKConfiguration {
|
|||||||
} };
|
} };
|
||||||
private static final String LANGUAGE = "java";
|
private static final String LANGUAGE = "java";
|
||||||
public static final String OPENAPI_DOC_VERSION = "0.0.3";
|
public static final String OPENAPI_DOC_VERSION = "0.0.3";
|
||||||
public static final String SDK_VERSION = "0.15.0";
|
public static final String SDK_VERSION = "0.16.1";
|
||||||
public static final String GEN_VERSION = "2.570.4";
|
public static final String GEN_VERSION = "2.595.4";
|
||||||
private static final String BASE_PACKAGE = "dev.plexapi.sdk";
|
private static final String BASE_PACKAGE = "dev.plexapi.sdk";
|
||||||
public static final String USER_AGENT =
|
public static final String USER_AGENT =
|
||||||
String.format("speakeasy-sdk/%s %s %s %s %s",
|
String.format("speakeasy-sdk/%s %s %s %s %s",
|
||||||
|
|||||||
172
src/main/java/dev/plexapi/sdk/models/operations/Attributes.java
Normal file
172
src/main/java/dev/plexapi/sdk/models/operations/Attributes.java
Normal file
@@ -0,0 +1,172 @@
|
|||||||
|
/*
|
||||||
|
* 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.Long;
|
||||||
|
import java.lang.Override;
|
||||||
|
import java.lang.String;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attributes
|
||||||
|
*
|
||||||
|
* <p>Attributes associated with the marker.
|
||||||
|
*/
|
||||||
|
public class Attributes {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The identifier for the attributes.
|
||||||
|
*/
|
||||||
|
@JsonProperty("id")
|
||||||
|
private long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The version number of the marker attributes.
|
||||||
|
*/
|
||||||
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
|
@JsonProperty("version")
|
||||||
|
private Optional<Long> version;
|
||||||
|
|
||||||
|
@JsonCreator
|
||||||
|
public Attributes(
|
||||||
|
@JsonProperty("id") long id,
|
||||||
|
@JsonProperty("version") Optional<Long> version) {
|
||||||
|
Utils.checkNotNull(id, "id");
|
||||||
|
Utils.checkNotNull(version, "version");
|
||||||
|
this.id = id;
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Attributes(
|
||||||
|
long id) {
|
||||||
|
this(id, Optional.empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The identifier for the attributes.
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public long id() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The version number of the marker attributes.
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public Optional<Long> version() {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final static Builder builder() {
|
||||||
|
return new Builder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The identifier for the attributes.
|
||||||
|
*/
|
||||||
|
public Attributes withId(long id) {
|
||||||
|
Utils.checkNotNull(id, "id");
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The version number of the marker attributes.
|
||||||
|
*/
|
||||||
|
public Attributes withVersion(long version) {
|
||||||
|
Utils.checkNotNull(version, "version");
|
||||||
|
this.version = Optional.ofNullable(version);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The version number of the marker attributes.
|
||||||
|
*/
|
||||||
|
public Attributes withVersion(Optional<Long> version) {
|
||||||
|
Utils.checkNotNull(version, "version");
|
||||||
|
this.version = version;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Attributes other = (Attributes) o;
|
||||||
|
return
|
||||||
|
Objects.deepEquals(this.id, other.id) &&
|
||||||
|
Objects.deepEquals(this.version, other.version);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(
|
||||||
|
id,
|
||||||
|
version);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return Utils.toString(Attributes.class,
|
||||||
|
"id", id,
|
||||||
|
"version", version);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final static class Builder {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private Optional<Long> version = Optional.empty();
|
||||||
|
|
||||||
|
private Builder() {
|
||||||
|
// force use of static builder() method
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The identifier for the attributes.
|
||||||
|
*/
|
||||||
|
public Builder id(long id) {
|
||||||
|
Utils.checkNotNull(id, "id");
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The version number of the marker attributes.
|
||||||
|
*/
|
||||||
|
public Builder version(long version) {
|
||||||
|
Utils.checkNotNull(version, "version");
|
||||||
|
this.version = Optional.ofNullable(version);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The version number of the marker attributes.
|
||||||
|
*/
|
||||||
|
public Builder version(Optional<Long> version) {
|
||||||
|
Utils.checkNotNull(version, "version");
|
||||||
|
this.version = version;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Attributes build() {
|
||||||
|
return new Attributes(
|
||||||
|
id,
|
||||||
|
version);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
237
src/main/java/dev/plexapi/sdk/models/operations/Chapter.java
Normal file
237
src/main/java/dev/plexapi/sdk/models/operations/Chapter.java
Normal file
@@ -0,0 +1,237 @@
|
|||||||
|
/*
|
||||||
|
* 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.Long;
|
||||||
|
import java.lang.Override;
|
||||||
|
import java.lang.String;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Chapter
|
||||||
|
*
|
||||||
|
* <p>The thumbnail for the chapter
|
||||||
|
*/
|
||||||
|
public class Chapter {
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
private long id;
|
||||||
|
|
||||||
|
@JsonProperty("filter")
|
||||||
|
private String filter;
|
||||||
|
|
||||||
|
@JsonProperty("index")
|
||||||
|
private long index;
|
||||||
|
|
||||||
|
@JsonProperty("startTimeOffset")
|
||||||
|
private long startTimeOffset;
|
||||||
|
|
||||||
|
@JsonProperty("endTimeOffset")
|
||||||
|
private long endTimeOffset;
|
||||||
|
|
||||||
|
@JsonProperty("thumb")
|
||||||
|
private String thumb;
|
||||||
|
|
||||||
|
@JsonCreator
|
||||||
|
public Chapter(
|
||||||
|
@JsonProperty("id") long id,
|
||||||
|
@JsonProperty("filter") String filter,
|
||||||
|
@JsonProperty("index") long index,
|
||||||
|
@JsonProperty("startTimeOffset") long startTimeOffset,
|
||||||
|
@JsonProperty("endTimeOffset") long endTimeOffset,
|
||||||
|
@JsonProperty("thumb") String thumb) {
|
||||||
|
Utils.checkNotNull(id, "id");
|
||||||
|
Utils.checkNotNull(filter, "filter");
|
||||||
|
Utils.checkNotNull(index, "index");
|
||||||
|
Utils.checkNotNull(startTimeOffset, "startTimeOffset");
|
||||||
|
Utils.checkNotNull(endTimeOffset, "endTimeOffset");
|
||||||
|
Utils.checkNotNull(thumb, "thumb");
|
||||||
|
this.id = id;
|
||||||
|
this.filter = filter;
|
||||||
|
this.index = index;
|
||||||
|
this.startTimeOffset = startTimeOffset;
|
||||||
|
this.endTimeOffset = endTimeOffset;
|
||||||
|
this.thumb = thumb;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public long id() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public String filter() {
|
||||||
|
return filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public long index() {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public long startTimeOffset() {
|
||||||
|
return startTimeOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public long endTimeOffset() {
|
||||||
|
return endTimeOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public String thumb() {
|
||||||
|
return thumb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final static Builder builder() {
|
||||||
|
return new Builder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Chapter withId(long id) {
|
||||||
|
Utils.checkNotNull(id, "id");
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Chapter withFilter(String filter) {
|
||||||
|
Utils.checkNotNull(filter, "filter");
|
||||||
|
this.filter = filter;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Chapter withIndex(long index) {
|
||||||
|
Utils.checkNotNull(index, "index");
|
||||||
|
this.index = index;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Chapter withStartTimeOffset(long startTimeOffset) {
|
||||||
|
Utils.checkNotNull(startTimeOffset, "startTimeOffset");
|
||||||
|
this.startTimeOffset = startTimeOffset;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Chapter withEndTimeOffset(long endTimeOffset) {
|
||||||
|
Utils.checkNotNull(endTimeOffset, "endTimeOffset");
|
||||||
|
this.endTimeOffset = endTimeOffset;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Chapter 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;
|
||||||
|
}
|
||||||
|
Chapter other = (Chapter) o;
|
||||||
|
return
|
||||||
|
Objects.deepEquals(this.id, other.id) &&
|
||||||
|
Objects.deepEquals(this.filter, other.filter) &&
|
||||||
|
Objects.deepEquals(this.index, other.index) &&
|
||||||
|
Objects.deepEquals(this.startTimeOffset, other.startTimeOffset) &&
|
||||||
|
Objects.deepEquals(this.endTimeOffset, other.endTimeOffset) &&
|
||||||
|
Objects.deepEquals(this.thumb, other.thumb);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(
|
||||||
|
id,
|
||||||
|
filter,
|
||||||
|
index,
|
||||||
|
startTimeOffset,
|
||||||
|
endTimeOffset,
|
||||||
|
thumb);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return Utils.toString(Chapter.class,
|
||||||
|
"id", id,
|
||||||
|
"filter", filter,
|
||||||
|
"index", index,
|
||||||
|
"startTimeOffset", startTimeOffset,
|
||||||
|
"endTimeOffset", endTimeOffset,
|
||||||
|
"thumb", thumb);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final static class Builder {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String filter;
|
||||||
|
|
||||||
|
private Long index;
|
||||||
|
|
||||||
|
private Long startTimeOffset;
|
||||||
|
|
||||||
|
private Long endTimeOffset;
|
||||||
|
|
||||||
|
private String thumb;
|
||||||
|
|
||||||
|
private Builder() {
|
||||||
|
// force use of static builder() method
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder id(long id) {
|
||||||
|
Utils.checkNotNull(id, "id");
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder filter(String filter) {
|
||||||
|
Utils.checkNotNull(filter, "filter");
|
||||||
|
this.filter = filter;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder index(long index) {
|
||||||
|
Utils.checkNotNull(index, "index");
|
||||||
|
this.index = index;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder startTimeOffset(long startTimeOffset) {
|
||||||
|
Utils.checkNotNull(startTimeOffset, "startTimeOffset");
|
||||||
|
this.startTimeOffset = startTimeOffset;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder endTimeOffset(long endTimeOffset) {
|
||||||
|
Utils.checkNotNull(endTimeOffset, "endTimeOffset");
|
||||||
|
this.endTimeOffset = endTimeOffset;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder thumb(String thumb) {
|
||||||
|
Utils.checkNotNull(thumb, "thumb");
|
||||||
|
this.thumb = thumb;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Chapter build() {
|
||||||
|
return new Chapter(
|
||||||
|
id,
|
||||||
|
filter,
|
||||||
|
index,
|
||||||
|
startTimeOffset,
|
||||||
|
endTimeOffset,
|
||||||
|
thumb);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
|||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Long;
|
import java.lang.Integer;
|
||||||
import java.lang.Override;
|
import java.lang.Override;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -23,7 +23,7 @@ import java.util.Optional;
|
|||||||
public class Country {
|
public class Country {
|
||||||
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private long id;
|
private int id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The country of origin of this media item
|
* The country of origin of this media item
|
||||||
@@ -37,7 +37,7 @@ public class Country {
|
|||||||
|
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
public Country(
|
public Country(
|
||||||
@JsonProperty("id") long id,
|
@JsonProperty("id") int id,
|
||||||
@JsonProperty("tag") String tag,
|
@JsonProperty("tag") String tag,
|
||||||
@JsonProperty("filter") Optional<String> filter) {
|
@JsonProperty("filter") Optional<String> filter) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
@@ -49,13 +49,13 @@ public class Country {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Country(
|
public Country(
|
||||||
long id,
|
int id,
|
||||||
String tag) {
|
String tag) {
|
||||||
this(id, tag, Optional.empty());
|
this(id, tag, Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public long id() {
|
public int id() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ public class Country {
|
|||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Country withId(long id) {
|
public Country withId(int id) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
@@ -137,7 +137,7 @@ public class Country {
|
|||||||
|
|
||||||
public final static class Builder {
|
public final static class Builder {
|
||||||
|
|
||||||
private Long id;
|
private Integer id;
|
||||||
|
|
||||||
private String tag;
|
private String tag;
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ public class Country {
|
|||||||
// force use of static builder() method
|
// force use of static builder() method
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder id(long id) {
|
public Builder id(int id) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -3,39 +3,186 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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
|
* CreatePlaylistQueryParamType
|
||||||
*
|
*
|
||||||
* <p>type of playlist to create
|
* <p>type of playlist to create
|
||||||
*/
|
*/
|
||||||
public enum CreatePlaylistQueryParamType {
|
@JsonDeserialize(using = CreatePlaylistQueryParamType._Deserializer.class)
|
||||||
AUDIO("audio"),
|
@JsonSerialize(using = CreatePlaylistQueryParamType._Serializer.class)
|
||||||
VIDEO("video"),
|
public class CreatePlaylistQueryParamType {
|
||||||
PHOTO("photo");
|
|
||||||
|
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 final String value;
|
||||||
|
|
||||||
private CreatePlaylistQueryParamType(String value) {
|
private CreatePlaylistQueryParamType(String value) {
|
||||||
this.value = 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() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<CreatePlaylistQueryParamType> fromValue(String value) {
|
public Optional<CreatePlaylistQueryParamTypeEnum> asEnum() {
|
||||||
for (CreatePlaylistQueryParamType o: CreatePlaylistQueryParamType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,38 +3,182 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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
|
* EnableCreditsMarkerGeneration
|
||||||
*
|
*
|
||||||
* <p>Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
|
* <p>Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
|
||||||
*/
|
*/
|
||||||
public enum EnableCreditsMarkerGeneration {
|
@JsonDeserialize(using = EnableCreditsMarkerGeneration._Deserializer.class)
|
||||||
LibraryDefault("-1"),
|
@JsonSerialize(using = EnableCreditsMarkerGeneration._Serializer.class)
|
||||||
Disabled("0");
|
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 final String value;
|
||||||
|
|
||||||
private EnableCreditsMarkerGeneration(String value) {
|
private EnableCreditsMarkerGeneration(String value) {
|
||||||
this.value = 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() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<EnableCreditsMarkerGeneration> fromValue(String value) {
|
public Optional<EnableCreditsMarkerGenerationEnum> asEnum() {
|
||||||
for (EnableCreditsMarkerGeneration o: EnableCreditsMarkerGeneration.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,39 +3,186 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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
|
* EpisodeSort
|
||||||
*
|
*
|
||||||
* <p>Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
|
* <p>Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
|
||||||
*/
|
*/
|
||||||
public enum EpisodeSort {
|
@JsonDeserialize(using = EpisodeSort._Deserializer.class)
|
||||||
LibraryDefault("-1"),
|
@JsonSerialize(using = EpisodeSort._Serializer.class)
|
||||||
OldestFirst("0"),
|
public class EpisodeSort {
|
||||||
NewestFirst("1");
|
|
||||||
|
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 final String value;
|
||||||
|
|
||||||
private EpisodeSort(String value) {
|
private EpisodeSort(String value) {
|
||||||
this.value = 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() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<EpisodeSort> fromValue(String value) {
|
public Optional<EpisodeSortEnum> asEnum() {
|
||||||
for (EpisodeSort o: EpisodeSort.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
125
src/main/java/dev/plexapi/sdk/models/operations/Extras.java
Normal file
125
src/main/java/dev/plexapi/sdk/models/operations/Extras.java
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
/*
|
||||||
|
* 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.Long;
|
||||||
|
import java.lang.Override;
|
||||||
|
import java.lang.String;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
public class Extras {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The size of the extras.
|
||||||
|
*/
|
||||||
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
|
@JsonProperty("size")
|
||||||
|
private Optional<Long> size;
|
||||||
|
|
||||||
|
@JsonCreator
|
||||||
|
public Extras(
|
||||||
|
@JsonProperty("size") Optional<Long> size) {
|
||||||
|
Utils.checkNotNull(size, "size");
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Extras() {
|
||||||
|
this(Optional.empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The size of the extras.
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public Optional<Long> size() {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final static Builder builder() {
|
||||||
|
return new Builder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The size of the extras.
|
||||||
|
*/
|
||||||
|
public Extras withSize(long size) {
|
||||||
|
Utils.checkNotNull(size, "size");
|
||||||
|
this.size = Optional.ofNullable(size);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The size of the extras.
|
||||||
|
*/
|
||||||
|
public Extras withSize(Optional<Long> size) {
|
||||||
|
Utils.checkNotNull(size, "size");
|
||||||
|
this.size = size;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Extras other = (Extras) o;
|
||||||
|
return
|
||||||
|
Objects.deepEquals(this.size, other.size);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(
|
||||||
|
size);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return Utils.toString(Extras.class,
|
||||||
|
"size", size);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final static class Builder {
|
||||||
|
|
||||||
|
private Optional<Long> size = Optional.empty();
|
||||||
|
|
||||||
|
private Builder() {
|
||||||
|
// force use of static builder() method
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The size of the extras.
|
||||||
|
*/
|
||||||
|
public Builder size(long size) {
|
||||||
|
Utils.checkNotNull(size, "size");
|
||||||
|
this.size = Optional.ofNullable(size);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The size of the extras.
|
||||||
|
*/
|
||||||
|
public Builder size(Optional<Long> size) {
|
||||||
|
Utils.checkNotNull(size, "size");
|
||||||
|
this.size = size;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Extras build() {
|
||||||
|
return new Extras(
|
||||||
|
size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,39 +3,186 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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
|
* Filter
|
||||||
*
|
*
|
||||||
* <p>Filter
|
* <p>Filter
|
||||||
*/
|
*/
|
||||||
public enum Filter {
|
@JsonDeserialize(using = Filter._Deserializer.class)
|
||||||
ALL("all"),
|
@JsonSerialize(using = Filter._Serializer.class)
|
||||||
AVAILABLE("available"),
|
public class Filter {
|
||||||
RELEASED("released");
|
|
||||||
|
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 final String value;
|
||||||
|
|
||||||
private Filter(String value) {
|
private Filter(String value) {
|
||||||
this.value = 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() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<Filter> fromValue(String value) {
|
public Optional<FilterEnum> asEnum() {
|
||||||
for (Filter o: Filter.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,39 +3,186 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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
|
* FlattenSeasons
|
||||||
*
|
*
|
||||||
* <p>Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
|
* <p>Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
|
||||||
*/
|
*/
|
||||||
public enum FlattenSeasons {
|
@JsonDeserialize(using = FlattenSeasons._Deserializer.class)
|
||||||
LibraryDefault("-1"),
|
@JsonSerialize(using = FlattenSeasons._Serializer.class)
|
||||||
Hide("0"),
|
public class FlattenSeasons {
|
||||||
Show("1");
|
|
||||||
|
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 final String value;
|
||||||
|
|
||||||
private FlattenSeasons(String value) {
|
private FlattenSeasons(String value) {
|
||||||
this.value = 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() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<FlattenSeasons> fromValue(String value) {
|
public Optional<FlattenSeasonsEnum> asEnum() {
|
||||||
for (FlattenSeasons o: FlattenSeasons.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,45 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.Objects;
|
||||||
import java.util.Optional;
|
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
|
* GetActorsLibraryQueryParamType
|
||||||
*
|
*
|
||||||
@@ -17,33 +52,159 @@ import java.util.Optional;
|
|||||||
* 4 = episode
|
* 4 = episode
|
||||||
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
||||||
*/
|
*/
|
||||||
public enum GetActorsLibraryQueryParamType {
|
@JsonDeserialize(using = GetActorsLibraryQueryParamType._Deserializer.class)
|
||||||
Movie(1L),
|
@JsonSerialize(using = GetActorsLibraryQueryParamType._Serializer.class)
|
||||||
TvShow(2L),
|
public class GetActorsLibraryQueryParamType {
|
||||||
Season(3L),
|
|
||||||
Episode(4L),
|
public static final GetActorsLibraryQueryParamType Movie = new GetActorsLibraryQueryParamType(1L);
|
||||||
Audio(8L),
|
public static final GetActorsLibraryQueryParamType TvShow = new GetActorsLibraryQueryParamType(2L);
|
||||||
Album(9L),
|
public static final GetActorsLibraryQueryParamType Season = new GetActorsLibraryQueryParamType(3L);
|
||||||
Track(10L);
|
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 final long value;
|
||||||
|
|
||||||
private GetActorsLibraryQueryParamType(long value) {
|
private GetActorsLibraryQueryParamType(long value) {
|
||||||
this.value = 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() {
|
public long value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetActorsLibraryQueryParamType> fromValue(long value) {
|
public Optional<GetActorsLibraryQueryParamTypeEnum> asEnum() {
|
||||||
for (GetActorsLibraryQueryParamType o: GetActorsLibraryQueryParamType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,42 +3,198 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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
|
* GetAllLibrariesType
|
||||||
*
|
*
|
||||||
* <p>The library type
|
* <p>The library type
|
||||||
*/
|
*/
|
||||||
public enum GetAllLibrariesType {
|
@JsonDeserialize(using = GetAllLibrariesType._Deserializer.class)
|
||||||
Movie("movie"),
|
@JsonSerialize(using = GetAllLibrariesType._Serializer.class)
|
||||||
TvShow("show"),
|
public class GetAllLibrariesType {
|
||||||
Season("season"),
|
|
||||||
Episode("episode"),
|
public static final GetAllLibrariesType Movie = new GetAllLibrariesType("movie");
|
||||||
Artist("artist"),
|
public static final GetAllLibrariesType TvShow = new GetAllLibrariesType("show");
|
||||||
Album("album");
|
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();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
private GetAllLibrariesType(String value) {
|
private GetAllLibrariesType(String value) {
|
||||||
this.value = 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() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetAllLibrariesType> fromValue(String value) {
|
public Optional<GetAllLibrariesTypeEnum> asEnum() {
|
||||||
for (GetAllLibrariesType o: GetAllLibrariesType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,35 +3,185 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
public enum GetAllMediaLibraryLibraryResponseType {
|
/**
|
||||||
COVER_POSTER("coverPoster"),
|
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
|
||||||
BACKGROUND("background"),
|
* to evolve (particularly with the addition of enum members over time). If an
|
||||||
SNAPSHOT("snapshot"),
|
* open enum is used then the appearance of unexpected enum values (say in a
|
||||||
CLEAR_LOGO("clearLogo");
|
* 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 final String value;
|
||||||
|
|
||||||
private GetAllMediaLibraryLibraryResponseType(String value) {
|
private GetAllMediaLibraryLibraryResponseType(String value) {
|
||||||
this.value = 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() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetAllMediaLibraryLibraryResponseType> fromValue(String value) {
|
public Optional<GetAllMediaLibraryLibraryResponseTypeEnum> asEnum() {
|
||||||
for (GetAllMediaLibraryLibraryResponseType o: GetAllMediaLibraryLibraryResponseType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,42 +3,198 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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
|
* GetAllMediaLibraryLibraryType
|
||||||
*
|
*
|
||||||
* <p>The type of media content
|
* <p>The type of media content
|
||||||
*/
|
*/
|
||||||
public enum GetAllMediaLibraryLibraryType {
|
@JsonDeserialize(using = GetAllMediaLibraryLibraryType._Deserializer.class)
|
||||||
Movie("movie"),
|
@JsonSerialize(using = GetAllMediaLibraryLibraryType._Serializer.class)
|
||||||
TvShow("show"),
|
public class GetAllMediaLibraryLibraryType {
|
||||||
Season("season"),
|
|
||||||
Episode("episode"),
|
public static final GetAllMediaLibraryLibraryType Movie = new GetAllMediaLibraryLibraryType("movie");
|
||||||
Artist("artist"),
|
public static final GetAllMediaLibraryLibraryType TvShow = new GetAllMediaLibraryLibraryType("show");
|
||||||
Album("album");
|
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 final String value;
|
||||||
|
|
||||||
private GetAllMediaLibraryLibraryType(String value) {
|
private GetAllMediaLibraryLibraryType(String value) {
|
||||||
this.value = 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() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetAllMediaLibraryLibraryType> fromValue(String value) {
|
public Optional<GetAllMediaLibraryLibraryTypeEnum> asEnum() {
|
||||||
for (GetAllMediaLibraryLibraryType o: GetAllMediaLibraryLibraryType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,45 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.Objects;
|
||||||
import java.util.Optional;
|
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
|
* GetAllMediaLibraryQueryParamType
|
||||||
*
|
*
|
||||||
@@ -17,33 +52,159 @@ import java.util.Optional;
|
|||||||
* 4 = episode
|
* 4 = episode
|
||||||
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
||||||
*/
|
*/
|
||||||
public enum GetAllMediaLibraryQueryParamType {
|
@JsonDeserialize(using = GetAllMediaLibraryQueryParamType._Deserializer.class)
|
||||||
Movie(1L),
|
@JsonSerialize(using = GetAllMediaLibraryQueryParamType._Serializer.class)
|
||||||
TvShow(2L),
|
public class GetAllMediaLibraryQueryParamType {
|
||||||
Season(3L),
|
|
||||||
Episode(4L),
|
public static final GetAllMediaLibraryQueryParamType Movie = new GetAllMediaLibraryQueryParamType(1L);
|
||||||
Audio(8L),
|
public static final GetAllMediaLibraryQueryParamType TvShow = new GetAllMediaLibraryQueryParamType(2L);
|
||||||
Album(9L),
|
public static final GetAllMediaLibraryQueryParamType Season = new GetAllMediaLibraryQueryParamType(3L);
|
||||||
Track(10L);
|
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 final long value;
|
||||||
|
|
||||||
private GetAllMediaLibraryQueryParamType(long value) {
|
private GetAllMediaLibraryQueryParamType(long value) {
|
||||||
this.value = 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() {
|
public long value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetAllMediaLibraryQueryParamType> fromValue(long value) {
|
public Optional<GetAllMediaLibraryQueryParamTypeEnum> asEnum() {
|
||||||
for (GetAllMediaLibraryQueryParamType o: GetAllMediaLibraryQueryParamType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,10 +27,20 @@ public class GetAllMediaLibraryStream {
|
|||||||
private long id;
|
private long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stream type (1=video, 2=audio, 3=subtitle).
|
* Stream type:
|
||||||
|
* - 1 = video
|
||||||
|
* - 2 = audio
|
||||||
|
* - 3 = subtitle
|
||||||
*/
|
*/
|
||||||
@JsonProperty("streamType")
|
@JsonProperty("streamType")
|
||||||
private int streamType;
|
private GetAllMediaLibraryStreamType streamType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format of the stream (e.g., srt).
|
||||||
|
*/
|
||||||
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
|
@JsonProperty("format")
|
||||||
|
private Optional<String> format;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if this stream is default.
|
* Indicates if this stream is default.
|
||||||
@@ -48,8 +58,9 @@ public class GetAllMediaLibraryStream {
|
|||||||
/**
|
/**
|
||||||
* Index of the stream.
|
* Index of the stream.
|
||||||
*/
|
*/
|
||||||
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
@JsonProperty("index")
|
@JsonProperty("index")
|
||||||
private int index;
|
private Optional<Integer> index;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bitrate of the stream.
|
* Bitrate of the stream.
|
||||||
@@ -216,6 +227,13 @@ public class GetAllMediaLibraryStream {
|
|||||||
@JsonProperty("frameRate")
|
@JsonProperty("frameRate")
|
||||||
private Optional<Float> frameRate;
|
private Optional<Float> frameRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Key to access this stream part.
|
||||||
|
*/
|
||||||
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
|
@JsonProperty("key")
|
||||||
|
private Optional<String> key;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Height of the video stream.
|
* Height of the video stream.
|
||||||
*/
|
*/
|
||||||
@@ -345,10 +363,11 @@ public class GetAllMediaLibraryStream {
|
|||||||
@JsonCreator
|
@JsonCreator
|
||||||
public GetAllMediaLibraryStream(
|
public GetAllMediaLibraryStream(
|
||||||
@JsonProperty("id") long id,
|
@JsonProperty("id") long id,
|
||||||
@JsonProperty("streamType") int streamType,
|
@JsonProperty("streamType") GetAllMediaLibraryStreamType streamType,
|
||||||
|
@JsonProperty("format") Optional<String> format,
|
||||||
@JsonProperty("default") Optional<Boolean> default_,
|
@JsonProperty("default") Optional<Boolean> default_,
|
||||||
@JsonProperty("codec") String codec,
|
@JsonProperty("codec") String codec,
|
||||||
@JsonProperty("index") int index,
|
@JsonProperty("index") Optional<Integer> index,
|
||||||
@JsonProperty("bitrate") Optional<Integer> bitrate,
|
@JsonProperty("bitrate") Optional<Integer> bitrate,
|
||||||
@JsonProperty("language") Optional<String> language,
|
@JsonProperty("language") Optional<String> language,
|
||||||
@JsonProperty("languageTag") Optional<String> languageTag,
|
@JsonProperty("languageTag") Optional<String> languageTag,
|
||||||
@@ -373,6 +392,7 @@ public class GetAllMediaLibraryStream {
|
|||||||
@JsonProperty("colorSpace") Optional<String> colorSpace,
|
@JsonProperty("colorSpace") Optional<String> colorSpace,
|
||||||
@JsonProperty("colorTrc") Optional<String> colorTrc,
|
@JsonProperty("colorTrc") Optional<String> colorTrc,
|
||||||
@JsonProperty("frameRate") Optional<Float> frameRate,
|
@JsonProperty("frameRate") Optional<Float> frameRate,
|
||||||
|
@JsonProperty("key") Optional<String> key,
|
||||||
@JsonProperty("height") Optional<Integer> height,
|
@JsonProperty("height") Optional<Integer> height,
|
||||||
@JsonProperty("level") Optional<Integer> level,
|
@JsonProperty("level") Optional<Integer> level,
|
||||||
@JsonProperty("original") Optional<Boolean> original,
|
@JsonProperty("original") Optional<Boolean> original,
|
||||||
@@ -395,6 +415,7 @@ public class GetAllMediaLibraryStream {
|
|||||||
@JsonProperty("title") Optional<String> title) {
|
@JsonProperty("title") Optional<String> title) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
Utils.checkNotNull(streamType, "streamType");
|
Utils.checkNotNull(streamType, "streamType");
|
||||||
|
Utils.checkNotNull(format, "format");
|
||||||
Utils.checkNotNull(default_, "default_");
|
Utils.checkNotNull(default_, "default_");
|
||||||
Utils.checkNotNull(codec, "codec");
|
Utils.checkNotNull(codec, "codec");
|
||||||
Utils.checkNotNull(index, "index");
|
Utils.checkNotNull(index, "index");
|
||||||
@@ -422,6 +443,7 @@ public class GetAllMediaLibraryStream {
|
|||||||
Utils.checkNotNull(colorSpace, "colorSpace");
|
Utils.checkNotNull(colorSpace, "colorSpace");
|
||||||
Utils.checkNotNull(colorTrc, "colorTrc");
|
Utils.checkNotNull(colorTrc, "colorTrc");
|
||||||
Utils.checkNotNull(frameRate, "frameRate");
|
Utils.checkNotNull(frameRate, "frameRate");
|
||||||
|
Utils.checkNotNull(key, "key");
|
||||||
Utils.checkNotNull(height, "height");
|
Utils.checkNotNull(height, "height");
|
||||||
Utils.checkNotNull(level, "level");
|
Utils.checkNotNull(level, "level");
|
||||||
Utils.checkNotNull(original, "original");
|
Utils.checkNotNull(original, "original");
|
||||||
@@ -444,6 +466,7 @@ public class GetAllMediaLibraryStream {
|
|||||||
Utils.checkNotNull(title, "title");
|
Utils.checkNotNull(title, "title");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.streamType = streamType;
|
this.streamType = streamType;
|
||||||
|
this.format = format;
|
||||||
this.default_ = default_;
|
this.default_ = default_;
|
||||||
this.codec = codec;
|
this.codec = codec;
|
||||||
this.index = index;
|
this.index = index;
|
||||||
@@ -471,6 +494,7 @@ public class GetAllMediaLibraryStream {
|
|||||||
this.colorSpace = colorSpace;
|
this.colorSpace = colorSpace;
|
||||||
this.colorTrc = colorTrc;
|
this.colorTrc = colorTrc;
|
||||||
this.frameRate = frameRate;
|
this.frameRate = frameRate;
|
||||||
|
this.key = key;
|
||||||
this.height = height;
|
this.height = height;
|
||||||
this.level = level;
|
this.level = level;
|
||||||
this.original = original;
|
this.original = original;
|
||||||
@@ -495,12 +519,11 @@ public class GetAllMediaLibraryStream {
|
|||||||
|
|
||||||
public GetAllMediaLibraryStream(
|
public GetAllMediaLibraryStream(
|
||||||
long id,
|
long id,
|
||||||
int streamType,
|
GetAllMediaLibraryStreamType streamType,
|
||||||
String codec,
|
String codec,
|
||||||
int index,
|
|
||||||
String displayTitle,
|
String displayTitle,
|
||||||
String extendedDisplayTitle) {
|
String extendedDisplayTitle) {
|
||||||
this(id, streamType, Optional.empty(), codec, index, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), displayTitle, extendedDisplayTitle, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
this(id, streamType, Optional.empty(), Optional.empty(), codec, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), displayTitle, extendedDisplayTitle, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -512,13 +535,24 @@ public class GetAllMediaLibraryStream {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stream type (1=video, 2=audio, 3=subtitle).
|
* Stream type:
|
||||||
|
* - 1 = video
|
||||||
|
* - 2 = audio
|
||||||
|
* - 3 = subtitle
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public int streamType() {
|
public GetAllMediaLibraryStreamType streamType() {
|
||||||
return streamType;
|
return streamType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format of the stream (e.g., srt).
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public Optional<String> format() {
|
||||||
|
return format;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if this stream is default.
|
* Indicates if this stream is default.
|
||||||
*/
|
*/
|
||||||
@@ -539,7 +573,7 @@ public class GetAllMediaLibraryStream {
|
|||||||
* Index of the stream.
|
* Index of the stream.
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public int index() {
|
public Optional<Integer> index() {
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -732,6 +766,14 @@ public class GetAllMediaLibraryStream {
|
|||||||
return frameRate;
|
return frameRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Key to access this stream part.
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public Optional<String> key() {
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Height of the video stream.
|
* Height of the video stream.
|
||||||
*/
|
*/
|
||||||
@@ -894,14 +936,35 @@ public class GetAllMediaLibraryStream {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stream type (1=video, 2=audio, 3=subtitle).
|
* Stream type:
|
||||||
|
* - 1 = video
|
||||||
|
* - 2 = audio
|
||||||
|
* - 3 = subtitle
|
||||||
*/
|
*/
|
||||||
public GetAllMediaLibraryStream withStreamType(int streamType) {
|
public GetAllMediaLibraryStream withStreamType(GetAllMediaLibraryStreamType streamType) {
|
||||||
Utils.checkNotNull(streamType, "streamType");
|
Utils.checkNotNull(streamType, "streamType");
|
||||||
this.streamType = streamType;
|
this.streamType = streamType;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format of the stream (e.g., srt).
|
||||||
|
*/
|
||||||
|
public GetAllMediaLibraryStream withFormat(String format) {
|
||||||
|
Utils.checkNotNull(format, "format");
|
||||||
|
this.format = Optional.ofNullable(format);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format of the stream (e.g., srt).
|
||||||
|
*/
|
||||||
|
public GetAllMediaLibraryStream withFormat(Optional<String> format) {
|
||||||
|
Utils.checkNotNull(format, "format");
|
||||||
|
this.format = format;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if this stream is default.
|
* Indicates if this stream is default.
|
||||||
*/
|
*/
|
||||||
@@ -933,6 +996,15 @@ public class GetAllMediaLibraryStream {
|
|||||||
* Index of the stream.
|
* Index of the stream.
|
||||||
*/
|
*/
|
||||||
public GetAllMediaLibraryStream withIndex(int index) {
|
public GetAllMediaLibraryStream withIndex(int index) {
|
||||||
|
Utils.checkNotNull(index, "index");
|
||||||
|
this.index = Optional.ofNullable(index);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Index of the stream.
|
||||||
|
*/
|
||||||
|
public GetAllMediaLibraryStream withIndex(Optional<Integer> index) {
|
||||||
Utils.checkNotNull(index, "index");
|
Utils.checkNotNull(index, "index");
|
||||||
this.index = index;
|
this.index = index;
|
||||||
return this;
|
return this;
|
||||||
@@ -1364,6 +1436,24 @@ public class GetAllMediaLibraryStream {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Key to access this stream part.
|
||||||
|
*/
|
||||||
|
public GetAllMediaLibraryStream withKey(String key) {
|
||||||
|
Utils.checkNotNull(key, "key");
|
||||||
|
this.key = Optional.ofNullable(key);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Key to access this stream part.
|
||||||
|
*/
|
||||||
|
public GetAllMediaLibraryStream withKey(Optional<String> key) {
|
||||||
|
Utils.checkNotNull(key, "key");
|
||||||
|
this.key = key;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Height of the video stream.
|
* Height of the video stream.
|
||||||
*/
|
*/
|
||||||
@@ -1695,6 +1785,7 @@ public class GetAllMediaLibraryStream {
|
|||||||
return
|
return
|
||||||
Objects.deepEquals(this.id, other.id) &&
|
Objects.deepEquals(this.id, other.id) &&
|
||||||
Objects.deepEquals(this.streamType, other.streamType) &&
|
Objects.deepEquals(this.streamType, other.streamType) &&
|
||||||
|
Objects.deepEquals(this.format, other.format) &&
|
||||||
Objects.deepEquals(this.default_, other.default_) &&
|
Objects.deepEquals(this.default_, other.default_) &&
|
||||||
Objects.deepEquals(this.codec, other.codec) &&
|
Objects.deepEquals(this.codec, other.codec) &&
|
||||||
Objects.deepEquals(this.index, other.index) &&
|
Objects.deepEquals(this.index, other.index) &&
|
||||||
@@ -1722,6 +1813,7 @@ public class GetAllMediaLibraryStream {
|
|||||||
Objects.deepEquals(this.colorSpace, other.colorSpace) &&
|
Objects.deepEquals(this.colorSpace, other.colorSpace) &&
|
||||||
Objects.deepEquals(this.colorTrc, other.colorTrc) &&
|
Objects.deepEquals(this.colorTrc, other.colorTrc) &&
|
||||||
Objects.deepEquals(this.frameRate, other.frameRate) &&
|
Objects.deepEquals(this.frameRate, other.frameRate) &&
|
||||||
|
Objects.deepEquals(this.key, other.key) &&
|
||||||
Objects.deepEquals(this.height, other.height) &&
|
Objects.deepEquals(this.height, other.height) &&
|
||||||
Objects.deepEquals(this.level, other.level) &&
|
Objects.deepEquals(this.level, other.level) &&
|
||||||
Objects.deepEquals(this.original, other.original) &&
|
Objects.deepEquals(this.original, other.original) &&
|
||||||
@@ -1749,6 +1841,7 @@ public class GetAllMediaLibraryStream {
|
|||||||
return Objects.hash(
|
return Objects.hash(
|
||||||
id,
|
id,
|
||||||
streamType,
|
streamType,
|
||||||
|
format,
|
||||||
default_,
|
default_,
|
||||||
codec,
|
codec,
|
||||||
index,
|
index,
|
||||||
@@ -1776,6 +1869,7 @@ public class GetAllMediaLibraryStream {
|
|||||||
colorSpace,
|
colorSpace,
|
||||||
colorTrc,
|
colorTrc,
|
||||||
frameRate,
|
frameRate,
|
||||||
|
key,
|
||||||
height,
|
height,
|
||||||
level,
|
level,
|
||||||
original,
|
original,
|
||||||
@@ -1803,6 +1897,7 @@ public class GetAllMediaLibraryStream {
|
|||||||
return Utils.toString(GetAllMediaLibraryStream.class,
|
return Utils.toString(GetAllMediaLibraryStream.class,
|
||||||
"id", id,
|
"id", id,
|
||||||
"streamType", streamType,
|
"streamType", streamType,
|
||||||
|
"format", format,
|
||||||
"default_", default_,
|
"default_", default_,
|
||||||
"codec", codec,
|
"codec", codec,
|
||||||
"index", index,
|
"index", index,
|
||||||
@@ -1830,6 +1925,7 @@ public class GetAllMediaLibraryStream {
|
|||||||
"colorSpace", colorSpace,
|
"colorSpace", colorSpace,
|
||||||
"colorTrc", colorTrc,
|
"colorTrc", colorTrc,
|
||||||
"frameRate", frameRate,
|
"frameRate", frameRate,
|
||||||
|
"key", key,
|
||||||
"height", height,
|
"height", height,
|
||||||
"level", level,
|
"level", level,
|
||||||
"original", original,
|
"original", original,
|
||||||
@@ -1856,13 +1952,15 @@ public class GetAllMediaLibraryStream {
|
|||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
private Integer streamType;
|
private GetAllMediaLibraryStreamType streamType;
|
||||||
|
|
||||||
|
private Optional<String> format = Optional.empty();
|
||||||
|
|
||||||
private Optional<Boolean> default_ = Optional.empty();
|
private Optional<Boolean> default_ = Optional.empty();
|
||||||
|
|
||||||
private String codec;
|
private String codec;
|
||||||
|
|
||||||
private Integer index;
|
private Optional<Integer> index = Optional.empty();
|
||||||
|
|
||||||
private Optional<Integer> bitrate = Optional.empty();
|
private Optional<Integer> bitrate = Optional.empty();
|
||||||
|
|
||||||
@@ -1912,6 +2010,8 @@ public class GetAllMediaLibraryStream {
|
|||||||
|
|
||||||
private Optional<Float> frameRate = Optional.empty();
|
private Optional<Float> frameRate = Optional.empty();
|
||||||
|
|
||||||
|
private Optional<String> key = Optional.empty();
|
||||||
|
|
||||||
private Optional<Integer> height = Optional.empty();
|
private Optional<Integer> height = Optional.empty();
|
||||||
|
|
||||||
private Optional<Integer> level = Optional.empty();
|
private Optional<Integer> level = Optional.empty();
|
||||||
@@ -1966,14 +2066,35 @@ public class GetAllMediaLibraryStream {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stream type (1=video, 2=audio, 3=subtitle).
|
* Stream type:
|
||||||
|
* - 1 = video
|
||||||
|
* - 2 = audio
|
||||||
|
* - 3 = subtitle
|
||||||
*/
|
*/
|
||||||
public Builder streamType(int streamType) {
|
public Builder streamType(GetAllMediaLibraryStreamType streamType) {
|
||||||
Utils.checkNotNull(streamType, "streamType");
|
Utils.checkNotNull(streamType, "streamType");
|
||||||
this.streamType = streamType;
|
this.streamType = streamType;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format of the stream (e.g., srt).
|
||||||
|
*/
|
||||||
|
public Builder format(String format) {
|
||||||
|
Utils.checkNotNull(format, "format");
|
||||||
|
this.format = Optional.ofNullable(format);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format of the stream (e.g., srt).
|
||||||
|
*/
|
||||||
|
public Builder format(Optional<String> format) {
|
||||||
|
Utils.checkNotNull(format, "format");
|
||||||
|
this.format = format;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if this stream is default.
|
* Indicates if this stream is default.
|
||||||
*/
|
*/
|
||||||
@@ -2005,6 +2126,15 @@ public class GetAllMediaLibraryStream {
|
|||||||
* Index of the stream.
|
* Index of the stream.
|
||||||
*/
|
*/
|
||||||
public Builder index(int index) {
|
public Builder index(int index) {
|
||||||
|
Utils.checkNotNull(index, "index");
|
||||||
|
this.index = Optional.ofNullable(index);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Index of the stream.
|
||||||
|
*/
|
||||||
|
public Builder index(Optional<Integer> index) {
|
||||||
Utils.checkNotNull(index, "index");
|
Utils.checkNotNull(index, "index");
|
||||||
this.index = index;
|
this.index = index;
|
||||||
return this;
|
return this;
|
||||||
@@ -2436,6 +2566,24 @@ public class GetAllMediaLibraryStream {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Key to access this stream part.
|
||||||
|
*/
|
||||||
|
public Builder key(String key) {
|
||||||
|
Utils.checkNotNull(key, "key");
|
||||||
|
this.key = Optional.ofNullable(key);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Key to access this stream part.
|
||||||
|
*/
|
||||||
|
public Builder key(Optional<String> key) {
|
||||||
|
Utils.checkNotNull(key, "key");
|
||||||
|
this.key = key;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Height of the video stream.
|
* Height of the video stream.
|
||||||
*/
|
*/
|
||||||
@@ -2758,6 +2906,7 @@ public class GetAllMediaLibraryStream {
|
|||||||
return new GetAllMediaLibraryStream(
|
return new GetAllMediaLibraryStream(
|
||||||
id,
|
id,
|
||||||
streamType,
|
streamType,
|
||||||
|
format,
|
||||||
default_,
|
default_,
|
||||||
codec,
|
codec,
|
||||||
index,
|
index,
|
||||||
@@ -2785,6 +2934,7 @@ public class GetAllMediaLibraryStream {
|
|||||||
colorSpace,
|
colorSpace,
|
||||||
colorTrc,
|
colorTrc,
|
||||||
frameRate,
|
frameRate,
|
||||||
|
key,
|
||||||
height,
|
height,
|
||||||
level,
|
level,
|
||||||
original,
|
original,
|
||||||
|
|||||||
@@ -0,0 +1,192 @@
|
|||||||
|
/*
|
||||||
|
* 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.Integer;
|
||||||
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GetAllMediaLibraryStreamType
|
||||||
|
*
|
||||||
|
* <p>Stream type:
|
||||||
|
* - 1 = video
|
||||||
|
* - 2 = audio
|
||||||
|
* - 3 = subtitle
|
||||||
|
*/
|
||||||
|
@JsonDeserialize(using = GetAllMediaLibraryStreamType._Deserializer.class)
|
||||||
|
@JsonSerialize(using = GetAllMediaLibraryStreamType._Serializer.class)
|
||||||
|
public class GetAllMediaLibraryStreamType {
|
||||||
|
|
||||||
|
public static final GetAllMediaLibraryStreamType Video = new GetAllMediaLibraryStreamType(1);
|
||||||
|
public static final GetAllMediaLibraryStreamType Audio = new GetAllMediaLibraryStreamType(2);
|
||||||
|
public static final GetAllMediaLibraryStreamType Subtitle = new GetAllMediaLibraryStreamType(3);
|
||||||
|
|
||||||
|
// 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<Integer, GetAllMediaLibraryStreamType> values = createValuesMap();
|
||||||
|
private static final Map<Integer, GetAllMediaLibraryStreamTypeEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
|
private final int value;
|
||||||
|
|
||||||
|
private GetAllMediaLibraryStreamType(int value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a GetAllMediaLibraryStreamType 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 GetAllMediaLibraryStreamType
|
||||||
|
*/
|
||||||
|
public static GetAllMediaLibraryStreamType of(int value) {
|
||||||
|
synchronized (GetAllMediaLibraryStreamType.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new GetAllMediaLibraryStreamType(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Optional<GetAllMediaLibraryStreamTypeEnum> 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;
|
||||||
|
GetAllMediaLibraryStreamType other = (GetAllMediaLibraryStreamType) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "GetAllMediaLibraryStreamType [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static GetAllMediaLibraryStreamType[] values() {
|
||||||
|
synchronized (GetAllMediaLibraryStreamType.class) {
|
||||||
|
return values.values().toArray(new GetAllMediaLibraryStreamType[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<Integer, GetAllMediaLibraryStreamType> createValuesMap() {
|
||||||
|
Map<Integer, GetAllMediaLibraryStreamType> map = new LinkedHashMap<>();
|
||||||
|
map.put(1, Video);
|
||||||
|
map.put(2, Audio);
|
||||||
|
map.put(3, Subtitle);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<Integer, GetAllMediaLibraryStreamTypeEnum> createEnumsMap() {
|
||||||
|
Map<Integer, GetAllMediaLibraryStreamTypeEnum> map = new HashMap<>();
|
||||||
|
map.put(1, GetAllMediaLibraryStreamTypeEnum.Video);
|
||||||
|
map.put(2, GetAllMediaLibraryStreamTypeEnum.Audio);
|
||||||
|
map.put(3, GetAllMediaLibraryStreamTypeEnum.Subtitle);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<GetAllMediaLibraryStreamType> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(GetAllMediaLibraryStreamType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(GetAllMediaLibraryStreamType value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<GetAllMediaLibraryStreamType> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(GetAllMediaLibraryStreamType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GetAllMediaLibraryStreamType deserialize(JsonParser p, DeserializationContext ctxt)
|
||||||
|
throws IOException, JacksonException {
|
||||||
|
int v = p.readValueAs(new TypeReference<Integer>() {});
|
||||||
|
// use the factory method to ensure we get singletons
|
||||||
|
return GetAllMediaLibraryStreamType.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum GetAllMediaLibraryStreamTypeEnum {
|
||||||
|
|
||||||
|
Video(1),
|
||||||
|
Audio(2),
|
||||||
|
Subtitle(3),;
|
||||||
|
|
||||||
|
private final int value;
|
||||||
|
|
||||||
|
private GetAllMediaLibraryStreamTypeEnum(int value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -3,10 +3,45 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.Objects;
|
||||||
import java.util.Optional;
|
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
|
* GetCountriesLibraryQueryParamType
|
||||||
*
|
*
|
||||||
@@ -17,33 +52,159 @@ import java.util.Optional;
|
|||||||
* 4 = episode
|
* 4 = episode
|
||||||
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
||||||
*/
|
*/
|
||||||
public enum GetCountriesLibraryQueryParamType {
|
@JsonDeserialize(using = GetCountriesLibraryQueryParamType._Deserializer.class)
|
||||||
Movie(1L),
|
@JsonSerialize(using = GetCountriesLibraryQueryParamType._Serializer.class)
|
||||||
TvShow(2L),
|
public class GetCountriesLibraryQueryParamType {
|
||||||
Season(3L),
|
|
||||||
Episode(4L),
|
public static final GetCountriesLibraryQueryParamType Movie = new GetCountriesLibraryQueryParamType(1L);
|
||||||
Audio(8L),
|
public static final GetCountriesLibraryQueryParamType TvShow = new GetCountriesLibraryQueryParamType(2L);
|
||||||
Album(9L),
|
public static final GetCountriesLibraryQueryParamType Season = new GetCountriesLibraryQueryParamType(3L);
|
||||||
Track(10L);
|
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 final long value;
|
||||||
|
|
||||||
private GetCountriesLibraryQueryParamType(long value) {
|
private GetCountriesLibraryQueryParamType(long value) {
|
||||||
this.value = 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() {
|
public long value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetCountriesLibraryQueryParamType> fromValue(long value) {
|
public Optional<GetCountriesLibraryQueryParamTypeEnum> asEnum() {
|
||||||
for (GetCountriesLibraryQueryParamType o: GetCountriesLibraryQueryParamType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,45 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.Objects;
|
||||||
import java.util.Optional;
|
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
|
* GetGenresLibraryQueryParamType
|
||||||
*
|
*
|
||||||
@@ -17,33 +52,159 @@ import java.util.Optional;
|
|||||||
* 4 = episode
|
* 4 = episode
|
||||||
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
||||||
*/
|
*/
|
||||||
public enum GetGenresLibraryQueryParamType {
|
@JsonDeserialize(using = GetGenresLibraryQueryParamType._Deserializer.class)
|
||||||
Movie(1L),
|
@JsonSerialize(using = GetGenresLibraryQueryParamType._Serializer.class)
|
||||||
TvShow(2L),
|
public class GetGenresLibraryQueryParamType {
|
||||||
Season(3L),
|
|
||||||
Episode(4L),
|
public static final GetGenresLibraryQueryParamType Movie = new GetGenresLibraryQueryParamType(1L);
|
||||||
Audio(8L),
|
public static final GetGenresLibraryQueryParamType TvShow = new GetGenresLibraryQueryParamType(2L);
|
||||||
Album(9L),
|
public static final GetGenresLibraryQueryParamType Season = new GetGenresLibraryQueryParamType(3L);
|
||||||
Track(10L);
|
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 final long value;
|
||||||
|
|
||||||
private GetGenresLibraryQueryParamType(long value) {
|
private GetGenresLibraryQueryParamType(long value) {
|
||||||
this.value = 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() {
|
public long value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetGenresLibraryQueryParamType> fromValue(long value) {
|
public Optional<GetGenresLibraryQueryParamTypeEnum> asEnum() {
|
||||||
for (GetGenresLibraryQueryParamType o: GetGenresLibraryQueryParamType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,35 +3,185 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
public enum GetLibraryItemsLibraryResponse200Type {
|
/**
|
||||||
COVER_POSTER("coverPoster"),
|
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
|
||||||
BACKGROUND("background"),
|
* to evolve (particularly with the addition of enum members over time). If an
|
||||||
SNAPSHOT("snapshot"),
|
* open enum is used then the appearance of unexpected enum values (say in a
|
||||||
CLEAR_LOGO("clearLogo");
|
* 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 final String value;
|
||||||
|
|
||||||
private GetLibraryItemsLibraryResponse200Type(String value) {
|
private GetLibraryItemsLibraryResponse200Type(String value) {
|
||||||
this.value = 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() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetLibraryItemsLibraryResponse200Type> fromValue(String value) {
|
public Optional<GetLibraryItemsLibraryResponse200TypeEnum> asEnum() {
|
||||||
for (GetLibraryItemsLibraryResponse200Type o: GetLibraryItemsLibraryResponse200Type.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,42 +3,198 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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
|
* GetLibraryItemsLibraryType
|
||||||
*
|
*
|
||||||
* <p>The type of media content
|
* <p>The type of media content
|
||||||
*/
|
*/
|
||||||
public enum GetLibraryItemsLibraryType {
|
@JsonDeserialize(using = GetLibraryItemsLibraryType._Deserializer.class)
|
||||||
Movie("movie"),
|
@JsonSerialize(using = GetLibraryItemsLibraryType._Serializer.class)
|
||||||
TvShow("show"),
|
public class GetLibraryItemsLibraryType {
|
||||||
Season("season"),
|
|
||||||
Episode("episode"),
|
public static final GetLibraryItemsLibraryType Movie = new GetLibraryItemsLibraryType("movie");
|
||||||
Artist("artist"),
|
public static final GetLibraryItemsLibraryType TvShow = new GetLibraryItemsLibraryType("show");
|
||||||
Album("album");
|
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 final String value;
|
||||||
|
|
||||||
private GetLibraryItemsLibraryType(String value) {
|
private GetLibraryItemsLibraryType(String value) {
|
||||||
this.value = 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() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetLibraryItemsLibraryType> fromValue(String value) {
|
public Optional<GetLibraryItemsLibraryTypeEnum> asEnum() {
|
||||||
for (GetLibraryItemsLibraryType o: GetLibraryItemsLibraryType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,45 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.Objects;
|
||||||
import java.util.Optional;
|
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
|
* GetLibraryItemsQueryParamType
|
||||||
*
|
*
|
||||||
@@ -17,33 +52,159 @@ import java.util.Optional;
|
|||||||
* 4 = episode
|
* 4 = episode
|
||||||
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
||||||
*/
|
*/
|
||||||
public enum GetLibraryItemsQueryParamType {
|
@JsonDeserialize(using = GetLibraryItemsQueryParamType._Deserializer.class)
|
||||||
Movie(1L),
|
@JsonSerialize(using = GetLibraryItemsQueryParamType._Serializer.class)
|
||||||
TvShow(2L),
|
public class GetLibraryItemsQueryParamType {
|
||||||
Season(3L),
|
|
||||||
Episode(4L),
|
public static final GetLibraryItemsQueryParamType Movie = new GetLibraryItemsQueryParamType(1L);
|
||||||
Audio(8L),
|
public static final GetLibraryItemsQueryParamType TvShow = new GetLibraryItemsQueryParamType(2L);
|
||||||
Album(9L),
|
public static final GetLibraryItemsQueryParamType Season = new GetLibraryItemsQueryParamType(3L);
|
||||||
Track(10L);
|
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 final long value;
|
||||||
|
|
||||||
private GetLibraryItemsQueryParamType(long value) {
|
private GetLibraryItemsQueryParamType(long value) {
|
||||||
this.value = 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() {
|
public long value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetLibraryItemsQueryParamType> fromValue(long value) {
|
public Optional<GetLibraryItemsQueryParamTypeEnum> asEnum() {
|
||||||
for (GetLibraryItemsQueryParamType o: GetLibraryItemsQueryParamType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,77 +5,77 @@ package dev.plexapi.sdk.models.operations;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
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.annotation.JsonProperty;
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Integer;
|
import java.lang.Integer;
|
||||||
import java.lang.Override;
|
import java.lang.Override;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GetMediaMetaDataCountry
|
||||||
|
*
|
||||||
|
* <p>The filter query string for country media items.
|
||||||
|
*/
|
||||||
public class GetMediaMetaDataCountry {
|
public class GetMediaMetaDataCountry {
|
||||||
|
|
||||||
/**
|
|
||||||
* The unique country identifier.
|
|
||||||
*/
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private int id;
|
private int id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the country.
|
* The country of origin of this media item
|
||||||
*/
|
|
||||||
@JsonProperty("filter")
|
|
||||||
private String filter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The country name.
|
|
||||||
*/
|
*/
|
||||||
@JsonProperty("tag")
|
@JsonProperty("tag")
|
||||||
private String tag;
|
private String tag;
|
||||||
|
|
||||||
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
|
@JsonProperty("filter")
|
||||||
|
private Optional<String> filter;
|
||||||
|
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
public GetMediaMetaDataCountry(
|
public GetMediaMetaDataCountry(
|
||||||
@JsonProperty("id") int id,
|
@JsonProperty("id") int id,
|
||||||
@JsonProperty("filter") String filter,
|
@JsonProperty("tag") String tag,
|
||||||
@JsonProperty("tag") String tag) {
|
@JsonProperty("filter") Optional<String> filter) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
Utils.checkNotNull(filter, "filter");
|
|
||||||
Utils.checkNotNull(tag, "tag");
|
Utils.checkNotNull(tag, "tag");
|
||||||
|
Utils.checkNotNull(filter, "filter");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.filter = filter;
|
|
||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
|
this.filter = filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetMediaMetaDataCountry(
|
||||||
|
int id,
|
||||||
|
String tag) {
|
||||||
|
this(id, tag, Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The unique country identifier.
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public int id() {
|
public int id() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the country.
|
* The country of origin of this media item
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public String filter() {
|
|
||||||
return filter;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The country name.
|
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String tag() {
|
public String tag() {
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public Optional<String> filter() {
|
||||||
|
return filter;
|
||||||
|
}
|
||||||
|
|
||||||
public final static Builder builder() {
|
public final static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The unique country identifier.
|
|
||||||
*/
|
|
||||||
public GetMediaMetaDataCountry withId(int id) {
|
public GetMediaMetaDataCountry withId(int id) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@@ -83,16 +83,7 @@ public class GetMediaMetaDataCountry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the country.
|
* The country of origin of this media item
|
||||||
*/
|
|
||||||
public GetMediaMetaDataCountry withFilter(String filter) {
|
|
||||||
Utils.checkNotNull(filter, "filter");
|
|
||||||
this.filter = filter;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The country name.
|
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataCountry withTag(String tag) {
|
public GetMediaMetaDataCountry withTag(String tag) {
|
||||||
Utils.checkNotNull(tag, "tag");
|
Utils.checkNotNull(tag, "tag");
|
||||||
@@ -100,6 +91,18 @@ public class GetMediaMetaDataCountry {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GetMediaMetaDataCountry withFilter(String filter) {
|
||||||
|
Utils.checkNotNull(filter, "filter");
|
||||||
|
this.filter = Optional.ofNullable(filter);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetMediaMetaDataCountry withFilter(Optional<String> filter) {
|
||||||
|
Utils.checkNotNull(filter, "filter");
|
||||||
|
this.filter = filter;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(java.lang.Object o) {
|
public boolean equals(java.lang.Object o) {
|
||||||
@@ -112,41 +115,38 @@ public class GetMediaMetaDataCountry {
|
|||||||
GetMediaMetaDataCountry other = (GetMediaMetaDataCountry) o;
|
GetMediaMetaDataCountry other = (GetMediaMetaDataCountry) o;
|
||||||
return
|
return
|
||||||
Objects.deepEquals(this.id, other.id) &&
|
Objects.deepEquals(this.id, other.id) &&
|
||||||
Objects.deepEquals(this.filter, other.filter) &&
|
Objects.deepEquals(this.tag, other.tag) &&
|
||||||
Objects.deepEquals(this.tag, other.tag);
|
Objects.deepEquals(this.filter, other.filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(
|
return Objects.hash(
|
||||||
id,
|
id,
|
||||||
filter,
|
tag,
|
||||||
tag);
|
filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return Utils.toString(GetMediaMetaDataCountry.class,
|
return Utils.toString(GetMediaMetaDataCountry.class,
|
||||||
"id", id,
|
"id", id,
|
||||||
"filter", filter,
|
"tag", tag,
|
||||||
"tag", tag);
|
"filter", filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final static class Builder {
|
public final static class Builder {
|
||||||
|
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
private String filter;
|
|
||||||
|
|
||||||
private String tag;
|
private String tag;
|
||||||
|
|
||||||
|
private Optional<String> filter = Optional.empty();
|
||||||
|
|
||||||
private Builder() {
|
private Builder() {
|
||||||
// force use of static builder() method
|
// force use of static builder() method
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The unique country identifier.
|
|
||||||
*/
|
|
||||||
public Builder id(int id) {
|
public Builder id(int id) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@@ -154,16 +154,7 @@ public class GetMediaMetaDataCountry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the country.
|
* The country of origin of this media item
|
||||||
*/
|
|
||||||
public Builder filter(String filter) {
|
|
||||||
Utils.checkNotNull(filter, "filter");
|
|
||||||
this.filter = filter;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The country name.
|
|
||||||
*/
|
*/
|
||||||
public Builder tag(String tag) {
|
public Builder tag(String tag) {
|
||||||
Utils.checkNotNull(tag, "tag");
|
Utils.checkNotNull(tag, "tag");
|
||||||
@@ -171,11 +162,23 @@ public class GetMediaMetaDataCountry {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Builder filter(String filter) {
|
||||||
|
Utils.checkNotNull(filter, "filter");
|
||||||
|
this.filter = Optional.ofNullable(filter);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder filter(Optional<String> filter) {
|
||||||
|
Utils.checkNotNull(filter, "filter");
|
||||||
|
this.filter = filter;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public GetMediaMetaDataCountry build() {
|
public GetMediaMetaDataCountry build() {
|
||||||
return new GetMediaMetaDataCountry(
|
return new GetMediaMetaDataCountry(
|
||||||
id,
|
id,
|
||||||
filter,
|
tag,
|
||||||
tag);
|
filter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
|||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Long;
|
import java.lang.Integer;
|
||||||
import java.lang.Override;
|
import java.lang.Override;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -18,38 +18,32 @@ import java.util.Optional;
|
|||||||
public class GetMediaMetaDataDirector {
|
public class GetMediaMetaDataDirector {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The unique role identifier.
|
* Unique identifier for the director.
|
||||||
*/
|
*/
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private long id;
|
private int id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the role.
|
* The role of Director
|
||||||
*/
|
|
||||||
@JsonProperty("filter")
|
|
||||||
private String filter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actor's name.
|
|
||||||
*/
|
*/
|
||||||
@JsonProperty("tag")
|
@JsonProperty("tag")
|
||||||
private String tag;
|
private String tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A key associated with the actor tag.
|
* The filter string used to query this director.
|
||||||
*/
|
*/
|
||||||
@JsonProperty("tagKey")
|
@JsonProperty("filter")
|
||||||
private String tagKey;
|
private String filter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The character name or role.
|
* A unique key associated with the director's tag, used for internal identification.
|
||||||
*/
|
*/
|
||||||
@JsonInclude(Include.NON_ABSENT)
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
@JsonProperty("role")
|
@JsonProperty("tagKey")
|
||||||
private Optional<String> role;
|
private Optional<String> tagKey;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL for the role thumbnail image.
|
* The URL of the thumbnail image for the director.
|
||||||
*/
|
*/
|
||||||
@JsonInclude(Include.NON_ABSENT)
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
@JsonProperty("thumb")
|
@JsonProperty("thumb")
|
||||||
@@ -57,52 +51,40 @@ public class GetMediaMetaDataDirector {
|
|||||||
|
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
public GetMediaMetaDataDirector(
|
public GetMediaMetaDataDirector(
|
||||||
@JsonProperty("id") long id,
|
@JsonProperty("id") int id,
|
||||||
@JsonProperty("filter") String filter,
|
|
||||||
@JsonProperty("tag") String tag,
|
@JsonProperty("tag") String tag,
|
||||||
@JsonProperty("tagKey") String tagKey,
|
@JsonProperty("filter") String filter,
|
||||||
@JsonProperty("role") Optional<String> role,
|
@JsonProperty("tagKey") Optional<String> tagKey,
|
||||||
@JsonProperty("thumb") Optional<String> thumb) {
|
@JsonProperty("thumb") Optional<String> thumb) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
Utils.checkNotNull(filter, "filter");
|
|
||||||
Utils.checkNotNull(tag, "tag");
|
Utils.checkNotNull(tag, "tag");
|
||||||
|
Utils.checkNotNull(filter, "filter");
|
||||||
Utils.checkNotNull(tagKey, "tagKey");
|
Utils.checkNotNull(tagKey, "tagKey");
|
||||||
Utils.checkNotNull(role, "role");
|
|
||||||
Utils.checkNotNull(thumb, "thumb");
|
Utils.checkNotNull(thumb, "thumb");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.filter = filter;
|
|
||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
|
this.filter = filter;
|
||||||
this.tagKey = tagKey;
|
this.tagKey = tagKey;
|
||||||
this.role = role;
|
|
||||||
this.thumb = thumb;
|
this.thumb = thumb;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetMediaMetaDataDirector(
|
public GetMediaMetaDataDirector(
|
||||||
long id,
|
int id,
|
||||||
String filter,
|
|
||||||
String tag,
|
String tag,
|
||||||
String tagKey) {
|
String filter) {
|
||||||
this(id, filter, tag, tagKey, Optional.empty(), Optional.empty());
|
this(id, tag, filter, Optional.empty(), Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The unique role identifier.
|
* Unique identifier for the director.
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public long id() {
|
public int id() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the role.
|
* The role of Director
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public String filter() {
|
|
||||||
return filter;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actor's name.
|
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String tag() {
|
public String tag() {
|
||||||
@@ -110,23 +92,23 @@ public class GetMediaMetaDataDirector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A key associated with the actor tag.
|
* The filter string used to query this director.
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String tagKey() {
|
public String filter() {
|
||||||
|
return filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique key associated with the director's tag, used for internal identification.
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public Optional<String> tagKey() {
|
||||||
return tagKey;
|
return tagKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The character name or role.
|
* The URL of the thumbnail image for the director.
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Optional<String> role() {
|
|
||||||
return role;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* URL for the role thumbnail image.
|
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public Optional<String> thumb() {
|
public Optional<String> thumb() {
|
||||||
@@ -138,25 +120,16 @@ public class GetMediaMetaDataDirector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The unique role identifier.
|
* Unique identifier for the director.
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataDirector withId(long id) {
|
public GetMediaMetaDataDirector withId(int id) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the role.
|
* The role of Director
|
||||||
*/
|
|
||||||
public GetMediaMetaDataDirector withFilter(String filter) {
|
|
||||||
Utils.checkNotNull(filter, "filter");
|
|
||||||
this.filter = filter;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actor's name.
|
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataDirector withTag(String tag) {
|
public GetMediaMetaDataDirector withTag(String tag) {
|
||||||
Utils.checkNotNull(tag, "tag");
|
Utils.checkNotNull(tag, "tag");
|
||||||
@@ -165,34 +138,34 @@ public class GetMediaMetaDataDirector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A key associated with the actor tag.
|
* The filter string used to query this director.
|
||||||
|
*/
|
||||||
|
public GetMediaMetaDataDirector withFilter(String filter) {
|
||||||
|
Utils.checkNotNull(filter, "filter");
|
||||||
|
this.filter = filter;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique key associated with the director's tag, used for internal identification.
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataDirector withTagKey(String tagKey) {
|
public GetMediaMetaDataDirector withTagKey(String tagKey) {
|
||||||
|
Utils.checkNotNull(tagKey, "tagKey");
|
||||||
|
this.tagKey = Optional.ofNullable(tagKey);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique key associated with the director's tag, used for internal identification.
|
||||||
|
*/
|
||||||
|
public GetMediaMetaDataDirector withTagKey(Optional<String> tagKey) {
|
||||||
Utils.checkNotNull(tagKey, "tagKey");
|
Utils.checkNotNull(tagKey, "tagKey");
|
||||||
this.tagKey = tagKey;
|
this.tagKey = tagKey;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The character name or role.
|
* The URL of the thumbnail image for the director.
|
||||||
*/
|
|
||||||
public GetMediaMetaDataDirector withRole(String role) {
|
|
||||||
Utils.checkNotNull(role, "role");
|
|
||||||
this.role = Optional.ofNullable(role);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The character name or role.
|
|
||||||
*/
|
|
||||||
public GetMediaMetaDataDirector withRole(Optional<String> role) {
|
|
||||||
Utils.checkNotNull(role, "role");
|
|
||||||
this.role = role;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* URL for the role thumbnail image.
|
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataDirector withThumb(String thumb) {
|
public GetMediaMetaDataDirector withThumb(String thumb) {
|
||||||
Utils.checkNotNull(thumb, "thumb");
|
Utils.checkNotNull(thumb, "thumb");
|
||||||
@@ -201,7 +174,7 @@ public class GetMediaMetaDataDirector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL for the role thumbnail image.
|
* The URL of the thumbnail image for the director.
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataDirector withThumb(Optional<String> thumb) {
|
public GetMediaMetaDataDirector withThumb(Optional<String> thumb) {
|
||||||
Utils.checkNotNull(thumb, "thumb");
|
Utils.checkNotNull(thumb, "thumb");
|
||||||
@@ -221,10 +194,9 @@ public class GetMediaMetaDataDirector {
|
|||||||
GetMediaMetaDataDirector other = (GetMediaMetaDataDirector) o;
|
GetMediaMetaDataDirector other = (GetMediaMetaDataDirector) o;
|
||||||
return
|
return
|
||||||
Objects.deepEquals(this.id, other.id) &&
|
Objects.deepEquals(this.id, other.id) &&
|
||||||
Objects.deepEquals(this.filter, other.filter) &&
|
|
||||||
Objects.deepEquals(this.tag, other.tag) &&
|
Objects.deepEquals(this.tag, other.tag) &&
|
||||||
|
Objects.deepEquals(this.filter, other.filter) &&
|
||||||
Objects.deepEquals(this.tagKey, other.tagKey) &&
|
Objects.deepEquals(this.tagKey, other.tagKey) &&
|
||||||
Objects.deepEquals(this.role, other.role) &&
|
|
||||||
Objects.deepEquals(this.thumb, other.thumb);
|
Objects.deepEquals(this.thumb, other.thumb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,10 +204,9 @@ public class GetMediaMetaDataDirector {
|
|||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(
|
return Objects.hash(
|
||||||
id,
|
id,
|
||||||
filter,
|
|
||||||
tag,
|
tag,
|
||||||
|
filter,
|
||||||
tagKey,
|
tagKey,
|
||||||
role,
|
|
||||||
thumb);
|
thumb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,24 +214,21 @@ public class GetMediaMetaDataDirector {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return Utils.toString(GetMediaMetaDataDirector.class,
|
return Utils.toString(GetMediaMetaDataDirector.class,
|
||||||
"id", id,
|
"id", id,
|
||||||
"filter", filter,
|
|
||||||
"tag", tag,
|
"tag", tag,
|
||||||
|
"filter", filter,
|
||||||
"tagKey", tagKey,
|
"tagKey", tagKey,
|
||||||
"role", role,
|
|
||||||
"thumb", thumb);
|
"thumb", thumb);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final static class Builder {
|
public final static class Builder {
|
||||||
|
|
||||||
private Long id;
|
private Integer id;
|
||||||
|
|
||||||
private String filter;
|
|
||||||
|
|
||||||
private String tag;
|
private String tag;
|
||||||
|
|
||||||
private String tagKey;
|
private String filter;
|
||||||
|
|
||||||
private Optional<String> role = Optional.empty();
|
private Optional<String> tagKey = Optional.empty();
|
||||||
|
|
||||||
private Optional<String> thumb = Optional.empty();
|
private Optional<String> thumb = Optional.empty();
|
||||||
|
|
||||||
@@ -269,25 +237,16 @@ public class GetMediaMetaDataDirector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The unique role identifier.
|
* Unique identifier for the director.
|
||||||
*/
|
*/
|
||||||
public Builder id(long id) {
|
public Builder id(int id) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the role.
|
* The role of Director
|
||||||
*/
|
|
||||||
public Builder filter(String filter) {
|
|
||||||
Utils.checkNotNull(filter, "filter");
|
|
||||||
this.filter = filter;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actor's name.
|
|
||||||
*/
|
*/
|
||||||
public Builder tag(String tag) {
|
public Builder tag(String tag) {
|
||||||
Utils.checkNotNull(tag, "tag");
|
Utils.checkNotNull(tag, "tag");
|
||||||
@@ -296,34 +255,34 @@ public class GetMediaMetaDataDirector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A key associated with the actor tag.
|
* The filter string used to query this director.
|
||||||
|
*/
|
||||||
|
public Builder filter(String filter) {
|
||||||
|
Utils.checkNotNull(filter, "filter");
|
||||||
|
this.filter = filter;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique key associated with the director's tag, used for internal identification.
|
||||||
*/
|
*/
|
||||||
public Builder tagKey(String tagKey) {
|
public Builder tagKey(String tagKey) {
|
||||||
|
Utils.checkNotNull(tagKey, "tagKey");
|
||||||
|
this.tagKey = Optional.ofNullable(tagKey);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique key associated with the director's tag, used for internal identification.
|
||||||
|
*/
|
||||||
|
public Builder tagKey(Optional<String> tagKey) {
|
||||||
Utils.checkNotNull(tagKey, "tagKey");
|
Utils.checkNotNull(tagKey, "tagKey");
|
||||||
this.tagKey = tagKey;
|
this.tagKey = tagKey;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The character name or role.
|
* The URL of the thumbnail image for the director.
|
||||||
*/
|
|
||||||
public Builder role(String role) {
|
|
||||||
Utils.checkNotNull(role, "role");
|
|
||||||
this.role = Optional.ofNullable(role);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The character name or role.
|
|
||||||
*/
|
|
||||||
public Builder role(Optional<String> role) {
|
|
||||||
Utils.checkNotNull(role, "role");
|
|
||||||
this.role = role;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* URL for the role thumbnail image.
|
|
||||||
*/
|
*/
|
||||||
public Builder thumb(String thumb) {
|
public Builder thumb(String thumb) {
|
||||||
Utils.checkNotNull(thumb, "thumb");
|
Utils.checkNotNull(thumb, "thumb");
|
||||||
@@ -332,7 +291,7 @@ public class GetMediaMetaDataDirector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL for the role thumbnail image.
|
* The URL of the thumbnail image for the director.
|
||||||
*/
|
*/
|
||||||
public Builder thumb(Optional<String> thumb) {
|
public Builder thumb(Optional<String> thumb) {
|
||||||
Utils.checkNotNull(thumb, "thumb");
|
Utils.checkNotNull(thumb, "thumb");
|
||||||
@@ -343,10 +302,9 @@ public class GetMediaMetaDataDirector {
|
|||||||
public GetMediaMetaDataDirector build() {
|
public GetMediaMetaDataDirector build() {
|
||||||
return new GetMediaMetaDataDirector(
|
return new GetMediaMetaDataDirector(
|
||||||
id,
|
id,
|
||||||
filter,
|
|
||||||
tag,
|
tag,
|
||||||
|
filter,
|
||||||
tagKey,
|
tagKey,
|
||||||
role,
|
|
||||||
thumb);
|
thumb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,70 +12,60 @@ import java.lang.Override;
|
|||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GetMediaMetaDataGenre
|
||||||
|
*
|
||||||
|
* <p>The filter query string for similar items.
|
||||||
|
*/
|
||||||
public class GetMediaMetaDataGenre {
|
public class GetMediaMetaDataGenre {
|
||||||
|
|
||||||
/**
|
|
||||||
* The unique genre identifier.
|
|
||||||
*/
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private long id;
|
private long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the genre.
|
* The genre name of this media-item
|
||||||
*/
|
|
||||||
@JsonProperty("filter")
|
|
||||||
private String filter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The genre name.
|
|
||||||
*/
|
*/
|
||||||
@JsonProperty("tag")
|
@JsonProperty("tag")
|
||||||
private String tag;
|
private String tag;
|
||||||
|
|
||||||
|
@JsonProperty("filter")
|
||||||
|
private String filter;
|
||||||
|
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
public GetMediaMetaDataGenre(
|
public GetMediaMetaDataGenre(
|
||||||
@JsonProperty("id") long id,
|
@JsonProperty("id") long id,
|
||||||
@JsonProperty("filter") String filter,
|
@JsonProperty("tag") String tag,
|
||||||
@JsonProperty("tag") String tag) {
|
@JsonProperty("filter") String filter) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
Utils.checkNotNull(filter, "filter");
|
|
||||||
Utils.checkNotNull(tag, "tag");
|
Utils.checkNotNull(tag, "tag");
|
||||||
|
Utils.checkNotNull(filter, "filter");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.filter = filter;
|
|
||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
|
this.filter = filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The unique genre identifier.
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public long id() {
|
public long id() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the genre.
|
* The genre name of this media-item
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public String filter() {
|
|
||||||
return filter;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The genre name.
|
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String tag() {
|
public String tag() {
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public String filter() {
|
||||||
|
return filter;
|
||||||
|
}
|
||||||
|
|
||||||
public final static Builder builder() {
|
public final static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The unique genre identifier.
|
|
||||||
*/
|
|
||||||
public GetMediaMetaDataGenre withId(long id) {
|
public GetMediaMetaDataGenre withId(long id) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@@ -83,16 +73,7 @@ public class GetMediaMetaDataGenre {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the genre.
|
* The genre name of this media-item
|
||||||
*/
|
|
||||||
public GetMediaMetaDataGenre withFilter(String filter) {
|
|
||||||
Utils.checkNotNull(filter, "filter");
|
|
||||||
this.filter = filter;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The genre name.
|
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataGenre withTag(String tag) {
|
public GetMediaMetaDataGenre withTag(String tag) {
|
||||||
Utils.checkNotNull(tag, "tag");
|
Utils.checkNotNull(tag, "tag");
|
||||||
@@ -100,6 +81,12 @@ public class GetMediaMetaDataGenre {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GetMediaMetaDataGenre withFilter(String filter) {
|
||||||
|
Utils.checkNotNull(filter, "filter");
|
||||||
|
this.filter = filter;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(java.lang.Object o) {
|
public boolean equals(java.lang.Object o) {
|
||||||
@@ -112,41 +99,38 @@ public class GetMediaMetaDataGenre {
|
|||||||
GetMediaMetaDataGenre other = (GetMediaMetaDataGenre) o;
|
GetMediaMetaDataGenre other = (GetMediaMetaDataGenre) o;
|
||||||
return
|
return
|
||||||
Objects.deepEquals(this.id, other.id) &&
|
Objects.deepEquals(this.id, other.id) &&
|
||||||
Objects.deepEquals(this.filter, other.filter) &&
|
Objects.deepEquals(this.tag, other.tag) &&
|
||||||
Objects.deepEquals(this.tag, other.tag);
|
Objects.deepEquals(this.filter, other.filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(
|
return Objects.hash(
|
||||||
id,
|
id,
|
||||||
filter,
|
tag,
|
||||||
tag);
|
filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return Utils.toString(GetMediaMetaDataGenre.class,
|
return Utils.toString(GetMediaMetaDataGenre.class,
|
||||||
"id", id,
|
"id", id,
|
||||||
"filter", filter,
|
"tag", tag,
|
||||||
"tag", tag);
|
"filter", filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final static class Builder {
|
public final static class Builder {
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
private String filter;
|
|
||||||
|
|
||||||
private String tag;
|
private String tag;
|
||||||
|
|
||||||
|
private String filter;
|
||||||
|
|
||||||
private Builder() {
|
private Builder() {
|
||||||
// force use of static builder() method
|
// force use of static builder() method
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The unique genre identifier.
|
|
||||||
*/
|
|
||||||
public Builder id(long id) {
|
public Builder id(long id) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@@ -154,16 +138,7 @@ public class GetMediaMetaDataGenre {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the genre.
|
* The genre name of this media-item
|
||||||
*/
|
|
||||||
public Builder filter(String filter) {
|
|
||||||
Utils.checkNotNull(filter, "filter");
|
|
||||||
this.filter = filter;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The genre name.
|
|
||||||
*/
|
*/
|
||||||
public Builder tag(String tag) {
|
public Builder tag(String tag) {
|
||||||
Utils.checkNotNull(tag, "tag");
|
Utils.checkNotNull(tag, "tag");
|
||||||
@@ -171,11 +146,17 @@ public class GetMediaMetaDataGenre {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Builder filter(String filter) {
|
||||||
|
Utils.checkNotNull(filter, "filter");
|
||||||
|
this.filter = filter;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public GetMediaMetaDataGenre build() {
|
public GetMediaMetaDataGenre build() {
|
||||||
return new GetMediaMetaDataGenre(
|
return new GetMediaMetaDataGenre(
|
||||||
id,
|
id,
|
||||||
filter,
|
tag,
|
||||||
tag);
|
filter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,28 +13,19 @@ import java.util.Objects;
|
|||||||
|
|
||||||
public class GetMediaMetaDataImage {
|
public class GetMediaMetaDataImage {
|
||||||
|
|
||||||
/**
|
|
||||||
* Alternate text for the image.
|
|
||||||
*/
|
|
||||||
@JsonProperty("alt")
|
@JsonProperty("alt")
|
||||||
private String alt;
|
private String alt;
|
||||||
|
|
||||||
/**
|
|
||||||
* The type of image (e.g., coverPoster, background, clearLogo).
|
|
||||||
*/
|
|
||||||
@JsonProperty("type")
|
@JsonProperty("type")
|
||||||
private String type;
|
private GetMediaMetaDataLibraryType type;
|
||||||
|
|
||||||
/**
|
|
||||||
* The URL of the image.
|
|
||||||
*/
|
|
||||||
@JsonProperty("url")
|
@JsonProperty("url")
|
||||||
private String url;
|
private String url;
|
||||||
|
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
public GetMediaMetaDataImage(
|
public GetMediaMetaDataImage(
|
||||||
@JsonProperty("alt") String alt,
|
@JsonProperty("alt") String alt,
|
||||||
@JsonProperty("type") String type,
|
@JsonProperty("type") GetMediaMetaDataLibraryType type,
|
||||||
@JsonProperty("url") String url) {
|
@JsonProperty("url") String url) {
|
||||||
Utils.checkNotNull(alt, "alt");
|
Utils.checkNotNull(alt, "alt");
|
||||||
Utils.checkNotNull(type, "type");
|
Utils.checkNotNull(type, "type");
|
||||||
@@ -44,25 +35,16 @@ public class GetMediaMetaDataImage {
|
|||||||
this.url = url;
|
this.url = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Alternate text for the image.
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String alt() {
|
public String alt() {
|
||||||
return alt;
|
return alt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The type of image (e.g., coverPoster, background, clearLogo).
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String type() {
|
public GetMediaMetaDataLibraryType type() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The URL of the image.
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String url() {
|
public String url() {
|
||||||
return url;
|
return url;
|
||||||
@@ -72,27 +54,18 @@ public class GetMediaMetaDataImage {
|
|||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Alternate text for the image.
|
|
||||||
*/
|
|
||||||
public GetMediaMetaDataImage withAlt(String alt) {
|
public GetMediaMetaDataImage withAlt(String alt) {
|
||||||
Utils.checkNotNull(alt, "alt");
|
Utils.checkNotNull(alt, "alt");
|
||||||
this.alt = alt;
|
this.alt = alt;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public GetMediaMetaDataImage withType(GetMediaMetaDataLibraryType type) {
|
||||||
* The type of image (e.g., coverPoster, background, clearLogo).
|
|
||||||
*/
|
|
||||||
public GetMediaMetaDataImage withType(String type) {
|
|
||||||
Utils.checkNotNull(type, "type");
|
Utils.checkNotNull(type, "type");
|
||||||
this.type = type;
|
this.type = type;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The URL of the image.
|
|
||||||
*/
|
|
||||||
public GetMediaMetaDataImage withUrl(String url) {
|
public GetMediaMetaDataImage withUrl(String url) {
|
||||||
Utils.checkNotNull(url, "url");
|
Utils.checkNotNull(url, "url");
|
||||||
this.url = url;
|
this.url = url;
|
||||||
@@ -135,7 +108,7 @@ public class GetMediaMetaDataImage {
|
|||||||
|
|
||||||
private String alt;
|
private String alt;
|
||||||
|
|
||||||
private String type;
|
private GetMediaMetaDataLibraryType type;
|
||||||
|
|
||||||
private String url;
|
private String url;
|
||||||
|
|
||||||
@@ -143,27 +116,18 @@ public class GetMediaMetaDataImage {
|
|||||||
// force use of static builder() method
|
// force use of static builder() method
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Alternate text for the image.
|
|
||||||
*/
|
|
||||||
public Builder alt(String alt) {
|
public Builder alt(String alt) {
|
||||||
Utils.checkNotNull(alt, "alt");
|
Utils.checkNotNull(alt, "alt");
|
||||||
this.alt = alt;
|
this.alt = alt;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public Builder type(GetMediaMetaDataLibraryType type) {
|
||||||
* The type of image (e.g., coverPoster, background, clearLogo).
|
|
||||||
*/
|
|
||||||
public Builder type(String type) {
|
|
||||||
Utils.checkNotNull(type, "type");
|
Utils.checkNotNull(type, "type");
|
||||||
this.type = type;
|
this.type = type;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The URL of the image.
|
|
||||||
*/
|
|
||||||
public Builder url(String url) {
|
public Builder url(String url) {
|
||||||
Utils.checkNotNull(url, "url");
|
Utils.checkNotNull(url, "url");
|
||||||
this.url = url;
|
this.url = url;
|
||||||
|
|||||||
@@ -0,0 +1,187 @@
|
|||||||
|
/*
|
||||||
|
* 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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@JsonDeserialize(using = GetMediaMetaDataLibraryType._Deserializer.class)
|
||||||
|
@JsonSerialize(using = GetMediaMetaDataLibraryType._Serializer.class)
|
||||||
|
public class GetMediaMetaDataLibraryType {
|
||||||
|
|
||||||
|
public static final GetMediaMetaDataLibraryType COVER_POSTER = new GetMediaMetaDataLibraryType("coverPoster");
|
||||||
|
public static final GetMediaMetaDataLibraryType BACKGROUND = new GetMediaMetaDataLibraryType("background");
|
||||||
|
public static final GetMediaMetaDataLibraryType SNAPSHOT = new GetMediaMetaDataLibraryType("snapshot");
|
||||||
|
public static final GetMediaMetaDataLibraryType CLEAR_LOGO = new GetMediaMetaDataLibraryType("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, GetMediaMetaDataLibraryType> values = createValuesMap();
|
||||||
|
private static final Map<String, GetMediaMetaDataLibraryTypeEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private GetMediaMetaDataLibraryType(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a GetMediaMetaDataLibraryType 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 GetMediaMetaDataLibraryType
|
||||||
|
*/
|
||||||
|
public static GetMediaMetaDataLibraryType of(String value) {
|
||||||
|
synchronized (GetMediaMetaDataLibraryType.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new GetMediaMetaDataLibraryType(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Optional<GetMediaMetaDataLibraryTypeEnum> 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;
|
||||||
|
GetMediaMetaDataLibraryType other = (GetMediaMetaDataLibraryType) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "GetMediaMetaDataLibraryType [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static GetMediaMetaDataLibraryType[] values() {
|
||||||
|
synchronized (GetMediaMetaDataLibraryType.class) {
|
||||||
|
return values.values().toArray(new GetMediaMetaDataLibraryType[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, GetMediaMetaDataLibraryType> createValuesMap() {
|
||||||
|
Map<String, GetMediaMetaDataLibraryType> 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, GetMediaMetaDataLibraryTypeEnum> createEnumsMap() {
|
||||||
|
Map<String, GetMediaMetaDataLibraryTypeEnum> map = new HashMap<>();
|
||||||
|
map.put("coverPoster", GetMediaMetaDataLibraryTypeEnum.COVER_POSTER);
|
||||||
|
map.put("background", GetMediaMetaDataLibraryTypeEnum.BACKGROUND);
|
||||||
|
map.put("snapshot", GetMediaMetaDataLibraryTypeEnum.SNAPSHOT);
|
||||||
|
map.put("clearLogo", GetMediaMetaDataLibraryTypeEnum.CLEAR_LOGO);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<GetMediaMetaDataLibraryType> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(GetMediaMetaDataLibraryType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(GetMediaMetaDataLibraryType value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<GetMediaMetaDataLibraryType> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(GetMediaMetaDataLibraryType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GetMediaMetaDataLibraryType 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 GetMediaMetaDataLibraryType.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum GetMediaMetaDataLibraryTypeEnum {
|
||||||
|
|
||||||
|
COVER_POSTER("coverPoster"),
|
||||||
|
BACKGROUND("background"),
|
||||||
|
SNAPSHOT("snapshot"),
|
||||||
|
CLEAR_LOGO("clearLogo"),;
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private GetMediaMetaDataLibraryTypeEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -18,38 +18,39 @@ import java.util.Optional;
|
|||||||
public class GetMediaMetaDataRole {
|
public class GetMediaMetaDataRole {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The unique role identifier.
|
* Unique identifier for the actor or role.
|
||||||
*/
|
*/
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private long id;
|
private long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the role.
|
* The display tag for the actor (typically the actor's name).
|
||||||
*/
|
|
||||||
@JsonProperty("filter")
|
|
||||||
private String filter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actor's name.
|
|
||||||
*/
|
*/
|
||||||
@JsonProperty("tag")
|
@JsonProperty("tag")
|
||||||
private String tag;
|
private String tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A key associated with the actor tag.
|
* The role played by the actor in the media item.
|
||||||
*/
|
|
||||||
@JsonProperty("tagKey")
|
|
||||||
private String tagKey;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The character name or role.
|
|
||||||
*/
|
*/
|
||||||
@JsonInclude(Include.NON_ABSENT)
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
@JsonProperty("role")
|
@JsonProperty("role")
|
||||||
private Optional<String> role;
|
private Optional<String> role;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL for the role thumbnail image.
|
* The filter string used to query this actor. For example, it may indicate that this is an actor with a given key.
|
||||||
|
*/
|
||||||
|
@JsonProperty("filter")
|
||||||
|
private String filter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique key associated with the actor's tag, used for internal identification.
|
||||||
|
*/
|
||||||
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
|
@JsonProperty("tagKey")
|
||||||
|
private Optional<String> tagKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The URL of the thumbnail image for the actor.
|
||||||
*/
|
*/
|
||||||
@JsonInclude(Include.NON_ABSENT)
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
@JsonProperty("thumb")
|
@JsonProperty("thumb")
|
||||||
@@ -58,35 +59,34 @@ public class GetMediaMetaDataRole {
|
|||||||
@JsonCreator
|
@JsonCreator
|
||||||
public GetMediaMetaDataRole(
|
public GetMediaMetaDataRole(
|
||||||
@JsonProperty("id") long id,
|
@JsonProperty("id") long id,
|
||||||
@JsonProperty("filter") String filter,
|
|
||||||
@JsonProperty("tag") String tag,
|
@JsonProperty("tag") String tag,
|
||||||
@JsonProperty("tagKey") String tagKey,
|
|
||||||
@JsonProperty("role") Optional<String> role,
|
@JsonProperty("role") Optional<String> role,
|
||||||
|
@JsonProperty("filter") String filter,
|
||||||
|
@JsonProperty("tagKey") Optional<String> tagKey,
|
||||||
@JsonProperty("thumb") Optional<String> thumb) {
|
@JsonProperty("thumb") Optional<String> thumb) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
Utils.checkNotNull(filter, "filter");
|
|
||||||
Utils.checkNotNull(tag, "tag");
|
Utils.checkNotNull(tag, "tag");
|
||||||
Utils.checkNotNull(tagKey, "tagKey");
|
|
||||||
Utils.checkNotNull(role, "role");
|
Utils.checkNotNull(role, "role");
|
||||||
|
Utils.checkNotNull(filter, "filter");
|
||||||
|
Utils.checkNotNull(tagKey, "tagKey");
|
||||||
Utils.checkNotNull(thumb, "thumb");
|
Utils.checkNotNull(thumb, "thumb");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.filter = filter;
|
|
||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
this.tagKey = tagKey;
|
|
||||||
this.role = role;
|
this.role = role;
|
||||||
|
this.filter = filter;
|
||||||
|
this.tagKey = tagKey;
|
||||||
this.thumb = thumb;
|
this.thumb = thumb;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetMediaMetaDataRole(
|
public GetMediaMetaDataRole(
|
||||||
long id,
|
long id,
|
||||||
String filter,
|
|
||||||
String tag,
|
String tag,
|
||||||
String tagKey) {
|
String filter) {
|
||||||
this(id, filter, tag, tagKey, Optional.empty(), Optional.empty());
|
this(id, tag, Optional.empty(), filter, Optional.empty(), Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The unique role identifier.
|
* Unique identifier for the actor or role.
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public long id() {
|
public long id() {
|
||||||
@@ -94,15 +94,7 @@ public class GetMediaMetaDataRole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the role.
|
* The display tag for the actor (typically the actor's name).
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public String filter() {
|
|
||||||
return filter;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actor's name.
|
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String tag() {
|
public String tag() {
|
||||||
@@ -110,15 +102,7 @@ public class GetMediaMetaDataRole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A key associated with the actor tag.
|
* The role played by the actor in the media item.
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public String tagKey() {
|
|
||||||
return tagKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The character name or role.
|
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public Optional<String> role() {
|
public Optional<String> role() {
|
||||||
@@ -126,7 +110,23 @@ public class GetMediaMetaDataRole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL for the role thumbnail image.
|
* The filter string used to query this actor. For example, it may indicate that this is an actor with a given key.
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public String filter() {
|
||||||
|
return filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique key associated with the actor's tag, used for internal identification.
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public Optional<String> tagKey() {
|
||||||
|
return tagKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The URL of the thumbnail image for the actor.
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public Optional<String> thumb() {
|
public Optional<String> thumb() {
|
||||||
@@ -138,7 +138,7 @@ public class GetMediaMetaDataRole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The unique role identifier.
|
* Unique identifier for the actor or role.
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataRole withId(long id) {
|
public GetMediaMetaDataRole withId(long id) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
@@ -147,16 +147,7 @@ public class GetMediaMetaDataRole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the role.
|
* The display tag for the actor (typically the actor's name).
|
||||||
*/
|
|
||||||
public GetMediaMetaDataRole withFilter(String filter) {
|
|
||||||
Utils.checkNotNull(filter, "filter");
|
|
||||||
this.filter = filter;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actor's name.
|
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataRole withTag(String tag) {
|
public GetMediaMetaDataRole withTag(String tag) {
|
||||||
Utils.checkNotNull(tag, "tag");
|
Utils.checkNotNull(tag, "tag");
|
||||||
@@ -165,16 +156,7 @@ public class GetMediaMetaDataRole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A key associated with the actor tag.
|
* The role played by the actor in the media item.
|
||||||
*/
|
|
||||||
public GetMediaMetaDataRole withTagKey(String tagKey) {
|
|
||||||
Utils.checkNotNull(tagKey, "tagKey");
|
|
||||||
this.tagKey = tagKey;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The character name or role.
|
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataRole withRole(String role) {
|
public GetMediaMetaDataRole withRole(String role) {
|
||||||
Utils.checkNotNull(role, "role");
|
Utils.checkNotNull(role, "role");
|
||||||
@@ -183,7 +165,7 @@ public class GetMediaMetaDataRole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The character name or role.
|
* The role played by the actor in the media item.
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataRole withRole(Optional<String> role) {
|
public GetMediaMetaDataRole withRole(Optional<String> role) {
|
||||||
Utils.checkNotNull(role, "role");
|
Utils.checkNotNull(role, "role");
|
||||||
@@ -192,7 +174,34 @@ public class GetMediaMetaDataRole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL for the role thumbnail image.
|
* The filter string used to query this actor. For example, it may indicate that this is an actor with a given key.
|
||||||
|
*/
|
||||||
|
public GetMediaMetaDataRole withFilter(String filter) {
|
||||||
|
Utils.checkNotNull(filter, "filter");
|
||||||
|
this.filter = filter;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique key associated with the actor's tag, used for internal identification.
|
||||||
|
*/
|
||||||
|
public GetMediaMetaDataRole withTagKey(String tagKey) {
|
||||||
|
Utils.checkNotNull(tagKey, "tagKey");
|
||||||
|
this.tagKey = Optional.ofNullable(tagKey);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique key associated with the actor's tag, used for internal identification.
|
||||||
|
*/
|
||||||
|
public GetMediaMetaDataRole withTagKey(Optional<String> tagKey) {
|
||||||
|
Utils.checkNotNull(tagKey, "tagKey");
|
||||||
|
this.tagKey = tagKey;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The URL of the thumbnail image for the actor.
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataRole withThumb(String thumb) {
|
public GetMediaMetaDataRole withThumb(String thumb) {
|
||||||
Utils.checkNotNull(thumb, "thumb");
|
Utils.checkNotNull(thumb, "thumb");
|
||||||
@@ -201,7 +210,7 @@ public class GetMediaMetaDataRole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL for the role thumbnail image.
|
* The URL of the thumbnail image for the actor.
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataRole withThumb(Optional<String> thumb) {
|
public GetMediaMetaDataRole withThumb(Optional<String> thumb) {
|
||||||
Utils.checkNotNull(thumb, "thumb");
|
Utils.checkNotNull(thumb, "thumb");
|
||||||
@@ -221,10 +230,10 @@ public class GetMediaMetaDataRole {
|
|||||||
GetMediaMetaDataRole other = (GetMediaMetaDataRole) o;
|
GetMediaMetaDataRole other = (GetMediaMetaDataRole) o;
|
||||||
return
|
return
|
||||||
Objects.deepEquals(this.id, other.id) &&
|
Objects.deepEquals(this.id, other.id) &&
|
||||||
Objects.deepEquals(this.filter, other.filter) &&
|
|
||||||
Objects.deepEquals(this.tag, other.tag) &&
|
Objects.deepEquals(this.tag, other.tag) &&
|
||||||
Objects.deepEquals(this.tagKey, other.tagKey) &&
|
|
||||||
Objects.deepEquals(this.role, other.role) &&
|
Objects.deepEquals(this.role, other.role) &&
|
||||||
|
Objects.deepEquals(this.filter, other.filter) &&
|
||||||
|
Objects.deepEquals(this.tagKey, other.tagKey) &&
|
||||||
Objects.deepEquals(this.thumb, other.thumb);
|
Objects.deepEquals(this.thumb, other.thumb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,10 +241,10 @@ public class GetMediaMetaDataRole {
|
|||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(
|
return Objects.hash(
|
||||||
id,
|
id,
|
||||||
filter,
|
|
||||||
tag,
|
tag,
|
||||||
tagKey,
|
|
||||||
role,
|
role,
|
||||||
|
filter,
|
||||||
|
tagKey,
|
||||||
thumb);
|
thumb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,10 +252,10 @@ public class GetMediaMetaDataRole {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return Utils.toString(GetMediaMetaDataRole.class,
|
return Utils.toString(GetMediaMetaDataRole.class,
|
||||||
"id", id,
|
"id", id,
|
||||||
"filter", filter,
|
|
||||||
"tag", tag,
|
"tag", tag,
|
||||||
"tagKey", tagKey,
|
|
||||||
"role", role,
|
"role", role,
|
||||||
|
"filter", filter,
|
||||||
|
"tagKey", tagKey,
|
||||||
"thumb", thumb);
|
"thumb", thumb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,14 +263,14 @@ public class GetMediaMetaDataRole {
|
|||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
private String filter;
|
|
||||||
|
|
||||||
private String tag;
|
private String tag;
|
||||||
|
|
||||||
private String tagKey;
|
|
||||||
|
|
||||||
private Optional<String> role = Optional.empty();
|
private Optional<String> role = Optional.empty();
|
||||||
|
|
||||||
|
private String filter;
|
||||||
|
|
||||||
|
private Optional<String> tagKey = Optional.empty();
|
||||||
|
|
||||||
private Optional<String> thumb = Optional.empty();
|
private Optional<String> thumb = Optional.empty();
|
||||||
|
|
||||||
private Builder() {
|
private Builder() {
|
||||||
@@ -269,7 +278,7 @@ public class GetMediaMetaDataRole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The unique role identifier.
|
* Unique identifier for the actor or role.
|
||||||
*/
|
*/
|
||||||
public Builder id(long id) {
|
public Builder id(long id) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
@@ -278,16 +287,7 @@ public class GetMediaMetaDataRole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the role.
|
* The display tag for the actor (typically the actor's name).
|
||||||
*/
|
|
||||||
public Builder filter(String filter) {
|
|
||||||
Utils.checkNotNull(filter, "filter");
|
|
||||||
this.filter = filter;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actor's name.
|
|
||||||
*/
|
*/
|
||||||
public Builder tag(String tag) {
|
public Builder tag(String tag) {
|
||||||
Utils.checkNotNull(tag, "tag");
|
Utils.checkNotNull(tag, "tag");
|
||||||
@@ -296,16 +296,7 @@ public class GetMediaMetaDataRole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A key associated with the actor tag.
|
* The role played by the actor in the media item.
|
||||||
*/
|
|
||||||
public Builder tagKey(String tagKey) {
|
|
||||||
Utils.checkNotNull(tagKey, "tagKey");
|
|
||||||
this.tagKey = tagKey;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The character name or role.
|
|
||||||
*/
|
*/
|
||||||
public Builder role(String role) {
|
public Builder role(String role) {
|
||||||
Utils.checkNotNull(role, "role");
|
Utils.checkNotNull(role, "role");
|
||||||
@@ -314,7 +305,7 @@ public class GetMediaMetaDataRole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The character name or role.
|
* The role played by the actor in the media item.
|
||||||
*/
|
*/
|
||||||
public Builder role(Optional<String> role) {
|
public Builder role(Optional<String> role) {
|
||||||
Utils.checkNotNull(role, "role");
|
Utils.checkNotNull(role, "role");
|
||||||
@@ -323,7 +314,34 @@ public class GetMediaMetaDataRole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL for the role thumbnail image.
|
* The filter string used to query this actor. For example, it may indicate that this is an actor with a given key.
|
||||||
|
*/
|
||||||
|
public Builder filter(String filter) {
|
||||||
|
Utils.checkNotNull(filter, "filter");
|
||||||
|
this.filter = filter;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique key associated with the actor's tag, used for internal identification.
|
||||||
|
*/
|
||||||
|
public Builder tagKey(String tagKey) {
|
||||||
|
Utils.checkNotNull(tagKey, "tagKey");
|
||||||
|
this.tagKey = Optional.ofNullable(tagKey);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique key associated with the actor's tag, used for internal identification.
|
||||||
|
*/
|
||||||
|
public Builder tagKey(Optional<String> tagKey) {
|
||||||
|
Utils.checkNotNull(tagKey, "tagKey");
|
||||||
|
this.tagKey = tagKey;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The URL of the thumbnail image for the actor.
|
||||||
*/
|
*/
|
||||||
public Builder thumb(String thumb) {
|
public Builder thumb(String thumb) {
|
||||||
Utils.checkNotNull(thumb, "thumb");
|
Utils.checkNotNull(thumb, "thumb");
|
||||||
@@ -332,7 +350,7 @@ public class GetMediaMetaDataRole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL for the role thumbnail image.
|
* The URL of the thumbnail image for the actor.
|
||||||
*/
|
*/
|
||||||
public Builder thumb(Optional<String> thumb) {
|
public Builder thumb(Optional<String> thumb) {
|
||||||
Utils.checkNotNull(thumb, "thumb");
|
Utils.checkNotNull(thumb, "thumb");
|
||||||
@@ -343,10 +361,10 @@ public class GetMediaMetaDataRole {
|
|||||||
public GetMediaMetaDataRole build() {
|
public GetMediaMetaDataRole build() {
|
||||||
return new GetMediaMetaDataRole(
|
return new GetMediaMetaDataRole(
|
||||||
id,
|
id,
|
||||||
filter,
|
|
||||||
tag,
|
tag,
|
||||||
tagKey,
|
|
||||||
role,
|
role,
|
||||||
|
filter,
|
||||||
|
tagKey,
|
||||||
thumb);
|
thumb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,10 +27,20 @@ public class GetMediaMetaDataStream {
|
|||||||
private long id;
|
private long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stream type (1=video, 2=audio, 3=subtitle).
|
* Stream type:
|
||||||
|
* - 1 = video
|
||||||
|
* - 2 = audio
|
||||||
|
* - 3 = subtitle
|
||||||
*/
|
*/
|
||||||
@JsonProperty("streamType")
|
@JsonProperty("streamType")
|
||||||
private int streamType;
|
private GetMediaMetaDataStreamType streamType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format of the stream (e.g., srt).
|
||||||
|
*/
|
||||||
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
|
@JsonProperty("format")
|
||||||
|
private Optional<String> format;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if this stream is default.
|
* Indicates if this stream is default.
|
||||||
@@ -48,8 +58,9 @@ public class GetMediaMetaDataStream {
|
|||||||
/**
|
/**
|
||||||
* Index of the stream.
|
* Index of the stream.
|
||||||
*/
|
*/
|
||||||
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
@JsonProperty("index")
|
@JsonProperty("index")
|
||||||
private int index;
|
private Optional<Integer> index;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bitrate of the stream.
|
* Bitrate of the stream.
|
||||||
@@ -216,6 +227,13 @@ public class GetMediaMetaDataStream {
|
|||||||
@JsonProperty("frameRate")
|
@JsonProperty("frameRate")
|
||||||
private Optional<Float> frameRate;
|
private Optional<Float> frameRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Key to access this stream part.
|
||||||
|
*/
|
||||||
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
|
@JsonProperty("key")
|
||||||
|
private Optional<String> key;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Height of the video stream.
|
* Height of the video stream.
|
||||||
*/
|
*/
|
||||||
@@ -345,10 +363,11 @@ public class GetMediaMetaDataStream {
|
|||||||
@JsonCreator
|
@JsonCreator
|
||||||
public GetMediaMetaDataStream(
|
public GetMediaMetaDataStream(
|
||||||
@JsonProperty("id") long id,
|
@JsonProperty("id") long id,
|
||||||
@JsonProperty("streamType") int streamType,
|
@JsonProperty("streamType") GetMediaMetaDataStreamType streamType,
|
||||||
|
@JsonProperty("format") Optional<String> format,
|
||||||
@JsonProperty("default") Optional<Boolean> default_,
|
@JsonProperty("default") Optional<Boolean> default_,
|
||||||
@JsonProperty("codec") String codec,
|
@JsonProperty("codec") String codec,
|
||||||
@JsonProperty("index") int index,
|
@JsonProperty("index") Optional<Integer> index,
|
||||||
@JsonProperty("bitrate") Optional<Integer> bitrate,
|
@JsonProperty("bitrate") Optional<Integer> bitrate,
|
||||||
@JsonProperty("language") Optional<String> language,
|
@JsonProperty("language") Optional<String> language,
|
||||||
@JsonProperty("languageTag") Optional<String> languageTag,
|
@JsonProperty("languageTag") Optional<String> languageTag,
|
||||||
@@ -373,6 +392,7 @@ public class GetMediaMetaDataStream {
|
|||||||
@JsonProperty("colorSpace") Optional<String> colorSpace,
|
@JsonProperty("colorSpace") Optional<String> colorSpace,
|
||||||
@JsonProperty("colorTrc") Optional<String> colorTrc,
|
@JsonProperty("colorTrc") Optional<String> colorTrc,
|
||||||
@JsonProperty("frameRate") Optional<Float> frameRate,
|
@JsonProperty("frameRate") Optional<Float> frameRate,
|
||||||
|
@JsonProperty("key") Optional<String> key,
|
||||||
@JsonProperty("height") Optional<Integer> height,
|
@JsonProperty("height") Optional<Integer> height,
|
||||||
@JsonProperty("level") Optional<Integer> level,
|
@JsonProperty("level") Optional<Integer> level,
|
||||||
@JsonProperty("original") Optional<Boolean> original,
|
@JsonProperty("original") Optional<Boolean> original,
|
||||||
@@ -395,6 +415,7 @@ public class GetMediaMetaDataStream {
|
|||||||
@JsonProperty("title") Optional<String> title) {
|
@JsonProperty("title") Optional<String> title) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
Utils.checkNotNull(streamType, "streamType");
|
Utils.checkNotNull(streamType, "streamType");
|
||||||
|
Utils.checkNotNull(format, "format");
|
||||||
Utils.checkNotNull(default_, "default_");
|
Utils.checkNotNull(default_, "default_");
|
||||||
Utils.checkNotNull(codec, "codec");
|
Utils.checkNotNull(codec, "codec");
|
||||||
Utils.checkNotNull(index, "index");
|
Utils.checkNotNull(index, "index");
|
||||||
@@ -422,6 +443,7 @@ public class GetMediaMetaDataStream {
|
|||||||
Utils.checkNotNull(colorSpace, "colorSpace");
|
Utils.checkNotNull(colorSpace, "colorSpace");
|
||||||
Utils.checkNotNull(colorTrc, "colorTrc");
|
Utils.checkNotNull(colorTrc, "colorTrc");
|
||||||
Utils.checkNotNull(frameRate, "frameRate");
|
Utils.checkNotNull(frameRate, "frameRate");
|
||||||
|
Utils.checkNotNull(key, "key");
|
||||||
Utils.checkNotNull(height, "height");
|
Utils.checkNotNull(height, "height");
|
||||||
Utils.checkNotNull(level, "level");
|
Utils.checkNotNull(level, "level");
|
||||||
Utils.checkNotNull(original, "original");
|
Utils.checkNotNull(original, "original");
|
||||||
@@ -444,6 +466,7 @@ public class GetMediaMetaDataStream {
|
|||||||
Utils.checkNotNull(title, "title");
|
Utils.checkNotNull(title, "title");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.streamType = streamType;
|
this.streamType = streamType;
|
||||||
|
this.format = format;
|
||||||
this.default_ = default_;
|
this.default_ = default_;
|
||||||
this.codec = codec;
|
this.codec = codec;
|
||||||
this.index = index;
|
this.index = index;
|
||||||
@@ -471,6 +494,7 @@ public class GetMediaMetaDataStream {
|
|||||||
this.colorSpace = colorSpace;
|
this.colorSpace = colorSpace;
|
||||||
this.colorTrc = colorTrc;
|
this.colorTrc = colorTrc;
|
||||||
this.frameRate = frameRate;
|
this.frameRate = frameRate;
|
||||||
|
this.key = key;
|
||||||
this.height = height;
|
this.height = height;
|
||||||
this.level = level;
|
this.level = level;
|
||||||
this.original = original;
|
this.original = original;
|
||||||
@@ -495,12 +519,11 @@ public class GetMediaMetaDataStream {
|
|||||||
|
|
||||||
public GetMediaMetaDataStream(
|
public GetMediaMetaDataStream(
|
||||||
long id,
|
long id,
|
||||||
int streamType,
|
GetMediaMetaDataStreamType streamType,
|
||||||
String codec,
|
String codec,
|
||||||
int index,
|
|
||||||
String displayTitle,
|
String displayTitle,
|
||||||
String extendedDisplayTitle) {
|
String extendedDisplayTitle) {
|
||||||
this(id, streamType, Optional.empty(), codec, index, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), displayTitle, extendedDisplayTitle, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
this(id, streamType, Optional.empty(), Optional.empty(), codec, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), displayTitle, extendedDisplayTitle, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -512,13 +535,24 @@ public class GetMediaMetaDataStream {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stream type (1=video, 2=audio, 3=subtitle).
|
* Stream type:
|
||||||
|
* - 1 = video
|
||||||
|
* - 2 = audio
|
||||||
|
* - 3 = subtitle
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public int streamType() {
|
public GetMediaMetaDataStreamType streamType() {
|
||||||
return streamType;
|
return streamType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format of the stream (e.g., srt).
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public Optional<String> format() {
|
||||||
|
return format;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if this stream is default.
|
* Indicates if this stream is default.
|
||||||
*/
|
*/
|
||||||
@@ -539,7 +573,7 @@ public class GetMediaMetaDataStream {
|
|||||||
* Index of the stream.
|
* Index of the stream.
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public int index() {
|
public Optional<Integer> index() {
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -732,6 +766,14 @@ public class GetMediaMetaDataStream {
|
|||||||
return frameRate;
|
return frameRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Key to access this stream part.
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public Optional<String> key() {
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Height of the video stream.
|
* Height of the video stream.
|
||||||
*/
|
*/
|
||||||
@@ -894,14 +936,35 @@ public class GetMediaMetaDataStream {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stream type (1=video, 2=audio, 3=subtitle).
|
* Stream type:
|
||||||
|
* - 1 = video
|
||||||
|
* - 2 = audio
|
||||||
|
* - 3 = subtitle
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataStream withStreamType(int streamType) {
|
public GetMediaMetaDataStream withStreamType(GetMediaMetaDataStreamType streamType) {
|
||||||
Utils.checkNotNull(streamType, "streamType");
|
Utils.checkNotNull(streamType, "streamType");
|
||||||
this.streamType = streamType;
|
this.streamType = streamType;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format of the stream (e.g., srt).
|
||||||
|
*/
|
||||||
|
public GetMediaMetaDataStream withFormat(String format) {
|
||||||
|
Utils.checkNotNull(format, "format");
|
||||||
|
this.format = Optional.ofNullable(format);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format of the stream (e.g., srt).
|
||||||
|
*/
|
||||||
|
public GetMediaMetaDataStream withFormat(Optional<String> format) {
|
||||||
|
Utils.checkNotNull(format, "format");
|
||||||
|
this.format = format;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if this stream is default.
|
* Indicates if this stream is default.
|
||||||
*/
|
*/
|
||||||
@@ -933,6 +996,15 @@ public class GetMediaMetaDataStream {
|
|||||||
* Index of the stream.
|
* Index of the stream.
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataStream withIndex(int index) {
|
public GetMediaMetaDataStream withIndex(int index) {
|
||||||
|
Utils.checkNotNull(index, "index");
|
||||||
|
this.index = Optional.ofNullable(index);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Index of the stream.
|
||||||
|
*/
|
||||||
|
public GetMediaMetaDataStream withIndex(Optional<Integer> index) {
|
||||||
Utils.checkNotNull(index, "index");
|
Utils.checkNotNull(index, "index");
|
||||||
this.index = index;
|
this.index = index;
|
||||||
return this;
|
return this;
|
||||||
@@ -1364,6 +1436,24 @@ public class GetMediaMetaDataStream {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Key to access this stream part.
|
||||||
|
*/
|
||||||
|
public GetMediaMetaDataStream withKey(String key) {
|
||||||
|
Utils.checkNotNull(key, "key");
|
||||||
|
this.key = Optional.ofNullable(key);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Key to access this stream part.
|
||||||
|
*/
|
||||||
|
public GetMediaMetaDataStream withKey(Optional<String> key) {
|
||||||
|
Utils.checkNotNull(key, "key");
|
||||||
|
this.key = key;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Height of the video stream.
|
* Height of the video stream.
|
||||||
*/
|
*/
|
||||||
@@ -1695,6 +1785,7 @@ public class GetMediaMetaDataStream {
|
|||||||
return
|
return
|
||||||
Objects.deepEquals(this.id, other.id) &&
|
Objects.deepEquals(this.id, other.id) &&
|
||||||
Objects.deepEquals(this.streamType, other.streamType) &&
|
Objects.deepEquals(this.streamType, other.streamType) &&
|
||||||
|
Objects.deepEquals(this.format, other.format) &&
|
||||||
Objects.deepEquals(this.default_, other.default_) &&
|
Objects.deepEquals(this.default_, other.default_) &&
|
||||||
Objects.deepEquals(this.codec, other.codec) &&
|
Objects.deepEquals(this.codec, other.codec) &&
|
||||||
Objects.deepEquals(this.index, other.index) &&
|
Objects.deepEquals(this.index, other.index) &&
|
||||||
@@ -1722,6 +1813,7 @@ public class GetMediaMetaDataStream {
|
|||||||
Objects.deepEquals(this.colorSpace, other.colorSpace) &&
|
Objects.deepEquals(this.colorSpace, other.colorSpace) &&
|
||||||
Objects.deepEquals(this.colorTrc, other.colorTrc) &&
|
Objects.deepEquals(this.colorTrc, other.colorTrc) &&
|
||||||
Objects.deepEquals(this.frameRate, other.frameRate) &&
|
Objects.deepEquals(this.frameRate, other.frameRate) &&
|
||||||
|
Objects.deepEquals(this.key, other.key) &&
|
||||||
Objects.deepEquals(this.height, other.height) &&
|
Objects.deepEquals(this.height, other.height) &&
|
||||||
Objects.deepEquals(this.level, other.level) &&
|
Objects.deepEquals(this.level, other.level) &&
|
||||||
Objects.deepEquals(this.original, other.original) &&
|
Objects.deepEquals(this.original, other.original) &&
|
||||||
@@ -1749,6 +1841,7 @@ public class GetMediaMetaDataStream {
|
|||||||
return Objects.hash(
|
return Objects.hash(
|
||||||
id,
|
id,
|
||||||
streamType,
|
streamType,
|
||||||
|
format,
|
||||||
default_,
|
default_,
|
||||||
codec,
|
codec,
|
||||||
index,
|
index,
|
||||||
@@ -1776,6 +1869,7 @@ public class GetMediaMetaDataStream {
|
|||||||
colorSpace,
|
colorSpace,
|
||||||
colorTrc,
|
colorTrc,
|
||||||
frameRate,
|
frameRate,
|
||||||
|
key,
|
||||||
height,
|
height,
|
||||||
level,
|
level,
|
||||||
original,
|
original,
|
||||||
@@ -1803,6 +1897,7 @@ public class GetMediaMetaDataStream {
|
|||||||
return Utils.toString(GetMediaMetaDataStream.class,
|
return Utils.toString(GetMediaMetaDataStream.class,
|
||||||
"id", id,
|
"id", id,
|
||||||
"streamType", streamType,
|
"streamType", streamType,
|
||||||
|
"format", format,
|
||||||
"default_", default_,
|
"default_", default_,
|
||||||
"codec", codec,
|
"codec", codec,
|
||||||
"index", index,
|
"index", index,
|
||||||
@@ -1830,6 +1925,7 @@ public class GetMediaMetaDataStream {
|
|||||||
"colorSpace", colorSpace,
|
"colorSpace", colorSpace,
|
||||||
"colorTrc", colorTrc,
|
"colorTrc", colorTrc,
|
||||||
"frameRate", frameRate,
|
"frameRate", frameRate,
|
||||||
|
"key", key,
|
||||||
"height", height,
|
"height", height,
|
||||||
"level", level,
|
"level", level,
|
||||||
"original", original,
|
"original", original,
|
||||||
@@ -1856,13 +1952,15 @@ public class GetMediaMetaDataStream {
|
|||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
private Integer streamType;
|
private GetMediaMetaDataStreamType streamType;
|
||||||
|
|
||||||
|
private Optional<String> format = Optional.empty();
|
||||||
|
|
||||||
private Optional<Boolean> default_ = Optional.empty();
|
private Optional<Boolean> default_ = Optional.empty();
|
||||||
|
|
||||||
private String codec;
|
private String codec;
|
||||||
|
|
||||||
private Integer index;
|
private Optional<Integer> index = Optional.empty();
|
||||||
|
|
||||||
private Optional<Integer> bitrate = Optional.empty();
|
private Optional<Integer> bitrate = Optional.empty();
|
||||||
|
|
||||||
@@ -1912,6 +2010,8 @@ public class GetMediaMetaDataStream {
|
|||||||
|
|
||||||
private Optional<Float> frameRate = Optional.empty();
|
private Optional<Float> frameRate = Optional.empty();
|
||||||
|
|
||||||
|
private Optional<String> key = Optional.empty();
|
||||||
|
|
||||||
private Optional<Integer> height = Optional.empty();
|
private Optional<Integer> height = Optional.empty();
|
||||||
|
|
||||||
private Optional<Integer> level = Optional.empty();
|
private Optional<Integer> level = Optional.empty();
|
||||||
@@ -1966,14 +2066,35 @@ public class GetMediaMetaDataStream {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stream type (1=video, 2=audio, 3=subtitle).
|
* Stream type:
|
||||||
|
* - 1 = video
|
||||||
|
* - 2 = audio
|
||||||
|
* - 3 = subtitle
|
||||||
*/
|
*/
|
||||||
public Builder streamType(int streamType) {
|
public Builder streamType(GetMediaMetaDataStreamType streamType) {
|
||||||
Utils.checkNotNull(streamType, "streamType");
|
Utils.checkNotNull(streamType, "streamType");
|
||||||
this.streamType = streamType;
|
this.streamType = streamType;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format of the stream (e.g., srt).
|
||||||
|
*/
|
||||||
|
public Builder format(String format) {
|
||||||
|
Utils.checkNotNull(format, "format");
|
||||||
|
this.format = Optional.ofNullable(format);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format of the stream (e.g., srt).
|
||||||
|
*/
|
||||||
|
public Builder format(Optional<String> format) {
|
||||||
|
Utils.checkNotNull(format, "format");
|
||||||
|
this.format = format;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if this stream is default.
|
* Indicates if this stream is default.
|
||||||
*/
|
*/
|
||||||
@@ -2005,6 +2126,15 @@ public class GetMediaMetaDataStream {
|
|||||||
* Index of the stream.
|
* Index of the stream.
|
||||||
*/
|
*/
|
||||||
public Builder index(int index) {
|
public Builder index(int index) {
|
||||||
|
Utils.checkNotNull(index, "index");
|
||||||
|
this.index = Optional.ofNullable(index);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Index of the stream.
|
||||||
|
*/
|
||||||
|
public Builder index(Optional<Integer> index) {
|
||||||
Utils.checkNotNull(index, "index");
|
Utils.checkNotNull(index, "index");
|
||||||
this.index = index;
|
this.index = index;
|
||||||
return this;
|
return this;
|
||||||
@@ -2436,6 +2566,24 @@ public class GetMediaMetaDataStream {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Key to access this stream part.
|
||||||
|
*/
|
||||||
|
public Builder key(String key) {
|
||||||
|
Utils.checkNotNull(key, "key");
|
||||||
|
this.key = Optional.ofNullable(key);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Key to access this stream part.
|
||||||
|
*/
|
||||||
|
public Builder key(Optional<String> key) {
|
||||||
|
Utils.checkNotNull(key, "key");
|
||||||
|
this.key = key;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Height of the video stream.
|
* Height of the video stream.
|
||||||
*/
|
*/
|
||||||
@@ -2758,6 +2906,7 @@ public class GetMediaMetaDataStream {
|
|||||||
return new GetMediaMetaDataStream(
|
return new GetMediaMetaDataStream(
|
||||||
id,
|
id,
|
||||||
streamType,
|
streamType,
|
||||||
|
format,
|
||||||
default_,
|
default_,
|
||||||
codec,
|
codec,
|
||||||
index,
|
index,
|
||||||
@@ -2785,6 +2934,7 @@ public class GetMediaMetaDataStream {
|
|||||||
colorSpace,
|
colorSpace,
|
||||||
colorTrc,
|
colorTrc,
|
||||||
frameRate,
|
frameRate,
|
||||||
|
key,
|
||||||
height,
|
height,
|
||||||
level,
|
level,
|
||||||
original,
|
original,
|
||||||
|
|||||||
@@ -0,0 +1,192 @@
|
|||||||
|
/*
|
||||||
|
* 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.Integer;
|
||||||
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GetMediaMetaDataStreamType
|
||||||
|
*
|
||||||
|
* <p>Stream type:
|
||||||
|
* - 1 = video
|
||||||
|
* - 2 = audio
|
||||||
|
* - 3 = subtitle
|
||||||
|
*/
|
||||||
|
@JsonDeserialize(using = GetMediaMetaDataStreamType._Deserializer.class)
|
||||||
|
@JsonSerialize(using = GetMediaMetaDataStreamType._Serializer.class)
|
||||||
|
public class GetMediaMetaDataStreamType {
|
||||||
|
|
||||||
|
public static final GetMediaMetaDataStreamType Video = new GetMediaMetaDataStreamType(1);
|
||||||
|
public static final GetMediaMetaDataStreamType Audio = new GetMediaMetaDataStreamType(2);
|
||||||
|
public static final GetMediaMetaDataStreamType Subtitle = new GetMediaMetaDataStreamType(3);
|
||||||
|
|
||||||
|
// 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<Integer, GetMediaMetaDataStreamType> values = createValuesMap();
|
||||||
|
private static final Map<Integer, GetMediaMetaDataStreamTypeEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
|
private final int value;
|
||||||
|
|
||||||
|
private GetMediaMetaDataStreamType(int value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a GetMediaMetaDataStreamType 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 GetMediaMetaDataStreamType
|
||||||
|
*/
|
||||||
|
public static GetMediaMetaDataStreamType of(int value) {
|
||||||
|
synchronized (GetMediaMetaDataStreamType.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new GetMediaMetaDataStreamType(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Optional<GetMediaMetaDataStreamTypeEnum> 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;
|
||||||
|
GetMediaMetaDataStreamType other = (GetMediaMetaDataStreamType) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "GetMediaMetaDataStreamType [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static GetMediaMetaDataStreamType[] values() {
|
||||||
|
synchronized (GetMediaMetaDataStreamType.class) {
|
||||||
|
return values.values().toArray(new GetMediaMetaDataStreamType[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<Integer, GetMediaMetaDataStreamType> createValuesMap() {
|
||||||
|
Map<Integer, GetMediaMetaDataStreamType> map = new LinkedHashMap<>();
|
||||||
|
map.put(1, Video);
|
||||||
|
map.put(2, Audio);
|
||||||
|
map.put(3, Subtitle);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<Integer, GetMediaMetaDataStreamTypeEnum> createEnumsMap() {
|
||||||
|
Map<Integer, GetMediaMetaDataStreamTypeEnum> map = new HashMap<>();
|
||||||
|
map.put(1, GetMediaMetaDataStreamTypeEnum.Video);
|
||||||
|
map.put(2, GetMediaMetaDataStreamTypeEnum.Audio);
|
||||||
|
map.put(3, GetMediaMetaDataStreamTypeEnum.Subtitle);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<GetMediaMetaDataStreamType> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(GetMediaMetaDataStreamType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(GetMediaMetaDataStreamType value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<GetMediaMetaDataStreamType> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(GetMediaMetaDataStreamType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GetMediaMetaDataStreamType deserialize(JsonParser p, DeserializationContext ctxt)
|
||||||
|
throws IOException, JacksonException {
|
||||||
|
int v = p.readValueAs(new TypeReference<Integer>() {});
|
||||||
|
// use the factory method to ensure we get singletons
|
||||||
|
return GetMediaMetaDataStreamType.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum GetMediaMetaDataStreamTypeEnum {
|
||||||
|
|
||||||
|
Video(1),
|
||||||
|
Audio(2),
|
||||||
|
Subtitle(3),;
|
||||||
|
|
||||||
|
private final int value;
|
||||||
|
|
||||||
|
private GetMediaMetaDataStreamTypeEnum(int value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GetMediaMetaDataType
|
||||||
|
*
|
||||||
|
* <p>The type of media content
|
||||||
|
*/
|
||||||
|
@JsonDeserialize(using = GetMediaMetaDataType._Deserializer.class)
|
||||||
|
@JsonSerialize(using = GetMediaMetaDataType._Serializer.class)
|
||||||
|
public class GetMediaMetaDataType {
|
||||||
|
|
||||||
|
public static final GetMediaMetaDataType Movie = new GetMediaMetaDataType("movie");
|
||||||
|
public static final GetMediaMetaDataType TvShow = new GetMediaMetaDataType("show");
|
||||||
|
public static final GetMediaMetaDataType Season = new GetMediaMetaDataType("season");
|
||||||
|
public static final GetMediaMetaDataType Episode = new GetMediaMetaDataType("episode");
|
||||||
|
public static final GetMediaMetaDataType Artist = new GetMediaMetaDataType("artist");
|
||||||
|
public static final GetMediaMetaDataType Album = new GetMediaMetaDataType("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, GetMediaMetaDataType> values = createValuesMap();
|
||||||
|
private static final Map<String, GetMediaMetaDataTypeEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private GetMediaMetaDataType(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a GetMediaMetaDataType 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 GetMediaMetaDataType
|
||||||
|
*/
|
||||||
|
public static GetMediaMetaDataType of(String value) {
|
||||||
|
synchronized (GetMediaMetaDataType.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new GetMediaMetaDataType(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Optional<GetMediaMetaDataTypeEnum> 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;
|
||||||
|
GetMediaMetaDataType other = (GetMediaMetaDataType) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "GetMediaMetaDataType [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static GetMediaMetaDataType[] values() {
|
||||||
|
synchronized (GetMediaMetaDataType.class) {
|
||||||
|
return values.values().toArray(new GetMediaMetaDataType[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, GetMediaMetaDataType> createValuesMap() {
|
||||||
|
Map<String, GetMediaMetaDataType> 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, GetMediaMetaDataTypeEnum> createEnumsMap() {
|
||||||
|
Map<String, GetMediaMetaDataTypeEnum> map = new HashMap<>();
|
||||||
|
map.put("movie", GetMediaMetaDataTypeEnum.Movie);
|
||||||
|
map.put("show", GetMediaMetaDataTypeEnum.TvShow);
|
||||||
|
map.put("season", GetMediaMetaDataTypeEnum.Season);
|
||||||
|
map.put("episode", GetMediaMetaDataTypeEnum.Episode);
|
||||||
|
map.put("artist", GetMediaMetaDataTypeEnum.Artist);
|
||||||
|
map.put("album", GetMediaMetaDataTypeEnum.Album);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<GetMediaMetaDataType> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(GetMediaMetaDataType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(GetMediaMetaDataType value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<GetMediaMetaDataType> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(GetMediaMetaDataType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GetMediaMetaDataType 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 GetMediaMetaDataType.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum GetMediaMetaDataTypeEnum {
|
||||||
|
|
||||||
|
Movie("movie"),
|
||||||
|
TvShow("show"),
|
||||||
|
Season("season"),
|
||||||
|
Episode("episode"),
|
||||||
|
Artist("artist"),
|
||||||
|
Album("album"),;
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private GetMediaMetaDataTypeEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -13,27 +13,15 @@ import java.util.Objects;
|
|||||||
|
|
||||||
public class GetMediaMetaDataUltraBlurColors {
|
public class GetMediaMetaDataUltraBlurColors {
|
||||||
|
|
||||||
/**
|
|
||||||
* The top-left color value.
|
|
||||||
*/
|
|
||||||
@JsonProperty("topLeft")
|
@JsonProperty("topLeft")
|
||||||
private String topLeft;
|
private String topLeft;
|
||||||
|
|
||||||
/**
|
|
||||||
* The top-right color value.
|
|
||||||
*/
|
|
||||||
@JsonProperty("topRight")
|
@JsonProperty("topRight")
|
||||||
private String topRight;
|
private String topRight;
|
||||||
|
|
||||||
/**
|
|
||||||
* The bottom-right color value.
|
|
||||||
*/
|
|
||||||
@JsonProperty("bottomRight")
|
@JsonProperty("bottomRight")
|
||||||
private String bottomRight;
|
private String bottomRight;
|
||||||
|
|
||||||
/**
|
|
||||||
* The bottom-left color value.
|
|
||||||
*/
|
|
||||||
@JsonProperty("bottomLeft")
|
@JsonProperty("bottomLeft")
|
||||||
private String bottomLeft;
|
private String bottomLeft;
|
||||||
|
|
||||||
@@ -53,33 +41,21 @@ public class GetMediaMetaDataUltraBlurColors {
|
|||||||
this.bottomLeft = bottomLeft;
|
this.bottomLeft = bottomLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The top-left color value.
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String topLeft() {
|
public String topLeft() {
|
||||||
return topLeft;
|
return topLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The top-right color value.
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String topRight() {
|
public String topRight() {
|
||||||
return topRight;
|
return topRight;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The bottom-right color value.
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String bottomRight() {
|
public String bottomRight() {
|
||||||
return bottomRight;
|
return bottomRight;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The bottom-left color value.
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String bottomLeft() {
|
public String bottomLeft() {
|
||||||
return bottomLeft;
|
return bottomLeft;
|
||||||
@@ -89,36 +65,24 @@ public class GetMediaMetaDataUltraBlurColors {
|
|||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The top-left color value.
|
|
||||||
*/
|
|
||||||
public GetMediaMetaDataUltraBlurColors withTopLeft(String topLeft) {
|
public GetMediaMetaDataUltraBlurColors withTopLeft(String topLeft) {
|
||||||
Utils.checkNotNull(topLeft, "topLeft");
|
Utils.checkNotNull(topLeft, "topLeft");
|
||||||
this.topLeft = topLeft;
|
this.topLeft = topLeft;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The top-right color value.
|
|
||||||
*/
|
|
||||||
public GetMediaMetaDataUltraBlurColors withTopRight(String topRight) {
|
public GetMediaMetaDataUltraBlurColors withTopRight(String topRight) {
|
||||||
Utils.checkNotNull(topRight, "topRight");
|
Utils.checkNotNull(topRight, "topRight");
|
||||||
this.topRight = topRight;
|
this.topRight = topRight;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The bottom-right color value.
|
|
||||||
*/
|
|
||||||
public GetMediaMetaDataUltraBlurColors withBottomRight(String bottomRight) {
|
public GetMediaMetaDataUltraBlurColors withBottomRight(String bottomRight) {
|
||||||
Utils.checkNotNull(bottomRight, "bottomRight");
|
Utils.checkNotNull(bottomRight, "bottomRight");
|
||||||
this.bottomRight = bottomRight;
|
this.bottomRight = bottomRight;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The bottom-left color value.
|
|
||||||
*/
|
|
||||||
public GetMediaMetaDataUltraBlurColors withBottomLeft(String bottomLeft) {
|
public GetMediaMetaDataUltraBlurColors withBottomLeft(String bottomLeft) {
|
||||||
Utils.checkNotNull(bottomLeft, "bottomLeft");
|
Utils.checkNotNull(bottomLeft, "bottomLeft");
|
||||||
this.bottomLeft = bottomLeft;
|
this.bottomLeft = bottomLeft;
|
||||||
@@ -174,36 +138,24 @@ public class GetMediaMetaDataUltraBlurColors {
|
|||||||
// force use of static builder() method
|
// force use of static builder() method
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The top-left color value.
|
|
||||||
*/
|
|
||||||
public Builder topLeft(String topLeft) {
|
public Builder topLeft(String topLeft) {
|
||||||
Utils.checkNotNull(topLeft, "topLeft");
|
Utils.checkNotNull(topLeft, "topLeft");
|
||||||
this.topLeft = topLeft;
|
this.topLeft = topLeft;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The top-right color value.
|
|
||||||
*/
|
|
||||||
public Builder topRight(String topRight) {
|
public Builder topRight(String topRight) {
|
||||||
Utils.checkNotNull(topRight, "topRight");
|
Utils.checkNotNull(topRight, "topRight");
|
||||||
this.topRight = topRight;
|
this.topRight = topRight;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The bottom-right color value.
|
|
||||||
*/
|
|
||||||
public Builder bottomRight(String bottomRight) {
|
public Builder bottomRight(String bottomRight) {
|
||||||
Utils.checkNotNull(bottomRight, "bottomRight");
|
Utils.checkNotNull(bottomRight, "bottomRight");
|
||||||
this.bottomRight = bottomRight;
|
this.bottomRight = bottomRight;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The bottom-left color value.
|
|
||||||
*/
|
|
||||||
public Builder bottomLeft(String bottomLeft) {
|
public Builder bottomLeft(String bottomLeft) {
|
||||||
Utils.checkNotNull(bottomLeft, "bottomLeft");
|
Utils.checkNotNull(bottomLeft, "bottomLeft");
|
||||||
this.bottomLeft = bottomLeft;
|
this.bottomLeft = bottomLeft;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
|||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Long;
|
import java.lang.Integer;
|
||||||
import java.lang.Override;
|
import java.lang.Override;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -18,91 +18,73 @@ import java.util.Optional;
|
|||||||
public class GetMediaMetaDataWriter {
|
public class GetMediaMetaDataWriter {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The unique role identifier.
|
* Unique identifier for the writer.
|
||||||
*/
|
*/
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private long id;
|
private int id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the role.
|
* The role of Writer
|
||||||
*/
|
|
||||||
@JsonProperty("filter")
|
|
||||||
private String filter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actor's name.
|
|
||||||
*/
|
*/
|
||||||
@JsonProperty("tag")
|
@JsonProperty("tag")
|
||||||
private String tag;
|
private String tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A key associated with the actor tag.
|
* The filter string used to query this writer.
|
||||||
*/
|
*/
|
||||||
@JsonProperty("tagKey")
|
@JsonProperty("filter")
|
||||||
private String tagKey;
|
private String filter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The character name or role.
|
* The URL of the thumbnail image for the writer.
|
||||||
*/
|
|
||||||
@JsonInclude(Include.NON_ABSENT)
|
|
||||||
@JsonProperty("role")
|
|
||||||
private Optional<String> role;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* URL for the role thumbnail image.
|
|
||||||
*/
|
*/
|
||||||
@JsonInclude(Include.NON_ABSENT)
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
@JsonProperty("thumb")
|
@JsonProperty("thumb")
|
||||||
private Optional<String> thumb;
|
private Optional<String> thumb;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique key associated with the writers tag, used for internal identification.
|
||||||
|
*/
|
||||||
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
|
@JsonProperty("tagKey")
|
||||||
|
private Optional<String> tagKey;
|
||||||
|
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
public GetMediaMetaDataWriter(
|
public GetMediaMetaDataWriter(
|
||||||
@JsonProperty("id") long id,
|
@JsonProperty("id") int id,
|
||||||
@JsonProperty("filter") String filter,
|
|
||||||
@JsonProperty("tag") String tag,
|
@JsonProperty("tag") String tag,
|
||||||
@JsonProperty("tagKey") String tagKey,
|
@JsonProperty("filter") String filter,
|
||||||
@JsonProperty("role") Optional<String> role,
|
@JsonProperty("thumb") Optional<String> thumb,
|
||||||
@JsonProperty("thumb") Optional<String> thumb) {
|
@JsonProperty("tagKey") Optional<String> tagKey) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
Utils.checkNotNull(filter, "filter");
|
|
||||||
Utils.checkNotNull(tag, "tag");
|
Utils.checkNotNull(tag, "tag");
|
||||||
Utils.checkNotNull(tagKey, "tagKey");
|
Utils.checkNotNull(filter, "filter");
|
||||||
Utils.checkNotNull(role, "role");
|
|
||||||
Utils.checkNotNull(thumb, "thumb");
|
Utils.checkNotNull(thumb, "thumb");
|
||||||
|
Utils.checkNotNull(tagKey, "tagKey");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.filter = filter;
|
|
||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
this.tagKey = tagKey;
|
this.filter = filter;
|
||||||
this.role = role;
|
|
||||||
this.thumb = thumb;
|
this.thumb = thumb;
|
||||||
|
this.tagKey = tagKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetMediaMetaDataWriter(
|
public GetMediaMetaDataWriter(
|
||||||
long id,
|
int id,
|
||||||
String filter,
|
|
||||||
String tag,
|
String tag,
|
||||||
String tagKey) {
|
String filter) {
|
||||||
this(id, filter, tag, tagKey, Optional.empty(), Optional.empty());
|
this(id, tag, filter, Optional.empty(), Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The unique role identifier.
|
* Unique identifier for the writer.
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public long id() {
|
public int id() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the role.
|
* The role of Writer
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public String filter() {
|
|
||||||
return filter;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actor's name.
|
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String tag() {
|
public String tag() {
|
||||||
@@ -110,53 +92,44 @@ public class GetMediaMetaDataWriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A key associated with the actor tag.
|
* The filter string used to query this writer.
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String tagKey() {
|
public String filter() {
|
||||||
return tagKey;
|
return filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The character name or role.
|
* The URL of the thumbnail image for the writer.
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Optional<String> role() {
|
|
||||||
return role;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* URL for the role thumbnail image.
|
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public Optional<String> thumb() {
|
public Optional<String> thumb() {
|
||||||
return thumb;
|
return thumb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique key associated with the writers tag, used for internal identification.
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public Optional<String> tagKey() {
|
||||||
|
return tagKey;
|
||||||
|
}
|
||||||
|
|
||||||
public final static Builder builder() {
|
public final static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The unique role identifier.
|
* Unique identifier for the writer.
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataWriter withId(long id) {
|
public GetMediaMetaDataWriter withId(int id) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the role.
|
* The role of Writer
|
||||||
*/
|
|
||||||
public GetMediaMetaDataWriter withFilter(String filter) {
|
|
||||||
Utils.checkNotNull(filter, "filter");
|
|
||||||
this.filter = filter;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actor's name.
|
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataWriter withTag(String tag) {
|
public GetMediaMetaDataWriter withTag(String tag) {
|
||||||
Utils.checkNotNull(tag, "tag");
|
Utils.checkNotNull(tag, "tag");
|
||||||
@@ -165,34 +138,16 @@ public class GetMediaMetaDataWriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A key associated with the actor tag.
|
* The filter string used to query this writer.
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataWriter withTagKey(String tagKey) {
|
public GetMediaMetaDataWriter withFilter(String filter) {
|
||||||
Utils.checkNotNull(tagKey, "tagKey");
|
Utils.checkNotNull(filter, "filter");
|
||||||
this.tagKey = tagKey;
|
this.filter = filter;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The character name or role.
|
* The URL of the thumbnail image for the writer.
|
||||||
*/
|
|
||||||
public GetMediaMetaDataWriter withRole(String role) {
|
|
||||||
Utils.checkNotNull(role, "role");
|
|
||||||
this.role = Optional.ofNullable(role);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The character name or role.
|
|
||||||
*/
|
|
||||||
public GetMediaMetaDataWriter withRole(Optional<String> role) {
|
|
||||||
Utils.checkNotNull(role, "role");
|
|
||||||
this.role = role;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* URL for the role thumbnail image.
|
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataWriter withThumb(String thumb) {
|
public GetMediaMetaDataWriter withThumb(String thumb) {
|
||||||
Utils.checkNotNull(thumb, "thumb");
|
Utils.checkNotNull(thumb, "thumb");
|
||||||
@@ -201,7 +156,7 @@ public class GetMediaMetaDataWriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL for the role thumbnail image.
|
* The URL of the thumbnail image for the writer.
|
||||||
*/
|
*/
|
||||||
public GetMediaMetaDataWriter withThumb(Optional<String> thumb) {
|
public GetMediaMetaDataWriter withThumb(Optional<String> thumb) {
|
||||||
Utils.checkNotNull(thumb, "thumb");
|
Utils.checkNotNull(thumb, "thumb");
|
||||||
@@ -209,6 +164,24 @@ public class GetMediaMetaDataWriter {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique key associated with the writers tag, used for internal identification.
|
||||||
|
*/
|
||||||
|
public GetMediaMetaDataWriter withTagKey(String tagKey) {
|
||||||
|
Utils.checkNotNull(tagKey, "tagKey");
|
||||||
|
this.tagKey = Optional.ofNullable(tagKey);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique key associated with the writers tag, used for internal identification.
|
||||||
|
*/
|
||||||
|
public GetMediaMetaDataWriter withTagKey(Optional<String> tagKey) {
|
||||||
|
Utils.checkNotNull(tagKey, "tagKey");
|
||||||
|
this.tagKey = tagKey;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(java.lang.Object o) {
|
public boolean equals(java.lang.Object o) {
|
||||||
@@ -221,73 +194,59 @@ public class GetMediaMetaDataWriter {
|
|||||||
GetMediaMetaDataWriter other = (GetMediaMetaDataWriter) o;
|
GetMediaMetaDataWriter other = (GetMediaMetaDataWriter) o;
|
||||||
return
|
return
|
||||||
Objects.deepEquals(this.id, other.id) &&
|
Objects.deepEquals(this.id, other.id) &&
|
||||||
Objects.deepEquals(this.filter, other.filter) &&
|
|
||||||
Objects.deepEquals(this.tag, other.tag) &&
|
Objects.deepEquals(this.tag, other.tag) &&
|
||||||
Objects.deepEquals(this.tagKey, other.tagKey) &&
|
Objects.deepEquals(this.filter, other.filter) &&
|
||||||
Objects.deepEquals(this.role, other.role) &&
|
Objects.deepEquals(this.thumb, other.thumb) &&
|
||||||
Objects.deepEquals(this.thumb, other.thumb);
|
Objects.deepEquals(this.tagKey, other.tagKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(
|
return Objects.hash(
|
||||||
id,
|
id,
|
||||||
filter,
|
|
||||||
tag,
|
tag,
|
||||||
tagKey,
|
filter,
|
||||||
role,
|
thumb,
|
||||||
thumb);
|
tagKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return Utils.toString(GetMediaMetaDataWriter.class,
|
return Utils.toString(GetMediaMetaDataWriter.class,
|
||||||
"id", id,
|
"id", id,
|
||||||
"filter", filter,
|
|
||||||
"tag", tag,
|
"tag", tag,
|
||||||
"tagKey", tagKey,
|
"filter", filter,
|
||||||
"role", role,
|
"thumb", thumb,
|
||||||
"thumb", thumb);
|
"tagKey", tagKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final static class Builder {
|
public final static class Builder {
|
||||||
|
|
||||||
private Long id;
|
private Integer id;
|
||||||
|
|
||||||
private String filter;
|
|
||||||
|
|
||||||
private String tag;
|
private String tag;
|
||||||
|
|
||||||
private String tagKey;
|
private String filter;
|
||||||
|
|
||||||
private Optional<String> role = Optional.empty();
|
|
||||||
|
|
||||||
private Optional<String> thumb = Optional.empty();
|
private Optional<String> thumb = Optional.empty();
|
||||||
|
|
||||||
|
private Optional<String> tagKey = Optional.empty();
|
||||||
|
|
||||||
private Builder() {
|
private Builder() {
|
||||||
// force use of static builder() method
|
// force use of static builder() method
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The unique role identifier.
|
* Unique identifier for the writer.
|
||||||
*/
|
*/
|
||||||
public Builder id(long id) {
|
public Builder id(int id) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string for the role.
|
* The role of Writer
|
||||||
*/
|
|
||||||
public Builder filter(String filter) {
|
|
||||||
Utils.checkNotNull(filter, "filter");
|
|
||||||
this.filter = filter;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actor's name.
|
|
||||||
*/
|
*/
|
||||||
public Builder tag(String tag) {
|
public Builder tag(String tag) {
|
||||||
Utils.checkNotNull(tag, "tag");
|
Utils.checkNotNull(tag, "tag");
|
||||||
@@ -296,34 +255,16 @@ public class GetMediaMetaDataWriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A key associated with the actor tag.
|
* The filter string used to query this writer.
|
||||||
*/
|
*/
|
||||||
public Builder tagKey(String tagKey) {
|
public Builder filter(String filter) {
|
||||||
Utils.checkNotNull(tagKey, "tagKey");
|
Utils.checkNotNull(filter, "filter");
|
||||||
this.tagKey = tagKey;
|
this.filter = filter;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The character name or role.
|
* The URL of the thumbnail image for the writer.
|
||||||
*/
|
|
||||||
public Builder role(String role) {
|
|
||||||
Utils.checkNotNull(role, "role");
|
|
||||||
this.role = Optional.ofNullable(role);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The character name or role.
|
|
||||||
*/
|
|
||||||
public Builder role(Optional<String> role) {
|
|
||||||
Utils.checkNotNull(role, "role");
|
|
||||||
this.role = role;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* URL for the role thumbnail image.
|
|
||||||
*/
|
*/
|
||||||
public Builder thumb(String thumb) {
|
public Builder thumb(String thumb) {
|
||||||
Utils.checkNotNull(thumb, "thumb");
|
Utils.checkNotNull(thumb, "thumb");
|
||||||
@@ -332,7 +273,7 @@ public class GetMediaMetaDataWriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL for the role thumbnail image.
|
* The URL of the thumbnail image for the writer.
|
||||||
*/
|
*/
|
||||||
public Builder thumb(Optional<String> thumb) {
|
public Builder thumb(Optional<String> thumb) {
|
||||||
Utils.checkNotNull(thumb, "thumb");
|
Utils.checkNotNull(thumb, "thumb");
|
||||||
@@ -340,14 +281,31 @@ public class GetMediaMetaDataWriter {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique key associated with the writers tag, used for internal identification.
|
||||||
|
*/
|
||||||
|
public Builder tagKey(String tagKey) {
|
||||||
|
Utils.checkNotNull(tagKey, "tagKey");
|
||||||
|
this.tagKey = Optional.ofNullable(tagKey);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique key associated with the writers tag, used for internal identification.
|
||||||
|
*/
|
||||||
|
public Builder tagKey(Optional<String> tagKey) {
|
||||||
|
Utils.checkNotNull(tagKey, "tagKey");
|
||||||
|
this.tagKey = tagKey;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public GetMediaMetaDataWriter build() {
|
public GetMediaMetaDataWriter build() {
|
||||||
return new GetMediaMetaDataWriter(
|
return new GetMediaMetaDataWriter(
|
||||||
id,
|
id,
|
||||||
filter,
|
|
||||||
tag,
|
tag,
|
||||||
tagKey,
|
filter,
|
||||||
role,
|
thumb,
|
||||||
thumb);
|
tagKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,45 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.Objects;
|
||||||
import java.util.Optional;
|
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
|
* GetPlaylistContentsQueryParamType
|
||||||
*
|
*
|
||||||
@@ -17,33 +52,159 @@ import java.util.Optional;
|
|||||||
* 4 = episode
|
* 4 = episode
|
||||||
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
||||||
*/
|
*/
|
||||||
public enum GetPlaylistContentsQueryParamType {
|
@JsonDeserialize(using = GetPlaylistContentsQueryParamType._Deserializer.class)
|
||||||
Movie(1L),
|
@JsonSerialize(using = GetPlaylistContentsQueryParamType._Serializer.class)
|
||||||
TvShow(2L),
|
public class GetPlaylistContentsQueryParamType {
|
||||||
Season(3L),
|
|
||||||
Episode(4L),
|
public static final GetPlaylistContentsQueryParamType Movie = new GetPlaylistContentsQueryParamType(1L);
|
||||||
Audio(8L),
|
public static final GetPlaylistContentsQueryParamType TvShow = new GetPlaylistContentsQueryParamType(2L);
|
||||||
Album(9L),
|
public static final GetPlaylistContentsQueryParamType Season = new GetPlaylistContentsQueryParamType(3L);
|
||||||
Track(10L);
|
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 final long value;
|
||||||
|
|
||||||
private GetPlaylistContentsQueryParamType(long value) {
|
private GetPlaylistContentsQueryParamType(long value) {
|
||||||
this.value = 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() {
|
public long value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetPlaylistContentsQueryParamType> fromValue(long value) {
|
public Optional<GetPlaylistContentsQueryParamTypeEnum> asEnum() {
|
||||||
for (GetPlaylistContentsQueryParamType o: GetPlaylistContentsQueryParamType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,35 +3,185 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
public enum GetRecentlyAddedHubsResponseType {
|
/**
|
||||||
COVER_POSTER("coverPoster"),
|
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
|
||||||
BACKGROUND("background"),
|
* to evolve (particularly with the addition of enum members over time). If an
|
||||||
SNAPSHOT("snapshot"),
|
* open enum is used then the appearance of unexpected enum values (say in a
|
||||||
CLEAR_LOGO("clearLogo");
|
* 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 final String value;
|
||||||
|
|
||||||
private GetRecentlyAddedHubsResponseType(String value) {
|
private GetRecentlyAddedHubsResponseType(String value) {
|
||||||
this.value = 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() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetRecentlyAddedHubsResponseType> fromValue(String value) {
|
public Optional<GetRecentlyAddedHubsResponseTypeEnum> asEnum() {
|
||||||
for (GetRecentlyAddedHubsResponseType o: GetRecentlyAddedHubsResponseType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,42 +3,198 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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
|
* GetRecentlyAddedHubsType
|
||||||
*
|
*
|
||||||
* <p>The type of media content
|
* <p>The type of media content
|
||||||
*/
|
*/
|
||||||
public enum GetRecentlyAddedHubsType {
|
@JsonDeserialize(using = GetRecentlyAddedHubsType._Deserializer.class)
|
||||||
Movie("movie"),
|
@JsonSerialize(using = GetRecentlyAddedHubsType._Serializer.class)
|
||||||
TvShow("show"),
|
public class GetRecentlyAddedHubsType {
|
||||||
Season("season"),
|
|
||||||
Episode("episode"),
|
public static final GetRecentlyAddedHubsType Movie = new GetRecentlyAddedHubsType("movie");
|
||||||
Artist("artist"),
|
public static final GetRecentlyAddedHubsType TvShow = new GetRecentlyAddedHubsType("show");
|
||||||
Album("album");
|
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 final String value;
|
||||||
|
|
||||||
private GetRecentlyAddedHubsType(String value) {
|
private GetRecentlyAddedHubsType(String value) {
|
||||||
this.value = 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() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetRecentlyAddedHubsType> fromValue(String value) {
|
public Optional<GetRecentlyAddedHubsTypeEnum> asEnum() {
|
||||||
for (GetRecentlyAddedHubsType o: GetRecentlyAddedHubsType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,38 +3,182 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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
|
* GetSearchAllLibrariesEnableCreditsMarkerGeneration
|
||||||
*
|
*
|
||||||
* <p>Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
|
* <p>Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
|
||||||
*/
|
*/
|
||||||
public enum GetSearchAllLibrariesEnableCreditsMarkerGeneration {
|
@JsonDeserialize(using = GetSearchAllLibrariesEnableCreditsMarkerGeneration._Deserializer.class)
|
||||||
LibraryDefault("-1"),
|
@JsonSerialize(using = GetSearchAllLibrariesEnableCreditsMarkerGeneration._Serializer.class)
|
||||||
Disabled("0");
|
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 final String value;
|
||||||
|
|
||||||
private GetSearchAllLibrariesEnableCreditsMarkerGeneration(String value) {
|
private GetSearchAllLibrariesEnableCreditsMarkerGeneration(String value) {
|
||||||
this.value = 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() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetSearchAllLibrariesEnableCreditsMarkerGeneration> fromValue(String value) {
|
public Optional<GetSearchAllLibrariesEnableCreditsMarkerGenerationEnum> asEnum() {
|
||||||
for (GetSearchAllLibrariesEnableCreditsMarkerGeneration o: GetSearchAllLibrariesEnableCreditsMarkerGeneration.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,39 +3,186 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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
|
* GetSearchAllLibrariesEpisodeSort
|
||||||
*
|
*
|
||||||
* <p>Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
|
* <p>Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
|
||||||
*/
|
*/
|
||||||
public enum GetSearchAllLibrariesEpisodeSort {
|
@JsonDeserialize(using = GetSearchAllLibrariesEpisodeSort._Deserializer.class)
|
||||||
LibraryDefault("-1"),
|
@JsonSerialize(using = GetSearchAllLibrariesEpisodeSort._Serializer.class)
|
||||||
OldestFirst("0"),
|
public class GetSearchAllLibrariesEpisodeSort {
|
||||||
NewestFirst("1");
|
|
||||||
|
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 final String value;
|
||||||
|
|
||||||
private GetSearchAllLibrariesEpisodeSort(String value) {
|
private GetSearchAllLibrariesEpisodeSort(String value) {
|
||||||
this.value = 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() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetSearchAllLibrariesEpisodeSort> fromValue(String value) {
|
public Optional<GetSearchAllLibrariesEpisodeSortEnum> asEnum() {
|
||||||
for (GetSearchAllLibrariesEpisodeSort o: GetSearchAllLibrariesEpisodeSort.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,39 +3,186 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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
|
* GetSearchAllLibrariesFlattenSeasons
|
||||||
*
|
*
|
||||||
* <p>Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
|
* <p>Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
|
||||||
*/
|
*/
|
||||||
public enum GetSearchAllLibrariesFlattenSeasons {
|
@JsonDeserialize(using = GetSearchAllLibrariesFlattenSeasons._Deserializer.class)
|
||||||
LibraryDefault("-1"),
|
@JsonSerialize(using = GetSearchAllLibrariesFlattenSeasons._Serializer.class)
|
||||||
Hide("0"),
|
public class GetSearchAllLibrariesFlattenSeasons {
|
||||||
Show("1");
|
|
||||||
|
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 final String value;
|
||||||
|
|
||||||
private GetSearchAllLibrariesFlattenSeasons(String value) {
|
private GetSearchAllLibrariesFlattenSeasons(String value) {
|
||||||
this.value = 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() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetSearchAllLibrariesFlattenSeasons> fromValue(String value) {
|
public Optional<GetSearchAllLibrariesFlattenSeasonsEnum> asEnum() {
|
||||||
for (GetSearchAllLibrariesFlattenSeasons o: GetSearchAllLibrariesFlattenSeasons.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,35 +3,185 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
public enum GetSearchAllLibrariesLibraryType {
|
/**
|
||||||
COVER_POSTER("coverPoster"),
|
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
|
||||||
BACKGROUND("background"),
|
* to evolve (particularly with the addition of enum members over time). If an
|
||||||
SNAPSHOT("snapshot"),
|
* open enum is used then the appearance of unexpected enum values (say in a
|
||||||
CLEAR_LOGO("clearLogo");
|
* 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 final String value;
|
||||||
|
|
||||||
private GetSearchAllLibrariesLibraryType(String value) {
|
private GetSearchAllLibrariesLibraryType(String value) {
|
||||||
this.value = 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() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetSearchAllLibrariesLibraryType> fromValue(String value) {
|
public Optional<GetSearchAllLibrariesLibraryTypeEnum> asEnum() {
|
||||||
for (GetSearchAllLibrariesLibraryType o: GetSearchAllLibrariesLibraryType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,44 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* GetSearchAllLibrariesShowOrdering
|
* GetSearchAllLibrariesShowOrdering
|
||||||
*
|
*
|
||||||
@@ -18,31 +51,151 @@ import java.util.Optional;
|
|||||||
* dvd = TheTVDB (DVD),
|
* dvd = TheTVDB (DVD),
|
||||||
* absolute = TheTVDB (Absolute)).
|
* absolute = TheTVDB (Absolute)).
|
||||||
*/
|
*/
|
||||||
public enum GetSearchAllLibrariesShowOrdering {
|
@JsonDeserialize(using = GetSearchAllLibrariesShowOrdering._Deserializer.class)
|
||||||
None("None"),
|
@JsonSerialize(using = GetSearchAllLibrariesShowOrdering._Serializer.class)
|
||||||
TmdbAiring("tmdbAiring"),
|
public class GetSearchAllLibrariesShowOrdering {
|
||||||
TvdbAired("aired"),
|
|
||||||
TvdbDvd("dvd"),
|
public static final GetSearchAllLibrariesShowOrdering None = new GetSearchAllLibrariesShowOrdering("None");
|
||||||
TvdbAbsolute("absolute");
|
public static final GetSearchAllLibrariesShowOrdering TmdbAiring = new GetSearchAllLibrariesShowOrdering("tmdbAiring");
|
||||||
|
public static final GetSearchAllLibrariesShowOrdering TvdbAired = new GetSearchAllLibrariesShowOrdering("aired");
|
||||||
|
public static final GetSearchAllLibrariesShowOrdering TvdbDvd = new GetSearchAllLibrariesShowOrdering("dvd");
|
||||||
|
public static final GetSearchAllLibrariesShowOrdering TvdbAbsolute = new GetSearchAllLibrariesShowOrdering("absolute");
|
||||||
|
|
||||||
|
// 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, GetSearchAllLibrariesShowOrdering> values = createValuesMap();
|
||||||
|
private static final Map<String, GetSearchAllLibrariesShowOrderingEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
private GetSearchAllLibrariesShowOrdering(String value) {
|
private GetSearchAllLibrariesShowOrdering(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a GetSearchAllLibrariesShowOrdering 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 GetSearchAllLibrariesShowOrdering
|
||||||
|
*/
|
||||||
|
public static GetSearchAllLibrariesShowOrdering of(String value) {
|
||||||
|
synchronized (GetSearchAllLibrariesShowOrdering.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new GetSearchAllLibrariesShowOrdering(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String value() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetSearchAllLibrariesShowOrdering> fromValue(String value) {
|
public Optional<GetSearchAllLibrariesShowOrderingEnum> asEnum() {
|
||||||
for (GetSearchAllLibrariesShowOrdering o: GetSearchAllLibrariesShowOrdering.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
GetSearchAllLibrariesShowOrdering other = (GetSearchAllLibrariesShowOrdering) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "GetSearchAllLibrariesShowOrdering [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static GetSearchAllLibrariesShowOrdering[] values() {
|
||||||
|
synchronized (GetSearchAllLibrariesShowOrdering.class) {
|
||||||
|
return values.values().toArray(new GetSearchAllLibrariesShowOrdering[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, GetSearchAllLibrariesShowOrdering> createValuesMap() {
|
||||||
|
Map<String, GetSearchAllLibrariesShowOrdering> map = new LinkedHashMap<>();
|
||||||
|
map.put("None", None);
|
||||||
|
map.put("tmdbAiring", TmdbAiring);
|
||||||
|
map.put("aired", TvdbAired);
|
||||||
|
map.put("dvd", TvdbDvd);
|
||||||
|
map.put("absolute", TvdbAbsolute);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, GetSearchAllLibrariesShowOrderingEnum> createEnumsMap() {
|
||||||
|
Map<String, GetSearchAllLibrariesShowOrderingEnum> map = new HashMap<>();
|
||||||
|
map.put("None", GetSearchAllLibrariesShowOrderingEnum.None);
|
||||||
|
map.put("tmdbAiring", GetSearchAllLibrariesShowOrderingEnum.TmdbAiring);
|
||||||
|
map.put("aired", GetSearchAllLibrariesShowOrderingEnum.TvdbAired);
|
||||||
|
map.put("dvd", GetSearchAllLibrariesShowOrderingEnum.TvdbDvd);
|
||||||
|
map.put("absolute", GetSearchAllLibrariesShowOrderingEnum.TvdbAbsolute);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<GetSearchAllLibrariesShowOrdering> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(GetSearchAllLibrariesShowOrdering.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(GetSearchAllLibrariesShowOrdering value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<GetSearchAllLibrariesShowOrdering> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(GetSearchAllLibrariesShowOrdering.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GetSearchAllLibrariesShowOrdering 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 GetSearchAllLibrariesShowOrdering.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum GetSearchAllLibrariesShowOrderingEnum {
|
||||||
|
|
||||||
|
None("None"),
|
||||||
|
TmdbAiring("tmdbAiring"),
|
||||||
|
TvdbAired("aired"),
|
||||||
|
TvdbDvd("dvd"),
|
||||||
|
TvdbAbsolute("absolute"),;
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private GetSearchAllLibrariesShowOrderingEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,42 +3,198 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* GetSearchAllLibrariesType
|
* GetSearchAllLibrariesType
|
||||||
*
|
*
|
||||||
* <p>The type of media content
|
* <p>The type of media content
|
||||||
*/
|
*/
|
||||||
public enum GetSearchAllLibrariesType {
|
@JsonDeserialize(using = GetSearchAllLibrariesType._Deserializer.class)
|
||||||
Movie("movie"),
|
@JsonSerialize(using = GetSearchAllLibrariesType._Serializer.class)
|
||||||
TvShow("show"),
|
public class GetSearchAllLibrariesType {
|
||||||
Season("season"),
|
|
||||||
Episode("episode"),
|
public static final GetSearchAllLibrariesType Movie = new GetSearchAllLibrariesType("movie");
|
||||||
Artist("artist"),
|
public static final GetSearchAllLibrariesType TvShow = new GetSearchAllLibrariesType("show");
|
||||||
Album("album");
|
public static final GetSearchAllLibrariesType Season = new GetSearchAllLibrariesType("season");
|
||||||
|
public static final GetSearchAllLibrariesType Episode = new GetSearchAllLibrariesType("episode");
|
||||||
|
public static final GetSearchAllLibrariesType Artist = new GetSearchAllLibrariesType("artist");
|
||||||
|
public static final GetSearchAllLibrariesType Album = new GetSearchAllLibrariesType("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, GetSearchAllLibrariesType> values = createValuesMap();
|
||||||
|
private static final Map<String, GetSearchAllLibrariesTypeEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
private GetSearchAllLibrariesType(String value) {
|
private GetSearchAllLibrariesType(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a GetSearchAllLibrariesType 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 GetSearchAllLibrariesType
|
||||||
|
*/
|
||||||
|
public static GetSearchAllLibrariesType of(String value) {
|
||||||
|
synchronized (GetSearchAllLibrariesType.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new GetSearchAllLibrariesType(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String value() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetSearchAllLibrariesType> fromValue(String value) {
|
public Optional<GetSearchAllLibrariesTypeEnum> asEnum() {
|
||||||
for (GetSearchAllLibrariesType o: GetSearchAllLibrariesType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
GetSearchAllLibrariesType other = (GetSearchAllLibrariesType) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "GetSearchAllLibrariesType [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static GetSearchAllLibrariesType[] values() {
|
||||||
|
synchronized (GetSearchAllLibrariesType.class) {
|
||||||
|
return values.values().toArray(new GetSearchAllLibrariesType[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, GetSearchAllLibrariesType> createValuesMap() {
|
||||||
|
Map<String, GetSearchAllLibrariesType> 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, GetSearchAllLibrariesTypeEnum> createEnumsMap() {
|
||||||
|
Map<String, GetSearchAllLibrariesTypeEnum> map = new HashMap<>();
|
||||||
|
map.put("movie", GetSearchAllLibrariesTypeEnum.Movie);
|
||||||
|
map.put("show", GetSearchAllLibrariesTypeEnum.TvShow);
|
||||||
|
map.put("season", GetSearchAllLibrariesTypeEnum.Season);
|
||||||
|
map.put("episode", GetSearchAllLibrariesTypeEnum.Episode);
|
||||||
|
map.put("artist", GetSearchAllLibrariesTypeEnum.Artist);
|
||||||
|
map.put("album", GetSearchAllLibrariesTypeEnum.Album);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<GetSearchAllLibrariesType> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(GetSearchAllLibrariesType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(GetSearchAllLibrariesType value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<GetSearchAllLibrariesType> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(GetSearchAllLibrariesType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GetSearchAllLibrariesType 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 GetSearchAllLibrariesType.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum GetSearchAllLibrariesTypeEnum {
|
||||||
|
|
||||||
|
Movie("movie"),
|
||||||
|
TvShow("show"),
|
||||||
|
Season("season"),
|
||||||
|
Episode("episode"),
|
||||||
|
Artist("artist"),
|
||||||
|
Album("album"),;
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private GetSearchAllLibrariesTypeEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,45 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.Objects;
|
||||||
import java.util.Optional;
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* GetSearchLibraryQueryParamType
|
* GetSearchLibraryQueryParamType
|
||||||
*
|
*
|
||||||
@@ -17,33 +52,159 @@ import java.util.Optional;
|
|||||||
* 4 = episode
|
* 4 = episode
|
||||||
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
||||||
*/
|
*/
|
||||||
public enum GetSearchLibraryQueryParamType {
|
@JsonDeserialize(using = GetSearchLibraryQueryParamType._Deserializer.class)
|
||||||
Movie(1L),
|
@JsonSerialize(using = GetSearchLibraryQueryParamType._Serializer.class)
|
||||||
TvShow(2L),
|
public class GetSearchLibraryQueryParamType {
|
||||||
Season(3L),
|
|
||||||
Episode(4L),
|
public static final GetSearchLibraryQueryParamType Movie = new GetSearchLibraryQueryParamType(1L);
|
||||||
Audio(8L),
|
public static final GetSearchLibraryQueryParamType TvShow = new GetSearchLibraryQueryParamType(2L);
|
||||||
Album(9L),
|
public static final GetSearchLibraryQueryParamType Season = new GetSearchLibraryQueryParamType(3L);
|
||||||
Track(10L);
|
public static final GetSearchLibraryQueryParamType Episode = new GetSearchLibraryQueryParamType(4L);
|
||||||
|
public static final GetSearchLibraryQueryParamType Audio = new GetSearchLibraryQueryParamType(8L);
|
||||||
|
public static final GetSearchLibraryQueryParamType Album = new GetSearchLibraryQueryParamType(9L);
|
||||||
|
public static final GetSearchLibraryQueryParamType Track = new GetSearchLibraryQueryParamType(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, GetSearchLibraryQueryParamType> values = createValuesMap();
|
||||||
|
private static final Map<Long, GetSearchLibraryQueryParamTypeEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final long value;
|
private final long value;
|
||||||
|
|
||||||
private GetSearchLibraryQueryParamType(long value) {
|
private GetSearchLibraryQueryParamType(long value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a GetSearchLibraryQueryParamType 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 GetSearchLibraryQueryParamType
|
||||||
|
*/
|
||||||
|
public static GetSearchLibraryQueryParamType of(long value) {
|
||||||
|
synchronized (GetSearchLibraryQueryParamType.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new GetSearchLibraryQueryParamType(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public long value() {
|
public long value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetSearchLibraryQueryParamType> fromValue(long value) {
|
public Optional<GetSearchLibraryQueryParamTypeEnum> asEnum() {
|
||||||
for (GetSearchLibraryQueryParamType o: GetSearchLibraryQueryParamType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
GetSearchLibraryQueryParamType other = (GetSearchLibraryQueryParamType) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "GetSearchLibraryQueryParamType [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static GetSearchLibraryQueryParamType[] values() {
|
||||||
|
synchronized (GetSearchLibraryQueryParamType.class) {
|
||||||
|
return values.values().toArray(new GetSearchLibraryQueryParamType[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<Long, GetSearchLibraryQueryParamType> createValuesMap() {
|
||||||
|
Map<Long, GetSearchLibraryQueryParamType> 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, GetSearchLibraryQueryParamTypeEnum> createEnumsMap() {
|
||||||
|
Map<Long, GetSearchLibraryQueryParamTypeEnum> map = new HashMap<>();
|
||||||
|
map.put(1L, GetSearchLibraryQueryParamTypeEnum.Movie);
|
||||||
|
map.put(2L, GetSearchLibraryQueryParamTypeEnum.TvShow);
|
||||||
|
map.put(3L, GetSearchLibraryQueryParamTypeEnum.Season);
|
||||||
|
map.put(4L, GetSearchLibraryQueryParamTypeEnum.Episode);
|
||||||
|
map.put(8L, GetSearchLibraryQueryParamTypeEnum.Audio);
|
||||||
|
map.put(9L, GetSearchLibraryQueryParamTypeEnum.Album);
|
||||||
|
map.put(10L, GetSearchLibraryQueryParamTypeEnum.Track);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<GetSearchLibraryQueryParamType> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(GetSearchLibraryQueryParamType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(GetSearchLibraryQueryParamType value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<GetSearchLibraryQueryParamType> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(GetSearchLibraryQueryParamType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GetSearchLibraryQueryParamType 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 GetSearchLibraryQueryParamType.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum GetSearchLibraryQueryParamTypeEnum {
|
||||||
|
|
||||||
|
Movie(1L),
|
||||||
|
TvShow(2L),
|
||||||
|
Season(3L),
|
||||||
|
Episode(4L),
|
||||||
|
Audio(8L),
|
||||||
|
Album(9L),
|
||||||
|
Track(10L),;
|
||||||
|
|
||||||
|
private final long value;
|
||||||
|
|
||||||
|
private GetSearchLibraryQueryParamTypeEnum(long value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,38 +3,182 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* GetTokenDetailsAuthenticationResponseStatus
|
* GetTokenDetailsAuthenticationResponseStatus
|
||||||
*
|
*
|
||||||
* <p>String representation of subscriptionActive
|
* <p>String representation of subscriptionActive
|
||||||
*/
|
*/
|
||||||
public enum GetTokenDetailsAuthenticationResponseStatus {
|
@JsonDeserialize(using = GetTokenDetailsAuthenticationResponseStatus._Deserializer.class)
|
||||||
INACTIVE("Inactive"),
|
@JsonSerialize(using = GetTokenDetailsAuthenticationResponseStatus._Serializer.class)
|
||||||
ACTIVE("Active");
|
public class GetTokenDetailsAuthenticationResponseStatus {
|
||||||
|
|
||||||
|
public static final GetTokenDetailsAuthenticationResponseStatus INACTIVE = new GetTokenDetailsAuthenticationResponseStatus("Inactive");
|
||||||
|
public static final GetTokenDetailsAuthenticationResponseStatus ACTIVE = new GetTokenDetailsAuthenticationResponseStatus("Active");
|
||||||
|
|
||||||
|
// 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, GetTokenDetailsAuthenticationResponseStatus> values = createValuesMap();
|
||||||
|
private static final Map<String, GetTokenDetailsAuthenticationResponseStatusEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
private GetTokenDetailsAuthenticationResponseStatus(String value) {
|
private GetTokenDetailsAuthenticationResponseStatus(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a GetTokenDetailsAuthenticationResponseStatus 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 GetTokenDetailsAuthenticationResponseStatus
|
||||||
|
*/
|
||||||
|
public static GetTokenDetailsAuthenticationResponseStatus of(String value) {
|
||||||
|
synchronized (GetTokenDetailsAuthenticationResponseStatus.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new GetTokenDetailsAuthenticationResponseStatus(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String value() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetTokenDetailsAuthenticationResponseStatus> fromValue(String value) {
|
public Optional<GetTokenDetailsAuthenticationResponseStatusEnum> asEnum() {
|
||||||
for (GetTokenDetailsAuthenticationResponseStatus o: GetTokenDetailsAuthenticationResponseStatus.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
GetTokenDetailsAuthenticationResponseStatus other = (GetTokenDetailsAuthenticationResponseStatus) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "GetTokenDetailsAuthenticationResponseStatus [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static GetTokenDetailsAuthenticationResponseStatus[] values() {
|
||||||
|
synchronized (GetTokenDetailsAuthenticationResponseStatus.class) {
|
||||||
|
return values.values().toArray(new GetTokenDetailsAuthenticationResponseStatus[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, GetTokenDetailsAuthenticationResponseStatus> createValuesMap() {
|
||||||
|
Map<String, GetTokenDetailsAuthenticationResponseStatus> map = new LinkedHashMap<>();
|
||||||
|
map.put("Inactive", INACTIVE);
|
||||||
|
map.put("Active", ACTIVE);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, GetTokenDetailsAuthenticationResponseStatusEnum> createEnumsMap() {
|
||||||
|
Map<String, GetTokenDetailsAuthenticationResponseStatusEnum> map = new HashMap<>();
|
||||||
|
map.put("Inactive", GetTokenDetailsAuthenticationResponseStatusEnum.INACTIVE);
|
||||||
|
map.put("Active", GetTokenDetailsAuthenticationResponseStatusEnum.ACTIVE);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<GetTokenDetailsAuthenticationResponseStatus> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(GetTokenDetailsAuthenticationResponseStatus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(GetTokenDetailsAuthenticationResponseStatus value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<GetTokenDetailsAuthenticationResponseStatus> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(GetTokenDetailsAuthenticationResponseStatus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GetTokenDetailsAuthenticationResponseStatus 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 GetTokenDetailsAuthenticationResponseStatus.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum GetTokenDetailsAuthenticationResponseStatusEnum {
|
||||||
|
|
||||||
|
INACTIVE("Inactive"),
|
||||||
|
ACTIVE("Active"),;
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private GetTokenDetailsAuthenticationResponseStatusEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,38 +3,182 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* GetTokenDetailsAuthenticationStatus
|
* GetTokenDetailsAuthenticationStatus
|
||||||
*
|
*
|
||||||
* <p>String representation of subscriptionActive
|
* <p>String representation of subscriptionActive
|
||||||
*/
|
*/
|
||||||
public enum GetTokenDetailsAuthenticationStatus {
|
@JsonDeserialize(using = GetTokenDetailsAuthenticationStatus._Deserializer.class)
|
||||||
INACTIVE("Inactive"),
|
@JsonSerialize(using = GetTokenDetailsAuthenticationStatus._Serializer.class)
|
||||||
ACTIVE("Active");
|
public class GetTokenDetailsAuthenticationStatus {
|
||||||
|
|
||||||
|
public static final GetTokenDetailsAuthenticationStatus INACTIVE = new GetTokenDetailsAuthenticationStatus("Inactive");
|
||||||
|
public static final GetTokenDetailsAuthenticationStatus ACTIVE = new GetTokenDetailsAuthenticationStatus("Active");
|
||||||
|
|
||||||
|
// 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, GetTokenDetailsAuthenticationStatus> values = createValuesMap();
|
||||||
|
private static final Map<String, GetTokenDetailsAuthenticationStatusEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
private GetTokenDetailsAuthenticationStatus(String value) {
|
private GetTokenDetailsAuthenticationStatus(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a GetTokenDetailsAuthenticationStatus 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 GetTokenDetailsAuthenticationStatus
|
||||||
|
*/
|
||||||
|
public static GetTokenDetailsAuthenticationStatus of(String value) {
|
||||||
|
synchronized (GetTokenDetailsAuthenticationStatus.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new GetTokenDetailsAuthenticationStatus(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String value() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetTokenDetailsAuthenticationStatus> fromValue(String value) {
|
public Optional<GetTokenDetailsAuthenticationStatusEnum> asEnum() {
|
||||||
for (GetTokenDetailsAuthenticationStatus o: GetTokenDetailsAuthenticationStatus.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
GetTokenDetailsAuthenticationStatus other = (GetTokenDetailsAuthenticationStatus) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "GetTokenDetailsAuthenticationStatus [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static GetTokenDetailsAuthenticationStatus[] values() {
|
||||||
|
synchronized (GetTokenDetailsAuthenticationStatus.class) {
|
||||||
|
return values.values().toArray(new GetTokenDetailsAuthenticationStatus[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, GetTokenDetailsAuthenticationStatus> createValuesMap() {
|
||||||
|
Map<String, GetTokenDetailsAuthenticationStatus> map = new LinkedHashMap<>();
|
||||||
|
map.put("Inactive", INACTIVE);
|
||||||
|
map.put("Active", ACTIVE);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, GetTokenDetailsAuthenticationStatusEnum> createEnumsMap() {
|
||||||
|
Map<String, GetTokenDetailsAuthenticationStatusEnum> map = new HashMap<>();
|
||||||
|
map.put("Inactive", GetTokenDetailsAuthenticationStatusEnum.INACTIVE);
|
||||||
|
map.put("Active", GetTokenDetailsAuthenticationStatusEnum.ACTIVE);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<GetTokenDetailsAuthenticationStatus> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(GetTokenDetailsAuthenticationStatus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(GetTokenDetailsAuthenticationStatus value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<GetTokenDetailsAuthenticationStatus> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(GetTokenDetailsAuthenticationStatus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GetTokenDetailsAuthenticationStatus 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 GetTokenDetailsAuthenticationStatus.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum GetTokenDetailsAuthenticationStatusEnum {
|
||||||
|
|
||||||
|
INACTIVE("Inactive"),
|
||||||
|
ACTIVE("Active"),;
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private GetTokenDetailsAuthenticationStatusEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,33 +3,177 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
public enum GetTokenDetailsStatus {
|
/**
|
||||||
ONLINE("online"),
|
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
|
||||||
OFFLINE("offline");
|
* 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 = GetTokenDetailsStatus._Deserializer.class)
|
||||||
|
@JsonSerialize(using = GetTokenDetailsStatus._Serializer.class)
|
||||||
|
public class GetTokenDetailsStatus {
|
||||||
|
|
||||||
|
public static final GetTokenDetailsStatus ONLINE = new GetTokenDetailsStatus("online");
|
||||||
|
public static final GetTokenDetailsStatus OFFLINE = new GetTokenDetailsStatus("offline");
|
||||||
|
|
||||||
|
// 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, GetTokenDetailsStatus> values = createValuesMap();
|
||||||
|
private static final Map<String, GetTokenDetailsStatusEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
private GetTokenDetailsStatus(String value) {
|
private GetTokenDetailsStatus(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a GetTokenDetailsStatus 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 GetTokenDetailsStatus
|
||||||
|
*/
|
||||||
|
public static GetTokenDetailsStatus of(String value) {
|
||||||
|
synchronized (GetTokenDetailsStatus.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new GetTokenDetailsStatus(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String value() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetTokenDetailsStatus> fromValue(String value) {
|
public Optional<GetTokenDetailsStatusEnum> asEnum() {
|
||||||
for (GetTokenDetailsStatus o: GetTokenDetailsStatus.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
GetTokenDetailsStatus other = (GetTokenDetailsStatus) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "GetTokenDetailsStatus [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static GetTokenDetailsStatus[] values() {
|
||||||
|
synchronized (GetTokenDetailsStatus.class) {
|
||||||
|
return values.values().toArray(new GetTokenDetailsStatus[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, GetTokenDetailsStatus> createValuesMap() {
|
||||||
|
Map<String, GetTokenDetailsStatus> map = new LinkedHashMap<>();
|
||||||
|
map.put("online", ONLINE);
|
||||||
|
map.put("offline", OFFLINE);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, GetTokenDetailsStatusEnum> createEnumsMap() {
|
||||||
|
Map<String, GetTokenDetailsStatusEnum> map = new HashMap<>();
|
||||||
|
map.put("online", GetTokenDetailsStatusEnum.ONLINE);
|
||||||
|
map.put("offline", GetTokenDetailsStatusEnum.OFFLINE);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<GetTokenDetailsStatus> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(GetTokenDetailsStatus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(GetTokenDetailsStatus value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<GetTokenDetailsStatus> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(GetTokenDetailsStatus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GetTokenDetailsStatus 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 GetTokenDetailsStatus.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum GetTokenDetailsStatusEnum {
|
||||||
|
|
||||||
|
ONLINE("online"),
|
||||||
|
OFFLINE("offline"),;
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private GetTokenDetailsStatusEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,45 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.Objects;
|
||||||
import java.util.Optional;
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* GetTopWatchedContentQueryParamType
|
* GetTopWatchedContentQueryParamType
|
||||||
*
|
*
|
||||||
@@ -17,33 +52,159 @@ import java.util.Optional;
|
|||||||
* 4 = episode
|
* 4 = episode
|
||||||
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
||||||
*/
|
*/
|
||||||
public enum GetTopWatchedContentQueryParamType {
|
@JsonDeserialize(using = GetTopWatchedContentQueryParamType._Deserializer.class)
|
||||||
Movie(1L),
|
@JsonSerialize(using = GetTopWatchedContentQueryParamType._Serializer.class)
|
||||||
TvShow(2L),
|
public class GetTopWatchedContentQueryParamType {
|
||||||
Season(3L),
|
|
||||||
Episode(4L),
|
public static final GetTopWatchedContentQueryParamType Movie = new GetTopWatchedContentQueryParamType(1L);
|
||||||
Audio(8L),
|
public static final GetTopWatchedContentQueryParamType TvShow = new GetTopWatchedContentQueryParamType(2L);
|
||||||
Album(9L),
|
public static final GetTopWatchedContentQueryParamType Season = new GetTopWatchedContentQueryParamType(3L);
|
||||||
Track(10L);
|
public static final GetTopWatchedContentQueryParamType Episode = new GetTopWatchedContentQueryParamType(4L);
|
||||||
|
public static final GetTopWatchedContentQueryParamType Audio = new GetTopWatchedContentQueryParamType(8L);
|
||||||
|
public static final GetTopWatchedContentQueryParamType Album = new GetTopWatchedContentQueryParamType(9L);
|
||||||
|
public static final GetTopWatchedContentQueryParamType Track = new GetTopWatchedContentQueryParamType(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, GetTopWatchedContentQueryParamType> values = createValuesMap();
|
||||||
|
private static final Map<Long, GetTopWatchedContentQueryParamTypeEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final long value;
|
private final long value;
|
||||||
|
|
||||||
private GetTopWatchedContentQueryParamType(long value) {
|
private GetTopWatchedContentQueryParamType(long value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a GetTopWatchedContentQueryParamType 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 GetTopWatchedContentQueryParamType
|
||||||
|
*/
|
||||||
|
public static GetTopWatchedContentQueryParamType of(long value) {
|
||||||
|
synchronized (GetTopWatchedContentQueryParamType.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new GetTopWatchedContentQueryParamType(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public long value() {
|
public long value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<GetTopWatchedContentQueryParamType> fromValue(long value) {
|
public Optional<GetTopWatchedContentQueryParamTypeEnum> asEnum() {
|
||||||
for (GetTopWatchedContentQueryParamType o: GetTopWatchedContentQueryParamType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
GetTopWatchedContentQueryParamType other = (GetTopWatchedContentQueryParamType) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "GetTopWatchedContentQueryParamType [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static GetTopWatchedContentQueryParamType[] values() {
|
||||||
|
synchronized (GetTopWatchedContentQueryParamType.class) {
|
||||||
|
return values.values().toArray(new GetTopWatchedContentQueryParamType[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<Long, GetTopWatchedContentQueryParamType> createValuesMap() {
|
||||||
|
Map<Long, GetTopWatchedContentQueryParamType> 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, GetTopWatchedContentQueryParamTypeEnum> createEnumsMap() {
|
||||||
|
Map<Long, GetTopWatchedContentQueryParamTypeEnum> map = new HashMap<>();
|
||||||
|
map.put(1L, GetTopWatchedContentQueryParamTypeEnum.Movie);
|
||||||
|
map.put(2L, GetTopWatchedContentQueryParamTypeEnum.TvShow);
|
||||||
|
map.put(3L, GetTopWatchedContentQueryParamTypeEnum.Season);
|
||||||
|
map.put(4L, GetTopWatchedContentQueryParamTypeEnum.Episode);
|
||||||
|
map.put(8L, GetTopWatchedContentQueryParamTypeEnum.Audio);
|
||||||
|
map.put(9L, GetTopWatchedContentQueryParamTypeEnum.Album);
|
||||||
|
map.put(10L, GetTopWatchedContentQueryParamTypeEnum.Track);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<GetTopWatchedContentQueryParamType> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(GetTopWatchedContentQueryParamType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(GetTopWatchedContentQueryParamType value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<GetTopWatchedContentQueryParamType> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(GetTopWatchedContentQueryParamType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GetTopWatchedContentQueryParamType 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 GetTopWatchedContentQueryParamType.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum GetTopWatchedContentQueryParamTypeEnum {
|
||||||
|
|
||||||
|
Movie(1L),
|
||||||
|
TvShow(2L),
|
||||||
|
Season(3L),
|
||||||
|
Episode(4L),
|
||||||
|
Audio(8L),
|
||||||
|
Album(9L),
|
||||||
|
Track(10L),;
|
||||||
|
|
||||||
|
private final long value;
|
||||||
|
|
||||||
|
private GetTopWatchedContentQueryParamTypeEnum(long value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,45 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.Objects;
|
||||||
import java.util.Optional;
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* Level
|
* Level
|
||||||
*
|
*
|
||||||
@@ -17,31 +52,151 @@ import java.util.Optional;
|
|||||||
* 3: Debug
|
* 3: Debug
|
||||||
* 4: Verbose
|
* 4: Verbose
|
||||||
*/
|
*/
|
||||||
public enum Level {
|
@JsonDeserialize(using = Level._Deserializer.class)
|
||||||
ZERO(0L),
|
@JsonSerialize(using = Level._Serializer.class)
|
||||||
ONE(1L),
|
public class Level {
|
||||||
TWO(2L),
|
|
||||||
THREE(3L),
|
public static final Level ZERO = new Level(0L);
|
||||||
FOUR(4L);
|
public static final Level ONE = new Level(1L);
|
||||||
|
public static final Level TWO = new Level(2L);
|
||||||
|
public static final Level THREE = new Level(3L);
|
||||||
|
public static final Level FOUR = new Level(4L);
|
||||||
|
|
||||||
|
// 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, Level> values = createValuesMap();
|
||||||
|
private static final Map<Long, LevelEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final long value;
|
private final long value;
|
||||||
|
|
||||||
private Level(long value) {
|
private Level(long value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a Level 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 Level
|
||||||
|
*/
|
||||||
|
public static Level of(long value) {
|
||||||
|
synchronized (Level.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new Level(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public long value() {
|
public long value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<Level> fromValue(long value) {
|
public Optional<LevelEnum> asEnum() {
|
||||||
for (Level o: Level.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
Level other = (Level) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Level [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static Level[] values() {
|
||||||
|
synchronized (Level.class) {
|
||||||
|
return values.values().toArray(new Level[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<Long, Level> createValuesMap() {
|
||||||
|
Map<Long, Level> map = new LinkedHashMap<>();
|
||||||
|
map.put(0L, ZERO);
|
||||||
|
map.put(1L, ONE);
|
||||||
|
map.put(2L, TWO);
|
||||||
|
map.put(3L, THREE);
|
||||||
|
map.put(4L, FOUR);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<Long, LevelEnum> createEnumsMap() {
|
||||||
|
Map<Long, LevelEnum> map = new HashMap<>();
|
||||||
|
map.put(0L, LevelEnum.ZERO);
|
||||||
|
map.put(1L, LevelEnum.ONE);
|
||||||
|
map.put(2L, LevelEnum.TWO);
|
||||||
|
map.put(3L, LevelEnum.THREE);
|
||||||
|
map.put(4L, LevelEnum.FOUR);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<Level> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(Level.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(Level value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<Level> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(Level.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Level 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 Level.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum LevelEnum {
|
||||||
|
|
||||||
|
ZERO(0L),
|
||||||
|
ONE(1L),
|
||||||
|
TWO(2L),
|
||||||
|
THREE(3L),
|
||||||
|
FOUR(4L),;
|
||||||
|
|
||||||
|
private final long value;
|
||||||
|
|
||||||
|
private LevelEnum(long value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,38 +3,182 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* Libtype
|
* Libtype
|
||||||
*
|
*
|
||||||
* <p>The type of library to filter. Can be "movie" or "show", or all if not present.
|
* <p>The type of library to filter. Can be "movie" or "show", or all if not present.
|
||||||
*/
|
*/
|
||||||
public enum Libtype {
|
@JsonDeserialize(using = Libtype._Deserializer.class)
|
||||||
MOVIE("movie"),
|
@JsonSerialize(using = Libtype._Serializer.class)
|
||||||
SHOW("show");
|
public class Libtype {
|
||||||
|
|
||||||
|
public static final Libtype MOVIE = new Libtype("movie");
|
||||||
|
public static final Libtype SHOW = new Libtype("show");
|
||||||
|
|
||||||
|
// 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, Libtype> values = createValuesMap();
|
||||||
|
private static final Map<String, LibtypeEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
private Libtype(String value) {
|
private Libtype(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a Libtype 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 Libtype
|
||||||
|
*/
|
||||||
|
public static Libtype of(String value) {
|
||||||
|
synchronized (Libtype.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new Libtype(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String value() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<Libtype> fromValue(String value) {
|
public Optional<LibtypeEnum> asEnum() {
|
||||||
for (Libtype o: Libtype.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
Libtype other = (Libtype) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Libtype [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static Libtype[] values() {
|
||||||
|
synchronized (Libtype.class) {
|
||||||
|
return values.values().toArray(new Libtype[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, Libtype> createValuesMap() {
|
||||||
|
Map<String, Libtype> map = new LinkedHashMap<>();
|
||||||
|
map.put("movie", MOVIE);
|
||||||
|
map.put("show", SHOW);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, LibtypeEnum> createEnumsMap() {
|
||||||
|
Map<String, LibtypeEnum> map = new HashMap<>();
|
||||||
|
map.put("movie", LibtypeEnum.MOVIE);
|
||||||
|
map.put("show", LibtypeEnum.SHOW);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<Libtype> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(Libtype.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(Libtype value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<Libtype> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(Libtype.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Libtype 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 Libtype.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum LibtypeEnum {
|
||||||
|
|
||||||
|
MOVIE("movie"),
|
||||||
|
SHOW("show"),;
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private LibtypeEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,38 +3,182 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* MailingListStatus
|
* MailingListStatus
|
||||||
*
|
*
|
||||||
* <p>Your current mailing list status (active or unsubscribed)
|
* <p>Your current mailing list status (active or unsubscribed)
|
||||||
*/
|
*/
|
||||||
public enum MailingListStatus {
|
@JsonDeserialize(using = MailingListStatus._Deserializer.class)
|
||||||
ACTIVE("active"),
|
@JsonSerialize(using = MailingListStatus._Serializer.class)
|
||||||
UNSUBSCRIBED("unsubscribed");
|
public class MailingListStatus {
|
||||||
|
|
||||||
|
public static final MailingListStatus ACTIVE = new MailingListStatus("active");
|
||||||
|
public static final MailingListStatus UNSUBSCRIBED = new MailingListStatus("unsubscribed");
|
||||||
|
|
||||||
|
// 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, MailingListStatus> values = createValuesMap();
|
||||||
|
private static final Map<String, MailingListStatusEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
private MailingListStatus(String value) {
|
private MailingListStatus(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a MailingListStatus 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 MailingListStatus
|
||||||
|
*/
|
||||||
|
public static MailingListStatus of(String value) {
|
||||||
|
synchronized (MailingListStatus.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new MailingListStatus(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String value() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<MailingListStatus> fromValue(String value) {
|
public Optional<MailingListStatusEnum> asEnum() {
|
||||||
for (MailingListStatus o: MailingListStatus.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
MailingListStatus other = (MailingListStatus) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "MailingListStatus [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static MailingListStatus[] values() {
|
||||||
|
synchronized (MailingListStatus.class) {
|
||||||
|
return values.values().toArray(new MailingListStatus[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, MailingListStatus> createValuesMap() {
|
||||||
|
Map<String, MailingListStatus> map = new LinkedHashMap<>();
|
||||||
|
map.put("active", ACTIVE);
|
||||||
|
map.put("unsubscribed", UNSUBSCRIBED);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, MailingListStatusEnum> createEnumsMap() {
|
||||||
|
Map<String, MailingListStatusEnum> map = new HashMap<>();
|
||||||
|
map.put("active", MailingListStatusEnum.ACTIVE);
|
||||||
|
map.put("unsubscribed", MailingListStatusEnum.UNSUBSCRIBED);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<MailingListStatus> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(MailingListStatus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(MailingListStatus value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<MailingListStatus> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(MailingListStatus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MailingListStatus 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 MailingListStatus.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum MailingListStatusEnum {
|
||||||
|
|
||||||
|
ACTIVE("active"),
|
||||||
|
UNSUBSCRIBED("unsubscribed"),;
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private MailingListStatusEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
295
src/main/java/dev/plexapi/sdk/models/operations/Marker.java
Normal file
295
src/main/java/dev/plexapi/sdk/models/operations/Marker.java
Normal file
@@ -0,0 +1,295 @@
|
|||||||
|
/*
|
||||||
|
* 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.Long;
|
||||||
|
import java.lang.Override;
|
||||||
|
import java.lang.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marker
|
||||||
|
*
|
||||||
|
* <p>The final status of the marker
|
||||||
|
*/
|
||||||
|
public class Marker {
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
private long id;
|
||||||
|
|
||||||
|
@JsonProperty("type")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@JsonProperty("startTimeOffset")
|
||||||
|
private long startTimeOffset;
|
||||||
|
|
||||||
|
@JsonProperty("endTimeOffset")
|
||||||
|
private long endTimeOffset;
|
||||||
|
|
||||||
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
|
@JsonProperty("final")
|
||||||
|
private Optional<Boolean> final_;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attributes associated with the marker.
|
||||||
|
*/
|
||||||
|
@JsonInclude(Include.NON_ABSENT)
|
||||||
|
@JsonProperty("Attributes")
|
||||||
|
private Optional<? extends Attributes> attributes;
|
||||||
|
|
||||||
|
@JsonCreator
|
||||||
|
public Marker(
|
||||||
|
@JsonProperty("id") long id,
|
||||||
|
@JsonProperty("type") String type,
|
||||||
|
@JsonProperty("startTimeOffset") long startTimeOffset,
|
||||||
|
@JsonProperty("endTimeOffset") long endTimeOffset,
|
||||||
|
@JsonProperty("final") Optional<Boolean> final_,
|
||||||
|
@JsonProperty("Attributes") Optional<? extends Attributes> attributes) {
|
||||||
|
Utils.checkNotNull(id, "id");
|
||||||
|
Utils.checkNotNull(type, "type");
|
||||||
|
Utils.checkNotNull(startTimeOffset, "startTimeOffset");
|
||||||
|
Utils.checkNotNull(endTimeOffset, "endTimeOffset");
|
||||||
|
Utils.checkNotNull(final_, "final_");
|
||||||
|
Utils.checkNotNull(attributes, "attributes");
|
||||||
|
this.id = id;
|
||||||
|
this.type = type;
|
||||||
|
this.startTimeOffset = startTimeOffset;
|
||||||
|
this.endTimeOffset = endTimeOffset;
|
||||||
|
this.final_ = final_;
|
||||||
|
this.attributes = attributes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Marker(
|
||||||
|
long id,
|
||||||
|
String type,
|
||||||
|
long startTimeOffset,
|
||||||
|
long endTimeOffset) {
|
||||||
|
this(id, type, startTimeOffset, endTimeOffset, Optional.empty(), Optional.empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public long id() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public String type() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public long startTimeOffset() {
|
||||||
|
return startTimeOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public long endTimeOffset() {
|
||||||
|
return endTimeOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public Optional<Boolean> final_() {
|
||||||
|
return final_;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attributes associated with the marker.
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@JsonIgnore
|
||||||
|
public Optional<Attributes> attributes() {
|
||||||
|
return (Optional<Attributes>) attributes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final static Builder builder() {
|
||||||
|
return new Builder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Marker withId(long id) {
|
||||||
|
Utils.checkNotNull(id, "id");
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Marker withType(String type) {
|
||||||
|
Utils.checkNotNull(type, "type");
|
||||||
|
this.type = type;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Marker withStartTimeOffset(long startTimeOffset) {
|
||||||
|
Utils.checkNotNull(startTimeOffset, "startTimeOffset");
|
||||||
|
this.startTimeOffset = startTimeOffset;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Marker withEndTimeOffset(long endTimeOffset) {
|
||||||
|
Utils.checkNotNull(endTimeOffset, "endTimeOffset");
|
||||||
|
this.endTimeOffset = endTimeOffset;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Marker withFinal(boolean final_) {
|
||||||
|
Utils.checkNotNull(final_, "final_");
|
||||||
|
this.final_ = Optional.ofNullable(final_);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Marker withFinal(Optional<Boolean> final_) {
|
||||||
|
Utils.checkNotNull(final_, "final_");
|
||||||
|
this.final_ = final_;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attributes associated with the marker.
|
||||||
|
*/
|
||||||
|
public Marker withAttributes(Attributes attributes) {
|
||||||
|
Utils.checkNotNull(attributes, "attributes");
|
||||||
|
this.attributes = Optional.ofNullable(attributes);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attributes associated with the marker.
|
||||||
|
*/
|
||||||
|
public Marker withAttributes(Optional<? extends Attributes> attributes) {
|
||||||
|
Utils.checkNotNull(attributes, "attributes");
|
||||||
|
this.attributes = attributes;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Marker other = (Marker) o;
|
||||||
|
return
|
||||||
|
Objects.deepEquals(this.id, other.id) &&
|
||||||
|
Objects.deepEquals(this.type, other.type) &&
|
||||||
|
Objects.deepEquals(this.startTimeOffset, other.startTimeOffset) &&
|
||||||
|
Objects.deepEquals(this.endTimeOffset, other.endTimeOffset) &&
|
||||||
|
Objects.deepEquals(this.final_, other.final_) &&
|
||||||
|
Objects.deepEquals(this.attributes, other.attributes);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(
|
||||||
|
id,
|
||||||
|
type,
|
||||||
|
startTimeOffset,
|
||||||
|
endTimeOffset,
|
||||||
|
final_,
|
||||||
|
attributes);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return Utils.toString(Marker.class,
|
||||||
|
"id", id,
|
||||||
|
"type", type,
|
||||||
|
"startTimeOffset", startTimeOffset,
|
||||||
|
"endTimeOffset", endTimeOffset,
|
||||||
|
"final_", final_,
|
||||||
|
"attributes", attributes);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final static class Builder {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
private Long startTimeOffset;
|
||||||
|
|
||||||
|
private Long endTimeOffset;
|
||||||
|
|
||||||
|
private Optional<Boolean> final_ = Optional.empty();
|
||||||
|
|
||||||
|
private Optional<? extends Attributes> attributes = Optional.empty();
|
||||||
|
|
||||||
|
private Builder() {
|
||||||
|
// force use of static builder() method
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder id(long id) {
|
||||||
|
Utils.checkNotNull(id, "id");
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder type(String type) {
|
||||||
|
Utils.checkNotNull(type, "type");
|
||||||
|
this.type = type;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder startTimeOffset(long startTimeOffset) {
|
||||||
|
Utils.checkNotNull(startTimeOffset, "startTimeOffset");
|
||||||
|
this.startTimeOffset = startTimeOffset;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder endTimeOffset(long endTimeOffset) {
|
||||||
|
Utils.checkNotNull(endTimeOffset, "endTimeOffset");
|
||||||
|
this.endTimeOffset = endTimeOffset;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder final_(boolean final_) {
|
||||||
|
Utils.checkNotNull(final_, "final_");
|
||||||
|
this.final_ = Optional.ofNullable(final_);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder final_(Optional<Boolean> final_) {
|
||||||
|
Utils.checkNotNull(final_, "final_");
|
||||||
|
this.final_ = final_;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attributes associated with the marker.
|
||||||
|
*/
|
||||||
|
public Builder attributes(Attributes attributes) {
|
||||||
|
Utils.checkNotNull(attributes, "attributes");
|
||||||
|
this.attributes = Optional.ofNullable(attributes);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attributes associated with the marker.
|
||||||
|
*/
|
||||||
|
public Builder attributes(Optional<? extends Attributes> attributes) {
|
||||||
|
Utils.checkNotNull(attributes, "attributes");
|
||||||
|
this.attributes = attributes;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Marker build() {
|
||||||
|
return new Marker(
|
||||||
|
id,
|
||||||
|
type,
|
||||||
|
startTimeOffset,
|
||||||
|
endTimeOffset,
|
||||||
|
final_,
|
||||||
|
attributes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,50 +3,230 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* PathParamTaskName
|
* PathParamTaskName
|
||||||
*
|
*
|
||||||
* <p>The name of the task to be started.
|
* <p>The name of the task to be started.
|
||||||
*/
|
*/
|
||||||
public enum PathParamTaskName {
|
@JsonDeserialize(using = PathParamTaskName._Deserializer.class)
|
||||||
BACKUP_DATABASE("BackupDatabase"),
|
@JsonSerialize(using = PathParamTaskName._Serializer.class)
|
||||||
BUILD_GRACENOTE_COLLECTIONS("BuildGracenoteCollections"),
|
public class PathParamTaskName {
|
||||||
CHECK_FOR_UPDATES("CheckForUpdates"),
|
|
||||||
CLEAN_OLD_BUNDLES("CleanOldBundles"),
|
public static final PathParamTaskName BACKUP_DATABASE = new PathParamTaskName("BackupDatabase");
|
||||||
CLEAN_OLD_CACHE_FILES("CleanOldCacheFiles"),
|
public static final PathParamTaskName BUILD_GRACENOTE_COLLECTIONS = new PathParamTaskName("BuildGracenoteCollections");
|
||||||
DEEP_MEDIA_ANALYSIS("DeepMediaAnalysis"),
|
public static final PathParamTaskName CHECK_FOR_UPDATES = new PathParamTaskName("CheckForUpdates");
|
||||||
GENERATE_AUTO_TAGS("GenerateAutoTags"),
|
public static final PathParamTaskName CLEAN_OLD_BUNDLES = new PathParamTaskName("CleanOldBundles");
|
||||||
GENERATE_CHAPTER_THUMBS("GenerateChapterThumbs"),
|
public static final PathParamTaskName CLEAN_OLD_CACHE_FILES = new PathParamTaskName("CleanOldCacheFiles");
|
||||||
GENERATE_MEDIA_INDEX_FILES("GenerateMediaIndexFiles"),
|
public static final PathParamTaskName DEEP_MEDIA_ANALYSIS = new PathParamTaskName("DeepMediaAnalysis");
|
||||||
OPTIMIZE_DATABASE("OptimizeDatabase"),
|
public static final PathParamTaskName GENERATE_AUTO_TAGS = new PathParamTaskName("GenerateAutoTags");
|
||||||
REFRESH_LIBRARIES("RefreshLibraries"),
|
public static final PathParamTaskName GENERATE_CHAPTER_THUMBS = new PathParamTaskName("GenerateChapterThumbs");
|
||||||
REFRESH_LOCAL_MEDIA("RefreshLocalMedia"),
|
public static final PathParamTaskName GENERATE_MEDIA_INDEX_FILES = new PathParamTaskName("GenerateMediaIndexFiles");
|
||||||
REFRESH_PERIODIC_METADATA("RefreshPeriodicMetadata"),
|
public static final PathParamTaskName OPTIMIZE_DATABASE = new PathParamTaskName("OptimizeDatabase");
|
||||||
UPGRADE_MEDIA_ANALYSIS("UpgradeMediaAnalysis");
|
public static final PathParamTaskName REFRESH_LIBRARIES = new PathParamTaskName("RefreshLibraries");
|
||||||
|
public static final PathParamTaskName REFRESH_LOCAL_MEDIA = new PathParamTaskName("RefreshLocalMedia");
|
||||||
|
public static final PathParamTaskName REFRESH_PERIODIC_METADATA = new PathParamTaskName("RefreshPeriodicMetadata");
|
||||||
|
public static final PathParamTaskName UPGRADE_MEDIA_ANALYSIS = new PathParamTaskName("UpgradeMediaAnalysis");
|
||||||
|
|
||||||
|
// 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, PathParamTaskName> values = createValuesMap();
|
||||||
|
private static final Map<String, PathParamTaskNameEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
private PathParamTaskName(String value) {
|
private PathParamTaskName(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a PathParamTaskName 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 PathParamTaskName
|
||||||
|
*/
|
||||||
|
public static PathParamTaskName of(String value) {
|
||||||
|
synchronized (PathParamTaskName.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new PathParamTaskName(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String value() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<PathParamTaskName> fromValue(String value) {
|
public Optional<PathParamTaskNameEnum> asEnum() {
|
||||||
for (PathParamTaskName o: PathParamTaskName.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
PathParamTaskName other = (PathParamTaskName) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PathParamTaskName [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static PathParamTaskName[] values() {
|
||||||
|
synchronized (PathParamTaskName.class) {
|
||||||
|
return values.values().toArray(new PathParamTaskName[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, PathParamTaskName> createValuesMap() {
|
||||||
|
Map<String, PathParamTaskName> map = new LinkedHashMap<>();
|
||||||
|
map.put("BackupDatabase", BACKUP_DATABASE);
|
||||||
|
map.put("BuildGracenoteCollections", BUILD_GRACENOTE_COLLECTIONS);
|
||||||
|
map.put("CheckForUpdates", CHECK_FOR_UPDATES);
|
||||||
|
map.put("CleanOldBundles", CLEAN_OLD_BUNDLES);
|
||||||
|
map.put("CleanOldCacheFiles", CLEAN_OLD_CACHE_FILES);
|
||||||
|
map.put("DeepMediaAnalysis", DEEP_MEDIA_ANALYSIS);
|
||||||
|
map.put("GenerateAutoTags", GENERATE_AUTO_TAGS);
|
||||||
|
map.put("GenerateChapterThumbs", GENERATE_CHAPTER_THUMBS);
|
||||||
|
map.put("GenerateMediaIndexFiles", GENERATE_MEDIA_INDEX_FILES);
|
||||||
|
map.put("OptimizeDatabase", OPTIMIZE_DATABASE);
|
||||||
|
map.put("RefreshLibraries", REFRESH_LIBRARIES);
|
||||||
|
map.put("RefreshLocalMedia", REFRESH_LOCAL_MEDIA);
|
||||||
|
map.put("RefreshPeriodicMetadata", REFRESH_PERIODIC_METADATA);
|
||||||
|
map.put("UpgradeMediaAnalysis", UPGRADE_MEDIA_ANALYSIS);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, PathParamTaskNameEnum> createEnumsMap() {
|
||||||
|
Map<String, PathParamTaskNameEnum> map = new HashMap<>();
|
||||||
|
map.put("BackupDatabase", PathParamTaskNameEnum.BACKUP_DATABASE);
|
||||||
|
map.put("BuildGracenoteCollections", PathParamTaskNameEnum.BUILD_GRACENOTE_COLLECTIONS);
|
||||||
|
map.put("CheckForUpdates", PathParamTaskNameEnum.CHECK_FOR_UPDATES);
|
||||||
|
map.put("CleanOldBundles", PathParamTaskNameEnum.CLEAN_OLD_BUNDLES);
|
||||||
|
map.put("CleanOldCacheFiles", PathParamTaskNameEnum.CLEAN_OLD_CACHE_FILES);
|
||||||
|
map.put("DeepMediaAnalysis", PathParamTaskNameEnum.DEEP_MEDIA_ANALYSIS);
|
||||||
|
map.put("GenerateAutoTags", PathParamTaskNameEnum.GENERATE_AUTO_TAGS);
|
||||||
|
map.put("GenerateChapterThumbs", PathParamTaskNameEnum.GENERATE_CHAPTER_THUMBS);
|
||||||
|
map.put("GenerateMediaIndexFiles", PathParamTaskNameEnum.GENERATE_MEDIA_INDEX_FILES);
|
||||||
|
map.put("OptimizeDatabase", PathParamTaskNameEnum.OPTIMIZE_DATABASE);
|
||||||
|
map.put("RefreshLibraries", PathParamTaskNameEnum.REFRESH_LIBRARIES);
|
||||||
|
map.put("RefreshLocalMedia", PathParamTaskNameEnum.REFRESH_LOCAL_MEDIA);
|
||||||
|
map.put("RefreshPeriodicMetadata", PathParamTaskNameEnum.REFRESH_PERIODIC_METADATA);
|
||||||
|
map.put("UpgradeMediaAnalysis", PathParamTaskNameEnum.UPGRADE_MEDIA_ANALYSIS);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<PathParamTaskName> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(PathParamTaskName.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(PathParamTaskName value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<PathParamTaskName> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(PathParamTaskName.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PathParamTaskName 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 PathParamTaskName.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum PathParamTaskNameEnum {
|
||||||
|
|
||||||
|
BACKUP_DATABASE("BackupDatabase"),
|
||||||
|
BUILD_GRACENOTE_COLLECTIONS("BuildGracenoteCollections"),
|
||||||
|
CHECK_FOR_UPDATES("CheckForUpdates"),
|
||||||
|
CLEAN_OLD_BUNDLES("CleanOldBundles"),
|
||||||
|
CLEAN_OLD_CACHE_FILES("CleanOldCacheFiles"),
|
||||||
|
DEEP_MEDIA_ANALYSIS("DeepMediaAnalysis"),
|
||||||
|
GENERATE_AUTO_TAGS("GenerateAutoTags"),
|
||||||
|
GENERATE_CHAPTER_THUMBS("GenerateChapterThumbs"),
|
||||||
|
GENERATE_MEDIA_INDEX_FILES("GenerateMediaIndexFiles"),
|
||||||
|
OPTIMIZE_DATABASE("OptimizeDatabase"),
|
||||||
|
REFRESH_LIBRARIES("RefreshLibraries"),
|
||||||
|
REFRESH_LOCAL_MEDIA("RefreshLocalMedia"),
|
||||||
|
REFRESH_PERIODIC_METADATA("RefreshPeriodicMetadata"),
|
||||||
|
UPGRADE_MEDIA_ANALYSIS("UpgradeMediaAnalysis"),;
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private PathParamTaskNameEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,39 +3,186 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* PlaylistType
|
* PlaylistType
|
||||||
*
|
*
|
||||||
* <p>limit to a type of playlist.
|
* <p>limit to a type of playlist.
|
||||||
*/
|
*/
|
||||||
public enum PlaylistType {
|
@JsonDeserialize(using = PlaylistType._Deserializer.class)
|
||||||
AUDIO("audio"),
|
@JsonSerialize(using = PlaylistType._Serializer.class)
|
||||||
VIDEO("video"),
|
public class PlaylistType {
|
||||||
PHOTO("photo");
|
|
||||||
|
public static final PlaylistType AUDIO = new PlaylistType("audio");
|
||||||
|
public static final PlaylistType VIDEO = new PlaylistType("video");
|
||||||
|
public static final PlaylistType PHOTO = new PlaylistType("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, PlaylistType> values = createValuesMap();
|
||||||
|
private static final Map<String, PlaylistTypeEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
private PlaylistType(String value) {
|
private PlaylistType(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a PlaylistType 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 PlaylistType
|
||||||
|
*/
|
||||||
|
public static PlaylistType of(String value) {
|
||||||
|
synchronized (PlaylistType.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new PlaylistType(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String value() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<PlaylistType> fromValue(String value) {
|
public Optional<PlaylistTypeEnum> asEnum() {
|
||||||
for (PlaylistType o: PlaylistType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
PlaylistType other = (PlaylistType) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PlaylistType [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static PlaylistType[] values() {
|
||||||
|
synchronized (PlaylistType.class) {
|
||||||
|
return values.values().toArray(new PlaylistType[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, PlaylistType> createValuesMap() {
|
||||||
|
Map<String, PlaylistType> map = new LinkedHashMap<>();
|
||||||
|
map.put("audio", AUDIO);
|
||||||
|
map.put("video", VIDEO);
|
||||||
|
map.put("photo", PHOTO);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, PlaylistTypeEnum> createEnumsMap() {
|
||||||
|
Map<String, PlaylistTypeEnum> map = new HashMap<>();
|
||||||
|
map.put("audio", PlaylistTypeEnum.AUDIO);
|
||||||
|
map.put("video", PlaylistTypeEnum.VIDEO);
|
||||||
|
map.put("photo", PlaylistTypeEnum.PHOTO);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<PlaylistType> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(PlaylistType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(PlaylistType value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<PlaylistType> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(PlaylistType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PlaylistType 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 PlaylistType.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum PlaylistTypeEnum {
|
||||||
|
|
||||||
|
AUDIO("audio"),
|
||||||
|
VIDEO("video"),
|
||||||
|
PHOTO("photo"),;
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private PlaylistTypeEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,38 +3,182 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* PostUsersSignInDataAuthenticationResponseStatus
|
* PostUsersSignInDataAuthenticationResponseStatus
|
||||||
*
|
*
|
||||||
* <p>String representation of subscriptionActive
|
* <p>String representation of subscriptionActive
|
||||||
*/
|
*/
|
||||||
public enum PostUsersSignInDataAuthenticationResponseStatus {
|
@JsonDeserialize(using = PostUsersSignInDataAuthenticationResponseStatus._Deserializer.class)
|
||||||
INACTIVE("Inactive"),
|
@JsonSerialize(using = PostUsersSignInDataAuthenticationResponseStatus._Serializer.class)
|
||||||
ACTIVE("Active");
|
public class PostUsersSignInDataAuthenticationResponseStatus {
|
||||||
|
|
||||||
|
public static final PostUsersSignInDataAuthenticationResponseStatus INACTIVE = new PostUsersSignInDataAuthenticationResponseStatus("Inactive");
|
||||||
|
public static final PostUsersSignInDataAuthenticationResponseStatus ACTIVE = new PostUsersSignInDataAuthenticationResponseStatus("Active");
|
||||||
|
|
||||||
|
// 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, PostUsersSignInDataAuthenticationResponseStatus> values = createValuesMap();
|
||||||
|
private static final Map<String, PostUsersSignInDataAuthenticationResponseStatusEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
private PostUsersSignInDataAuthenticationResponseStatus(String value) {
|
private PostUsersSignInDataAuthenticationResponseStatus(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a PostUsersSignInDataAuthenticationResponseStatus 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 PostUsersSignInDataAuthenticationResponseStatus
|
||||||
|
*/
|
||||||
|
public static PostUsersSignInDataAuthenticationResponseStatus of(String value) {
|
||||||
|
synchronized (PostUsersSignInDataAuthenticationResponseStatus.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new PostUsersSignInDataAuthenticationResponseStatus(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String value() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<PostUsersSignInDataAuthenticationResponseStatus> fromValue(String value) {
|
public Optional<PostUsersSignInDataAuthenticationResponseStatusEnum> asEnum() {
|
||||||
for (PostUsersSignInDataAuthenticationResponseStatus o: PostUsersSignInDataAuthenticationResponseStatus.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
PostUsersSignInDataAuthenticationResponseStatus other = (PostUsersSignInDataAuthenticationResponseStatus) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PostUsersSignInDataAuthenticationResponseStatus [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static PostUsersSignInDataAuthenticationResponseStatus[] values() {
|
||||||
|
synchronized (PostUsersSignInDataAuthenticationResponseStatus.class) {
|
||||||
|
return values.values().toArray(new PostUsersSignInDataAuthenticationResponseStatus[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, PostUsersSignInDataAuthenticationResponseStatus> createValuesMap() {
|
||||||
|
Map<String, PostUsersSignInDataAuthenticationResponseStatus> map = new LinkedHashMap<>();
|
||||||
|
map.put("Inactive", INACTIVE);
|
||||||
|
map.put("Active", ACTIVE);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, PostUsersSignInDataAuthenticationResponseStatusEnum> createEnumsMap() {
|
||||||
|
Map<String, PostUsersSignInDataAuthenticationResponseStatusEnum> map = new HashMap<>();
|
||||||
|
map.put("Inactive", PostUsersSignInDataAuthenticationResponseStatusEnum.INACTIVE);
|
||||||
|
map.put("Active", PostUsersSignInDataAuthenticationResponseStatusEnum.ACTIVE);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<PostUsersSignInDataAuthenticationResponseStatus> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(PostUsersSignInDataAuthenticationResponseStatus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(PostUsersSignInDataAuthenticationResponseStatus value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<PostUsersSignInDataAuthenticationResponseStatus> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(PostUsersSignInDataAuthenticationResponseStatus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PostUsersSignInDataAuthenticationResponseStatus 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 PostUsersSignInDataAuthenticationResponseStatus.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum PostUsersSignInDataAuthenticationResponseStatusEnum {
|
||||||
|
|
||||||
|
INACTIVE("Inactive"),
|
||||||
|
ACTIVE("Active"),;
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private PostUsersSignInDataAuthenticationResponseStatusEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,38 +3,182 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* PostUsersSignInDataAuthenticationStatus
|
* PostUsersSignInDataAuthenticationStatus
|
||||||
*
|
*
|
||||||
* <p>String representation of subscriptionActive
|
* <p>String representation of subscriptionActive
|
||||||
*/
|
*/
|
||||||
public enum PostUsersSignInDataAuthenticationStatus {
|
@JsonDeserialize(using = PostUsersSignInDataAuthenticationStatus._Deserializer.class)
|
||||||
INACTIVE("Inactive"),
|
@JsonSerialize(using = PostUsersSignInDataAuthenticationStatus._Serializer.class)
|
||||||
ACTIVE("Active");
|
public class PostUsersSignInDataAuthenticationStatus {
|
||||||
|
|
||||||
|
public static final PostUsersSignInDataAuthenticationStatus INACTIVE = new PostUsersSignInDataAuthenticationStatus("Inactive");
|
||||||
|
public static final PostUsersSignInDataAuthenticationStatus ACTIVE = new PostUsersSignInDataAuthenticationStatus("Active");
|
||||||
|
|
||||||
|
// 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, PostUsersSignInDataAuthenticationStatus> values = createValuesMap();
|
||||||
|
private static final Map<String, PostUsersSignInDataAuthenticationStatusEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
private PostUsersSignInDataAuthenticationStatus(String value) {
|
private PostUsersSignInDataAuthenticationStatus(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a PostUsersSignInDataAuthenticationStatus 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 PostUsersSignInDataAuthenticationStatus
|
||||||
|
*/
|
||||||
|
public static PostUsersSignInDataAuthenticationStatus of(String value) {
|
||||||
|
synchronized (PostUsersSignInDataAuthenticationStatus.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new PostUsersSignInDataAuthenticationStatus(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String value() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<PostUsersSignInDataAuthenticationStatus> fromValue(String value) {
|
public Optional<PostUsersSignInDataAuthenticationStatusEnum> asEnum() {
|
||||||
for (PostUsersSignInDataAuthenticationStatus o: PostUsersSignInDataAuthenticationStatus.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
PostUsersSignInDataAuthenticationStatus other = (PostUsersSignInDataAuthenticationStatus) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PostUsersSignInDataAuthenticationStatus [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static PostUsersSignInDataAuthenticationStatus[] values() {
|
||||||
|
synchronized (PostUsersSignInDataAuthenticationStatus.class) {
|
||||||
|
return values.values().toArray(new PostUsersSignInDataAuthenticationStatus[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, PostUsersSignInDataAuthenticationStatus> createValuesMap() {
|
||||||
|
Map<String, PostUsersSignInDataAuthenticationStatus> map = new LinkedHashMap<>();
|
||||||
|
map.put("Inactive", INACTIVE);
|
||||||
|
map.put("Active", ACTIVE);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, PostUsersSignInDataAuthenticationStatusEnum> createEnumsMap() {
|
||||||
|
Map<String, PostUsersSignInDataAuthenticationStatusEnum> map = new HashMap<>();
|
||||||
|
map.put("Inactive", PostUsersSignInDataAuthenticationStatusEnum.INACTIVE);
|
||||||
|
map.put("Active", PostUsersSignInDataAuthenticationStatusEnum.ACTIVE);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<PostUsersSignInDataAuthenticationStatus> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(PostUsersSignInDataAuthenticationStatus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(PostUsersSignInDataAuthenticationStatus value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<PostUsersSignInDataAuthenticationStatus> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(PostUsersSignInDataAuthenticationStatus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PostUsersSignInDataAuthenticationStatus 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 PostUsersSignInDataAuthenticationStatus.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum PostUsersSignInDataAuthenticationStatusEnum {
|
||||||
|
|
||||||
|
INACTIVE("Inactive"),
|
||||||
|
ACTIVE("Active"),;
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private PostUsersSignInDataAuthenticationStatusEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,38 +3,182 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* PostUsersSignInDataMailingListStatus
|
* PostUsersSignInDataMailingListStatus
|
||||||
*
|
*
|
||||||
* <p>Your current mailing list status (active or unsubscribed)
|
* <p>Your current mailing list status (active or unsubscribed)
|
||||||
*/
|
*/
|
||||||
public enum PostUsersSignInDataMailingListStatus {
|
@JsonDeserialize(using = PostUsersSignInDataMailingListStatus._Deserializer.class)
|
||||||
ACTIVE("active"),
|
@JsonSerialize(using = PostUsersSignInDataMailingListStatus._Serializer.class)
|
||||||
UNSUBSCRIBED("unsubscribed");
|
public class PostUsersSignInDataMailingListStatus {
|
||||||
|
|
||||||
|
public static final PostUsersSignInDataMailingListStatus ACTIVE = new PostUsersSignInDataMailingListStatus("active");
|
||||||
|
public static final PostUsersSignInDataMailingListStatus UNSUBSCRIBED = new PostUsersSignInDataMailingListStatus("unsubscribed");
|
||||||
|
|
||||||
|
// 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, PostUsersSignInDataMailingListStatus> values = createValuesMap();
|
||||||
|
private static final Map<String, PostUsersSignInDataMailingListStatusEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
private PostUsersSignInDataMailingListStatus(String value) {
|
private PostUsersSignInDataMailingListStatus(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a PostUsersSignInDataMailingListStatus 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 PostUsersSignInDataMailingListStatus
|
||||||
|
*/
|
||||||
|
public static PostUsersSignInDataMailingListStatus of(String value) {
|
||||||
|
synchronized (PostUsersSignInDataMailingListStatus.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new PostUsersSignInDataMailingListStatus(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String value() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<PostUsersSignInDataMailingListStatus> fromValue(String value) {
|
public Optional<PostUsersSignInDataMailingListStatusEnum> asEnum() {
|
||||||
for (PostUsersSignInDataMailingListStatus o: PostUsersSignInDataMailingListStatus.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
PostUsersSignInDataMailingListStatus other = (PostUsersSignInDataMailingListStatus) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PostUsersSignInDataMailingListStatus [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static PostUsersSignInDataMailingListStatus[] values() {
|
||||||
|
synchronized (PostUsersSignInDataMailingListStatus.class) {
|
||||||
|
return values.values().toArray(new PostUsersSignInDataMailingListStatus[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, PostUsersSignInDataMailingListStatus> createValuesMap() {
|
||||||
|
Map<String, PostUsersSignInDataMailingListStatus> map = new LinkedHashMap<>();
|
||||||
|
map.put("active", ACTIVE);
|
||||||
|
map.put("unsubscribed", UNSUBSCRIBED);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, PostUsersSignInDataMailingListStatusEnum> createEnumsMap() {
|
||||||
|
Map<String, PostUsersSignInDataMailingListStatusEnum> map = new HashMap<>();
|
||||||
|
map.put("active", PostUsersSignInDataMailingListStatusEnum.ACTIVE);
|
||||||
|
map.put("unsubscribed", PostUsersSignInDataMailingListStatusEnum.UNSUBSCRIBED);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<PostUsersSignInDataMailingListStatus> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(PostUsersSignInDataMailingListStatus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(PostUsersSignInDataMailingListStatus value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<PostUsersSignInDataMailingListStatus> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(PostUsersSignInDataMailingListStatus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PostUsersSignInDataMailingListStatus 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 PostUsersSignInDataMailingListStatus.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum PostUsersSignInDataMailingListStatusEnum {
|
||||||
|
|
||||||
|
ACTIVE("active"),
|
||||||
|
UNSUBSCRIBED("unsubscribed"),;
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private PostUsersSignInDataMailingListStatusEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,32 +3,173 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
public enum PostUsersSignInDataState {
|
/**
|
||||||
ENDED("ended");
|
* <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 = PostUsersSignInDataState._Deserializer.class)
|
||||||
|
@JsonSerialize(using = PostUsersSignInDataState._Serializer.class)
|
||||||
|
public class PostUsersSignInDataState {
|
||||||
|
|
||||||
|
public static final PostUsersSignInDataState ENDED = new PostUsersSignInDataState("ended");
|
||||||
|
|
||||||
|
// 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, PostUsersSignInDataState> values = createValuesMap();
|
||||||
|
private static final Map<String, PostUsersSignInDataStateEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
private PostUsersSignInDataState(String value) {
|
private PostUsersSignInDataState(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a PostUsersSignInDataState 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 PostUsersSignInDataState
|
||||||
|
*/
|
||||||
|
public static PostUsersSignInDataState of(String value) {
|
||||||
|
synchronized (PostUsersSignInDataState.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new PostUsersSignInDataState(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String value() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<PostUsersSignInDataState> fromValue(String value) {
|
public Optional<PostUsersSignInDataStateEnum> asEnum() {
|
||||||
for (PostUsersSignInDataState o: PostUsersSignInDataState.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
PostUsersSignInDataState other = (PostUsersSignInDataState) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PostUsersSignInDataState [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static PostUsersSignInDataState[] values() {
|
||||||
|
synchronized (PostUsersSignInDataState.class) {
|
||||||
|
return values.values().toArray(new PostUsersSignInDataState[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, PostUsersSignInDataState> createValuesMap() {
|
||||||
|
Map<String, PostUsersSignInDataState> map = new LinkedHashMap<>();
|
||||||
|
map.put("ended", ENDED);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, PostUsersSignInDataStateEnum> createEnumsMap() {
|
||||||
|
Map<String, PostUsersSignInDataStateEnum> map = new HashMap<>();
|
||||||
|
map.put("ended", PostUsersSignInDataStateEnum.ENDED);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<PostUsersSignInDataState> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(PostUsersSignInDataState.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(PostUsersSignInDataState value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<PostUsersSignInDataState> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(PostUsersSignInDataState.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PostUsersSignInDataState 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 PostUsersSignInDataState.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum PostUsersSignInDataStateEnum {
|
||||||
|
|
||||||
|
ENDED("ended"),;
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private PostUsersSignInDataStateEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,33 +3,177 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
public enum PostUsersSignInDataStatus {
|
/**
|
||||||
ONLINE("online"),
|
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
|
||||||
OFFLINE("offline");
|
* 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 = PostUsersSignInDataStatus._Deserializer.class)
|
||||||
|
@JsonSerialize(using = PostUsersSignInDataStatus._Serializer.class)
|
||||||
|
public class PostUsersSignInDataStatus {
|
||||||
|
|
||||||
|
public static final PostUsersSignInDataStatus ONLINE = new PostUsersSignInDataStatus("online");
|
||||||
|
public static final PostUsersSignInDataStatus OFFLINE = new PostUsersSignInDataStatus("offline");
|
||||||
|
|
||||||
|
// 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, PostUsersSignInDataStatus> values = createValuesMap();
|
||||||
|
private static final Map<String, PostUsersSignInDataStatusEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
private PostUsersSignInDataStatus(String value) {
|
private PostUsersSignInDataStatus(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a PostUsersSignInDataStatus 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 PostUsersSignInDataStatus
|
||||||
|
*/
|
||||||
|
public static PostUsersSignInDataStatus of(String value) {
|
||||||
|
synchronized (PostUsersSignInDataStatus.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new PostUsersSignInDataStatus(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String value() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<PostUsersSignInDataStatus> fromValue(String value) {
|
public Optional<PostUsersSignInDataStatusEnum> asEnum() {
|
||||||
for (PostUsersSignInDataStatus o: PostUsersSignInDataStatus.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
PostUsersSignInDataStatus other = (PostUsersSignInDataStatus) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PostUsersSignInDataStatus [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static PostUsersSignInDataStatus[] values() {
|
||||||
|
synchronized (PostUsersSignInDataStatus.class) {
|
||||||
|
return values.values().toArray(new PostUsersSignInDataStatus[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, PostUsersSignInDataStatus> createValuesMap() {
|
||||||
|
Map<String, PostUsersSignInDataStatus> map = new LinkedHashMap<>();
|
||||||
|
map.put("online", ONLINE);
|
||||||
|
map.put("offline", OFFLINE);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, PostUsersSignInDataStatusEnum> createEnumsMap() {
|
||||||
|
Map<String, PostUsersSignInDataStatusEnum> map = new HashMap<>();
|
||||||
|
map.put("online", PostUsersSignInDataStatusEnum.ONLINE);
|
||||||
|
map.put("offline", PostUsersSignInDataStatusEnum.OFFLINE);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<PostUsersSignInDataStatus> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(PostUsersSignInDataStatus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(PostUsersSignInDataStatus value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<PostUsersSignInDataStatus> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(PostUsersSignInDataStatus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PostUsersSignInDataStatus 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 PostUsersSignInDataStatus.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum PostUsersSignInDataStatusEnum {
|
||||||
|
|
||||||
|
ONLINE("online"),
|
||||||
|
OFFLINE("offline"),;
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private PostUsersSignInDataStatusEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
|||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import dev.plexapi.sdk.utils.Utils;
|
import dev.plexapi.sdk.utils.Utils;
|
||||||
import java.lang.Long;
|
import java.lang.Integer;
|
||||||
import java.lang.Override;
|
import java.lang.Override;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -21,7 +21,7 @@ public class Producer {
|
|||||||
* Unique identifier for the producer.
|
* Unique identifier for the producer.
|
||||||
*/
|
*/
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private long id;
|
private int id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filter string used to query this producer.
|
* The filter string used to query this producer.
|
||||||
@@ -51,7 +51,7 @@ public class Producer {
|
|||||||
|
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
public Producer(
|
public Producer(
|
||||||
@JsonProperty("id") long id,
|
@JsonProperty("id") int id,
|
||||||
@JsonProperty("filter") String filter,
|
@JsonProperty("filter") String filter,
|
||||||
@JsonProperty("tag") String tag,
|
@JsonProperty("tag") String tag,
|
||||||
@JsonProperty("tagKey") Optional<String> tagKey,
|
@JsonProperty("tagKey") Optional<String> tagKey,
|
||||||
@@ -69,7 +69,7 @@ public class Producer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Producer(
|
public Producer(
|
||||||
long id,
|
int id,
|
||||||
String filter,
|
String filter,
|
||||||
String tag) {
|
String tag) {
|
||||||
this(id, filter, tag, Optional.empty(), Optional.empty());
|
this(id, filter, tag, Optional.empty(), Optional.empty());
|
||||||
@@ -79,7 +79,7 @@ public class Producer {
|
|||||||
* Unique identifier for the producer.
|
* Unique identifier for the producer.
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public long id() {
|
public int id() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ public class Producer {
|
|||||||
/**
|
/**
|
||||||
* Unique identifier for the producer.
|
* Unique identifier for the producer.
|
||||||
*/
|
*/
|
||||||
public Producer withId(long id) {
|
public Producer withId(int id) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
@@ -222,7 +222,7 @@ public class Producer {
|
|||||||
|
|
||||||
public final static class Builder {
|
public final static class Builder {
|
||||||
|
|
||||||
private Long id;
|
private Integer id;
|
||||||
|
|
||||||
private String filter;
|
private String filter;
|
||||||
|
|
||||||
@@ -239,7 +239,7 @@ public class Producer {
|
|||||||
/**
|
/**
|
||||||
* Unique identifier for the producer.
|
* Unique identifier for the producer.
|
||||||
*/
|
*/
|
||||||
public Builder id(long id) {
|
public Builder id(int id) {
|
||||||
Utils.checkNotNull(id, "id");
|
Utils.checkNotNull(id, "id");
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -3,37 +3,183 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.Objects;
|
||||||
import java.util.Optional;
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* QueryParamSmart
|
* QueryParamSmart
|
||||||
*
|
*
|
||||||
* <p>type of playlists to return (default is all).
|
* <p>type of playlists to return (default is all).
|
||||||
*/
|
*/
|
||||||
public enum QueryParamSmart {
|
@JsonDeserialize(using = QueryParamSmart._Deserializer.class)
|
||||||
ZERO(0L),
|
@JsonSerialize(using = QueryParamSmart._Serializer.class)
|
||||||
ONE(1L);
|
public class QueryParamSmart {
|
||||||
|
|
||||||
|
public static final QueryParamSmart ZERO = new QueryParamSmart(0L);
|
||||||
|
public static final QueryParamSmart ONE = new QueryParamSmart(1L);
|
||||||
|
|
||||||
|
// 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, QueryParamSmart> values = createValuesMap();
|
||||||
|
private static final Map<Long, QueryParamSmartEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final long value;
|
private final long value;
|
||||||
|
|
||||||
private QueryParamSmart(long value) {
|
private QueryParamSmart(long value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a QueryParamSmart 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 QueryParamSmart
|
||||||
|
*/
|
||||||
|
public static QueryParamSmart of(long value) {
|
||||||
|
synchronized (QueryParamSmart.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new QueryParamSmart(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public long value() {
|
public long value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<QueryParamSmart> fromValue(long value) {
|
public Optional<QueryParamSmartEnum> asEnum() {
|
||||||
for (QueryParamSmart o: QueryParamSmart.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
QueryParamSmart other = (QueryParamSmart) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "QueryParamSmart [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static QueryParamSmart[] values() {
|
||||||
|
synchronized (QueryParamSmart.class) {
|
||||||
|
return values.values().toArray(new QueryParamSmart[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<Long, QueryParamSmart> createValuesMap() {
|
||||||
|
Map<Long, QueryParamSmart> map = new LinkedHashMap<>();
|
||||||
|
map.put(0L, ZERO);
|
||||||
|
map.put(1L, ONE);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<Long, QueryParamSmartEnum> createEnumsMap() {
|
||||||
|
Map<Long, QueryParamSmartEnum> map = new HashMap<>();
|
||||||
|
map.put(0L, QueryParamSmartEnum.ZERO);
|
||||||
|
map.put(1L, QueryParamSmartEnum.ONE);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<QueryParamSmart> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(QueryParamSmart.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(QueryParamSmart value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<QueryParamSmart> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(QueryParamSmart.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryParamSmart 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 QueryParamSmart.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum QueryParamSmartEnum {
|
||||||
|
|
||||||
|
ZERO(0L),
|
||||||
|
ONE(1L),;
|
||||||
|
|
||||||
|
private final long value;
|
||||||
|
|
||||||
|
private QueryParamSmartEnum(long value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,45 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.Objects;
|
||||||
import java.util.Optional;
|
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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* QueryParamType
|
* QueryParamType
|
||||||
*
|
*
|
||||||
@@ -17,33 +52,159 @@ import java.util.Optional;
|
|||||||
* 4 = episode
|
* 4 = episode
|
||||||
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
|
||||||
*/
|
*/
|
||||||
public enum QueryParamType {
|
@JsonDeserialize(using = QueryParamType._Deserializer.class)
|
||||||
Movie(1L),
|
@JsonSerialize(using = QueryParamType._Serializer.class)
|
||||||
TvShow(2L),
|
public class QueryParamType {
|
||||||
Season(3L),
|
|
||||||
Episode(4L),
|
public static final QueryParamType Movie = new QueryParamType(1L);
|
||||||
Audio(8L),
|
public static final QueryParamType TvShow = new QueryParamType(2L);
|
||||||
Album(9L),
|
public static final QueryParamType Season = new QueryParamType(3L);
|
||||||
Track(10L);
|
public static final QueryParamType Episode = new QueryParamType(4L);
|
||||||
|
public static final QueryParamType Audio = new QueryParamType(8L);
|
||||||
|
public static final QueryParamType Album = new QueryParamType(9L);
|
||||||
|
public static final QueryParamType Track = new QueryParamType(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, QueryParamType> values = createValuesMap();
|
||||||
|
private static final Map<Long, QueryParamTypeEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final long value;
|
private final long value;
|
||||||
|
|
||||||
private QueryParamType(long value) {
|
private QueryParamType(long value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a QueryParamType 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 QueryParamType
|
||||||
|
*/
|
||||||
|
public static QueryParamType of(long value) {
|
||||||
|
synchronized (QueryParamType.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new QueryParamType(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public long value() {
|
public long value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<QueryParamType> fromValue(long value) {
|
public Optional<QueryParamTypeEnum> asEnum() {
|
||||||
for (QueryParamType o: QueryParamType.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
QueryParamType other = (QueryParamType) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "QueryParamType [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static QueryParamType[] values() {
|
||||||
|
synchronized (QueryParamType.class) {
|
||||||
|
return values.values().toArray(new QueryParamType[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<Long, QueryParamType> createValuesMap() {
|
||||||
|
Map<Long, QueryParamType> 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, QueryParamTypeEnum> createEnumsMap() {
|
||||||
|
Map<Long, QueryParamTypeEnum> map = new HashMap<>();
|
||||||
|
map.put(1L, QueryParamTypeEnum.Movie);
|
||||||
|
map.put(2L, QueryParamTypeEnum.TvShow);
|
||||||
|
map.put(3L, QueryParamTypeEnum.Season);
|
||||||
|
map.put(4L, QueryParamTypeEnum.Episode);
|
||||||
|
map.put(8L, QueryParamTypeEnum.Audio);
|
||||||
|
map.put(9L, QueryParamTypeEnum.Album);
|
||||||
|
map.put(10L, QueryParamTypeEnum.Track);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<QueryParamType> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(QueryParamType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(QueryParamType value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<QueryParamType> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(QueryParamType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryParamType 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 QueryParamType.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum QueryParamTypeEnum {
|
||||||
|
|
||||||
|
Movie(1L),
|
||||||
|
TvShow(2L),
|
||||||
|
Season(3L),
|
||||||
|
Episode(4L),
|
||||||
|
Audio(8L),
|
||||||
|
Album(9L),
|
||||||
|
Track(10L),;
|
||||||
|
|
||||||
|
private final long value;
|
||||||
|
|
||||||
|
private QueryParamTypeEnum(long value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long value() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,36 +3,189 @@
|
|||||||
*/
|
*/
|
||||||
package dev.plexapi.sdk.models.operations;
|
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.String;
|
||||||
|
import java.lang.SuppressWarnings;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
public enum SearchTypes {
|
/**
|
||||||
MOVIES("movies"),
|
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
|
||||||
MUSIC("music"),
|
* to evolve (particularly with the addition of enum members over time). If an
|
||||||
OTHER_VIDEOS("otherVideos"),
|
* open enum is used then the appearance of unexpected enum values (say in a
|
||||||
PEOPLE("people"),
|
* response from an updated an API) will not bring about a runtime error thus
|
||||||
TV("tv");
|
* 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 = SearchTypes._Deserializer.class)
|
||||||
|
@JsonSerialize(using = SearchTypes._Serializer.class)
|
||||||
|
public class SearchTypes {
|
||||||
|
|
||||||
|
public static final SearchTypes MOVIES = new SearchTypes("movies");
|
||||||
|
public static final SearchTypes MUSIC = new SearchTypes("music");
|
||||||
|
public static final SearchTypes OTHER_VIDEOS = new SearchTypes("otherVideos");
|
||||||
|
public static final SearchTypes PEOPLE = new SearchTypes("people");
|
||||||
|
public static final SearchTypes TV = new SearchTypes("tv");
|
||||||
|
|
||||||
|
// 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, SearchTypes> values = createValuesMap();
|
||||||
|
private static final Map<String, SearchTypesEnum> enums = createEnumsMap();
|
||||||
|
|
||||||
@JsonValue
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
private SearchTypes(String value) {
|
private SearchTypes(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a SearchTypes 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 SearchTypes
|
||||||
|
*/
|
||||||
|
public static SearchTypes of(String value) {
|
||||||
|
synchronized (SearchTypes.class) {
|
||||||
|
return values.computeIfAbsent(value, v -> new SearchTypes(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String value() {
|
public String value() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<SearchTypes> fromValue(String value) {
|
public Optional<SearchTypesEnum> asEnum() {
|
||||||
for (SearchTypes o: SearchTypes.values()) {
|
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||||
if (Objects.deepEquals(o.value, value)) {
|
}
|
||||||
return Optional.of(o);
|
|
||||||
}
|
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;
|
||||||
|
SearchTypes other = (SearchTypes) obj;
|
||||||
|
return Objects.equals(value, other.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "SearchTypes [value=" + value + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an array just like an enum
|
||||||
|
public static SearchTypes[] values() {
|
||||||
|
synchronized (SearchTypes.class) {
|
||||||
|
return values.values().toArray(new SearchTypes[] {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, SearchTypes> createValuesMap() {
|
||||||
|
Map<String, SearchTypes> map = new LinkedHashMap<>();
|
||||||
|
map.put("movies", MOVIES);
|
||||||
|
map.put("music", MUSIC);
|
||||||
|
map.put("otherVideos", OTHER_VIDEOS);
|
||||||
|
map.put("people", PEOPLE);
|
||||||
|
map.put("tv", TV);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, SearchTypesEnum> createEnumsMap() {
|
||||||
|
Map<String, SearchTypesEnum> map = new HashMap<>();
|
||||||
|
map.put("movies", SearchTypesEnum.MOVIES);
|
||||||
|
map.put("music", SearchTypesEnum.MUSIC);
|
||||||
|
map.put("otherVideos", SearchTypesEnum.OTHER_VIDEOS);
|
||||||
|
map.put("people", SearchTypesEnum.PEOPLE);
|
||||||
|
map.put("tv", SearchTypesEnum.TV);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Serializer extends StdSerializer<SearchTypes> {
|
||||||
|
|
||||||
|
protected _Serializer() {
|
||||||
|
super(SearchTypes.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(SearchTypes value, JsonGenerator g, SerializerProvider provider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
g.writeObject(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public static final class _Deserializer extends StdDeserializer<SearchTypes> {
|
||||||
|
|
||||||
|
protected _Deserializer() {
|
||||||
|
super(SearchTypes.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SearchTypes 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 SearchTypes.of(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SearchTypesEnum {
|
||||||
|
|
||||||
|
MOVIES("movies"),
|
||||||
|
MUSIC("music"),
|
||||||
|
OTHER_VIDEOS("otherVideos"),
|
||||||
|
PEOPLE("people"),
|
||||||
|
TV("tv"),;
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private SearchTypesEnum(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
Reference in New Issue
Block a user