mirror of
https://github.com/LukeHagar/plexjava.git
synced 2025-12-06 12:37:47 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd781d1e27 | ||
|
|
dcdcafc044 |
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -9,4 +9,3 @@
|
||||
|
||||
# This allows generated code to be indexed correctly
|
||||
*.java linguist-generated=false
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -15,7 +15,7 @@ generation:
|
||||
oAuth2ClientCredentialsEnabled: true
|
||||
oAuth2PasswordEnabled: false
|
||||
java:
|
||||
version: 0.14.0
|
||||
version: 0.14.2
|
||||
additionalDependencies: []
|
||||
additionalPlugins: []
|
||||
artifactID: plexapi
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
speakeasyVersion: 1.526.6
|
||||
speakeasyVersion: 1.529.1
|
||||
sources:
|
||||
my-source:
|
||||
sourceNamespace: my-source
|
||||
@@ -8,19 +8,19 @@ sources:
|
||||
- latest
|
||||
plexapi:
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:cffb18feaa0523b300655a6f0073caad99133b143f5a420fddbb1e1efe47bcaf
|
||||
sourceBlobDigest: sha256:1737023e29cd9cf36c07ccd8c8c48c47e14f47ce22b4d6ba9ee241afbbd8f351
|
||||
sourceRevisionDigest: sha256:ea508e3da23b283f47aeb4384d6b3ab374a27bdffb8d8d8376cedbad3ad77a06
|
||||
sourceBlobDigest: sha256:c210adbd02b0213b9e6f95ffc27f60ec38f8f9040137d55ccf2b650d92ab0ff5
|
||||
tags:
|
||||
- latest
|
||||
- speakeasy-sdk-regen-1743440866
|
||||
- speakeasy-sdk-regen-1743899436
|
||||
targets:
|
||||
plexjava:
|
||||
source: plexapi
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:cffb18feaa0523b300655a6f0073caad99133b143f5a420fddbb1e1efe47bcaf
|
||||
sourceBlobDigest: sha256:1737023e29cd9cf36c07ccd8c8c48c47e14f47ce22b4d6ba9ee241afbbd8f351
|
||||
sourceRevisionDigest: sha256:ea508e3da23b283f47aeb4384d6b3ab374a27bdffb8d8d8376cedbad3ad77a06
|
||||
sourceBlobDigest: sha256:c210adbd02b0213b9e6f95ffc27f60ec38f8f9040137d55ccf2b650d92ab0ff5
|
||||
codeSamplesNamespace: code-samples-java-plexjava
|
||||
codeSamplesRevisionDigest: sha256:efd9a529c906a73b2d32257e52235b87cdb19f16486800f6eb2172eec9454726
|
||||
codeSamplesRevisionDigest: sha256:c7bc64aee5441f09dae1f6b15a89c94f6b6065f2e25f5528e849e5ddf2f50d8c
|
||||
workflow:
|
||||
workflowVersion: 1.0.0
|
||||
speakeasyVersion: latest
|
||||
|
||||
@@ -69,7 +69,7 @@ The samples below show how a published SDK artifact is used:
|
||||
|
||||
Gradle:
|
||||
```groovy
|
||||
implementation 'dev.plexapi:plexapi:0.14.0'
|
||||
implementation 'dev.plexapi:plexapi:0.14.2'
|
||||
```
|
||||
|
||||
Maven:
|
||||
@@ -77,7 +77,7 @@ Maven:
|
||||
<dependency>
|
||||
<groupId>dev.plexapi</groupId>
|
||||
<artifactId>plexapi</artifactId>
|
||||
<version>0.14.0</version>
|
||||
<version>0.14.2</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
@@ -177,6 +177,10 @@ public class Application {
|
||||
* [getActorsLibrary](docs/sdks/library/README.md#getactorslibrary) - Get Actors of library media
|
||||
* [getSearchAllLibraries](docs/sdks/library/README.md#getsearchalllibraries) - Search All Libraries
|
||||
* [getMediaMetaData](docs/sdks/library/README.md#getmediametadata) - Get Media Metadata
|
||||
* [getMediaArts](docs/sdks/library/README.md#getmediaarts) - Get Media Background Artwork
|
||||
* [postMediaArts](docs/sdks/library/README.md#postmediaarts) - Upload Media Background Artwork
|
||||
* [getMediaPosters](docs/sdks/library/README.md#getmediaposters) - Get Media Posters
|
||||
* [postMediaPoster](docs/sdks/library/README.md#postmediaposter) - Upload Media Poster
|
||||
* [getMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children
|
||||
* [getTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content
|
||||
|
||||
|
||||
20
RELEASES.md
20
RELEASES.md
@@ -289,3 +289,23 @@ Based on:
|
||||
- [java v0.14.0] .
|
||||
### Releases
|
||||
- [Maven Central v0.14.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.14.0 - .
|
||||
|
||||
## 2025-04-03 00:27:41
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.528.1 (2.565.1) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [java v0.14.1] .
|
||||
### Releases
|
||||
- [Maven Central v0.14.1] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.14.1 - .
|
||||
|
||||
## 2025-04-06 00:30:19
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.529.1 (2.566.5) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [java v0.14.2] .
|
||||
### Releases
|
||||
- [Maven Central v0.14.2] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.14.2 - .
|
||||
@@ -103,7 +103,7 @@ publishing {
|
||||
// https://github.com/gradle/gradle/issues/18619
|
||||
groupId = "dev.plexapi"
|
||||
artifactId = "plexapi"
|
||||
version = "0.14.0"
|
||||
version = "0.14.2"
|
||||
|
||||
from components.java
|
||||
|
||||
|
||||
806
codeSamples.yaml
806
codeSamples.yaml
File diff suppressed because it is too large
Load Diff
@@ -5,24 +5,24 @@
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
|
||||
| `allowSync` | *boolean* | :heavy_check_mark: | N/A | true |
|
||||
| `art` | *String* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg |
|
||||
| `composite` | *String* | :heavy_check_mark: | N/A | /library/sections/1/composite/1705615584 |
|
||||
| `filters` | *boolean* | :heavy_check_mark: | N/A | true |
|
||||
| `refreshing` | *boolean* | :heavy_check_mark: | N/A | false |
|
||||
| `thumb` | *String* | :heavy_check_mark: | N/A | /:/resources/movie.png |
|
||||
| `key` | *String* | :heavy_check_mark: | N/A | 1 |
|
||||
| `type` | *String* | :heavy_check_mark: | N/A | movie |
|
||||
| `title` | *String* | :heavy_check_mark: | N/A | Movies |
|
||||
| `agent` | *String* | :heavy_check_mark: | N/A | tv.plex.agents.movie |
|
||||
| `scanner` | *String* | :heavy_check_mark: | N/A | Plex Movie |
|
||||
| `language` | *String* | :heavy_check_mark: | N/A | en-US |
|
||||
| `uuid` | *String* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 |
|
||||
| `allowSync` | *boolean* | :heavy_check_mark: | Indicates whether syncing is allowed. | false |
|
||||
| `art` | *String* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg |
|
||||
| `composite` | *String* | :heavy_check_mark: | The relative path to the composite media item. | /library/sections/1/composite/1743824484 |
|
||||
| `filters` | *boolean* | :heavy_check_mark: | UNKNOWN | true |
|
||||
| `refreshing` | *boolean* | :heavy_check_mark: | Indicates whether the library is currently being refreshed or updated | true |
|
||||
| `thumb` | *String* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png |
|
||||
| `key` | *String* | :heavy_check_mark: | The library key representing the unique identifier | 1 |
|
||||
| `type` | [GetAllLibrariesType](../../models/operations/GetAllLibrariesType.md) | :heavy_check_mark: | N/A | movie |
|
||||
| `title` | *String* | :heavy_check_mark: | The title of the library | Movies |
|
||||
| `agent` | *String* | :heavy_check_mark: | The Plex agent used to match and retrieve media metadata. | tv.plex.agents.movie |
|
||||
| `scanner` | *String* | :heavy_check_mark: | UNKNOWN | Plex Movie |
|
||||
| `language` | *String* | :heavy_check_mark: | The Plex library language that has been set | en-US |
|
||||
| `uuid` | *String* | :heavy_check_mark: | The universally unique identifier for the library. | e69655a2-ef48-4aba-bb19-01e7d3cc34d6 |
|
||||
| `updatedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
|
||||
| `createdAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
|
||||
| `createdAt` | *Optional\<Long>* | :heavy_minus_sign: | N/A | 1556281940 |
|
||||
| `scannedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
|
||||
| `content` | *boolean* | :heavy_check_mark: | N/A | true |
|
||||
| `directory` | *boolean* | :heavy_check_mark: | N/A | true |
|
||||
| `contentChangedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
|
||||
| `hidden` | *int* | :heavy_check_mark: | N/A | 0 |
|
||||
| `content` | *boolean* | :heavy_check_mark: | UNKNOWN | true |
|
||||
| `directory` | *boolean* | :heavy_check_mark: | UNKNOWN | true |
|
||||
| `contentChangedAt` | *int* | :heavy_check_mark: | The number of seconds since the content was last changed relative to now. | 9173960 |
|
||||
| `hidden` | [Optional\<Hidden>](../../models/operations/Hidden.md) | :heavy_minus_sign: | N/A | 1 |
|
||||
| `location` | List\<[GetAllLibrariesLocation](../../models/operations/GetAllLibrariesLocation.md)> | :heavy_check_mark: | N/A | |
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `id` | *int* | :heavy_check_mark: | N/A | 1 |
|
||||
| `path` | *String* | :heavy_check_mark: | N/A | /movies |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------- | --------------------------- | --------------------------- | --------------------------- | --------------------------- |
|
||||
| `id` | *int* | :heavy_check_mark: | The ID of the location. | 1 |
|
||||
| `path` | *String* | :heavy_check_mark: | The path to the media item. | /Movies |
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
||||
| `size` | *int* | :heavy_check_mark: | N/A | 5 |
|
||||
| `allowSync` | *boolean* | :heavy_check_mark: | N/A | false |
|
||||
| `title1` | *String* | :heavy_check_mark: | N/A | Plex Library |
|
||||
| `directory` | List\<[GetAllLibrariesDirectory](../../models/operations/GetAllLibrariesDirectory.md)> | :heavy_check_mark: | N/A | |
|
||||
| `size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
|
||||
| `allowSync` | *boolean* | :heavy_check_mark: | Indicates whether syncing is allowed. | false |
|
||||
| `title1` | *String* | :heavy_check_mark: | The primary title of the media container. | TV Series |
|
||||
| `directory` | List\<[GetAllLibrariesDirectory](../../models/operations/GetAllLibrariesDirectory.md)> | :heavy_minus_sign: | N/A | |
|
||||
@@ -5,6 +5,6 @@ The libraries available on the Server
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
||||
| `mediaContainer` | [GetAllLibrariesMediaContainer](../../models/operations/GetAllLibrariesMediaContainer.md) | :heavy_check_mark: | N/A |
|
||||
| Field | Type | Required | Description |
|
||||
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||
| `mediaContainer` | [Optional\<GetAllLibrariesMediaContainer>](../../models/operations/GetAllLibrariesMediaContainer.md) | :heavy_minus_sign: | N/A |
|
||||
15
docs/models/operations/GetAllLibrariesType.md
Normal file
15
docs/models/operations/GetAllLibrariesType.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# GetAllLibrariesType
|
||||
|
||||
The library type
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------- | --------- |
|
||||
| `Movie` | movie |
|
||||
| `TvShow` | show |
|
||||
| `Season` | season |
|
||||
| `Episode` | episode |
|
||||
| `Artist` | artist |
|
||||
| `Album` | album |
|
||||
12
docs/models/operations/GetMediaArtsMediaContainer.md
Normal file
12
docs/models/operations/GetMediaArtsMediaContainer.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# GetMediaArtsMediaContainer
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
|
||||
| `size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
|
||||
| `mediaTagVersion` | *long* | :heavy_check_mark: | The version number for media tags. | 1734362201 |
|
||||
| `mediaTagPrefix` | *String* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ |
|
||||
| `identifier` | *String* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library |
|
||||
| `metadata` | List\<[GetMediaArtsMetadata](../../models/operations/GetMediaArtsMetadata.md)> | :heavy_check_mark: | N/A | |
|
||||
12
docs/models/operations/GetMediaArtsMetadata.md
Normal file
12
docs/models/operations/GetMediaArtsMetadata.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# GetMediaArtsMetadata
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `key` | *String* | :heavy_check_mark: | The URL of the artwork. | https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg |
|
||||
| `provider` | *Optional\<String>* | :heavy_minus_sign: | The provider of the artwork. | tmdb |
|
||||
| `ratingKey` | *String* | :heavy_check_mark: | The URL of the artwork. | https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg |
|
||||
| `selected` | *boolean* | :heavy_check_mark: | Whether this is the selected artwork. | true |
|
||||
| `thumb` | *String* | :heavy_check_mark: | The URL of the artwork thumbnail. | https://images.plex.tv/photo?height=270&width=480&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FixgFmf1X59PUZam2qbAfskx2gQr%2Ejpg |
|
||||
8
docs/models/operations/GetMediaArtsRequest.md
Normal file
8
docs/models/operations/GetMediaArtsRequest.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# GetMediaArtsRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
|
||||
| `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the artwork of. | 16099 |
|
||||
11
docs/models/operations/GetMediaArtsResponse.md
Normal file
11
docs/models/operations/GetMediaArtsResponse.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# GetMediaArtsResponse
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||
| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||
| `rawResponse` | [HttpResponse\<InputStream>](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||
| `object` | [Optional\<GetMediaArtsResponseBody>](../../models/operations/GetMediaArtsResponseBody.md) | :heavy_minus_sign: | The available background artwork for the library item. |
|
||||
10
docs/models/operations/GetMediaArtsResponseBody.md
Normal file
10
docs/models/operations/GetMediaArtsResponseBody.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# GetMediaArtsResponseBody
|
||||
|
||||
The available background artwork for the library item.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
||||
| `mediaContainer` | [Optional\<GetMediaArtsMediaContainer>](../../models/operations/GetMediaArtsMediaContainer.md) | :heavy_minus_sign: | N/A |
|
||||
12
docs/models/operations/GetMediaPostersMediaContainer.md
Normal file
12
docs/models/operations/GetMediaPostersMediaContainer.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# GetMediaPostersMediaContainer
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
|
||||
| `size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
|
||||
| `mediaTagVersion` | *long* | :heavy_check_mark: | The version number for media tags. | 1734362201 |
|
||||
| `mediaTagPrefix` | *String* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ |
|
||||
| `identifier` | *String* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library |
|
||||
| `metadata` | List\<[GetMediaPostersMetadata](../../models/operations/GetMediaPostersMetadata.md)> | :heavy_check_mark: | N/A | |
|
||||
12
docs/models/operations/GetMediaPostersMetadata.md
Normal file
12
docs/models/operations/GetMediaPostersMetadata.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# GetMediaPostersMetadata
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `key` | *String* | :heavy_check_mark: | The URL of the poster. | https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg |
|
||||
| `provider` | *Optional\<String>* | :heavy_minus_sign: | The provider of the poster. | tmdb |
|
||||
| `ratingKey` | *String* | :heavy_check_mark: | The URL of the poster. | https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg |
|
||||
| `selected` | *boolean* | :heavy_check_mark: | Whether this is the selected poster. | true |
|
||||
| `thumb` | *String* | :heavy_check_mark: | The URL of the poster thumbnail. | https://images.plex.tv/photo?height=336&width=225&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FhntBJjqbv4m0Iyniqaztv9xaudI%2Ejpg |
|
||||
8
docs/models/operations/GetMediaPostersRequest.md
Normal file
8
docs/models/operations/GetMediaPostersRequest.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# GetMediaPostersRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
|
||||
| `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the posters of. | 16099 |
|
||||
11
docs/models/operations/GetMediaPostersResponse.md
Normal file
11
docs/models/operations/GetMediaPostersResponse.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# GetMediaPostersResponse
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||
| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||
| `rawResponse` | [HttpResponse\<InputStream>](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||
| `object` | [Optional\<GetMediaPostersResponseBody>](../../models/operations/GetMediaPostersResponseBody.md) | :heavy_minus_sign: | The available posters for the library item. |
|
||||
10
docs/models/operations/GetMediaPostersResponseBody.md
Normal file
10
docs/models/operations/GetMediaPostersResponseBody.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# GetMediaPostersResponseBody
|
||||
|
||||
The available posters for the library item.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||
| `mediaContainer` | [Optional\<GetMediaPostersMediaContainer>](../../models/operations/GetMediaPostersMediaContainer.md) | :heavy_minus_sign: | N/A |
|
||||
11
docs/models/operations/Hidden.md
Normal file
11
docs/models/operations/Hidden.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Hidden
|
||||
|
||||
UNKNOWN
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------- | --------- |
|
||||
| `Disable` | 0 |
|
||||
| `Enable` | 1 |
|
||||
10
docs/models/operations/PostMediaArtsRequest.md
Normal file
10
docs/models/operations/PostMediaArtsRequest.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# PostMediaArtsRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
|
||||
| `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
|
||||
| `url` | *Optional\<String>* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
|
||||
| `requestBody` | *Optional\<byte[]>* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |
|
||||
10
docs/models/operations/PostMediaArtsResponse.md
Normal file
10
docs/models/operations/PostMediaArtsResponse.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# PostMediaArtsResponse
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||
| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||
| `rawResponse` | [HttpResponse\<InputStream>](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||
10
docs/models/operations/PostMediaPosterRequest.md
Normal file
10
docs/models/operations/PostMediaPosterRequest.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# PostMediaPosterRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
|
||||
| `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
|
||||
| `url` | *Optional\<String>* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
|
||||
| `requestBody` | *Optional\<byte[]>* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |
|
||||
10
docs/models/operations/PostMediaPosterResponse.md
Normal file
10
docs/models/operations/PostMediaPosterResponse.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# PostMediaPosterResponse
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||
| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||
| `rawResponse` | [HttpResponse\<InputStream>](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||
@@ -25,7 +25,6 @@ import dev.plexapi.sdk.PlexAPI;
|
||||
import dev.plexapi.sdk.models.errors.GetGlobalHubsBadRequest;
|
||||
import dev.plexapi.sdk.models.errors.GetGlobalHubsUnauthorized;
|
||||
import dev.plexapi.sdk.models.operations.GetGlobalHubsResponse;
|
||||
import dev.plexapi.sdk.models.operations.OnlyTransient;
|
||||
import java.lang.Exception;
|
||||
|
||||
public class Application {
|
||||
@@ -37,8 +36,6 @@ public class Application {
|
||||
.build();
|
||||
|
||||
GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs()
|
||||
.count(1262.49)
|
||||
.onlyTransient(OnlyTransient.ONE)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
@@ -136,7 +133,6 @@ import dev.plexapi.sdk.PlexAPI;
|
||||
import dev.plexapi.sdk.models.errors.GetLibraryHubsBadRequest;
|
||||
import dev.plexapi.sdk.models.errors.GetLibraryHubsUnauthorized;
|
||||
import dev.plexapi.sdk.models.operations.GetLibraryHubsResponse;
|
||||
import dev.plexapi.sdk.models.operations.QueryParamOnlyTransient;
|
||||
import java.lang.Exception;
|
||||
|
||||
public class Application {
|
||||
@@ -149,8 +145,6 @@ public class Application {
|
||||
|
||||
GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs()
|
||||
.sectionId(6728.76)
|
||||
.count(6728.76)
|
||||
.onlyTransient(QueryParamOnlyTransient.ZERO)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
|
||||
@@ -22,6 +22,10 @@ API Calls interacting with Plex Media Server Libraries
|
||||
* [getActorsLibrary](#getactorslibrary) - Get Actors of library media
|
||||
* [getSearchAllLibraries](#getsearchalllibraries) - Search All Libraries
|
||||
* [getMediaMetaData](#getmediametadata) - Get Media Metadata
|
||||
* [getMediaArts](#getmediaarts) - Get Media Background Artwork
|
||||
* [postMediaArts](#postmediaarts) - Upload Media Background Artwork
|
||||
* [getMediaPosters](#getmediaposters) - Get Media Posters
|
||||
* [postMediaPoster](#postmediaposter) - Upload Media Poster
|
||||
* [getMetadataChildren](#getmetadatachildren) - Get Items Children
|
||||
* [getTopWatchedContent](#gettopwatchedcontent) - Get Top Watched Content
|
||||
|
||||
@@ -50,7 +54,6 @@ public class Application {
|
||||
|
||||
GetFileHashResponse res = sdk.library().getFileHash()
|
||||
.url("file://C:\Image.png&type=13")
|
||||
.type(4462.17)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
@@ -253,7 +256,6 @@ import dev.plexapi.sdk.PlexAPI;
|
||||
import dev.plexapi.sdk.models.errors.GetLibraryDetailsBadRequest;
|
||||
import dev.plexapi.sdk.models.errors.GetLibraryDetailsUnauthorized;
|
||||
import dev.plexapi.sdk.models.operations.GetLibraryDetailsResponse;
|
||||
import dev.plexapi.sdk.models.operations.IncludeDetails;
|
||||
import java.lang.Exception;
|
||||
|
||||
public class Application {
|
||||
@@ -265,7 +267,6 @@ public class Application {
|
||||
.build();
|
||||
|
||||
GetLibraryDetailsResponse res = sdk.library().getLibraryDetails()
|
||||
.includeDetails(IncludeDetails.ZERO)
|
||||
.sectionKey(9518)
|
||||
.call();
|
||||
|
||||
@@ -909,6 +910,200 @@ public class Application {
|
||||
| models/errors/GetMediaMetaDataUnauthorized | 401 | application/json |
|
||||
| models/errors/SDKError | 4XX, 5XX | \*/\* |
|
||||
|
||||
## getMediaArts
|
||||
|
||||
Returns the background artwork for a library item.
|
||||
|
||||
### Example Usage
|
||||
|
||||
```java
|
||||
package hello.world;
|
||||
|
||||
import dev.plexapi.sdk.PlexAPI;
|
||||
import dev.plexapi.sdk.models.operations.GetMediaArtsResponse;
|
||||
import java.lang.Exception;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.build();
|
||||
|
||||
GetMediaArtsResponse res = sdk.library().getMediaArts()
|
||||
.ratingKey(16099L)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
|
||||
| `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the artwork of. | 16099 |
|
||||
|
||||
### Response
|
||||
|
||||
**[GetMediaArtsResponse](../../models/operations/GetMediaArtsResponse.md)**
|
||||
|
||||
### Errors
|
||||
|
||||
| Error Type | Status Code | Content Type |
|
||||
| ---------------------- | ---------------------- | ---------------------- |
|
||||
| models/errors/SDKError | 4XX, 5XX | \*/\* |
|
||||
|
||||
## postMediaArts
|
||||
|
||||
Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL
|
||||
|
||||
### Example Usage
|
||||
|
||||
```java
|
||||
package hello.world;
|
||||
|
||||
import dev.plexapi.sdk.PlexAPI;
|
||||
import dev.plexapi.sdk.models.operations.PostMediaArtsResponse;
|
||||
import java.lang.Exception;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.build();
|
||||
|
||||
PostMediaArtsResponse res = sdk.library().postMediaArts()
|
||||
.ratingKey(2268L)
|
||||
.url("https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b")
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
|
||||
| `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
|
||||
| `url` | *Optional\<String>* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
|
||||
| `requestBody` | *Optional\<byte[]>* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |
|
||||
|
||||
### Response
|
||||
|
||||
**[PostMediaArtsResponse](../../models/operations/PostMediaArtsResponse.md)**
|
||||
|
||||
### Errors
|
||||
|
||||
| Error Type | Status Code | Content Type |
|
||||
| ---------------------- | ---------------------- | ---------------------- |
|
||||
| models/errors/SDKError | 4XX, 5XX | \*/\* |
|
||||
|
||||
## getMediaPosters
|
||||
|
||||
Returns the available posters for a library item.
|
||||
|
||||
### Example Usage
|
||||
|
||||
```java
|
||||
package hello.world;
|
||||
|
||||
import dev.plexapi.sdk.PlexAPI;
|
||||
import dev.plexapi.sdk.models.operations.GetMediaPostersResponse;
|
||||
import java.lang.Exception;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.build();
|
||||
|
||||
GetMediaPostersResponse res = sdk.library().getMediaPosters()
|
||||
.ratingKey(16099L)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
|
||||
| `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the posters of. | 16099 |
|
||||
|
||||
### Response
|
||||
|
||||
**[GetMediaPostersResponse](../../models/operations/GetMediaPostersResponse.md)**
|
||||
|
||||
### Errors
|
||||
|
||||
| Error Type | Status Code | Content Type |
|
||||
| ---------------------- | ---------------------- | ---------------------- |
|
||||
| models/errors/SDKError | 4XX, 5XX | \*/\* |
|
||||
|
||||
## postMediaPoster
|
||||
|
||||
Uploads a poster to a library item, either from a local file or a remote URL
|
||||
|
||||
### Example Usage
|
||||
|
||||
```java
|
||||
package hello.world;
|
||||
|
||||
import dev.plexapi.sdk.PlexAPI;
|
||||
import dev.plexapi.sdk.models.operations.PostMediaPosterResponse;
|
||||
import java.lang.Exception;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
PlexAPI sdk = PlexAPI.builder()
|
||||
.accessToken("<YOUR_API_KEY_HERE>")
|
||||
.build();
|
||||
|
||||
PostMediaPosterResponse res = sdk.library().postMediaPoster()
|
||||
.ratingKey(2268L)
|
||||
.url("https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b")
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
|
||||
| `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
|
||||
| `url` | *Optional\<String>* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
|
||||
| `requestBody` | *Optional\<byte[]>* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |
|
||||
|
||||
### Response
|
||||
|
||||
**[PostMediaPosterResponse](../../models/operations/PostMediaPosterResponse.md)**
|
||||
|
||||
### Errors
|
||||
|
||||
| Error Type | Status Code | Content Type |
|
||||
| ---------------------- | ---------------------- | ---------------------- |
|
||||
| models/errors/SDKError | 4XX, 5XX | \*/\* |
|
||||
|
||||
## getMetadataChildren
|
||||
|
||||
This endpoint will return the children of of a library item specified with the ratingKey.
|
||||
|
||||
@@ -95,7 +95,7 @@ package hello.world;
|
||||
import dev.plexapi.sdk.PlexAPI;
|
||||
import dev.plexapi.sdk.models.errors.GetPlaylistsBadRequest;
|
||||
import dev.plexapi.sdk.models.errors.GetPlaylistsUnauthorized;
|
||||
import dev.plexapi.sdk.models.operations.*;
|
||||
import dev.plexapi.sdk.models.operations.GetPlaylistsResponse;
|
||||
import java.lang.Exception;
|
||||
|
||||
public class Application {
|
||||
@@ -107,8 +107,6 @@ public class Application {
|
||||
.build();
|
||||
|
||||
GetPlaylistsResponse res = sdk.playlists().getPlaylists()
|
||||
.playlistType(PlaylistType.AUDIO)
|
||||
.smart(QueryParamSmart.ZERO)
|
||||
.call();
|
||||
|
||||
if (res.object().isPresent()) {
|
||||
@@ -268,8 +266,6 @@ public class Application {
|
||||
|
||||
UpdatePlaylistResponse res = sdk.playlists().updatePlaylist()
|
||||
.playlistID(3915)
|
||||
.title("<value>")
|
||||
.summary("<value>")
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
|
||||
@@ -225,7 +225,7 @@ package hello.world;
|
||||
import dev.plexapi.sdk.PlexAPI;
|
||||
import dev.plexapi.sdk.models.errors.GetServerResourcesBadRequest;
|
||||
import dev.plexapi.sdk.models.errors.GetServerResourcesUnauthorized;
|
||||
import dev.plexapi.sdk.models.operations.*;
|
||||
import dev.plexapi.sdk.models.operations.GetServerResourcesResponse;
|
||||
import java.lang.Exception;
|
||||
|
||||
public class Application {
|
||||
@@ -237,9 +237,6 @@ public class Application {
|
||||
.build();
|
||||
|
||||
GetServerResourcesResponse res = sdk.plex().getServerResources()
|
||||
.includeHttps(IncludeHttps.Enable)
|
||||
.includeRelay(IncludeRelay.Enable)
|
||||
.includeIPv6(IncludeIPv6.Enable)
|
||||
.clientID("3381b62b-9ab7-4e37-827b-203e9809eb58")
|
||||
.call();
|
||||
|
||||
|
||||
@@ -49,8 +49,6 @@ public class Application {
|
||||
|
||||
PerformSearchResponse res = sdk.search().performSearch()
|
||||
.query("dylan")
|
||||
.sectionId(9487.88)
|
||||
.limit(5)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
@@ -107,8 +105,6 @@ public class Application {
|
||||
|
||||
PerformVoiceSearchResponse res = sdk.search().performVoiceSearch()
|
||||
.query("dead+poop")
|
||||
.sectionId(4094.8)
|
||||
.limit(5)
|
||||
.call();
|
||||
|
||||
// handle response
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
groupId=dev.plexapi
|
||||
artifactId=plexapi
|
||||
version=0.14.0
|
||||
version=0.14.2
|
||||
@@ -30,8 +30,6 @@ import java.net.http.HttpResponse;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.
|
||||
* Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity.
|
||||
|
||||
@@ -47,8 +47,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* API Calls regarding authentication for Plex Media Server
|
||||
*/
|
||||
|
||||
@@ -45,8 +45,6 @@ import java.net.http.HttpResponse;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Butler is the task manager of the Plex Media Server Ecosystem.
|
||||
*/
|
||||
|
||||
@@ -39,8 +39,6 @@ import java.net.http.HttpResponse;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
|
||||
*/
|
||||
|
||||
@@ -74,10 +74,18 @@ import dev.plexapi.sdk.models.operations.GetLibraryItemsRequest;
|
||||
import dev.plexapi.sdk.models.operations.GetLibraryItemsRequestBuilder;
|
||||
import dev.plexapi.sdk.models.operations.GetLibraryItemsResponse;
|
||||
import dev.plexapi.sdk.models.operations.GetLibraryItemsResponseBody;
|
||||
import dev.plexapi.sdk.models.operations.GetMediaArtsRequest;
|
||||
import dev.plexapi.sdk.models.operations.GetMediaArtsRequestBuilder;
|
||||
import dev.plexapi.sdk.models.operations.GetMediaArtsResponse;
|
||||
import dev.plexapi.sdk.models.operations.GetMediaArtsResponseBody;
|
||||
import dev.plexapi.sdk.models.operations.GetMediaMetaDataRequest;
|
||||
import dev.plexapi.sdk.models.operations.GetMediaMetaDataRequestBuilder;
|
||||
import dev.plexapi.sdk.models.operations.GetMediaMetaDataResponse;
|
||||
import dev.plexapi.sdk.models.operations.GetMediaMetaDataResponseBody;
|
||||
import dev.plexapi.sdk.models.operations.GetMediaPostersRequest;
|
||||
import dev.plexapi.sdk.models.operations.GetMediaPostersRequestBuilder;
|
||||
import dev.plexapi.sdk.models.operations.GetMediaPostersResponse;
|
||||
import dev.plexapi.sdk.models.operations.GetMediaPostersResponseBody;
|
||||
import dev.plexapi.sdk.models.operations.GetMetadataChildrenRequest;
|
||||
import dev.plexapi.sdk.models.operations.GetMetadataChildrenRequestBuilder;
|
||||
import dev.plexapi.sdk.models.operations.GetMetadataChildrenResponse;
|
||||
@@ -104,25 +112,32 @@ import dev.plexapi.sdk.models.operations.GetTopWatchedContentRequestBuilder;
|
||||
import dev.plexapi.sdk.models.operations.GetTopWatchedContentResponse;
|
||||
import dev.plexapi.sdk.models.operations.GetTopWatchedContentResponseBody;
|
||||
import dev.plexapi.sdk.models.operations.IncludeDetails;
|
||||
import dev.plexapi.sdk.models.operations.PostMediaArtsRequest;
|
||||
import dev.plexapi.sdk.models.operations.PostMediaArtsRequestBuilder;
|
||||
import dev.plexapi.sdk.models.operations.PostMediaArtsResponse;
|
||||
import dev.plexapi.sdk.models.operations.PostMediaPosterRequest;
|
||||
import dev.plexapi.sdk.models.operations.PostMediaPosterRequestBuilder;
|
||||
import dev.plexapi.sdk.models.operations.PostMediaPosterResponse;
|
||||
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
|
||||
import dev.plexapi.sdk.utils.HTTPClient;
|
||||
import dev.plexapi.sdk.utils.HTTPRequest;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
|
||||
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
|
||||
import dev.plexapi.sdk.utils.SerializedBody;
|
||||
import dev.plexapi.sdk.utils.Utils.JsonShape;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Double;
|
||||
import java.lang.Exception;
|
||||
import java.lang.Long;
|
||||
import java.lang.Object;
|
||||
import java.lang.String;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* API Calls interacting with Plex Media Server Libraries
|
||||
*/
|
||||
@@ -141,6 +156,10 @@ public class Library implements
|
||||
MethodCallGetActorsLibrary,
|
||||
MethodCallGetSearchAllLibraries,
|
||||
MethodCallGetMediaMetaData,
|
||||
MethodCallGetMediaArts,
|
||||
MethodCallPostMediaArts,
|
||||
MethodCallGetMediaPosters,
|
||||
MethodCallPostMediaPoster,
|
||||
MethodCallGetMetadataChildren,
|
||||
MethodCallGetTopWatchedContent {
|
||||
|
||||
@@ -2860,6 +2879,618 @@ public class Library implements
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get Media Background Artwork
|
||||
*
|
||||
* <p>Returns the background artwork for a library item.
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public GetMediaArtsRequestBuilder getMediaArts() {
|
||||
return new GetMediaArtsRequestBuilder(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Media Background Artwork
|
||||
*
|
||||
* <p>Returns the background artwork for a library item.
|
||||
*
|
||||
* @param ratingKey the id of the library item to return the artwork of.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetMediaArtsResponse getMediaArts(
|
||||
long ratingKey) throws Exception {
|
||||
GetMediaArtsRequest request =
|
||||
GetMediaArtsRequest
|
||||
.builder()
|
||||
.ratingKey(ratingKey)
|
||||
.build();
|
||||
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
GetMediaArtsRequest.class,
|
||||
_baseUrl,
|
||||
"/library/metadata/{ratingKey}/arts",
|
||||
request, null);
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
SDKConfiguration.USER_AGENT);
|
||||
|
||||
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
_baseUrl,
|
||||
"get-media-arts",
|
||||
Optional.of(List.of()),
|
||||
_hookSecuritySource),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
_baseUrl,
|
||||
"get-media-arts",
|
||||
Optional.of(List.of()),
|
||||
_hookSecuritySource),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
_baseUrl,
|
||||
"get-media-arts",
|
||||
Optional.of(List.of()),
|
||||
_hookSecuritySource),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
_baseUrl,
|
||||
"get-media-arts",
|
||||
Optional.of(List.of()),
|
||||
_hookSecuritySource),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
GetMediaArtsResponse.Builder _resBuilder =
|
||||
GetMediaArtsResponse
|
||||
.builder()
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
GetMediaArtsResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
GetMediaArtsResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<GetMediaArtsResponseBody>() {});
|
||||
_res.withObject(Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.extractByteArrayFromBody(_httpRes));
|
||||
}
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.extractByteArrayFromBody(_httpRes));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.extractByteArrayFromBody(_httpRes));
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.extractByteArrayFromBody(_httpRes));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Upload Media Background Artwork
|
||||
*
|
||||
* <p>Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public PostMediaArtsRequestBuilder postMediaArts() {
|
||||
return new PostMediaArtsRequestBuilder(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload Media Background Artwork
|
||||
*
|
||||
* <p>Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL
|
||||
*
|
||||
* @param ratingKey the id of the library item to return the posters of.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public PostMediaArtsResponse postMediaArts(
|
||||
long ratingKey) throws Exception {
|
||||
return postMediaArts(ratingKey, Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload Media Background Artwork
|
||||
*
|
||||
* <p>Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL
|
||||
*
|
||||
* @param ratingKey the id of the library item to return the posters of.
|
||||
* @param url The URL of the image, if uploading a remote image
|
||||
* @param requestBody The contents of the image, if uploading a local file
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public PostMediaArtsResponse postMediaArts(
|
||||
long ratingKey,
|
||||
Optional<String> url,
|
||||
Optional<byte[]> requestBody) throws Exception {
|
||||
PostMediaArtsRequest request =
|
||||
PostMediaArtsRequest
|
||||
.builder()
|
||||
.ratingKey(ratingKey)
|
||||
.url(url)
|
||||
.requestBody(requestBody)
|
||||
.build();
|
||||
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
PostMediaArtsRequest.class,
|
||||
_baseUrl,
|
||||
"/library/metadata/{ratingKey}/arts",
|
||||
request, null);
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "POST");
|
||||
Object _convertedRequest = Utils.convertToShape(
|
||||
request,
|
||||
JsonShape.DEFAULT,
|
||||
new TypeReference<Object>() {});
|
||||
SerializedBody _serializedRequestBody = Utils.serializeRequestBody(
|
||||
_convertedRequest,
|
||||
"requestBody",
|
||||
"raw",
|
||||
false);
|
||||
_req.setBody(Optional.ofNullable(_serializedRequestBody));
|
||||
_req.addHeader("Accept", "*/*")
|
||||
.addHeader("user-agent",
|
||||
SDKConfiguration.USER_AGENT);
|
||||
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
PostMediaArtsRequest.class,
|
||||
request,
|
||||
null));
|
||||
|
||||
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
_baseUrl,
|
||||
"post-media-arts",
|
||||
Optional.of(List.of()),
|
||||
_hookSecuritySource),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
_baseUrl,
|
||||
"post-media-arts",
|
||||
Optional.of(List.of()),
|
||||
_hookSecuritySource),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
_baseUrl,
|
||||
"post-media-arts",
|
||||
Optional.of(List.of()),
|
||||
_hookSecuritySource),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
_baseUrl,
|
||||
"post-media-arts",
|
||||
Optional.of(List.of()),
|
||||
_hookSecuritySource),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
PostMediaArtsResponse.Builder _resBuilder =
|
||||
PostMediaArtsResponse
|
||||
.builder()
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
PostMediaArtsResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.extractByteArrayFromBody(_httpRes));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.extractByteArrayFromBody(_httpRes));
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.extractByteArrayFromBody(_httpRes));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get Media Posters
|
||||
*
|
||||
* <p>Returns the available posters for a library item.
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public GetMediaPostersRequestBuilder getMediaPosters() {
|
||||
return new GetMediaPostersRequestBuilder(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Media Posters
|
||||
*
|
||||
* <p>Returns the available posters for a library item.
|
||||
*
|
||||
* @param ratingKey the id of the library item to return the posters of.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public GetMediaPostersResponse getMediaPosters(
|
||||
long ratingKey) throws Exception {
|
||||
GetMediaPostersRequest request =
|
||||
GetMediaPostersRequest
|
||||
.builder()
|
||||
.ratingKey(ratingKey)
|
||||
.build();
|
||||
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
GetMediaPostersRequest.class,
|
||||
_baseUrl,
|
||||
"/library/metadata/{ratingKey}/posters",
|
||||
request, null);
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "GET");
|
||||
_req.addHeader("Accept", "application/json")
|
||||
.addHeader("user-agent",
|
||||
SDKConfiguration.USER_AGENT);
|
||||
|
||||
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
_baseUrl,
|
||||
"get-media-posters",
|
||||
Optional.of(List.of()),
|
||||
_hookSecuritySource),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
_baseUrl,
|
||||
"get-media-posters",
|
||||
Optional.of(List.of()),
|
||||
_hookSecuritySource),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
_baseUrl,
|
||||
"get-media-posters",
|
||||
Optional.of(List.of()),
|
||||
_hookSecuritySource),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
_baseUrl,
|
||||
"get-media-posters",
|
||||
Optional.of(List.of()),
|
||||
_hookSecuritySource),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
GetMediaPostersResponse.Builder _resBuilder =
|
||||
GetMediaPostersResponse
|
||||
.builder()
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
GetMediaPostersResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
if (Utils.contentTypeMatches(_contentType, "application/json")) {
|
||||
GetMediaPostersResponseBody _out = Utils.mapper().readValue(
|
||||
Utils.toUtf8AndClose(_httpRes.body()),
|
||||
new TypeReference<GetMediaPostersResponseBody>() {});
|
||||
_res.withObject(Optional.ofNullable(_out));
|
||||
return _res;
|
||||
} else {
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected content-type received: " + _contentType,
|
||||
Utils.extractByteArrayFromBody(_httpRes));
|
||||
}
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.extractByteArrayFromBody(_httpRes));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.extractByteArrayFromBody(_httpRes));
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.extractByteArrayFromBody(_httpRes));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Upload Media Poster
|
||||
*
|
||||
* <p>Uploads a poster to a library item, either from a local file or a remote URL
|
||||
*
|
||||
* @return The call builder
|
||||
*/
|
||||
public PostMediaPosterRequestBuilder postMediaPoster() {
|
||||
return new PostMediaPosterRequestBuilder(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload Media Poster
|
||||
*
|
||||
* <p>Uploads a poster to a library item, either from a local file or a remote URL
|
||||
*
|
||||
* @param ratingKey the id of the library item to return the posters of.
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public PostMediaPosterResponse postMediaPoster(
|
||||
long ratingKey) throws Exception {
|
||||
return postMediaPoster(ratingKey, Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload Media Poster
|
||||
*
|
||||
* <p>Uploads a poster to a library item, either from a local file or a remote URL
|
||||
*
|
||||
* @param ratingKey the id of the library item to return the posters of.
|
||||
* @param url The URL of the image, if uploading a remote image
|
||||
* @param requestBody The contents of the image, if uploading a local file
|
||||
* @return The response from the API call
|
||||
* @throws Exception if the API call fails
|
||||
*/
|
||||
public PostMediaPosterResponse postMediaPoster(
|
||||
long ratingKey,
|
||||
Optional<String> url,
|
||||
Optional<byte[]> requestBody) throws Exception {
|
||||
PostMediaPosterRequest request =
|
||||
PostMediaPosterRequest
|
||||
.builder()
|
||||
.ratingKey(ratingKey)
|
||||
.url(url)
|
||||
.requestBody(requestBody)
|
||||
.build();
|
||||
|
||||
String _baseUrl = Utils.templateUrl(
|
||||
this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults());
|
||||
String _url = Utils.generateURL(
|
||||
PostMediaPosterRequest.class,
|
||||
_baseUrl,
|
||||
"/library/metadata/{ratingKey}/posters",
|
||||
request, null);
|
||||
|
||||
HTTPRequest _req = new HTTPRequest(_url, "POST");
|
||||
Object _convertedRequest = Utils.convertToShape(
|
||||
request,
|
||||
JsonShape.DEFAULT,
|
||||
new TypeReference<Object>() {});
|
||||
SerializedBody _serializedRequestBody = Utils.serializeRequestBody(
|
||||
_convertedRequest,
|
||||
"requestBody",
|
||||
"raw",
|
||||
false);
|
||||
_req.setBody(Optional.ofNullable(_serializedRequestBody));
|
||||
_req.addHeader("Accept", "*/*")
|
||||
.addHeader("user-agent",
|
||||
SDKConfiguration.USER_AGENT);
|
||||
|
||||
_req.addQueryParams(Utils.getQueryParams(
|
||||
PostMediaPosterRequest.class,
|
||||
request,
|
||||
null));
|
||||
|
||||
Optional<SecuritySource> _hookSecuritySource = this.sdkConfiguration.securitySource();
|
||||
Utils.configureSecurity(_req,
|
||||
this.sdkConfiguration.securitySource.getSecurity());
|
||||
HTTPClient _client = this.sdkConfiguration.defaultClient;
|
||||
HttpRequest _r =
|
||||
sdkConfiguration.hooks()
|
||||
.beforeRequest(
|
||||
new BeforeRequestContextImpl(
|
||||
_baseUrl,
|
||||
"post-media-poster",
|
||||
Optional.of(List.of()),
|
||||
_hookSecuritySource),
|
||||
_req.build());
|
||||
HttpResponse<InputStream> _httpRes;
|
||||
try {
|
||||
_httpRes = _client.send(_r);
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
_baseUrl,
|
||||
"post-media-poster",
|
||||
Optional.of(List.of()),
|
||||
_hookSecuritySource),
|
||||
Optional.of(_httpRes),
|
||||
Optional.empty());
|
||||
} else {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterSuccess(
|
||||
new AfterSuccessContextImpl(
|
||||
_baseUrl,
|
||||
"post-media-poster",
|
||||
Optional.of(List.of()),
|
||||
_hookSecuritySource),
|
||||
_httpRes);
|
||||
}
|
||||
} catch (Exception _e) {
|
||||
_httpRes = sdkConfiguration.hooks()
|
||||
.afterError(
|
||||
new AfterErrorContextImpl(
|
||||
_baseUrl,
|
||||
"post-media-poster",
|
||||
Optional.of(List.of()),
|
||||
_hookSecuritySource),
|
||||
Optional.empty(),
|
||||
Optional.of(_e));
|
||||
}
|
||||
String _contentType = _httpRes
|
||||
.headers()
|
||||
.firstValue("Content-Type")
|
||||
.orElse("application/octet-stream");
|
||||
PostMediaPosterResponse.Builder _resBuilder =
|
||||
PostMediaPosterResponse
|
||||
.builder()
|
||||
.contentType(_contentType)
|
||||
.statusCode(_httpRes.statusCode())
|
||||
.rawResponse(_httpRes);
|
||||
|
||||
PostMediaPosterResponse _res = _resBuilder.build();
|
||||
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
|
||||
// no content
|
||||
return _res;
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.extractByteArrayFromBody(_httpRes));
|
||||
}
|
||||
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
|
||||
// no content
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"API error occurred",
|
||||
Utils.extractByteArrayFromBody(_httpRes));
|
||||
}
|
||||
throw new SDKError(
|
||||
_httpRes,
|
||||
_httpRes.statusCode(),
|
||||
"Unexpected status code received: " + _httpRes.statusCode(),
|
||||
Utils.extractByteArrayFromBody(_httpRes));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get Items Children
|
||||
*
|
||||
|
||||
@@ -37,8 +37,6 @@ import java.net.http.HttpResponse;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Submit logs to the Log Handler for Plex Media Server
|
||||
*/
|
||||
|
||||
@@ -45,8 +45,6 @@ import java.net.http.HttpResponse;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* API Calls interacting with Plex Media Server Media
|
||||
*/
|
||||
|
||||
@@ -75,8 +75,6 @@ import java.net.http.HttpResponse;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017").
|
||||
* They can be organized in (optionally nesting) folders.
|
||||
|
||||
@@ -61,8 +61,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* API Calls that perform operations directly against https://Plex.tv
|
||||
*/
|
||||
|
||||
@@ -14,8 +14,6 @@ import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
|
||||
*
|
||||
@@ -54,7 +52,7 @@ public class PlexAPI {
|
||||
/**
|
||||
* The full address of your Plex Server
|
||||
*/
|
||||
"{protocol}://{ip}:{port}",
|
||||
"https://10.10.10.47:32400",
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -510,4 +508,5 @@ public class PlexAPI {
|
||||
this.updater = new Updater(sdkConfiguration);
|
||||
this.users = new Users(sdkConfiguration);
|
||||
this.sdkConfiguration.initialize();
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
class SDKConfiguration {
|
||||
public SecuritySource securitySource;
|
||||
|
||||
@@ -44,8 +42,8 @@ class SDKConfiguration {
|
||||
} };
|
||||
private static final String LANGUAGE = "java";
|
||||
public static final String OPENAPI_DOC_VERSION = "0.0.3";
|
||||
public static final String SDK_VERSION = "0.14.0";
|
||||
public static final String GEN_VERSION = "2.563.1";
|
||||
public static final String SDK_VERSION = "0.14.2";
|
||||
public static final String GEN_VERSION = "2.566.5";
|
||||
private static final String BASE_PACKAGE = "dev.plexapi.sdk";
|
||||
public static final String USER_AGENT =
|
||||
String.format("speakeasy-sdk/%s %s %s %s %s",
|
||||
|
||||
@@ -37,8 +37,6 @@ import java.net.http.HttpResponse;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* API Calls that perform search operations with Plex Media Server
|
||||
*/
|
||||
|
||||
@@ -5,8 +5,6 @@ package dev.plexapi.sdk;
|
||||
|
||||
import dev.plexapi.sdk.utils.HasSecurity;
|
||||
|
||||
|
||||
|
||||
public interface SecuritySource {
|
||||
|
||||
HasSecurity getSecurity();
|
||||
|
||||
@@ -65,8 +65,6 @@ import java.net.http.HttpResponse;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Operations against the Plex Media Server System.
|
||||
*/
|
||||
|
||||
@@ -43,8 +43,6 @@ import java.net.http.HttpResponse;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* API Calls that perform search operations with Plex Media Server Sessions
|
||||
*/
|
||||
|
||||
@@ -39,8 +39,6 @@ import java.net.http.HttpResponse;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* API Calls that perform operations with Plex Media Server Statistics
|
||||
*/
|
||||
|
||||
@@ -38,8 +38,6 @@ import java.net.http.HttpResponse;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This describes the API for searching and applying updates to the Plex Media Server.
|
||||
* Updates to the status can be observed via the Event API.
|
||||
|
||||
@@ -26,8 +26,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
public class Users implements
|
||||
MethodCallGetUsers {
|
||||
|
||||
|
||||
@@ -30,8 +30,6 @@ import java.net.http.HttpResponse;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* API Calls that perform operations with Plex Media Server Videos
|
||||
*/
|
||||
|
||||
@@ -27,8 +27,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* API Calls that perform operations with Plex Media Server Watchlists
|
||||
*/
|
||||
|
||||
@@ -5,54 +5,96 @@ package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import dev.plexapi.sdk.utils.LazySingletonValue;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Boolean;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Long;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
public class GetAllLibrariesDirectory {
|
||||
|
||||
/**
|
||||
* Indicates whether syncing is allowed.
|
||||
*/
|
||||
@JsonProperty("allowSync")
|
||||
private boolean allowSync;
|
||||
|
||||
/**
|
||||
* URL for the background artwork of the media container.
|
||||
*/
|
||||
@JsonProperty("art")
|
||||
private String art;
|
||||
|
||||
/**
|
||||
* The relative path to the composite media item.
|
||||
*/
|
||||
@JsonProperty("composite")
|
||||
private String composite;
|
||||
|
||||
/**
|
||||
* UNKNOWN
|
||||
*/
|
||||
@JsonProperty("filters")
|
||||
private boolean filters;
|
||||
|
||||
/**
|
||||
* Indicates whether the library is currently being refreshed or updated
|
||||
*/
|
||||
@JsonProperty("refreshing")
|
||||
private boolean refreshing;
|
||||
|
||||
/**
|
||||
* URL for the thumbnail image of the media container.
|
||||
*/
|
||||
@JsonProperty("thumb")
|
||||
private String thumb;
|
||||
|
||||
/**
|
||||
* The library key representing the unique identifier
|
||||
*/
|
||||
@JsonProperty("key")
|
||||
private String key;
|
||||
|
||||
@JsonProperty("type")
|
||||
private String type;
|
||||
private GetAllLibrariesType type;
|
||||
|
||||
/**
|
||||
* The title of the library
|
||||
*/
|
||||
@JsonProperty("title")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* The Plex agent used to match and retrieve media metadata.
|
||||
*/
|
||||
@JsonProperty("agent")
|
||||
private String agent;
|
||||
|
||||
/**
|
||||
* UNKNOWN
|
||||
*/
|
||||
@JsonProperty("scanner")
|
||||
private String scanner;
|
||||
|
||||
/**
|
||||
* The Plex library language that has been set
|
||||
*/
|
||||
@JsonProperty("language")
|
||||
private String language;
|
||||
|
||||
/**
|
||||
* The universally unique identifier for the library.
|
||||
*/
|
||||
@JsonProperty("uuid")
|
||||
private String uuid;
|
||||
|
||||
@@ -62,11 +104,9 @@ public class GetAllLibrariesDirectory {
|
||||
@JsonProperty("updatedAt")
|
||||
private long updatedAt;
|
||||
|
||||
/**
|
||||
* Unix epoch datetime in seconds
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("createdAt")
|
||||
private long createdAt;
|
||||
private Optional<Long> createdAt;
|
||||
|
||||
/**
|
||||
* Unix epoch datetime in seconds
|
||||
@@ -74,20 +114,27 @@ public class GetAllLibrariesDirectory {
|
||||
@JsonProperty("scannedAt")
|
||||
private long scannedAt;
|
||||
|
||||
/**
|
||||
* UNKNOWN
|
||||
*/
|
||||
@JsonProperty("content")
|
||||
private boolean content;
|
||||
|
||||
/**
|
||||
* UNKNOWN
|
||||
*/
|
||||
@JsonProperty("directory")
|
||||
private boolean directory;
|
||||
|
||||
/**
|
||||
* Unix epoch datetime in seconds
|
||||
* The number of seconds since the content was last changed relative to now.
|
||||
*/
|
||||
@JsonProperty("contentChangedAt")
|
||||
private long contentChangedAt;
|
||||
private int contentChangedAt;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("hidden")
|
||||
private int hidden;
|
||||
private Optional<? extends Hidden> hidden;
|
||||
|
||||
@JsonProperty("Location")
|
||||
private List<GetAllLibrariesLocation> location;
|
||||
@@ -101,19 +148,19 @@ public class GetAllLibrariesDirectory {
|
||||
@JsonProperty("refreshing") boolean refreshing,
|
||||
@JsonProperty("thumb") String thumb,
|
||||
@JsonProperty("key") String key,
|
||||
@JsonProperty("type") String type,
|
||||
@JsonProperty("type") GetAllLibrariesType type,
|
||||
@JsonProperty("title") String title,
|
||||
@JsonProperty("agent") String agent,
|
||||
@JsonProperty("scanner") String scanner,
|
||||
@JsonProperty("language") String language,
|
||||
@JsonProperty("uuid") String uuid,
|
||||
@JsonProperty("updatedAt") long updatedAt,
|
||||
@JsonProperty("createdAt") long createdAt,
|
||||
@JsonProperty("createdAt") Optional<Long> createdAt,
|
||||
@JsonProperty("scannedAt") long scannedAt,
|
||||
@JsonProperty("content") boolean content,
|
||||
@JsonProperty("directory") boolean directory,
|
||||
@JsonProperty("contentChangedAt") long contentChangedAt,
|
||||
@JsonProperty("hidden") int hidden,
|
||||
@JsonProperty("contentChangedAt") int contentChangedAt,
|
||||
@JsonProperty("hidden") Optional<? extends Hidden> hidden,
|
||||
@JsonProperty("Location") List<GetAllLibrariesLocation> location) {
|
||||
Utils.checkNotNull(allowSync, "allowSync");
|
||||
Utils.checkNotNull(art, "art");
|
||||
@@ -159,66 +206,125 @@ public class GetAllLibrariesDirectory {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public GetAllLibrariesDirectory(
|
||||
boolean allowSync,
|
||||
String art,
|
||||
String composite,
|
||||
boolean filters,
|
||||
boolean refreshing,
|
||||
String thumb,
|
||||
String key,
|
||||
GetAllLibrariesType type,
|
||||
String title,
|
||||
String agent,
|
||||
String scanner,
|
||||
String language,
|
||||
String uuid,
|
||||
long updatedAt,
|
||||
long scannedAt,
|
||||
boolean content,
|
||||
boolean directory,
|
||||
int contentChangedAt,
|
||||
List<GetAllLibrariesLocation> location) {
|
||||
this(allowSync, art, composite, filters, refreshing, thumb, key, type, title, agent, scanner, language, uuid, updatedAt, Optional.empty(), scannedAt, content, directory, contentChangedAt, Optional.empty(), location);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether syncing is allowed.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public boolean allowSync() {
|
||||
return allowSync;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL for the background artwork of the media container.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String art() {
|
||||
return art;
|
||||
}
|
||||
|
||||
/**
|
||||
* The relative path to the composite media item.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String composite() {
|
||||
return composite;
|
||||
}
|
||||
|
||||
/**
|
||||
* UNKNOWN
|
||||
*/
|
||||
@JsonIgnore
|
||||
public boolean filters() {
|
||||
return filters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the library is currently being refreshed or updated
|
||||
*/
|
||||
@JsonIgnore
|
||||
public boolean refreshing() {
|
||||
return refreshing;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL for the thumbnail image of the media container.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String thumb() {
|
||||
return thumb;
|
||||
}
|
||||
|
||||
/**
|
||||
* The library key representing the unique identifier
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String key() {
|
||||
return key;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String type() {
|
||||
public GetAllLibrariesType type() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* The title of the library
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String title() {
|
||||
return title;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Plex agent used to match and retrieve media metadata.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String agent() {
|
||||
return agent;
|
||||
}
|
||||
|
||||
/**
|
||||
* UNKNOWN
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String scanner() {
|
||||
return scanner;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Plex library language that has been set
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String language() {
|
||||
return language;
|
||||
}
|
||||
|
||||
/**
|
||||
* The universally unique identifier for the library.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String uuid() {
|
||||
return uuid;
|
||||
@@ -232,11 +338,8 @@ public class GetAllLibrariesDirectory {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unix epoch datetime in seconds
|
||||
*/
|
||||
@JsonIgnore
|
||||
public long createdAt() {
|
||||
public Optional<Long> createdAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
@@ -248,27 +351,34 @@ public class GetAllLibrariesDirectory {
|
||||
return scannedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* UNKNOWN
|
||||
*/
|
||||
@JsonIgnore
|
||||
public boolean content() {
|
||||
return content;
|
||||
}
|
||||
|
||||
/**
|
||||
* UNKNOWN
|
||||
*/
|
||||
@JsonIgnore
|
||||
public boolean directory() {
|
||||
return directory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unix epoch datetime in seconds
|
||||
* The number of seconds since the content was last changed relative to now.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public long contentChangedAt() {
|
||||
public int contentChangedAt() {
|
||||
return contentChangedAt;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public int hidden() {
|
||||
return hidden;
|
||||
public Optional<Hidden> hidden() {
|
||||
return (Optional<Hidden>) hidden;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@@ -280,78 +390,114 @@ public class GetAllLibrariesDirectory {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether syncing is allowed.
|
||||
*/
|
||||
public GetAllLibrariesDirectory withAllowSync(boolean allowSync) {
|
||||
Utils.checkNotNull(allowSync, "allowSync");
|
||||
this.allowSync = allowSync;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL for the background artwork of the media container.
|
||||
*/
|
||||
public GetAllLibrariesDirectory withArt(String art) {
|
||||
Utils.checkNotNull(art, "art");
|
||||
this.art = art;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The relative path to the composite media item.
|
||||
*/
|
||||
public GetAllLibrariesDirectory withComposite(String composite) {
|
||||
Utils.checkNotNull(composite, "composite");
|
||||
this.composite = composite;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* UNKNOWN
|
||||
*/
|
||||
public GetAllLibrariesDirectory withFilters(boolean filters) {
|
||||
Utils.checkNotNull(filters, "filters");
|
||||
this.filters = filters;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the library is currently being refreshed or updated
|
||||
*/
|
||||
public GetAllLibrariesDirectory withRefreshing(boolean refreshing) {
|
||||
Utils.checkNotNull(refreshing, "refreshing");
|
||||
this.refreshing = refreshing;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL for the thumbnail image of the media container.
|
||||
*/
|
||||
public GetAllLibrariesDirectory withThumb(String thumb) {
|
||||
Utils.checkNotNull(thumb, "thumb");
|
||||
this.thumb = thumb;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The library key representing the unique identifier
|
||||
*/
|
||||
public GetAllLibrariesDirectory withKey(String key) {
|
||||
Utils.checkNotNull(key, "key");
|
||||
this.key = key;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetAllLibrariesDirectory withType(String type) {
|
||||
public GetAllLibrariesDirectory withType(GetAllLibrariesType type) {
|
||||
Utils.checkNotNull(type, "type");
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The title of the library
|
||||
*/
|
||||
public GetAllLibrariesDirectory withTitle(String title) {
|
||||
Utils.checkNotNull(title, "title");
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Plex agent used to match and retrieve media metadata.
|
||||
*/
|
||||
public GetAllLibrariesDirectory withAgent(String agent) {
|
||||
Utils.checkNotNull(agent, "agent");
|
||||
this.agent = agent;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* UNKNOWN
|
||||
*/
|
||||
public GetAllLibrariesDirectory withScanner(String scanner) {
|
||||
Utils.checkNotNull(scanner, "scanner");
|
||||
this.scanner = scanner;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Plex library language that has been set
|
||||
*/
|
||||
public GetAllLibrariesDirectory withLanguage(String language) {
|
||||
Utils.checkNotNull(language, "language");
|
||||
this.language = language;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The universally unique identifier for the library.
|
||||
*/
|
||||
public GetAllLibrariesDirectory withUuid(String uuid) {
|
||||
Utils.checkNotNull(uuid, "uuid");
|
||||
this.uuid = uuid;
|
||||
@@ -367,10 +513,13 @@ public class GetAllLibrariesDirectory {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unix epoch datetime in seconds
|
||||
*/
|
||||
public GetAllLibrariesDirectory withCreatedAt(long createdAt) {
|
||||
Utils.checkNotNull(createdAt, "createdAt");
|
||||
this.createdAt = Optional.ofNullable(createdAt);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetAllLibrariesDirectory withCreatedAt(Optional<Long> createdAt) {
|
||||
Utils.checkNotNull(createdAt, "createdAt");
|
||||
this.createdAt = createdAt;
|
||||
return this;
|
||||
@@ -385,12 +534,18 @@ public class GetAllLibrariesDirectory {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* UNKNOWN
|
||||
*/
|
||||
public GetAllLibrariesDirectory withContent(boolean content) {
|
||||
Utils.checkNotNull(content, "content");
|
||||
this.content = content;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* UNKNOWN
|
||||
*/
|
||||
public GetAllLibrariesDirectory withDirectory(boolean directory) {
|
||||
Utils.checkNotNull(directory, "directory");
|
||||
this.directory = directory;
|
||||
@@ -398,15 +553,21 @@ public class GetAllLibrariesDirectory {
|
||||
}
|
||||
|
||||
/**
|
||||
* Unix epoch datetime in seconds
|
||||
* The number of seconds since the content was last changed relative to now.
|
||||
*/
|
||||
public GetAllLibrariesDirectory withContentChangedAt(long contentChangedAt) {
|
||||
public GetAllLibrariesDirectory withContentChangedAt(int contentChangedAt) {
|
||||
Utils.checkNotNull(contentChangedAt, "contentChangedAt");
|
||||
this.contentChangedAt = contentChangedAt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetAllLibrariesDirectory withHidden(int hidden) {
|
||||
public GetAllLibrariesDirectory withHidden(Hidden hidden) {
|
||||
Utils.checkNotNull(hidden, "hidden");
|
||||
this.hidden = Optional.ofNullable(hidden);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetAllLibrariesDirectory withHidden(Optional<? extends Hidden> hidden) {
|
||||
Utils.checkNotNull(hidden, "hidden");
|
||||
this.hidden = hidden;
|
||||
return this;
|
||||
@@ -520,7 +681,7 @@ public class GetAllLibrariesDirectory {
|
||||
|
||||
private String key;
|
||||
|
||||
private String type;
|
||||
private GetAllLibrariesType type;
|
||||
|
||||
private String title;
|
||||
|
||||
@@ -534,7 +695,7 @@ public class GetAllLibrariesDirectory {
|
||||
|
||||
private Long updatedAt;
|
||||
|
||||
private Long createdAt;
|
||||
private Optional<Long> createdAt = Optional.empty();
|
||||
|
||||
private Long scannedAt;
|
||||
|
||||
@@ -542,9 +703,9 @@ public class GetAllLibrariesDirectory {
|
||||
|
||||
private Boolean directory;
|
||||
|
||||
private Long contentChangedAt;
|
||||
private Integer contentChangedAt;
|
||||
|
||||
private Integer hidden;
|
||||
private Optional<? extends Hidden> hidden;
|
||||
|
||||
private List<GetAllLibrariesLocation> location;
|
||||
|
||||
@@ -552,78 +713,114 @@ public class GetAllLibrariesDirectory {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether syncing is allowed.
|
||||
*/
|
||||
public Builder allowSync(boolean allowSync) {
|
||||
Utils.checkNotNull(allowSync, "allowSync");
|
||||
this.allowSync = allowSync;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL for the background artwork of the media container.
|
||||
*/
|
||||
public Builder art(String art) {
|
||||
Utils.checkNotNull(art, "art");
|
||||
this.art = art;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The relative path to the composite media item.
|
||||
*/
|
||||
public Builder composite(String composite) {
|
||||
Utils.checkNotNull(composite, "composite");
|
||||
this.composite = composite;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* UNKNOWN
|
||||
*/
|
||||
public Builder filters(boolean filters) {
|
||||
Utils.checkNotNull(filters, "filters");
|
||||
this.filters = filters;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the library is currently being refreshed or updated
|
||||
*/
|
||||
public Builder refreshing(boolean refreshing) {
|
||||
Utils.checkNotNull(refreshing, "refreshing");
|
||||
this.refreshing = refreshing;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL for the thumbnail image of the media container.
|
||||
*/
|
||||
public Builder thumb(String thumb) {
|
||||
Utils.checkNotNull(thumb, "thumb");
|
||||
this.thumb = thumb;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The library key representing the unique identifier
|
||||
*/
|
||||
public Builder key(String key) {
|
||||
Utils.checkNotNull(key, "key");
|
||||
this.key = key;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder type(String type) {
|
||||
public Builder type(GetAllLibrariesType type) {
|
||||
Utils.checkNotNull(type, "type");
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The title of the library
|
||||
*/
|
||||
public Builder title(String title) {
|
||||
Utils.checkNotNull(title, "title");
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Plex agent used to match and retrieve media metadata.
|
||||
*/
|
||||
public Builder agent(String agent) {
|
||||
Utils.checkNotNull(agent, "agent");
|
||||
this.agent = agent;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* UNKNOWN
|
||||
*/
|
||||
public Builder scanner(String scanner) {
|
||||
Utils.checkNotNull(scanner, "scanner");
|
||||
this.scanner = scanner;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Plex library language that has been set
|
||||
*/
|
||||
public Builder language(String language) {
|
||||
Utils.checkNotNull(language, "language");
|
||||
this.language = language;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The universally unique identifier for the library.
|
||||
*/
|
||||
public Builder uuid(String uuid) {
|
||||
Utils.checkNotNull(uuid, "uuid");
|
||||
this.uuid = uuid;
|
||||
@@ -639,10 +836,13 @@ public class GetAllLibrariesDirectory {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unix epoch datetime in seconds
|
||||
*/
|
||||
public Builder createdAt(long createdAt) {
|
||||
Utils.checkNotNull(createdAt, "createdAt");
|
||||
this.createdAt = Optional.ofNullable(createdAt);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder createdAt(Optional<Long> createdAt) {
|
||||
Utils.checkNotNull(createdAt, "createdAt");
|
||||
this.createdAt = createdAt;
|
||||
return this;
|
||||
@@ -657,12 +857,18 @@ public class GetAllLibrariesDirectory {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* UNKNOWN
|
||||
*/
|
||||
public Builder content(boolean content) {
|
||||
Utils.checkNotNull(content, "content");
|
||||
this.content = content;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* UNKNOWN
|
||||
*/
|
||||
public Builder directory(boolean directory) {
|
||||
Utils.checkNotNull(directory, "directory");
|
||||
this.directory = directory;
|
||||
@@ -670,15 +876,21 @@ public class GetAllLibrariesDirectory {
|
||||
}
|
||||
|
||||
/**
|
||||
* Unix epoch datetime in seconds
|
||||
* The number of seconds since the content was last changed relative to now.
|
||||
*/
|
||||
public Builder contentChangedAt(long contentChangedAt) {
|
||||
public Builder contentChangedAt(int contentChangedAt) {
|
||||
Utils.checkNotNull(contentChangedAt, "contentChangedAt");
|
||||
this.contentChangedAt = contentChangedAt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder hidden(int hidden) {
|
||||
public Builder hidden(Hidden hidden) {
|
||||
Utils.checkNotNull(hidden, "hidden");
|
||||
this.hidden = Optional.ofNullable(hidden);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder hidden(Optional<? extends Hidden> hidden) {
|
||||
Utils.checkNotNull(hidden, "hidden");
|
||||
this.hidden = hidden;
|
||||
return this;
|
||||
@@ -691,6 +903,9 @@ public class GetAllLibrariesDirectory {
|
||||
}
|
||||
|
||||
public GetAllLibrariesDirectory build() {
|
||||
if (hidden == null) {
|
||||
hidden = _SINGLETON_VALUE_Hidden.value();
|
||||
}
|
||||
return new GetAllLibrariesDirectory(
|
||||
allowSync,
|
||||
art,
|
||||
@@ -714,5 +929,11 @@ public class GetAllLibrariesDirectory {
|
||||
hidden,
|
||||
location);
|
||||
}
|
||||
|
||||
private static final LazySingletonValue<Optional<? extends Hidden>> _SINGLETON_VALUE_Hidden =
|
||||
new LazySingletonValue<>(
|
||||
"hidden",
|
||||
"0",
|
||||
new TypeReference<Optional<? extends Hidden>>() {});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,9 +14,15 @@ import java.util.Objects;
|
||||
|
||||
public class GetAllLibrariesLocation {
|
||||
|
||||
/**
|
||||
* The ID of the location.
|
||||
*/
|
||||
@JsonProperty("id")
|
||||
private int id;
|
||||
|
||||
/**
|
||||
* The path to the media item.
|
||||
*/
|
||||
@JsonProperty("path")
|
||||
private String path;
|
||||
|
||||
@@ -30,11 +36,17 @@ public class GetAllLibrariesLocation {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the location.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public int id() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The path to the media item.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String path() {
|
||||
return path;
|
||||
@@ -44,12 +56,18 @@ public class GetAllLibrariesLocation {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the location.
|
||||
*/
|
||||
public GetAllLibrariesLocation withId(int id) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The path to the media item.
|
||||
*/
|
||||
public GetAllLibrariesLocation withPath(String path) {
|
||||
Utils.checkNotNull(path, "path");
|
||||
this.path = path;
|
||||
@@ -95,12 +113,18 @@ public class GetAllLibrariesLocation {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the location.
|
||||
*/
|
||||
public Builder id(int id) {
|
||||
Utils.checkNotNull(id, "id");
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The path to the media item.
|
||||
*/
|
||||
public Builder path(String path) {
|
||||
Utils.checkNotNull(path, "path");
|
||||
this.path = path;
|
||||
|
||||
@@ -5,35 +5,49 @@ package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Boolean;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
public class GetAllLibrariesMediaContainer {
|
||||
|
||||
/**
|
||||
* Number of media items returned in this response.
|
||||
*/
|
||||
@JsonProperty("size")
|
||||
private int size;
|
||||
|
||||
/**
|
||||
* Indicates whether syncing is allowed.
|
||||
*/
|
||||
@JsonProperty("allowSync")
|
||||
private boolean allowSync;
|
||||
|
||||
/**
|
||||
* The primary title of the media container.
|
||||
*/
|
||||
@JsonProperty("title1")
|
||||
private String title1;
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("Directory")
|
||||
private List<GetAllLibrariesDirectory> directory;
|
||||
private Optional<? extends List<GetAllLibrariesDirectory>> directory;
|
||||
|
||||
@JsonCreator
|
||||
public GetAllLibrariesMediaContainer(
|
||||
@JsonProperty("size") int size,
|
||||
@JsonProperty("allowSync") boolean allowSync,
|
||||
@JsonProperty("title1") String title1,
|
||||
@JsonProperty("Directory") List<GetAllLibrariesDirectory> directory) {
|
||||
@JsonProperty("Directory") Optional<? extends List<GetAllLibrariesDirectory>> directory) {
|
||||
Utils.checkNotNull(size, "size");
|
||||
Utils.checkNotNull(allowSync, "allowSync");
|
||||
Utils.checkNotNull(title1, "title1");
|
||||
@@ -44,42 +58,68 @@ public class GetAllLibrariesMediaContainer {
|
||||
this.directory = directory;
|
||||
}
|
||||
|
||||
public GetAllLibrariesMediaContainer(
|
||||
int size,
|
||||
boolean allowSync,
|
||||
String title1) {
|
||||
this(size, allowSync, title1, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of media items returned in this response.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public int size() {
|
||||
return size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether syncing is allowed.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public boolean allowSync() {
|
||||
return allowSync;
|
||||
}
|
||||
|
||||
/**
|
||||
* The primary title of the media container.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String title1() {
|
||||
return title1;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public List<GetAllLibrariesDirectory> directory() {
|
||||
return directory;
|
||||
public Optional<List<GetAllLibrariesDirectory>> directory() {
|
||||
return (Optional<List<GetAllLibrariesDirectory>>) directory;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of media items returned in this response.
|
||||
*/
|
||||
public GetAllLibrariesMediaContainer withSize(int size) {
|
||||
Utils.checkNotNull(size, "size");
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether syncing is allowed.
|
||||
*/
|
||||
public GetAllLibrariesMediaContainer withAllowSync(boolean allowSync) {
|
||||
Utils.checkNotNull(allowSync, "allowSync");
|
||||
this.allowSync = allowSync;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The primary title of the media container.
|
||||
*/
|
||||
public GetAllLibrariesMediaContainer withTitle1(String title1) {
|
||||
Utils.checkNotNull(title1, "title1");
|
||||
this.title1 = title1;
|
||||
@@ -87,6 +127,12 @@ public class GetAllLibrariesMediaContainer {
|
||||
}
|
||||
|
||||
public GetAllLibrariesMediaContainer withDirectory(List<GetAllLibrariesDirectory> directory) {
|
||||
Utils.checkNotNull(directory, "directory");
|
||||
this.directory = Optional.ofNullable(directory);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetAllLibrariesMediaContainer withDirectory(Optional<? extends List<GetAllLibrariesDirectory>> directory) {
|
||||
Utils.checkNotNull(directory, "directory");
|
||||
this.directory = directory;
|
||||
return this;
|
||||
@@ -135,24 +181,33 @@ public class GetAllLibrariesMediaContainer {
|
||||
|
||||
private String title1;
|
||||
|
||||
private List<GetAllLibrariesDirectory> directory;
|
||||
private Optional<? extends List<GetAllLibrariesDirectory>> directory = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of media items returned in this response.
|
||||
*/
|
||||
public Builder size(int size) {
|
||||
Utils.checkNotNull(size, "size");
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether syncing is allowed.
|
||||
*/
|
||||
public Builder allowSync(boolean allowSync) {
|
||||
Utils.checkNotNull(allowSync, "allowSync");
|
||||
this.allowSync = allowSync;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The primary title of the media container.
|
||||
*/
|
||||
public Builder title1(String title1) {
|
||||
Utils.checkNotNull(title1, "title1");
|
||||
this.title1 = title1;
|
||||
@@ -160,6 +215,12 @@ public class GetAllLibrariesMediaContainer {
|
||||
}
|
||||
|
||||
public Builder directory(List<GetAllLibrariesDirectory> directory) {
|
||||
Utils.checkNotNull(directory, "directory");
|
||||
this.directory = Optional.ofNullable(directory);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder directory(Optional<? extends List<GetAllLibrariesDirectory>> directory) {
|
||||
Utils.checkNotNull(directory, "directory");
|
||||
this.directory = directory;
|
||||
return this;
|
||||
|
||||
@@ -5,11 +5,15 @@ package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* GetAllLibrariesResponseBody
|
||||
@@ -18,19 +22,25 @@ import java.util.Objects;
|
||||
*/
|
||||
public class GetAllLibrariesResponseBody {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("MediaContainer")
|
||||
private GetAllLibrariesMediaContainer mediaContainer;
|
||||
private Optional<? extends GetAllLibrariesMediaContainer> mediaContainer;
|
||||
|
||||
@JsonCreator
|
||||
public GetAllLibrariesResponseBody(
|
||||
@JsonProperty("MediaContainer") GetAllLibrariesMediaContainer mediaContainer) {
|
||||
@JsonProperty("MediaContainer") Optional<? extends GetAllLibrariesMediaContainer> mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = mediaContainer;
|
||||
}
|
||||
|
||||
public GetAllLibrariesResponseBody() {
|
||||
this(Optional.empty());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public GetAllLibrariesMediaContainer mediaContainer() {
|
||||
return mediaContainer;
|
||||
public Optional<GetAllLibrariesMediaContainer> mediaContainer() {
|
||||
return (Optional<GetAllLibrariesMediaContainer>) mediaContainer;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
@@ -38,6 +48,12 @@ public class GetAllLibrariesResponseBody {
|
||||
}
|
||||
|
||||
public GetAllLibrariesResponseBody withMediaContainer(GetAllLibrariesMediaContainer mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = Optional.ofNullable(mediaContainer);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetAllLibrariesResponseBody withMediaContainer(Optional<? extends GetAllLibrariesMediaContainer> mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = mediaContainer;
|
||||
return this;
|
||||
@@ -71,13 +87,19 @@ public class GetAllLibrariesResponseBody {
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private GetAllLibrariesMediaContainer mediaContainer;
|
||||
private Optional<? extends GetAllLibrariesMediaContainer> mediaContainer = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder mediaContainer(GetAllLibrariesMediaContainer mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = Optional.ofNullable(mediaContainer);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder mediaContainer(Optional<? extends GetAllLibrariesMediaContainer> mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = mediaContainer;
|
||||
return this;
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* GetAllLibrariesType
|
||||
*
|
||||
* <p>The library type
|
||||
*/
|
||||
public enum GetAllLibrariesType {
|
||||
Movie("movie"),
|
||||
TvShow("show"),
|
||||
Season("season"),
|
||||
Episode("episode"),
|
||||
Artist("artist"),
|
||||
Album("album");
|
||||
|
||||
@JsonValue
|
||||
private final String value;
|
||||
|
||||
private GetAllLibrariesType(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String value() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static Optional<GetAllLibrariesType> fromValue(String value) {
|
||||
for (GetAllLibrariesType o: GetAllLibrariesType.values()) {
|
||||
if (Objects.deepEquals(o.value, value)) {
|
||||
return Optional.of(o);
|
||||
}
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,253 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Long;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class GetMediaArtsMediaContainer {
|
||||
|
||||
/**
|
||||
* Number of media items returned in this response.
|
||||
*/
|
||||
@JsonProperty("size")
|
||||
private int size;
|
||||
|
||||
/**
|
||||
* The version number for media tags.
|
||||
*/
|
||||
@JsonProperty("mediaTagVersion")
|
||||
private long mediaTagVersion;
|
||||
|
||||
/**
|
||||
* The prefix used for media tag resource paths.
|
||||
*/
|
||||
@JsonProperty("mediaTagPrefix")
|
||||
private String mediaTagPrefix;
|
||||
|
||||
/**
|
||||
* An plugin identifier for the media container.
|
||||
*/
|
||||
@JsonProperty("identifier")
|
||||
private String identifier;
|
||||
|
||||
@JsonProperty("Metadata")
|
||||
private List<GetMediaArtsMetadata> metadata;
|
||||
|
||||
@JsonCreator
|
||||
public GetMediaArtsMediaContainer(
|
||||
@JsonProperty("size") int size,
|
||||
@JsonProperty("mediaTagVersion") long mediaTagVersion,
|
||||
@JsonProperty("mediaTagPrefix") String mediaTagPrefix,
|
||||
@JsonProperty("identifier") String identifier,
|
||||
@JsonProperty("Metadata") List<GetMediaArtsMetadata> metadata) {
|
||||
Utils.checkNotNull(size, "size");
|
||||
Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
|
||||
Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
|
||||
Utils.checkNotNull(identifier, "identifier");
|
||||
Utils.checkNotNull(metadata, "metadata");
|
||||
this.size = size;
|
||||
this.mediaTagVersion = mediaTagVersion;
|
||||
this.mediaTagPrefix = mediaTagPrefix;
|
||||
this.identifier = identifier;
|
||||
this.metadata = metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of media items returned in this response.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public int size() {
|
||||
return size;
|
||||
}
|
||||
|
||||
/**
|
||||
* The version number for media tags.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public long mediaTagVersion() {
|
||||
return mediaTagVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* The prefix used for media tag resource paths.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String mediaTagPrefix() {
|
||||
return mediaTagPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* An plugin identifier for the media container.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String identifier() {
|
||||
return identifier;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public List<GetMediaArtsMetadata> metadata() {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of media items returned in this response.
|
||||
*/
|
||||
public GetMediaArtsMediaContainer withSize(int size) {
|
||||
Utils.checkNotNull(size, "size");
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The version number for media tags.
|
||||
*/
|
||||
public GetMediaArtsMediaContainer withMediaTagVersion(long mediaTagVersion) {
|
||||
Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
|
||||
this.mediaTagVersion = mediaTagVersion;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The prefix used for media tag resource paths.
|
||||
*/
|
||||
public GetMediaArtsMediaContainer withMediaTagPrefix(String mediaTagPrefix) {
|
||||
Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
|
||||
this.mediaTagPrefix = mediaTagPrefix;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An plugin identifier for the media container.
|
||||
*/
|
||||
public GetMediaArtsMediaContainer withIdentifier(String identifier) {
|
||||
Utils.checkNotNull(identifier, "identifier");
|
||||
this.identifier = identifier;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMediaArtsMediaContainer withMetadata(List<GetMediaArtsMetadata> metadata) {
|
||||
Utils.checkNotNull(metadata, "metadata");
|
||||
this.metadata = metadata;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetMediaArtsMediaContainer other = (GetMediaArtsMediaContainer) o;
|
||||
return
|
||||
Objects.deepEquals(this.size, other.size) &&
|
||||
Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) &&
|
||||
Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) &&
|
||||
Objects.deepEquals(this.identifier, other.identifier) &&
|
||||
Objects.deepEquals(this.metadata, other.metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
size,
|
||||
mediaTagVersion,
|
||||
mediaTagPrefix,
|
||||
identifier,
|
||||
metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetMediaArtsMediaContainer.class,
|
||||
"size", size,
|
||||
"mediaTagVersion", mediaTagVersion,
|
||||
"mediaTagPrefix", mediaTagPrefix,
|
||||
"identifier", identifier,
|
||||
"metadata", metadata);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Integer size;
|
||||
|
||||
private Long mediaTagVersion;
|
||||
|
||||
private String mediaTagPrefix;
|
||||
|
||||
private String identifier;
|
||||
|
||||
private List<GetMediaArtsMetadata> metadata;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of media items returned in this response.
|
||||
*/
|
||||
public Builder size(int size) {
|
||||
Utils.checkNotNull(size, "size");
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The version number for media tags.
|
||||
*/
|
||||
public Builder mediaTagVersion(long mediaTagVersion) {
|
||||
Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
|
||||
this.mediaTagVersion = mediaTagVersion;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The prefix used for media tag resource paths.
|
||||
*/
|
||||
public Builder mediaTagPrefix(String mediaTagPrefix) {
|
||||
Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
|
||||
this.mediaTagPrefix = mediaTagPrefix;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An plugin identifier for the media container.
|
||||
*/
|
||||
public Builder identifier(String identifier) {
|
||||
Utils.checkNotNull(identifier, "identifier");
|
||||
this.identifier = identifier;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder metadata(List<GetMediaArtsMetadata> metadata) {
|
||||
Utils.checkNotNull(metadata, "metadata");
|
||||
this.metadata = metadata;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMediaArtsMediaContainer build() {
|
||||
return new GetMediaArtsMediaContainer(
|
||||
size,
|
||||
mediaTagVersion,
|
||||
mediaTagPrefix,
|
||||
identifier,
|
||||
metadata);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Boolean;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
public class GetMediaArtsMetadata {
|
||||
|
||||
/**
|
||||
* The URL of the artwork.
|
||||
*/
|
||||
@JsonProperty("key")
|
||||
private String key;
|
||||
|
||||
/**
|
||||
* The provider of the artwork.
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("provider")
|
||||
private Optional<String> provider;
|
||||
|
||||
/**
|
||||
* The URL of the artwork.
|
||||
*/
|
||||
@JsonProperty("ratingKey")
|
||||
private String ratingKey;
|
||||
|
||||
/**
|
||||
* Whether this is the selected artwork.
|
||||
*/
|
||||
@JsonProperty("selected")
|
||||
private boolean selected;
|
||||
|
||||
/**
|
||||
* The URL of the artwork thumbnail.
|
||||
*/
|
||||
@JsonProperty("thumb")
|
||||
private String thumb;
|
||||
|
||||
@JsonCreator
|
||||
public GetMediaArtsMetadata(
|
||||
@JsonProperty("key") String key,
|
||||
@JsonProperty("provider") Optional<String> provider,
|
||||
@JsonProperty("ratingKey") String ratingKey,
|
||||
@JsonProperty("selected") boolean selected,
|
||||
@JsonProperty("thumb") String thumb) {
|
||||
Utils.checkNotNull(key, "key");
|
||||
Utils.checkNotNull(provider, "provider");
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
Utils.checkNotNull(selected, "selected");
|
||||
Utils.checkNotNull(thumb, "thumb");
|
||||
this.key = key;
|
||||
this.provider = provider;
|
||||
this.ratingKey = ratingKey;
|
||||
this.selected = selected;
|
||||
this.thumb = thumb;
|
||||
}
|
||||
|
||||
public GetMediaArtsMetadata(
|
||||
String key,
|
||||
String ratingKey,
|
||||
boolean selected,
|
||||
String thumb) {
|
||||
this(key, Optional.empty(), ratingKey, selected, thumb);
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the artwork.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String key() {
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
* The provider of the artwork.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<String> provider() {
|
||||
return provider;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the artwork.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String ratingKey() {
|
||||
return ratingKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this is the selected artwork.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public boolean selected() {
|
||||
return selected;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the artwork thumbnail.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String thumb() {
|
||||
return thumb;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the artwork.
|
||||
*/
|
||||
public GetMediaArtsMetadata withKey(String key) {
|
||||
Utils.checkNotNull(key, "key");
|
||||
this.key = key;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The provider of the artwork.
|
||||
*/
|
||||
public GetMediaArtsMetadata withProvider(String provider) {
|
||||
Utils.checkNotNull(provider, "provider");
|
||||
this.provider = Optional.ofNullable(provider);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The provider of the artwork.
|
||||
*/
|
||||
public GetMediaArtsMetadata withProvider(Optional<String> provider) {
|
||||
Utils.checkNotNull(provider, "provider");
|
||||
this.provider = provider;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the artwork.
|
||||
*/
|
||||
public GetMediaArtsMetadata withRatingKey(String ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this is the selected artwork.
|
||||
*/
|
||||
public GetMediaArtsMetadata withSelected(boolean selected) {
|
||||
Utils.checkNotNull(selected, "selected");
|
||||
this.selected = selected;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the artwork thumbnail.
|
||||
*/
|
||||
public GetMediaArtsMetadata withThumb(String thumb) {
|
||||
Utils.checkNotNull(thumb, "thumb");
|
||||
this.thumb = thumb;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetMediaArtsMetadata other = (GetMediaArtsMetadata) o;
|
||||
return
|
||||
Objects.deepEquals(this.key, other.key) &&
|
||||
Objects.deepEquals(this.provider, other.provider) &&
|
||||
Objects.deepEquals(this.ratingKey, other.ratingKey) &&
|
||||
Objects.deepEquals(this.selected, other.selected) &&
|
||||
Objects.deepEquals(this.thumb, other.thumb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
key,
|
||||
provider,
|
||||
ratingKey,
|
||||
selected,
|
||||
thumb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetMediaArtsMetadata.class,
|
||||
"key", key,
|
||||
"provider", provider,
|
||||
"ratingKey", ratingKey,
|
||||
"selected", selected,
|
||||
"thumb", thumb);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private String key;
|
||||
|
||||
private Optional<String> provider = Optional.empty();
|
||||
|
||||
private String ratingKey;
|
||||
|
||||
private Boolean selected;
|
||||
|
||||
private String thumb;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the artwork.
|
||||
*/
|
||||
public Builder key(String key) {
|
||||
Utils.checkNotNull(key, "key");
|
||||
this.key = key;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The provider of the artwork.
|
||||
*/
|
||||
public Builder provider(String provider) {
|
||||
Utils.checkNotNull(provider, "provider");
|
||||
this.provider = Optional.ofNullable(provider);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The provider of the artwork.
|
||||
*/
|
||||
public Builder provider(Optional<String> provider) {
|
||||
Utils.checkNotNull(provider, "provider");
|
||||
this.provider = provider;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the artwork.
|
||||
*/
|
||||
public Builder ratingKey(String ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this is the selected artwork.
|
||||
*/
|
||||
public Builder selected(boolean selected) {
|
||||
Utils.checkNotNull(selected, "selected");
|
||||
this.selected = selected;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the artwork thumbnail.
|
||||
*/
|
||||
public Builder thumb(String thumb) {
|
||||
Utils.checkNotNull(thumb, "thumb");
|
||||
this.thumb = thumb;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMediaArtsMetadata build() {
|
||||
return new GetMediaArtsMetadata(
|
||||
key,
|
||||
provider,
|
||||
ratingKey,
|
||||
selected,
|
||||
thumb);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import dev.plexapi.sdk.utils.SpeakeasyMetadata;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Long;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
|
||||
public class GetMediaArtsRequest {
|
||||
|
||||
/**
|
||||
* the id of the library item to return the artwork of.
|
||||
*/
|
||||
@SpeakeasyMetadata("pathParam:style=simple,explode=false,name=ratingKey")
|
||||
private long ratingKey;
|
||||
|
||||
@JsonCreator
|
||||
public GetMediaArtsRequest(
|
||||
long ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* the id of the library item to return the artwork of.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public long ratingKey() {
|
||||
return ratingKey;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* the id of the library item to return the artwork of.
|
||||
*/
|
||||
public GetMediaArtsRequest withRatingKey(long ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetMediaArtsRequest other = (GetMediaArtsRequest) o;
|
||||
return
|
||||
Objects.deepEquals(this.ratingKey, other.ratingKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
ratingKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetMediaArtsRequest.class,
|
||||
"ratingKey", ratingKey);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Long ratingKey;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* the id of the library item to return the artwork of.
|
||||
*/
|
||||
public Builder ratingKey(long ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMediaArtsRequest build() {
|
||||
return new GetMediaArtsRequest(
|
||||
ratingKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Exception;
|
||||
import java.lang.Long;
|
||||
|
||||
public class GetMediaArtsRequestBuilder {
|
||||
|
||||
private Long ratingKey;
|
||||
private final SDKMethodInterfaces.MethodCallGetMediaArts sdk;
|
||||
|
||||
public GetMediaArtsRequestBuilder(SDKMethodInterfaces.MethodCallGetMediaArts sdk) {
|
||||
this.sdk = sdk;
|
||||
}
|
||||
|
||||
public GetMediaArtsRequestBuilder ratingKey(long ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMediaArtsResponse call() throws Exception {
|
||||
|
||||
return sdk.getMediaArts(
|
||||
ratingKey);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,248 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import dev.plexapi.sdk.utils.Response;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
public class GetMediaArtsResponse implements Response {
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
private String contentType;
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
private int statusCode;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
private HttpResponse<InputStream> rawResponse;
|
||||
|
||||
/**
|
||||
* The available background artwork for the library item.
|
||||
*/
|
||||
private Optional<? extends GetMediaArtsResponseBody> object;
|
||||
|
||||
@JsonCreator
|
||||
public GetMediaArtsResponse(
|
||||
String contentType,
|
||||
int statusCode,
|
||||
HttpResponse<InputStream> rawResponse,
|
||||
Optional<? extends GetMediaArtsResponseBody> object) {
|
||||
Utils.checkNotNull(contentType, "contentType");
|
||||
Utils.checkNotNull(statusCode, "statusCode");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
Utils.checkNotNull(object, "object");
|
||||
this.contentType = contentType;
|
||||
this.statusCode = statusCode;
|
||||
this.rawResponse = rawResponse;
|
||||
this.object = object;
|
||||
}
|
||||
|
||||
public GetMediaArtsResponse(
|
||||
String contentType,
|
||||
int statusCode,
|
||||
HttpResponse<InputStream> rawResponse) {
|
||||
this(contentType, statusCode, rawResponse, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String contentType() {
|
||||
return contentType;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
@JsonIgnore
|
||||
public int statusCode() {
|
||||
return statusCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonIgnore
|
||||
public HttpResponse<InputStream> rawResponse() {
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* The available background artwork for the library item.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<GetMediaArtsResponseBody> object() {
|
||||
return (Optional<GetMediaArtsResponseBody>) object;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
public GetMediaArtsResponse withContentType(String contentType) {
|
||||
Utils.checkNotNull(contentType, "contentType");
|
||||
this.contentType = contentType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
public GetMediaArtsResponse withStatusCode(int statusCode) {
|
||||
Utils.checkNotNull(statusCode, "statusCode");
|
||||
this.statusCode = statusCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetMediaArtsResponse withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = rawResponse;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The available background artwork for the library item.
|
||||
*/
|
||||
public GetMediaArtsResponse withObject(GetMediaArtsResponseBody object) {
|
||||
Utils.checkNotNull(object, "object");
|
||||
this.object = Optional.ofNullable(object);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The available background artwork for the library item.
|
||||
*/
|
||||
public GetMediaArtsResponse withObject(Optional<? extends GetMediaArtsResponseBody> object) {
|
||||
Utils.checkNotNull(object, "object");
|
||||
this.object = object;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetMediaArtsResponse other = (GetMediaArtsResponse) o;
|
||||
return
|
||||
Objects.deepEquals(this.contentType, other.contentType) &&
|
||||
Objects.deepEquals(this.statusCode, other.statusCode) &&
|
||||
Objects.deepEquals(this.rawResponse, other.rawResponse) &&
|
||||
Objects.deepEquals(this.object, other.object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
contentType,
|
||||
statusCode,
|
||||
rawResponse,
|
||||
object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetMediaArtsResponse.class,
|
||||
"contentType", contentType,
|
||||
"statusCode", statusCode,
|
||||
"rawResponse", rawResponse,
|
||||
"object", object);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private String contentType;
|
||||
|
||||
private Integer statusCode;
|
||||
|
||||
private HttpResponse<InputStream> rawResponse;
|
||||
|
||||
private Optional<? extends GetMediaArtsResponseBody> object = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
public Builder contentType(String contentType) {
|
||||
Utils.checkNotNull(contentType, "contentType");
|
||||
this.contentType = contentType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
public Builder statusCode(int statusCode) {
|
||||
Utils.checkNotNull(statusCode, "statusCode");
|
||||
this.statusCode = statusCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Builder rawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = rawResponse;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The available background artwork for the library item.
|
||||
*/
|
||||
public Builder object(GetMediaArtsResponseBody object) {
|
||||
Utils.checkNotNull(object, "object");
|
||||
this.object = Optional.ofNullable(object);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The available background artwork for the library item.
|
||||
*/
|
||||
public Builder object(Optional<? extends GetMediaArtsResponseBody> object) {
|
||||
Utils.checkNotNull(object, "object");
|
||||
this.object = object;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMediaArtsResponse build() {
|
||||
return new GetMediaArtsResponse(
|
||||
contentType,
|
||||
statusCode,
|
||||
rawResponse,
|
||||
object);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* GetMediaArtsResponseBody
|
||||
*
|
||||
* <p>The available background artwork for the library item.
|
||||
*/
|
||||
public class GetMediaArtsResponseBody {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("MediaContainer")
|
||||
private Optional<? extends GetMediaArtsMediaContainer> mediaContainer;
|
||||
|
||||
@JsonCreator
|
||||
public GetMediaArtsResponseBody(
|
||||
@JsonProperty("MediaContainer") Optional<? extends GetMediaArtsMediaContainer> mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = mediaContainer;
|
||||
}
|
||||
|
||||
public GetMediaArtsResponseBody() {
|
||||
this(Optional.empty());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<GetMediaArtsMediaContainer> mediaContainer() {
|
||||
return (Optional<GetMediaArtsMediaContainer>) mediaContainer;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetMediaArtsResponseBody withMediaContainer(GetMediaArtsMediaContainer mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = Optional.ofNullable(mediaContainer);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMediaArtsResponseBody withMediaContainer(Optional<? extends GetMediaArtsMediaContainer> mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = mediaContainer;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetMediaArtsResponseBody other = (GetMediaArtsResponseBody) o;
|
||||
return
|
||||
Objects.deepEquals(this.mediaContainer, other.mediaContainer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
mediaContainer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetMediaArtsResponseBody.class,
|
||||
"mediaContainer", mediaContainer);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends GetMediaArtsMediaContainer> mediaContainer = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder mediaContainer(GetMediaArtsMediaContainer mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = Optional.ofNullable(mediaContainer);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder mediaContainer(Optional<? extends GetMediaArtsMediaContainer> mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = mediaContainer;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMediaArtsResponseBody build() {
|
||||
return new GetMediaArtsResponseBody(
|
||||
mediaContainer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Long;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class GetMediaPostersMediaContainer {
|
||||
|
||||
/**
|
||||
* Number of media items returned in this response.
|
||||
*/
|
||||
@JsonProperty("size")
|
||||
private int size;
|
||||
|
||||
/**
|
||||
* The version number for media tags.
|
||||
*/
|
||||
@JsonProperty("mediaTagVersion")
|
||||
private long mediaTagVersion;
|
||||
|
||||
/**
|
||||
* The prefix used for media tag resource paths.
|
||||
*/
|
||||
@JsonProperty("mediaTagPrefix")
|
||||
private String mediaTagPrefix;
|
||||
|
||||
/**
|
||||
* An plugin identifier for the media container.
|
||||
*/
|
||||
@JsonProperty("identifier")
|
||||
private String identifier;
|
||||
|
||||
@JsonProperty("Metadata")
|
||||
private List<GetMediaPostersMetadata> metadata;
|
||||
|
||||
@JsonCreator
|
||||
public GetMediaPostersMediaContainer(
|
||||
@JsonProperty("size") int size,
|
||||
@JsonProperty("mediaTagVersion") long mediaTagVersion,
|
||||
@JsonProperty("mediaTagPrefix") String mediaTagPrefix,
|
||||
@JsonProperty("identifier") String identifier,
|
||||
@JsonProperty("Metadata") List<GetMediaPostersMetadata> metadata) {
|
||||
Utils.checkNotNull(size, "size");
|
||||
Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
|
||||
Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
|
||||
Utils.checkNotNull(identifier, "identifier");
|
||||
Utils.checkNotNull(metadata, "metadata");
|
||||
this.size = size;
|
||||
this.mediaTagVersion = mediaTagVersion;
|
||||
this.mediaTagPrefix = mediaTagPrefix;
|
||||
this.identifier = identifier;
|
||||
this.metadata = metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of media items returned in this response.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public int size() {
|
||||
return size;
|
||||
}
|
||||
|
||||
/**
|
||||
* The version number for media tags.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public long mediaTagVersion() {
|
||||
return mediaTagVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* The prefix used for media tag resource paths.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String mediaTagPrefix() {
|
||||
return mediaTagPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* An plugin identifier for the media container.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String identifier() {
|
||||
return identifier;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public List<GetMediaPostersMetadata> metadata() {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of media items returned in this response.
|
||||
*/
|
||||
public GetMediaPostersMediaContainer withSize(int size) {
|
||||
Utils.checkNotNull(size, "size");
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The version number for media tags.
|
||||
*/
|
||||
public GetMediaPostersMediaContainer withMediaTagVersion(long mediaTagVersion) {
|
||||
Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
|
||||
this.mediaTagVersion = mediaTagVersion;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The prefix used for media tag resource paths.
|
||||
*/
|
||||
public GetMediaPostersMediaContainer withMediaTagPrefix(String mediaTagPrefix) {
|
||||
Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
|
||||
this.mediaTagPrefix = mediaTagPrefix;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An plugin identifier for the media container.
|
||||
*/
|
||||
public GetMediaPostersMediaContainer withIdentifier(String identifier) {
|
||||
Utils.checkNotNull(identifier, "identifier");
|
||||
this.identifier = identifier;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMediaPostersMediaContainer withMetadata(List<GetMediaPostersMetadata> metadata) {
|
||||
Utils.checkNotNull(metadata, "metadata");
|
||||
this.metadata = metadata;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetMediaPostersMediaContainer other = (GetMediaPostersMediaContainer) o;
|
||||
return
|
||||
Objects.deepEquals(this.size, other.size) &&
|
||||
Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) &&
|
||||
Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) &&
|
||||
Objects.deepEquals(this.identifier, other.identifier) &&
|
||||
Objects.deepEquals(this.metadata, other.metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
size,
|
||||
mediaTagVersion,
|
||||
mediaTagPrefix,
|
||||
identifier,
|
||||
metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetMediaPostersMediaContainer.class,
|
||||
"size", size,
|
||||
"mediaTagVersion", mediaTagVersion,
|
||||
"mediaTagPrefix", mediaTagPrefix,
|
||||
"identifier", identifier,
|
||||
"metadata", metadata);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Integer size;
|
||||
|
||||
private Long mediaTagVersion;
|
||||
|
||||
private String mediaTagPrefix;
|
||||
|
||||
private String identifier;
|
||||
|
||||
private List<GetMediaPostersMetadata> metadata;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of media items returned in this response.
|
||||
*/
|
||||
public Builder size(int size) {
|
||||
Utils.checkNotNull(size, "size");
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The version number for media tags.
|
||||
*/
|
||||
public Builder mediaTagVersion(long mediaTagVersion) {
|
||||
Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
|
||||
this.mediaTagVersion = mediaTagVersion;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The prefix used for media tag resource paths.
|
||||
*/
|
||||
public Builder mediaTagPrefix(String mediaTagPrefix) {
|
||||
Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
|
||||
this.mediaTagPrefix = mediaTagPrefix;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An plugin identifier for the media container.
|
||||
*/
|
||||
public Builder identifier(String identifier) {
|
||||
Utils.checkNotNull(identifier, "identifier");
|
||||
this.identifier = identifier;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder metadata(List<GetMediaPostersMetadata> metadata) {
|
||||
Utils.checkNotNull(metadata, "metadata");
|
||||
this.metadata = metadata;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMediaPostersMediaContainer build() {
|
||||
return new GetMediaPostersMediaContainer(
|
||||
size,
|
||||
mediaTagVersion,
|
||||
mediaTagPrefix,
|
||||
identifier,
|
||||
metadata);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Boolean;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
public class GetMediaPostersMetadata {
|
||||
|
||||
/**
|
||||
* The URL of the poster.
|
||||
*/
|
||||
@JsonProperty("key")
|
||||
private String key;
|
||||
|
||||
/**
|
||||
* The provider of the poster.
|
||||
*/
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("provider")
|
||||
private Optional<String> provider;
|
||||
|
||||
/**
|
||||
* The URL of the poster.
|
||||
*/
|
||||
@JsonProperty("ratingKey")
|
||||
private String ratingKey;
|
||||
|
||||
/**
|
||||
* Whether this is the selected poster.
|
||||
*/
|
||||
@JsonProperty("selected")
|
||||
private boolean selected;
|
||||
|
||||
/**
|
||||
* The URL of the poster thumbnail.
|
||||
*/
|
||||
@JsonProperty("thumb")
|
||||
private String thumb;
|
||||
|
||||
@JsonCreator
|
||||
public GetMediaPostersMetadata(
|
||||
@JsonProperty("key") String key,
|
||||
@JsonProperty("provider") Optional<String> provider,
|
||||
@JsonProperty("ratingKey") String ratingKey,
|
||||
@JsonProperty("selected") boolean selected,
|
||||
@JsonProperty("thumb") String thumb) {
|
||||
Utils.checkNotNull(key, "key");
|
||||
Utils.checkNotNull(provider, "provider");
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
Utils.checkNotNull(selected, "selected");
|
||||
Utils.checkNotNull(thumb, "thumb");
|
||||
this.key = key;
|
||||
this.provider = provider;
|
||||
this.ratingKey = ratingKey;
|
||||
this.selected = selected;
|
||||
this.thumb = thumb;
|
||||
}
|
||||
|
||||
public GetMediaPostersMetadata(
|
||||
String key,
|
||||
String ratingKey,
|
||||
boolean selected,
|
||||
String thumb) {
|
||||
this(key, Optional.empty(), ratingKey, selected, thumb);
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the poster.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String key() {
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
* The provider of the poster.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<String> provider() {
|
||||
return provider;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the poster.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String ratingKey() {
|
||||
return ratingKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this is the selected poster.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public boolean selected() {
|
||||
return selected;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the poster thumbnail.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String thumb() {
|
||||
return thumb;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the poster.
|
||||
*/
|
||||
public GetMediaPostersMetadata withKey(String key) {
|
||||
Utils.checkNotNull(key, "key");
|
||||
this.key = key;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The provider of the poster.
|
||||
*/
|
||||
public GetMediaPostersMetadata withProvider(String provider) {
|
||||
Utils.checkNotNull(provider, "provider");
|
||||
this.provider = Optional.ofNullable(provider);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The provider of the poster.
|
||||
*/
|
||||
public GetMediaPostersMetadata withProvider(Optional<String> provider) {
|
||||
Utils.checkNotNull(provider, "provider");
|
||||
this.provider = provider;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the poster.
|
||||
*/
|
||||
public GetMediaPostersMetadata withRatingKey(String ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this is the selected poster.
|
||||
*/
|
||||
public GetMediaPostersMetadata withSelected(boolean selected) {
|
||||
Utils.checkNotNull(selected, "selected");
|
||||
this.selected = selected;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the poster thumbnail.
|
||||
*/
|
||||
public GetMediaPostersMetadata withThumb(String thumb) {
|
||||
Utils.checkNotNull(thumb, "thumb");
|
||||
this.thumb = thumb;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetMediaPostersMetadata other = (GetMediaPostersMetadata) o;
|
||||
return
|
||||
Objects.deepEquals(this.key, other.key) &&
|
||||
Objects.deepEquals(this.provider, other.provider) &&
|
||||
Objects.deepEquals(this.ratingKey, other.ratingKey) &&
|
||||
Objects.deepEquals(this.selected, other.selected) &&
|
||||
Objects.deepEquals(this.thumb, other.thumb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
key,
|
||||
provider,
|
||||
ratingKey,
|
||||
selected,
|
||||
thumb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetMediaPostersMetadata.class,
|
||||
"key", key,
|
||||
"provider", provider,
|
||||
"ratingKey", ratingKey,
|
||||
"selected", selected,
|
||||
"thumb", thumb);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private String key;
|
||||
|
||||
private Optional<String> provider = Optional.empty();
|
||||
|
||||
private String ratingKey;
|
||||
|
||||
private Boolean selected;
|
||||
|
||||
private String thumb;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the poster.
|
||||
*/
|
||||
public Builder key(String key) {
|
||||
Utils.checkNotNull(key, "key");
|
||||
this.key = key;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The provider of the poster.
|
||||
*/
|
||||
public Builder provider(String provider) {
|
||||
Utils.checkNotNull(provider, "provider");
|
||||
this.provider = Optional.ofNullable(provider);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The provider of the poster.
|
||||
*/
|
||||
public Builder provider(Optional<String> provider) {
|
||||
Utils.checkNotNull(provider, "provider");
|
||||
this.provider = provider;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the poster.
|
||||
*/
|
||||
public Builder ratingKey(String ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this is the selected poster.
|
||||
*/
|
||||
public Builder selected(boolean selected) {
|
||||
Utils.checkNotNull(selected, "selected");
|
||||
this.selected = selected;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the poster thumbnail.
|
||||
*/
|
||||
public Builder thumb(String thumb) {
|
||||
Utils.checkNotNull(thumb, "thumb");
|
||||
this.thumb = thumb;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMediaPostersMetadata build() {
|
||||
return new GetMediaPostersMetadata(
|
||||
key,
|
||||
provider,
|
||||
ratingKey,
|
||||
selected,
|
||||
thumb);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import dev.plexapi.sdk.utils.SpeakeasyMetadata;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Long;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
|
||||
public class GetMediaPostersRequest {
|
||||
|
||||
/**
|
||||
* the id of the library item to return the posters of.
|
||||
*/
|
||||
@SpeakeasyMetadata("pathParam:style=simple,explode=false,name=ratingKey")
|
||||
private long ratingKey;
|
||||
|
||||
@JsonCreator
|
||||
public GetMediaPostersRequest(
|
||||
long ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* the id of the library item to return the posters of.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public long ratingKey() {
|
||||
return ratingKey;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* the id of the library item to return the posters of.
|
||||
*/
|
||||
public GetMediaPostersRequest withRatingKey(long ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetMediaPostersRequest other = (GetMediaPostersRequest) o;
|
||||
return
|
||||
Objects.deepEquals(this.ratingKey, other.ratingKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
ratingKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetMediaPostersRequest.class,
|
||||
"ratingKey", ratingKey);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Long ratingKey;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* the id of the library item to return the posters of.
|
||||
*/
|
||||
public Builder ratingKey(long ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMediaPostersRequest build() {
|
||||
return new GetMediaPostersRequest(
|
||||
ratingKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Exception;
|
||||
import java.lang.Long;
|
||||
|
||||
public class GetMediaPostersRequestBuilder {
|
||||
|
||||
private Long ratingKey;
|
||||
private final SDKMethodInterfaces.MethodCallGetMediaPosters sdk;
|
||||
|
||||
public GetMediaPostersRequestBuilder(SDKMethodInterfaces.MethodCallGetMediaPosters sdk) {
|
||||
this.sdk = sdk;
|
||||
}
|
||||
|
||||
public GetMediaPostersRequestBuilder ratingKey(long ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMediaPostersResponse call() throws Exception {
|
||||
|
||||
return sdk.getMediaPosters(
|
||||
ratingKey);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,248 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import dev.plexapi.sdk.utils.Response;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
public class GetMediaPostersResponse implements Response {
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
private String contentType;
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
private int statusCode;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
private HttpResponse<InputStream> rawResponse;
|
||||
|
||||
/**
|
||||
* The available posters for the library item.
|
||||
*/
|
||||
private Optional<? extends GetMediaPostersResponseBody> object;
|
||||
|
||||
@JsonCreator
|
||||
public GetMediaPostersResponse(
|
||||
String contentType,
|
||||
int statusCode,
|
||||
HttpResponse<InputStream> rawResponse,
|
||||
Optional<? extends GetMediaPostersResponseBody> object) {
|
||||
Utils.checkNotNull(contentType, "contentType");
|
||||
Utils.checkNotNull(statusCode, "statusCode");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
Utils.checkNotNull(object, "object");
|
||||
this.contentType = contentType;
|
||||
this.statusCode = statusCode;
|
||||
this.rawResponse = rawResponse;
|
||||
this.object = object;
|
||||
}
|
||||
|
||||
public GetMediaPostersResponse(
|
||||
String contentType,
|
||||
int statusCode,
|
||||
HttpResponse<InputStream> rawResponse) {
|
||||
this(contentType, statusCode, rawResponse, Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String contentType() {
|
||||
return contentType;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
@JsonIgnore
|
||||
public int statusCode() {
|
||||
return statusCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonIgnore
|
||||
public HttpResponse<InputStream> rawResponse() {
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* The available posters for the library item.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<GetMediaPostersResponseBody> object() {
|
||||
return (Optional<GetMediaPostersResponseBody>) object;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
public GetMediaPostersResponse withContentType(String contentType) {
|
||||
Utils.checkNotNull(contentType, "contentType");
|
||||
this.contentType = contentType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
public GetMediaPostersResponse withStatusCode(int statusCode) {
|
||||
Utils.checkNotNull(statusCode, "statusCode");
|
||||
this.statusCode = statusCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public GetMediaPostersResponse withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = rawResponse;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The available posters for the library item.
|
||||
*/
|
||||
public GetMediaPostersResponse withObject(GetMediaPostersResponseBody object) {
|
||||
Utils.checkNotNull(object, "object");
|
||||
this.object = Optional.ofNullable(object);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The available posters for the library item.
|
||||
*/
|
||||
public GetMediaPostersResponse withObject(Optional<? extends GetMediaPostersResponseBody> object) {
|
||||
Utils.checkNotNull(object, "object");
|
||||
this.object = object;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetMediaPostersResponse other = (GetMediaPostersResponse) o;
|
||||
return
|
||||
Objects.deepEquals(this.contentType, other.contentType) &&
|
||||
Objects.deepEquals(this.statusCode, other.statusCode) &&
|
||||
Objects.deepEquals(this.rawResponse, other.rawResponse) &&
|
||||
Objects.deepEquals(this.object, other.object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
contentType,
|
||||
statusCode,
|
||||
rawResponse,
|
||||
object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetMediaPostersResponse.class,
|
||||
"contentType", contentType,
|
||||
"statusCode", statusCode,
|
||||
"rawResponse", rawResponse,
|
||||
"object", object);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private String contentType;
|
||||
|
||||
private Integer statusCode;
|
||||
|
||||
private HttpResponse<InputStream> rawResponse;
|
||||
|
||||
private Optional<? extends GetMediaPostersResponseBody> object = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
public Builder contentType(String contentType) {
|
||||
Utils.checkNotNull(contentType, "contentType");
|
||||
this.contentType = contentType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
public Builder statusCode(int statusCode) {
|
||||
Utils.checkNotNull(statusCode, "statusCode");
|
||||
this.statusCode = statusCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Builder rawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = rawResponse;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The available posters for the library item.
|
||||
*/
|
||||
public Builder object(GetMediaPostersResponseBody object) {
|
||||
Utils.checkNotNull(object, "object");
|
||||
this.object = Optional.ofNullable(object);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The available posters for the library item.
|
||||
*/
|
||||
public Builder object(Optional<? extends GetMediaPostersResponseBody> object) {
|
||||
Utils.checkNotNull(object, "object");
|
||||
this.object = object;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMediaPostersResponse build() {
|
||||
return new GetMediaPostersResponse(
|
||||
contentType,
|
||||
statusCode,
|
||||
rawResponse,
|
||||
object);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* GetMediaPostersResponseBody
|
||||
*
|
||||
* <p>The available posters for the library item.
|
||||
*/
|
||||
public class GetMediaPostersResponseBody {
|
||||
|
||||
@JsonInclude(Include.NON_ABSENT)
|
||||
@JsonProperty("MediaContainer")
|
||||
private Optional<? extends GetMediaPostersMediaContainer> mediaContainer;
|
||||
|
||||
@JsonCreator
|
||||
public GetMediaPostersResponseBody(
|
||||
@JsonProperty("MediaContainer") Optional<? extends GetMediaPostersMediaContainer> mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = mediaContainer;
|
||||
}
|
||||
|
||||
public GetMediaPostersResponseBody() {
|
||||
this(Optional.empty());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@JsonIgnore
|
||||
public Optional<GetMediaPostersMediaContainer> mediaContainer() {
|
||||
return (Optional<GetMediaPostersMediaContainer>) mediaContainer;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public GetMediaPostersResponseBody withMediaContainer(GetMediaPostersMediaContainer mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = Optional.ofNullable(mediaContainer);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMediaPostersResponseBody withMediaContainer(Optional<? extends GetMediaPostersMediaContainer> mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = mediaContainer;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GetMediaPostersResponseBody other = (GetMediaPostersResponseBody) o;
|
||||
return
|
||||
Objects.deepEquals(this.mediaContainer, other.mediaContainer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
mediaContainer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(GetMediaPostersResponseBody.class,
|
||||
"mediaContainer", mediaContainer);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Optional<? extends GetMediaPostersMediaContainer> mediaContainer = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
public Builder mediaContainer(GetMediaPostersMediaContainer mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = Optional.ofNullable(mediaContainer);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder mediaContainer(Optional<? extends GetMediaPostersMediaContainer> mediaContainer) {
|
||||
Utils.checkNotNull(mediaContainer, "mediaContainer");
|
||||
this.mediaContainer = mediaContainer;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GetMediaPostersResponseBody build() {
|
||||
return new GetMediaPostersResponseBody(
|
||||
mediaContainer);
|
||||
}
|
||||
}
|
||||
}
|
||||
39
src/main/java/dev/plexapi/sdk/models/operations/Hidden.java
Normal file
39
src/main/java/dev/plexapi/sdk/models/operations/Hidden.java
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Hidden
|
||||
*
|
||||
* <p>UNKNOWN
|
||||
*/
|
||||
public enum Hidden {
|
||||
Disable(0),
|
||||
Enable(1);
|
||||
|
||||
@JsonValue
|
||||
private final int value;
|
||||
|
||||
private Hidden(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int value() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static Optional<Hidden> fromValue(int value) {
|
||||
for (Hidden o: Hidden.values()) {
|
||||
if (Objects.deepEquals(o.value, value)) {
|
||||
return Optional.of(o);
|
||||
}
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import dev.plexapi.sdk.utils.SpeakeasyMetadata;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Long;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
public class PostMediaArtsRequest {
|
||||
|
||||
/**
|
||||
* the id of the library item to return the posters of.
|
||||
*/
|
||||
@SpeakeasyMetadata("pathParam:style=simple,explode=false,name=ratingKey")
|
||||
private long ratingKey;
|
||||
|
||||
/**
|
||||
* The URL of the image, if uploading a remote image
|
||||
*/
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=url")
|
||||
private Optional<String> url;
|
||||
|
||||
/**
|
||||
* The contents of the image, if uploading a local file
|
||||
*/
|
||||
@SpeakeasyMetadata("request:mediaType=image/*")
|
||||
private Optional<byte[]> requestBody;
|
||||
|
||||
@JsonCreator
|
||||
public PostMediaArtsRequest(
|
||||
long ratingKey,
|
||||
Optional<String> url,
|
||||
Optional<byte[]> requestBody) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
Utils.checkNotNull(url, "url");
|
||||
Utils.checkNotNull(requestBody, "requestBody");
|
||||
this.ratingKey = ratingKey;
|
||||
this.url = url;
|
||||
this.requestBody = requestBody;
|
||||
}
|
||||
|
||||
public PostMediaArtsRequest(
|
||||
long ratingKey) {
|
||||
this(ratingKey, Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* the id of the library item to return the posters of.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public long ratingKey() {
|
||||
return ratingKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the image, if uploading a remote image
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<String> url() {
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* The contents of the image, if uploading a local file
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<byte[]> requestBody() {
|
||||
return requestBody;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* the id of the library item to return the posters of.
|
||||
*/
|
||||
public PostMediaArtsRequest withRatingKey(long ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the image, if uploading a remote image
|
||||
*/
|
||||
public PostMediaArtsRequest withUrl(String url) {
|
||||
Utils.checkNotNull(url, "url");
|
||||
this.url = Optional.ofNullable(url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the image, if uploading a remote image
|
||||
*/
|
||||
public PostMediaArtsRequest withUrl(Optional<String> url) {
|
||||
Utils.checkNotNull(url, "url");
|
||||
this.url = url;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The contents of the image, if uploading a local file
|
||||
*/
|
||||
public PostMediaArtsRequest withRequestBody(byte[] requestBody) {
|
||||
Utils.checkNotNull(requestBody, "requestBody");
|
||||
this.requestBody = Optional.ofNullable(requestBody);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The contents of the image, if uploading a local file
|
||||
*/
|
||||
public PostMediaArtsRequest withRequestBody(Optional<byte[]> requestBody) {
|
||||
Utils.checkNotNull(requestBody, "requestBody");
|
||||
this.requestBody = requestBody;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
PostMediaArtsRequest other = (PostMediaArtsRequest) o;
|
||||
return
|
||||
Objects.deepEquals(this.ratingKey, other.ratingKey) &&
|
||||
Objects.deepEquals(this.url, other.url) &&
|
||||
Objects.deepEquals(this.requestBody, other.requestBody);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
ratingKey,
|
||||
url,
|
||||
requestBody);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(PostMediaArtsRequest.class,
|
||||
"ratingKey", ratingKey,
|
||||
"url", url,
|
||||
"requestBody", requestBody);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Long ratingKey;
|
||||
|
||||
private Optional<String> url = Optional.empty();
|
||||
|
||||
private Optional<byte[]> requestBody = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* the id of the library item to return the posters of.
|
||||
*/
|
||||
public Builder ratingKey(long ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the image, if uploading a remote image
|
||||
*/
|
||||
public Builder url(String url) {
|
||||
Utils.checkNotNull(url, "url");
|
||||
this.url = Optional.ofNullable(url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the image, if uploading a remote image
|
||||
*/
|
||||
public Builder url(Optional<String> url) {
|
||||
Utils.checkNotNull(url, "url");
|
||||
this.url = url;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The contents of the image, if uploading a local file
|
||||
*/
|
||||
public Builder requestBody(byte[] requestBody) {
|
||||
Utils.checkNotNull(requestBody, "requestBody");
|
||||
this.requestBody = Optional.ofNullable(requestBody);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The contents of the image, if uploading a local file
|
||||
*/
|
||||
public Builder requestBody(Optional<byte[]> requestBody) {
|
||||
Utils.checkNotNull(requestBody, "requestBody");
|
||||
this.requestBody = requestBody;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PostMediaArtsRequest build() {
|
||||
return new PostMediaArtsRequest(
|
||||
ratingKey,
|
||||
url,
|
||||
requestBody);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Exception;
|
||||
import java.lang.Long;
|
||||
import java.lang.String;
|
||||
import java.util.Optional;
|
||||
|
||||
public class PostMediaArtsRequestBuilder {
|
||||
|
||||
private Long ratingKey;
|
||||
private Optional<String> url = Optional.empty();
|
||||
private Optional<byte[]> requestBody = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallPostMediaArts sdk;
|
||||
|
||||
public PostMediaArtsRequestBuilder(SDKMethodInterfaces.MethodCallPostMediaArts sdk) {
|
||||
this.sdk = sdk;
|
||||
}
|
||||
|
||||
public PostMediaArtsRequestBuilder ratingKey(long ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PostMediaArtsRequestBuilder url(String url) {
|
||||
Utils.checkNotNull(url, "url");
|
||||
this.url = Optional.of(url);
|
||||
return this;
|
||||
}
|
||||
|
||||
public PostMediaArtsRequestBuilder url(Optional<String> url) {
|
||||
Utils.checkNotNull(url, "url");
|
||||
this.url = url;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PostMediaArtsRequestBuilder requestBody(byte[] requestBody) {
|
||||
Utils.checkNotNull(requestBody, "requestBody");
|
||||
this.requestBody = Optional.of(requestBody);
|
||||
return this;
|
||||
}
|
||||
|
||||
public PostMediaArtsRequestBuilder requestBody(Optional<byte[]> requestBody) {
|
||||
Utils.checkNotNull(requestBody, "requestBody");
|
||||
this.requestBody = requestBody;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PostMediaArtsResponse call() throws Exception {
|
||||
|
||||
return sdk.postMediaArts(
|
||||
ratingKey,
|
||||
url,
|
||||
requestBody);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import dev.plexapi.sdk.utils.Response;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Objects;
|
||||
|
||||
public class PostMediaArtsResponse implements Response {
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
private String contentType;
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
private int statusCode;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
private HttpResponse<InputStream> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public PostMediaArtsResponse(
|
||||
String contentType,
|
||||
int statusCode,
|
||||
HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(contentType, "contentType");
|
||||
Utils.checkNotNull(statusCode, "statusCode");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.contentType = contentType;
|
||||
this.statusCode = statusCode;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String contentType() {
|
||||
return contentType;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
@JsonIgnore
|
||||
public int statusCode() {
|
||||
return statusCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonIgnore
|
||||
public HttpResponse<InputStream> rawResponse() {
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
public PostMediaArtsResponse withContentType(String contentType) {
|
||||
Utils.checkNotNull(contentType, "contentType");
|
||||
this.contentType = contentType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
public PostMediaArtsResponse withStatusCode(int statusCode) {
|
||||
Utils.checkNotNull(statusCode, "statusCode");
|
||||
this.statusCode = statusCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public PostMediaArtsResponse withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = rawResponse;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
PostMediaArtsResponse other = (PostMediaArtsResponse) o;
|
||||
return
|
||||
Objects.deepEquals(this.contentType, other.contentType) &&
|
||||
Objects.deepEquals(this.statusCode, other.statusCode) &&
|
||||
Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
contentType,
|
||||
statusCode,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(PostMediaArtsResponse.class,
|
||||
"contentType", contentType,
|
||||
"statusCode", statusCode,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private String contentType;
|
||||
|
||||
private Integer statusCode;
|
||||
|
||||
private HttpResponse<InputStream> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
public Builder contentType(String contentType) {
|
||||
Utils.checkNotNull(contentType, "contentType");
|
||||
this.contentType = contentType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
public Builder statusCode(int statusCode) {
|
||||
Utils.checkNotNull(statusCode, "statusCode");
|
||||
this.statusCode = statusCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Builder rawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = rawResponse;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PostMediaArtsResponse build() {
|
||||
return new PostMediaArtsResponse(
|
||||
contentType,
|
||||
statusCode,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import dev.plexapi.sdk.utils.SpeakeasyMetadata;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Long;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
public class PostMediaPosterRequest {
|
||||
|
||||
/**
|
||||
* the id of the library item to return the posters of.
|
||||
*/
|
||||
@SpeakeasyMetadata("pathParam:style=simple,explode=false,name=ratingKey")
|
||||
private long ratingKey;
|
||||
|
||||
/**
|
||||
* The URL of the image, if uploading a remote image
|
||||
*/
|
||||
@SpeakeasyMetadata("queryParam:style=form,explode=true,name=url")
|
||||
private Optional<String> url;
|
||||
|
||||
/**
|
||||
* The contents of the image, if uploading a local file
|
||||
*/
|
||||
@SpeakeasyMetadata("request:mediaType=image/*")
|
||||
private Optional<byte[]> requestBody;
|
||||
|
||||
@JsonCreator
|
||||
public PostMediaPosterRequest(
|
||||
long ratingKey,
|
||||
Optional<String> url,
|
||||
Optional<byte[]> requestBody) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
Utils.checkNotNull(url, "url");
|
||||
Utils.checkNotNull(requestBody, "requestBody");
|
||||
this.ratingKey = ratingKey;
|
||||
this.url = url;
|
||||
this.requestBody = requestBody;
|
||||
}
|
||||
|
||||
public PostMediaPosterRequest(
|
||||
long ratingKey) {
|
||||
this(ratingKey, Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* the id of the library item to return the posters of.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public long ratingKey() {
|
||||
return ratingKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the image, if uploading a remote image
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<String> url() {
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* The contents of the image, if uploading a local file
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Optional<byte[]> requestBody() {
|
||||
return requestBody;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* the id of the library item to return the posters of.
|
||||
*/
|
||||
public PostMediaPosterRequest withRatingKey(long ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the image, if uploading a remote image
|
||||
*/
|
||||
public PostMediaPosterRequest withUrl(String url) {
|
||||
Utils.checkNotNull(url, "url");
|
||||
this.url = Optional.ofNullable(url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the image, if uploading a remote image
|
||||
*/
|
||||
public PostMediaPosterRequest withUrl(Optional<String> url) {
|
||||
Utils.checkNotNull(url, "url");
|
||||
this.url = url;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The contents of the image, if uploading a local file
|
||||
*/
|
||||
public PostMediaPosterRequest withRequestBody(byte[] requestBody) {
|
||||
Utils.checkNotNull(requestBody, "requestBody");
|
||||
this.requestBody = Optional.ofNullable(requestBody);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The contents of the image, if uploading a local file
|
||||
*/
|
||||
public PostMediaPosterRequest withRequestBody(Optional<byte[]> requestBody) {
|
||||
Utils.checkNotNull(requestBody, "requestBody");
|
||||
this.requestBody = requestBody;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
PostMediaPosterRequest other = (PostMediaPosterRequest) o;
|
||||
return
|
||||
Objects.deepEquals(this.ratingKey, other.ratingKey) &&
|
||||
Objects.deepEquals(this.url, other.url) &&
|
||||
Objects.deepEquals(this.requestBody, other.requestBody);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
ratingKey,
|
||||
url,
|
||||
requestBody);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(PostMediaPosterRequest.class,
|
||||
"ratingKey", ratingKey,
|
||||
"url", url,
|
||||
"requestBody", requestBody);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private Long ratingKey;
|
||||
|
||||
private Optional<String> url = Optional.empty();
|
||||
|
||||
private Optional<byte[]> requestBody = Optional.empty();
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* the id of the library item to return the posters of.
|
||||
*/
|
||||
public Builder ratingKey(long ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the image, if uploading a remote image
|
||||
*/
|
||||
public Builder url(String url) {
|
||||
Utils.checkNotNull(url, "url");
|
||||
this.url = Optional.ofNullable(url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL of the image, if uploading a remote image
|
||||
*/
|
||||
public Builder url(Optional<String> url) {
|
||||
Utils.checkNotNull(url, "url");
|
||||
this.url = url;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The contents of the image, if uploading a local file
|
||||
*/
|
||||
public Builder requestBody(byte[] requestBody) {
|
||||
Utils.checkNotNull(requestBody, "requestBody");
|
||||
this.requestBody = Optional.ofNullable(requestBody);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The contents of the image, if uploading a local file
|
||||
*/
|
||||
public Builder requestBody(Optional<byte[]> requestBody) {
|
||||
Utils.checkNotNull(requestBody, "requestBody");
|
||||
this.requestBody = requestBody;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PostMediaPosterRequest build() {
|
||||
return new PostMediaPosterRequest(
|
||||
ratingKey,
|
||||
url,
|
||||
requestBody);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.lang.Exception;
|
||||
import java.lang.Long;
|
||||
import java.lang.String;
|
||||
import java.util.Optional;
|
||||
|
||||
public class PostMediaPosterRequestBuilder {
|
||||
|
||||
private Long ratingKey;
|
||||
private Optional<String> url = Optional.empty();
|
||||
private Optional<byte[]> requestBody = Optional.empty();
|
||||
private final SDKMethodInterfaces.MethodCallPostMediaPoster sdk;
|
||||
|
||||
public PostMediaPosterRequestBuilder(SDKMethodInterfaces.MethodCallPostMediaPoster sdk) {
|
||||
this.sdk = sdk;
|
||||
}
|
||||
|
||||
public PostMediaPosterRequestBuilder ratingKey(long ratingKey) {
|
||||
Utils.checkNotNull(ratingKey, "ratingKey");
|
||||
this.ratingKey = ratingKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PostMediaPosterRequestBuilder url(String url) {
|
||||
Utils.checkNotNull(url, "url");
|
||||
this.url = Optional.of(url);
|
||||
return this;
|
||||
}
|
||||
|
||||
public PostMediaPosterRequestBuilder url(Optional<String> url) {
|
||||
Utils.checkNotNull(url, "url");
|
||||
this.url = url;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PostMediaPosterRequestBuilder requestBody(byte[] requestBody) {
|
||||
Utils.checkNotNull(requestBody, "requestBody");
|
||||
this.requestBody = Optional.of(requestBody);
|
||||
return this;
|
||||
}
|
||||
|
||||
public PostMediaPosterRequestBuilder requestBody(Optional<byte[]> requestBody) {
|
||||
Utils.checkNotNull(requestBody, "requestBody");
|
||||
this.requestBody = requestBody;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PostMediaPosterResponse call() throws Exception {
|
||||
|
||||
return sdk.postMediaPoster(
|
||||
ratingKey,
|
||||
url,
|
||||
requestBody);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import dev.plexapi.sdk.utils.Response;
|
||||
import dev.plexapi.sdk.utils.Utils;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.Objects;
|
||||
|
||||
public class PostMediaPosterResponse implements Response {
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
private String contentType;
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
private int statusCode;
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
private HttpResponse<InputStream> rawResponse;
|
||||
|
||||
@JsonCreator
|
||||
public PostMediaPosterResponse(
|
||||
String contentType,
|
||||
int statusCode,
|
||||
HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(contentType, "contentType");
|
||||
Utils.checkNotNull(statusCode, "statusCode");
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.contentType = contentType;
|
||||
this.statusCode = statusCode;
|
||||
this.rawResponse = rawResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String contentType() {
|
||||
return contentType;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
@JsonIgnore
|
||||
public int statusCode() {
|
||||
return statusCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
@JsonIgnore
|
||||
public HttpResponse<InputStream> rawResponse() {
|
||||
return rawResponse;
|
||||
}
|
||||
|
||||
public final static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
public PostMediaPosterResponse withContentType(String contentType) {
|
||||
Utils.checkNotNull(contentType, "contentType");
|
||||
this.contentType = contentType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
public PostMediaPosterResponse withStatusCode(int statusCode) {
|
||||
Utils.checkNotNull(statusCode, "statusCode");
|
||||
this.statusCode = statusCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public PostMediaPosterResponse withRawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = rawResponse;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
PostMediaPosterResponse other = (PostMediaPosterResponse) o;
|
||||
return
|
||||
Objects.deepEquals(this.contentType, other.contentType) &&
|
||||
Objects.deepEquals(this.statusCode, other.statusCode) &&
|
||||
Objects.deepEquals(this.rawResponse, other.rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
contentType,
|
||||
statusCode,
|
||||
rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toString(PostMediaPosterResponse.class,
|
||||
"contentType", contentType,
|
||||
"statusCode", statusCode,
|
||||
"rawResponse", rawResponse);
|
||||
}
|
||||
|
||||
public final static class Builder {
|
||||
|
||||
private String contentType;
|
||||
|
||||
private Integer statusCode;
|
||||
|
||||
private HttpResponse<InputStream> rawResponse;
|
||||
|
||||
private Builder() {
|
||||
// force use of static builder() method
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response content type for this operation
|
||||
*/
|
||||
public Builder contentType(String contentType) {
|
||||
Utils.checkNotNull(contentType, "contentType");
|
||||
this.contentType = contentType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP response status code for this operation
|
||||
*/
|
||||
public Builder statusCode(int statusCode) {
|
||||
Utils.checkNotNull(statusCode, "statusCode");
|
||||
this.statusCode = statusCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
public Builder rawResponse(HttpResponse<InputStream> rawResponse) {
|
||||
Utils.checkNotNull(rawResponse, "rawResponse");
|
||||
this.rawResponse = rawResponse;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PostMediaPosterResponse build() {
|
||||
return new PostMediaPosterResponse(
|
||||
contentType,
|
||||
statusCode,
|
||||
rawResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -270,6 +270,30 @@ public class SDKMethodInterfaces {
|
||||
GetMediaMetaDataRequest request) throws Exception;
|
||||
}
|
||||
|
||||
public interface MethodCallGetMediaArts {
|
||||
GetMediaArtsResponse getMediaArts(
|
||||
long ratingKey) throws Exception;
|
||||
}
|
||||
|
||||
public interface MethodCallPostMediaArts {
|
||||
PostMediaArtsResponse postMediaArts(
|
||||
long ratingKey,
|
||||
Optional<String> url,
|
||||
Optional<byte[]> requestBody) throws Exception;
|
||||
}
|
||||
|
||||
public interface MethodCallGetMediaPosters {
|
||||
GetMediaPostersResponse getMediaPosters(
|
||||
long ratingKey) throws Exception;
|
||||
}
|
||||
|
||||
public interface MethodCallPostMediaPoster {
|
||||
PostMediaPosterResponse postMediaPoster(
|
||||
long ratingKey,
|
||||
Optional<String> url,
|
||||
Optional<byte[]> requestBody) throws Exception;
|
||||
}
|
||||
|
||||
public interface MethodCallGetMetadataChildren {
|
||||
GetMetadataChildrenResponse getMetadataChildren(
|
||||
double ratingKey,
|
||||
|
||||
10
src/main/java/dev/plexapi/sdk/utils/Constants.java
Normal file
10
src/main/java/dev/plexapi/sdk/utils/Constants.java
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
package dev.plexapi.sdk.utils;
|
||||
|
||||
public final class Constants {
|
||||
|
||||
public static final boolean HAS_CLIENT_CREDENTIALS_BASIC = false;
|
||||
|
||||
}
|
||||
@@ -7,8 +7,14 @@ import java.lang.reflect.Field;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Arrays;
|
||||
import java.util.Base64;
|
||||
import java.util.Deque;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public final class Security {
|
||||
@@ -187,6 +193,58 @@ public final class Security {
|
||||
.getBytes(StandardCharsets.UTF_8)));
|
||||
}
|
||||
|
||||
public static Optional<Object> findComplexObjectWithNonEmptyAnnotatedField(Object object, String... regexes) {
|
||||
if (object == null || object instanceof String) {
|
||||
return Optional.empty();
|
||||
}
|
||||
Deque<Object> stack = new LinkedList<>();
|
||||
// be defensive about circular references (not expected)
|
||||
Set<Object> processed = new HashSet<>();
|
||||
stack.push(object);
|
||||
processed.add(object);
|
||||
while (!stack.isEmpty()) {
|
||||
Object o = stack.pop();
|
||||
Field[] fields = o.getClass().getDeclaredFields();
|
||||
List<Field> annotatedFields = Arrays.stream(fields) //
|
||||
.filter(f -> {
|
||||
SpeakeasyMetadata[] anns = f.getDeclaredAnnotationsByType(SpeakeasyMetadata.class);
|
||||
return anns != null && anns.length > 0;
|
||||
}) //
|
||||
.collect(Collectors.toList());
|
||||
for (Field f : annotatedFields) {
|
||||
SpeakeasyMetadata[] anns = f.getDeclaredAnnotationsByType(SpeakeasyMetadata.class);
|
||||
Object value = getUnwrappedFieldValue(o, f);
|
||||
if (value != null && !(value instanceof String)) {
|
||||
// we are looking for a complex object (so can't be a String)
|
||||
boolean regexMatches = Arrays //
|
||||
.stream(regexes) //
|
||||
.allMatch(regex -> matches(anns, regex));
|
||||
if (regexMatches) {
|
||||
return Optional.of(value);
|
||||
} else if (!processed.contains(value)) {
|
||||
stack.push(value);
|
||||
processed.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
private static Object getUnwrappedFieldValue(Object o, Field f) {
|
||||
try {
|
||||
f.setAccessible(true);
|
||||
Object value = f.get(o);
|
||||
if (value != null && value instanceof Optional) {
|
||||
return ((Optional<?>) value).orElse(null);
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
} catch (IllegalArgumentException | IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Stream<Field> findFieldsWhereMetadataContainsRegexes(Object o, String... regexes) {
|
||||
Field[] fields = o.getClass().getDeclaredFields();
|
||||
return Arrays.stream(fields) //
|
||||
|
||||
@@ -158,8 +158,8 @@ public final class SessionManager<T extends SessionManager.HasSessionKey> {
|
||||
if (!t.tokenType.orElse("").equals("Bearer")) {
|
||||
throw new AuthException("Expected 'Bearer' token type but was '" + t.tokenType.orElse("") + "'");
|
||||
}
|
||||
final Optional<OffsetDateTime> expiresAt = t.expiresInMs
|
||||
.map(x -> OffsetDateTime.now().plus(x, ChronoUnit.MILLIS));
|
||||
final Optional<OffsetDateTime> expiresAt = t.expiresInSeconds
|
||||
.map(x -> OffsetDateTime.now().plus(x, ChronoUnit.SECONDS));
|
||||
return new Session<T>(credentials, t.accessToken, scopes, expiresAt);
|
||||
} catch (IOException | IllegalArgumentException | IllegalAccessException | InterruptedException | URISyntaxException e) {
|
||||
throw new RuntimeException(e);
|
||||
@@ -175,7 +175,7 @@ public final class SessionManager<T extends SessionManager.HasSessionKey> {
|
||||
Optional<String> tokenType;
|
||||
|
||||
@JsonProperty("expires_in")
|
||||
Optional<Long> expiresInMs;
|
||||
Optional<Long> expiresInSeconds;;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user