diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 2af60a63..47ceb9f0 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 1732900d-e173-47c1-a90d-d45182eb35d9 management: - docChecksum: f12b653820ae77ca3b2820bc9459d866 + docChecksum: 1ee2e5413af07e886e33659b9b269dd5 docVersion: 0.0.3 - speakeasyVersion: 1.405.6 - generationVersion: 2.428.1 - releaseVersion: 0.7.0 - configChecksum: 778e40a6f6ea35580b5da4c033f0b08f + speakeasyVersion: 1.406.0 + generationVersion: 2.429.0 + releaseVersion: 0.8.0 + configChecksum: c0c94b0c04fc6858e1ced149989e0cf6 repoURL: https://github.com/LukeHagar/plexjava.git published: true features: @@ -27,6 +27,7 @@ features: methodServerURLs: 2.82.1 nameOverrides: 2.81.3 nullables: 0.1.0 + retries: 0.1.1 sdkHooks: 0.1.0 generatedFiles: - .gitattributes @@ -176,6 +177,10 @@ generatedFiles: - docs/models/errors/GetResourcesStatisticsErrors.md - docs/models/errors/GetResourcesStatisticsStatisticsErrors.md - docs/models/errors/GetResourcesStatisticsUnauthorized.md + - docs/models/errors/GetSearchAllLibrariesBadRequest.md + - docs/models/errors/GetSearchAllLibrariesErrors.md + - docs/models/errors/GetSearchAllLibrariesLibraryErrors.md + - docs/models/errors/GetSearchAllLibrariesUnauthorized.md - docs/models/errors/GetSearchLibraryBadRequest.md - docs/models/errors/GetSearchLibraryErrors.md - docs/models/errors/GetSearchLibraryLibraryErrors.md @@ -368,7 +373,6 @@ generatedFiles: - docs/models/operations/Download.md - docs/models/operations/EnablePaperTrailResponse.md - docs/models/operations/Feature.md - - docs/models/operations/Features.md - docs/models/operations/Field.md - docs/models/operations/FieldType.md - docs/models/operations/Filter.md @@ -378,6 +382,7 @@ generatedFiles: - docs/models/operations/Genre.md - docs/models/operations/GeoData.md - docs/models/operations/GetAllLibrariesDirectory.md + - docs/models/operations/GetAllLibrariesLocation.md - docs/models/operations/GetAllLibrariesMediaContainer.md - docs/models/operations/GetAllLibrariesResponse.md - docs/models/operations/GetAllLibrariesResponseBody.md @@ -455,6 +460,7 @@ generatedFiles: - docs/models/operations/GetLibraryItemsLibraryResponseType.md - docs/models/operations/GetLibraryItemsLibrarySort.md - docs/models/operations/GetLibraryItemsLibraryType.md + - docs/models/operations/GetLibraryItemsLocation.md - docs/models/operations/GetLibraryItemsMedia.md - docs/models/operations/GetLibraryItemsMediaContainer.md - docs/models/operations/GetLibraryItemsMediaGuid.md @@ -574,6 +580,31 @@ generatedFiles: - docs/models/operations/GetResourcesStatisticsRequest.md - docs/models/operations/GetResourcesStatisticsResponse.md - docs/models/operations/GetResourcesStatisticsResponseBody.md + - docs/models/operations/GetSearchAllLibrariesCollection.md + - docs/models/operations/GetSearchAllLibrariesCountry.md + - docs/models/operations/GetSearchAllLibrariesDirector.md + - docs/models/operations/GetSearchAllLibrariesFlattenSeasons.md + - docs/models/operations/GetSearchAllLibrariesGenre.md + - docs/models/operations/GetSearchAllLibrariesHasThumbnail.md + - docs/models/operations/GetSearchAllLibrariesImage.md + - docs/models/operations/GetSearchAllLibrariesLibraryType.md + - docs/models/operations/GetSearchAllLibrariesLocation.md + - docs/models/operations/GetSearchAllLibrariesMedia.md + - docs/models/operations/GetSearchAllLibrariesMediaContainer.md + - docs/models/operations/GetSearchAllLibrariesMediaGuid.md + - docs/models/operations/GetSearchAllLibrariesMetaDataRating.md + - docs/models/operations/GetSearchAllLibrariesMetadata.md + - docs/models/operations/GetSearchAllLibrariesOptimizedForStreaming.md + - docs/models/operations/GetSearchAllLibrariesPart.md + - docs/models/operations/GetSearchAllLibrariesRequest.md + - docs/models/operations/GetSearchAllLibrariesResponse.md + - docs/models/operations/GetSearchAllLibrariesResponseBody.md + - docs/models/operations/GetSearchAllLibrariesRole.md + - docs/models/operations/GetSearchAllLibrariesShowOrdering.md + - docs/models/operations/GetSearchAllLibrariesStream.md + - docs/models/operations/GetSearchAllLibrariesType.md + - docs/models/operations/GetSearchAllLibrariesUltraBlurColors.md + - docs/models/operations/GetSearchAllLibrariesWriter.md - docs/models/operations/GetSearchLibraryMediaContainer.md - docs/models/operations/GetSearchLibraryMetadata.md - docs/models/operations/GetSearchLibraryQueryParamType.md @@ -639,7 +670,6 @@ generatedFiles: - docs/models/operations/GetTokenByPinIdResponse.md - docs/models/operations/GetTokenDetailsAuthenticationResponseStatus.md - docs/models/operations/GetTokenDetailsAuthenticationStatus.md - - docs/models/operations/GetTokenDetailsFeatures.md - docs/models/operations/GetTokenDetailsResponse.md - docs/models/operations/GetTokenDetailsStatus.md - docs/models/operations/GetTokenDetailsSubscription.md @@ -715,14 +745,12 @@ generatedFiles: - docs/models/operations/Player.md - docs/models/operations/PlaylistType.md - docs/models/operations/PlexDevice.md - - docs/models/operations/PostUsersSignInDataAuthenticationFeatures.md - docs/models/operations/PostUsersSignInDataAuthenticationResponseStatus.md - docs/models/operations/PostUsersSignInDataAuthenticationStatus.md - docs/models/operations/PostUsersSignInDataAuthenticationSubscription.md - docs/models/operations/PostUsersSignInDataAutoSelectSubtitle.md - docs/models/operations/PostUsersSignInDataDefaultSubtitleAccessibility.md - docs/models/operations/PostUsersSignInDataDefaultSubtitleForced.md - - docs/models/operations/PostUsersSignInDataFeatures.md - docs/models/operations/PostUsersSignInDataMailingListStatus.md - docs/models/operations/PostUsersSignInDataMediaReviewsVisibility.md - docs/models/operations/PostUsersSignInDataRequest.md @@ -740,6 +768,8 @@ generatedFiles: - docs/models/operations/Provider.md - docs/models/operations/QueryParamFilter.md - docs/models/operations/QueryParamForce.md + - docs/models/operations/QueryParamIncludeCollections.md + - docs/models/operations/QueryParamIncludeExternalMedia.md - docs/models/operations/QueryParamIncludeMeta.md - docs/models/operations/QueryParamOnlyTransient.md - docs/models/operations/QueryParamSmart.md @@ -749,6 +779,8 @@ generatedFiles: - docs/models/operations/ResponseBody.md - docs/models/operations/Role.md - docs/models/operations/Scope.md + - docs/models/operations/SearchResult.md + - docs/models/operations/SearchTypes.md - docs/models/operations/Server.md - docs/models/operations/Services.md - docs/models/operations/Session.md @@ -980,6 +1012,10 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsErrors.java - src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsStatisticsErrors.java - src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesErrors.java + - src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesLibraryErrors.java + - src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesUnauthorized.java - src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryBadRequest.java - src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryErrors.java - src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryLibraryErrors.java @@ -1182,7 +1218,6 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/models/operations/EnablePaperTrailRequestBuilder.java - src/main/java/dev/plexapi/sdk/models/operations/EnablePaperTrailResponse.java - src/main/java/dev/plexapi/sdk/models/operations/Feature.java - - src/main/java/dev/plexapi/sdk/models/operations/Features.java - src/main/java/dev/plexapi/sdk/models/operations/Field.java - src/main/java/dev/plexapi/sdk/models/operations/FieldType.java - src/main/java/dev/plexapi/sdk/models/operations/Filter.java @@ -1192,6 +1227,7 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/models/operations/Genre.java - src/main/java/dev/plexapi/sdk/models/operations/GeoData.java - src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesDirectory.java + - src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesLocation.java - src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesMediaContainer.java - src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesRequestBuilder.java - src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesResponse.java @@ -1282,6 +1318,7 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryResponseType.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibrarySort.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryType.java + - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLocation.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMedia.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMediaContainer.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMediaGuid.java @@ -1416,6 +1453,32 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsRequestBuilder.java - src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsResponse.java - src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsResponseBody.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesCollection.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesCountry.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesDirector.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesFlattenSeasons.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesGenre.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesHasThumbnail.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesImage.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLibraryType.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLocation.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMedia.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMediaContainer.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMediaGuid.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMetaDataRating.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMetadata.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreaming.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesPart.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequest.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesResponseBody.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRole.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesShowOrdering.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesStream.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesType.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesUltraBlurColors.java + - src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesWriter.java - src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryMediaContainer.java - src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryMetadata.java - src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryQueryParamType.java @@ -1496,7 +1559,6 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdResponse.java - src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsAuthenticationResponseStatus.java - src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsAuthenticationStatus.java - - src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsFeatures.java - src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsRequestBuilder.java - src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsResponse.java - src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsStatus.java @@ -1585,14 +1647,12 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/models/operations/Player.java - src/main/java/dev/plexapi/sdk/models/operations/PlaylistType.java - src/main/java/dev/plexapi/sdk/models/operations/PlexDevice.java - - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationFeatures.java - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationResponseStatus.java - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationStatus.java - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationSubscription.java - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAutoSelectSubtitle.java - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleAccessibility.java - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleForced.java - - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataFeatures.java - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMailingListStatus.java - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMediaReviewsVisibility.java - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequest.java @@ -1611,6 +1671,8 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/models/operations/Provider.java - src/main/java/dev/plexapi/sdk/models/operations/QueryParamFilter.java - src/main/java/dev/plexapi/sdk/models/operations/QueryParamForce.java + - src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeCollections.java + - src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeExternalMedia.java - src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeMeta.java - src/main/java/dev/plexapi/sdk/models/operations/QueryParamOnlyTransient.java - src/main/java/dev/plexapi/sdk/models/operations/QueryParamSmart.java @@ -1621,6 +1683,8 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/models/operations/Role.java - src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java - src/main/java/dev/plexapi/sdk/models/operations/Scope.java + - src/main/java/dev/plexapi/sdk/models/operations/SearchResult.java + - src/main/java/dev/plexapi/sdk/models/operations/SearchTypes.java - src/main/java/dev/plexapi/sdk/models/operations/Server.java - src/main/java/dev/plexapi/sdk/models/operations/Services.java - src/main/java/dev/plexapi/sdk/models/operations/Session.java @@ -1786,6 +1850,8 @@ examples: parameters: query: X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" + header: + X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" responses: "401": application/json: {"errors": []} @@ -1845,6 +1911,8 @@ examples: minSize: 1 upscale: 1 X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" + header: + X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" responses: "401": application/json: {"errors": []} @@ -1862,6 +1930,8 @@ examples: minSize: 1 upscale: 1 X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" + header: + X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" responses: "401": application/json: {"errors": []} @@ -2025,6 +2095,21 @@ examples: application/json: [] "400": application/json: {"errors": []} + "": + parameters: + query: + includeHttps: 1 + includeRelay: 1 + includeIPv6: 1 + header: + X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58" + responses: + "200": + application/json: [] + "400": + application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} + "401": + application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} getPin: "": parameters: @@ -2034,6 +2119,12 @@ examples: X-Plex-Version: "4.133.0" X-Plex-Platform: "Chrome" X-Plex-Client-Identifier: "gcgzw5rz2xovp84b4vha3a40" + header: + X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58" + X-Plex-Product: "Plex for Roku" + X-Plex-Device: "Roku 3" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" responses: "200": application/json: {"id": 308667304, "code": "7RQZ", "product": "0", "trusted": false, "qr": "https://plex.tv/api/v2/pins/qr/7RQZ", "clientIdentifier": "string", "location": {"code": "VI", "continent_code": "NA", "country": "United States Virgin Islands", "city": "Amsterdam", "european_union_member": true, "time_zone": "America/St_Thomas", "postal_code": 802, "in_privacy_restricted_country": true, "in_privacy_restricted_region": true, "subdivisions": "Saint Thomas", "coordinates": "18.3381, -64.8941"}, "expiresIn": 876, "createdAt": "2024-07-16T17:03:05Z", "expiresAt": "2024-07-16T17:18:05Z", "authToken": null, "newRegistration": null} @@ -2052,6 +2143,12 @@ examples: X-Plex-Device: "Linux" X-Plex-Version: "4.133.0" X-Plex-Platform: "Chrome" + header: + X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58" + X-Plex-Product: "Plex for Roku" + X-Plex-Device: "Roku 3" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" responses: "200": application/json: {"id": 308667304, "code": "7RQZ", "product": "0", "trusted": false, "qr": "https://plex.tv/api/v2/pins/qr/7RQZ", "clientIdentifier": "string", "location": {"code": "VI", "continent_code": "NA", "country": "United States Virgin Islands", "city": "Amsterdam", "european_union_member": true, "time_zone": "America/St_Thomas", "postal_code": 802, "in_privacy_restricted_country": true, "in_privacy_restricted_region": true, "subdivisions": "Saint Thomas", "coordinates": "18.3381, -64.8941"}, "expiresIn": 876, "createdAt": "2024-07-16T17:03:05Z", "expiresAt": "2024-07-16T17:18:05Z", "authToken": null, "newRegistration": null} @@ -2202,7 +2299,7 @@ examples: X-Plex-Container-Size: 50 responses: "200": - application/json: {"MediaContainer": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}], "size": 70, "totalSize": 170, "offset": 0, "content": "secondary", "allowSync": true, "nocache": true, "art": "/:/resources/movie-fanart.jpg", "identifier": "com.plexapp.plugins.library", "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionUUID": "322a231a-b7f7-49f5-920f-14c61199cd30", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1701731894, "thumb": "/:/resources/movie.png", "title1": "Movies", "title2": "Recently Released", "viewGroup": "movie", "viewMode": 65592, "mixedParents": true, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}, {"tag": "Adventure"}, {"tag": "Adventure"}], "Country": [{"tag": "United States of America"}, {"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Guid": [{"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}, {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [], "Country": [{"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Guid": [{"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}], "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [], "Sort": [], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}]}}} + application/json: {"MediaContainer": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}], "size": 70, "totalSize": 170, "offset": 0, "content": "secondary", "allowSync": true, "nocache": true, "art": "/:/resources/movie-fanart.jpg", "identifier": "com.plexapp.plugins.library", "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionUUID": "322a231a-b7f7-49f5-920f-14c61199cd30", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1701731894, "thumb": "/:/resources/movie.png", "title1": "Movies", "title2": "Recently Released", "viewGroup": "movie", "viewMode": 65592, "mixedParents": true, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}, {"tag": "Adventure"}, {"tag": "Adventure"}], "Country": [{"tag": "United States of America"}, {"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}, {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [], "Country": [{"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}], "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [], "Sort": [], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}]}}} "400": application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": @@ -2316,6 +2413,8 @@ examples: X-Plex-Container-Start: 0 X-Plex-Container-Size: 50 X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" + header: + X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" responses: "401": application/json: {"errors": []} @@ -2508,6 +2607,12 @@ examples: X-Plex-Device: "Linux" X-Plex-Version: "4.133.0" X-Plex-Platform: "Chrome" + header: + X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58" + X-Plex-Product: "Plex for Roku" + X-Plex-Device: "Roku 3" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" requestBody: application/x-www-form-urlencoded: {"login": "username@email.com", "password": "password123", "verificationCode": "123456"} responses: @@ -2710,7 +2815,7 @@ examples: X-Plex-Container-Size: 50 responses: "200": - application/json: {"MediaContainer": {"size": 50, "identifier": "com.plexapp.plugins.library", "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}]}, {"type": "tag", "Operator": []}, {"type": "tag", "Operator": []}]}, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": []}]}], "Genre": [{"tag": "Adventure"}], "Country": [], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [], "Collection": [], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}]}} + application/json: {"MediaContainer": {"size": 50, "identifier": "com.plexapp.plugins.library", "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}]}, {"type": "tag", "Operator": []}, {"type": "tag", "Operator": []}]}, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": []}]}], "Genre": [{"tag": "Adventure"}], "Country": [], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [], "Collection": [], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}]}} get-recently-added-library: speakeasy-default-get-recently-added-library: parameters: @@ -2729,3 +2834,20 @@ examples: application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}]} + get-search-all-libraries: + "": + parameters: + query: + query: "" + searchTypes: ["people"] + includeCollections: 1 + includeExternalMedia: 1 + header: + X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58" + responses: + "200": + application/json: {"MediaContainer": {"size": "9266.90", "SearchResult": [{"score": "2698.71", "Metadata": {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}, {"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}, {"tag": "Adventure"}, {"tag": "Adventure"}], "Country": [{"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}], "Writer": [], "Collection": [{"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}}, {"score": "9681.40", "Metadata": {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [], "Genre": [], "Country": [], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}], "Guid": [], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}}, {"score": "1665.12", "Metadata": {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}, {"tag": "Adventure"}], "Country": [{"tag": "United States of America"}, {"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}}]}} + "400": + application/json: {"errors": []} + "401": + application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 96325611..a0b0ee84 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true java: - version: 0.7.0 + version: 0.8.0 additionalDependencies: [] additionalPlugins: [] artifactID: plexapi diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 50f5c169..144a51e5 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.405.6 +speakeasyVersion: 1.406.0 sources: my-source: sourceNamespace: my-source @@ -8,8 +8,8 @@ sources: - latest plexapi: sourceNamespace: plexapi - sourceRevisionDigest: sha256:b377f79289070406b0d4adcf59fa6886c6c90cb13a7893c07b44cae956ee25e4 - sourceBlobDigest: sha256:92072097f693005146db1ceb5728eee08693d61bb5578b26c32dcbe1cc32927f + sourceRevisionDigest: sha256:c6ab8f13847c7cdc4ab3752f517164d7da08266726255aa0d614b1eaea66fb0e + sourceBlobDigest: sha256:64c7694915a0828aeb256d10d2fa0ea477681785b818916b6681be8cc5ffb93b tags: - latest - main @@ -17,10 +17,10 @@ targets: plexjava: source: plexapi sourceNamespace: plexapi - sourceRevisionDigest: sha256:b377f79289070406b0d4adcf59fa6886c6c90cb13a7893c07b44cae956ee25e4 - sourceBlobDigest: sha256:92072097f693005146db1ceb5728eee08693d61bb5578b26c32dcbe1cc32927f + sourceRevisionDigest: sha256:c6ab8f13847c7cdc4ab3752f517164d7da08266726255aa0d614b1eaea66fb0e + sourceBlobDigest: sha256:64c7694915a0828aeb256d10d2fa0ea477681785b818916b6681be8cc5ffb93b codeSamplesNamespace: code-samples-java-plexjava - codeSamplesRevisionDigest: sha256:ad2e918f9c50ecf860a405c94410f64a3ad90197c672258c177fd2e9d1f3d9a6 + codeSamplesRevisionDigest: sha256:46ccc091bbcaf0f056953e6349cd4c115250f9fc4359e7a23f6364979e2be555 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index ce4b6a5a..36115ff3 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ The following SDKs are generated from the OpenAPI Specification. They are automa * [SDK Installation](#sdk-installation) * [SDK Example Usage](#sdk-example-usage) * [Available Resources and Operations](#available-resources-and-operations) -* [Global Parameters](#global-parameters) +* [Retries](#retries) * [Error Handling](#error-handling) * [Server Selection](#server-selection) * [Authentication](#authentication) @@ -62,7 +62,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'dev.plexapi:plexapi:0.7.0' +implementation 'dev.plexapi:plexapi:0.8.0' ``` Maven: @@ -70,7 +70,7 @@ Maven: dev.plexapi plexapi - 0.7.0 + 0.8.0 ``` @@ -109,11 +109,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() @@ -169,6 +169,7 @@ public class Application { * [getLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items * [getRefreshLibraryMetadata](docs/sdks/library/README.md#getrefreshlibrarymetadata) - Refresh Metadata Of The Library * [getSearchLibrary](docs/sdks/library/README.md#getsearchlibrary) - Search Library +* [getSearchAllLibraries](docs/sdks/library/README.md#getsearchalllibraries) - Search All Libraries * [getMetaDataByRatingKey](docs/sdks/library/README.md#getmetadatabyratingkey) - Get Metadata by RatingKey * [getMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children * [getTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content @@ -260,68 +261,103 @@ public class Application { - -## Global Parameters + +## Retries -Certain parameters are configured globally. These parameters may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, These global values will be used as defaults on the operations that use them. When such operations are called, there is a place in each to override the global value, if needed. - -For example, you can set `ClientID` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getServerResources`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration. - - -### Available Globals - -The following global parameters are available. - -| Name | Type | Required | Description | -| ---- | ---- |:--------:| ----------- | -| clientID | java.lang.String | | The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) | -| clientName | java.lang.String | | The clientName parameter. | -| clientVersion | java.lang.String | | The clientVersion parameter. | -| clientPlatform | java.lang.String | | The clientPlatform parameter. | -| deviceName | java.lang.String | | The deviceName parameter. | - - -### Example +Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK. +To change the default retry strategy for a single API call, you can provide a `RetryConfig` object through the `retryConfig` builder method: ```java package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.GetServerResourcesBadRequest; -import dev.plexapi.sdk.models.errors.GetServerResourcesUnauthorized; -import dev.plexapi.sdk.models.operations.GetServerResourcesResponse; -import dev.plexapi.sdk.models.operations.IncludeHttps; -import dev.plexapi.sdk.models.operations.IncludeIPv6; -import dev.plexapi.sdk.models.operations.IncludeRelay; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized; +import dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponse; +import dev.plexapi.sdk.utils.BackoffStrategy; +import dev.plexapi.sdk.utils.RetryConfig; import java.lang.Exception; +import java.util.concurrent.TimeUnit; public class Application { - public static void main(String[] args) throws GetServerResourcesBadRequest, GetServerResourcesUnauthorized, Exception { + public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); - GetServerResourcesResponse res = sdk.plex().getServerResources() - .includeHttps(IncludeHttps.Enable) - .includeRelay(IncludeRelay.Enable) - .includeIPv6(IncludeIPv6.Enable) - .clientID("gcgzw5rz2xovp84b4vha3a40") + GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() + .retryConfig(RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(1L, TimeUnit.MILLISECONDS) + .maxInterval(50L, TimeUnit.MILLISECONDS) + .maxElapsedTime(1000L, TimeUnit.MILLISECONDS) + .baseFactor(1.1) + .jitterFactor(0.15) + .retryConnectError(false) + .build()) + .build()) .call(); - if (res.plexDevices().isPresent()) { + if (res.object().isPresent()) { // handle response } } } ``` - + +If you'd like to override the default retry strategy for all operations that support retries, you can provide a configuration at SDK initialization: +```java +package hello.world; + +import dev.plexapi.sdk.PlexAPI; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized; +import dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponse; +import dev.plexapi.sdk.utils.BackoffStrategy; +import dev.plexapi.sdk.utils.RetryConfig; +import java.lang.Exception; +import java.util.concurrent.TimeUnit; + +public class Application { + + public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() + .retryConfig(RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(1L, TimeUnit.MILLISECONDS) + .maxInterval(50L, TimeUnit.MILLISECONDS) + .maxElapsedTime(1000L, TimeUnit.MILLISECONDS) + .baseFactor(1.1) + .jitterFactor(0.15) + .retryConnectError(false) + .build()) + .build()) + .accessToken("") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") + .build(); + + GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() + .call(); + + if (res.object().isPresent()) { + // handle response + } + } +} +``` + ## Error Handling @@ -353,11 +389,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() @@ -400,11 +436,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .serverIndex(0) .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() @@ -443,11 +479,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .serverURL("{protocol}://{ip}:{port}") .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() @@ -478,11 +514,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetCompanionsDataResponse res = sdk.plex().getCompanionsData() @@ -524,11 +560,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() diff --git a/RELEASES.md b/RELEASES.md index 6bbc57d0..576699a1 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -138,4 +138,14 @@ Based on: ### Generated - [java v0.7.0] . ### Releases -- [Maven Central v0.7.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.7.0 - . \ No newline at end of file +- [Maven Central v0.7.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.7.0 - . + +## 2024-10-03 00:26:50 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.406.0 (2.429.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v0.8.0] . +### Releases +- [Maven Central v0.8.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.8.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 64231c75..66425063 100644 --- a/USAGE.md +++ b/USAGE.md @@ -14,11 +14,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() diff --git a/build.gradle b/build.gradle index 4a8754b4..c03c82e9 100644 --- a/build.gradle +++ b/build.gradle @@ -63,7 +63,7 @@ tasks.withType(Javadoc) { } group = "dev.plexapi" -version = "0.7.0" +version = "0.8.0" sourcesJar { archiveBaseName = "plexapi" @@ -101,7 +101,7 @@ publishing { maven(MavenPublication) { groupId = 'dev.plexapi' artifactId = 'plexapi' - version = '0.7.0' + version = '0.8.0' from components.java diff --git a/codeSamples.yaml b/codeSamples.yaml index 19bedf23..406f1ac5 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -23,11 +23,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() @@ -58,11 +58,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerPreferencesResponse res = sdk.server().getServerPreferences() @@ -93,11 +93,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); UpdatePlayProgressResponse res = sdk.media().updatePlayProgress() @@ -129,11 +129,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); MarkPlayedResponse res = sdk.media().markPlayed() @@ -165,11 +165,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetTimelineRequest req = GetTimelineRequest.builder() @@ -212,11 +212,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); MarkUnplayedResponse res = sdk.media().markUnplayed() @@ -246,11 +246,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerActivitiesResponse res = sdk.activities().getServerActivities() @@ -281,11 +281,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities() @@ -315,11 +315,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); StopAllTasksResponse res = sdk.butler().stopAllTasks() @@ -348,11 +348,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetButlerTasksResponse res = sdk.butler().getButlerTasks() @@ -383,11 +383,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); StartAllTasksResponse res = sdk.butler().startAllTasks() @@ -417,11 +417,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); StopTaskResponse res = sdk.butler().stopTask() @@ -452,11 +452,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); StartTaskResponse res = sdk.butler().startTask() @@ -486,11 +486,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetAvailableClientsResponse res = sdk.server().getAvailableClients() @@ -521,11 +521,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetCompanionsDataResponse res = sdk.plex().getCompanionsData() @@ -556,11 +556,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetDevicesResponse res = sdk.server().getDevices() @@ -591,11 +591,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetUserFriendsResponse res = sdk.plex().getUserFriends() @@ -625,11 +625,11 @@ actions: public static void main(String[] args) throws GetGeoDataBadRequest, GetGeoDataUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetGeoDataResponse res = sdk.plex().getGeoData() @@ -660,11 +660,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetHomeDataResponse res = sdk.plex().getHomeData() @@ -696,11 +696,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs() @@ -734,11 +734,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetRecentlyAddedRequest req = GetRecentlyAddedRequest.builder() @@ -779,11 +779,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); PerformSearchResponse res = sdk.search().performSearch() @@ -815,11 +815,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); PerformVoiceSearchResponse res = sdk.search().performVoiceSearch() @@ -852,11 +852,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs() @@ -888,11 +888,11 @@ actions: public static void main(String[] args) throws GetServerIdentityRequestTimeout, Exception { PlexAPI sdk = PlexAPI.builder() - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerIdentityResponse res = sdk.server().getServerIdentity() @@ -924,16 +924,16 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent() - .type(GetTopWatchedContentQueryParamType.TvShow) .includeGuids(1L) + .type(GetTopWatchedContentQueryParamType.TvShow) .call(); if (res.object().isPresent()) { @@ -961,11 +961,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetFileHashResponse res = sdk.library().getFileHash() @@ -996,11 +996,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetMetaDataByRatingKeyResponse res = sdk.library().getMetaDataByRatingKey() @@ -1033,11 +1033,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetBannerImageRequest req = GetBannerImageRequest.builder() @@ -1078,11 +1078,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetMetadataChildrenResponse res = sdk.library().getMetadataChildren() @@ -1116,11 +1116,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetThumbImageRequest req = GetThumbImageRequest.builder() @@ -1161,11 +1161,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetOnDeckResponse res = sdk.library().getOnDeck() @@ -1200,11 +1200,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetRecentlyAddedLibraryRequest req = GetRecentlyAddedLibraryRequest.builder() @@ -1233,6 +1233,55 @@ actions: .request(req) .call(); + if (res.object().isPresent()) { + // handle response + } + } + } + - target: $["paths"]["/library/search"]["get"] + update: + x-codeSamples: + - lang: java + label: libraries + source: |- + package hello.world; + + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetSearchAllLibrariesBadRequest; + import dev.plexapi.plexapi.models.errors.GetSearchAllLibrariesUnauthorized; + import dev.plexapi.plexapi.models.operations.GetSearchAllLibrariesRequest; + import dev.plexapi.plexapi.models.operations.GetSearchAllLibrariesResponse; + import dev.plexapi.plexapi.models.operations.QueryParamIncludeCollections; + import dev.plexapi.plexapi.models.operations.QueryParamIncludeExternalMedia; + import dev.plexapi.plexapi.models.operations.SearchTypes; + import java.lang.Exception; + import java.util.List; + + public class Application { + + public static void main(String[] args) throws GetSearchAllLibrariesBadRequest, GetSearchAllLibrariesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") + .build(); + + GetSearchAllLibrariesRequest req = GetSearchAllLibrariesRequest.builder() + .query("") + .searchTypes(List.of( + SearchTypes.PEOPLE)) + .includeCollections(QueryParamIncludeCollections.Enable) + .includeExternalMedia(QueryParamIncludeExternalMedia.Enable) + .build(); + + GetSearchAllLibrariesResponse res = sdk.library().getSearchAllLibraries() + .request(req) + .call(); + if (res.object().isPresent()) { // handle response } @@ -1258,11 +1307,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetAllLibrariesResponse res = sdk.library().getAllLibraries() @@ -1295,11 +1344,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetWatchListRequest req = GetWatchListRequest.builder() @@ -1338,11 +1387,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); DeleteLibraryResponse res = sdk.library().deleteLibrary() @@ -1373,16 +1422,16 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetLibraryDetailsResponse res = sdk.library().getLibraryDetails() - .sectionKey(9518) .includeDetails(IncludeDetails.ZERO) + .sectionKey(9518) .call(); if (res.object().isPresent()) { @@ -1411,16 +1460,16 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata() - .sectionKey(9518) .force(Force.ONE) + .sectionKey(9518) .call(); // handle response @@ -1447,11 +1496,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetSearchLibraryResponse res = sdk.library().getSearchLibrary() @@ -1489,16 +1538,16 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetLibraryItemsRequest req = GetLibraryItemsRequest.builder() - .sectionKey(9518) .tag(Tag.EDITION) + .sectionKey(9518) .includeGuids(IncludeGuids.Enable) .type(GetLibraryItemsQueryParamType.TvShow) .includeMeta(GetLibraryItemsQueryParamIncludeMeta.Enable) @@ -1536,11 +1585,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); LogLineResponse res = sdk.log().logLine() @@ -1573,11 +1622,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); String req = "level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman @@ -1610,11 +1659,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); EnablePaperTrailResponse res = sdk.log().enablePaperTrail() @@ -1643,11 +1692,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetMediaProvidersResponse res = sdk.server().getMediaProviders() @@ -1679,11 +1728,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount() @@ -1717,11 +1766,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetResizedPhotoRequest req = GetResizedPhotoRequest.builder() @@ -1760,11 +1809,11 @@ actions: public static void main(String[] args) throws GetPinBadRequest, Exception { PlexAPI sdk = PlexAPI.builder() - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetPinRequest req = GetPinRequest.builder() @@ -1799,11 +1848,11 @@ actions: public static void main(String[] args) throws GetTokenByPinIdBadRequest, GetTokenByPinIdResponseBody, Exception { PlexAPI sdk = PlexAPI.builder() - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetTokenByPinIdRequest req = GetTokenByPinIdRequest.builder() @@ -1841,11 +1890,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetPlaylistsResponse res = sdk.playlists().getPlaylists() @@ -1881,11 +1930,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); CreatePlaylistRequest req = CreatePlaylistRequest.builder() @@ -1925,11 +1974,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); UploadPlaylistResponse res = sdk.playlists().uploadPlaylist() @@ -1961,11 +2010,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); DeletePlaylistResponse res = sdk.playlists().deletePlaylist() @@ -1995,11 +2044,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetPlaylistResponse res = sdk.playlists().getPlaylist() @@ -2031,11 +2080,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); UpdatePlaylistResponse res = sdk.playlists().updatePlaylist() @@ -2067,11 +2116,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents() @@ -2102,11 +2151,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents() @@ -2139,11 +2188,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents() @@ -2180,18 +2229,18 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerResourcesResponse res = sdk.plex().getServerResources() .includeHttps(IncludeHttps.Enable) .includeRelay(IncludeRelay.Enable) .includeIPv6(IncludeIPv6.Enable) - .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") .call(); if (res.plexDevices().isPresent()) { @@ -2219,11 +2268,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetSearchResultsResponse res = sdk.search().getSearchResults() @@ -2255,11 +2304,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation() @@ -2291,11 +2340,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetTransientTokenResponse res = sdk.authentication().getTransientToken() @@ -2326,11 +2375,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerListResponse res = sdk.server().getServerList() @@ -2361,11 +2410,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics() @@ -2397,11 +2446,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetStatisticsResponse res = sdk.statistics().getStatistics() @@ -2433,11 +2482,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics() @@ -2469,11 +2518,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetSessionsResponse res = sdk.sessions().getSessions() @@ -2505,11 +2554,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetSessionHistoryResponse res = sdk.sessions().getSessionHistory() @@ -2545,11 +2594,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions() @@ -2580,11 +2629,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession() @@ -2616,11 +2665,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); ApplyUpdatesResponse res = sdk.updater().applyUpdates() @@ -2652,11 +2701,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); CheckForUpdatesResponse res = sdk.updater().checkForUpdates() @@ -2686,11 +2735,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetUpdateStatusResponse res = sdk.updater().getUpdateStatus() @@ -2721,11 +2770,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetTokenDetailsResponse res = sdk.authentication().getTokenDetails() @@ -2757,11 +2806,11 @@ actions: public static void main(String[] args) throws PostUsersSignInDataBadRequest, PostUsersSignInDataUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); PostUsersSignInDataRequest req = PostUsersSignInDataRequest.builder() @@ -2802,11 +2851,11 @@ actions: PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder() diff --git a/docs/models/errors/GetSearchAllLibrariesBadRequest.md b/docs/models/errors/GetSearchAllLibrariesBadRequest.md new file mode 100644 index 00000000..90013a04 --- /dev/null +++ b/docs/models/errors/GetSearchAllLibrariesBadRequest.md @@ -0,0 +1,11 @@ +# GetSearchAllLibrariesBadRequest + +Bad Request - A parameter was not specified, or was specified incorrectly. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[GetSearchAllLibrariesErrors](../../models/errors/GetSearchAllLibrariesErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetSearchAllLibrariesErrors.md b/docs/models/errors/GetSearchAllLibrariesErrors.md new file mode 100644 index 00000000..3c5a1a10 --- /dev/null +++ b/docs/models/errors/GetSearchAllLibrariesErrors.md @@ -0,0 +1,10 @@ +# GetSearchAllLibrariesErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `code` | *Optional* | :heavy_minus_sign: | N/A | 1000 | +| `message` | *Optional* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | +| `status` | *Optional* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/errors/GetSearchAllLibrariesLibraryErrors.md b/docs/models/errors/GetSearchAllLibrariesLibraryErrors.md new file mode 100644 index 00000000..2158617e --- /dev/null +++ b/docs/models/errors/GetSearchAllLibrariesLibraryErrors.md @@ -0,0 +1,10 @@ +# GetSearchAllLibrariesLibraryErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `code` | *Optional* | :heavy_minus_sign: | N/A | 1001 | +| `message` | *Optional* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `status` | *Optional* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/errors/GetSearchAllLibrariesUnauthorized.md b/docs/models/errors/GetSearchAllLibrariesUnauthorized.md new file mode 100644 index 00000000..db397e9d --- /dev/null +++ b/docs/models/errors/GetSearchAllLibrariesUnauthorized.md @@ -0,0 +1,11 @@ +# GetSearchAllLibrariesUnauthorized + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<[GetSearchAllLibrariesLibraryErrors](../../models/errors/GetSearchAllLibrariesLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/Features.md b/docs/models/operations/Features.md deleted file mode 100644 index afac6c0d..00000000 --- a/docs/models/operations/Features.md +++ /dev/null @@ -1,102 +0,0 @@ -# Features - - -## Values - -| Name | Value | -| ----------------------------------------- | ----------------------------------------- | -| `ANDROID_DOLBY_VISION` | Android - Dolby Vision | -| `ANDROID_PI_P` | Android - PiP | -| `CU_SUNSET` | CU Sunset | -| `HRK_ENABLE_EUR` | HRK_enable_EUR | -| `TREBLE_SHOW_FEATURES` | TREBLE-show-features | -| `AD_COUNTDOWN_TIMER` | ad-countdown-timer | -| `ADAPTIVE_BITRATE` | adaptive_bitrate | -| `ALBUM_TYPES` | album-types | -| `ALLOW_DVR` | allow_dvr | -| `AMAZON_LOOP_DEBUG` | amazon-loop-debug | -| `AVOD_AD_ANALYSIS` | avod-ad-analysis | -| `AVOD_NEW_MEDIA` | avod-new-media | -| `BLACKLIST_GET_SIGNIN` | blacklist_get_signin | -| `BOOST_VOICES` | boost-voices | -| `CAMERA_UPLOAD` | camera_upload | -| `CLIENT_RADIO_STATIONS` | client-radio-stations | -| `CLOUDFLARE_TURNSTILE_REQUIRED` | cloudflare-turnstile-required | -| `CLOUDSYNC` | cloudsync | -| `COLLECTIONS` | collections | -| `COMMENTS_AND_REPLIES_PUSH_NOTIFICATIONS` | comments_and_replies_push_notifications | -| `COMMUNITY_ACCESS_PLEX_TV` | community_access_plex_tv | -| `COMPANIONS_SONOS` | companions_sonos | -| `CONTENT_FILTER` | content_filter | -| `CUSTOM_HOME_REMOVAL` | custom-home-removal | -| `DISABLE_HOME_USER_FRIENDSHIPS` | disable_home_user_friendships | -| `DISABLE_SHARING_FRIENDSHIPS` | disable_sharing_friendships | -| `DOWNLOADS_GATING` | downloads-gating | -| `DRM_SUPPORT` | drm_support | -| `DVR` | dvr | -| `DVR_BLOCK_UNSUPPORTED_COUNTRIES` | dvr-block-unsupported-countries | -| `EPG_RECENT_CHANNELS` | epg-recent-channels | -| `EXCLUDE_RESTRICTIONS` | exclude restrictions | -| `FEDERATED_AUTH` | federated-auth | -| `FRIEND_REQUEST_PUSH_NOTIFICATIONS` | friend_request_push_notifications | -| `GRANDFATHER_SYNC` | grandfather-sync | -| `GUIDED_UPGRADE` | guided-upgrade | -| `HARDWARE_TRANSCODING` | hardware_transcoding | -| `HOME` | home | -| `HWTRANSCODE` | hwtranscode | -| `IMAGGA_V2` | imagga-v2 | -| `INCREASE_PASSWORD_COMPLEXITY` | increase-password-complexity | -| `IOS14_PRIVACY_BANNER` | ios14-privacy-banner | -| `ITERABLE_NOTIFICATION_TOKENS` | iterable-notification-tokens | -| `ITEM_CLUSTERS` | item_clusters | -| `KEEP_PAYMENT_METHOD` | keep-payment-method | -| `KEVIN_BACON` | kevin-bacon | -| `KOREA_CONSENT` | korea-consent | -| `LE_ISRG_ROOT_X1` | le_isrg_root_x1 | -| `LETS_ENCRYPT` | lets_encrypt | -| `LIGHTNING_DVR_PIVOT` | lightning-dvr-pivot | -| `LIVE_TV_SUPPORT_INCOMPLETE_SEGMENTS` | live-tv-support-incomplete-segments | -| `LIVETV` | livetv | -| `LYRICS` | lyrics | -| `METADATA_SEARCH` | metadata_search | -| `MUSIC_ANALYSIS` | music-analysis | -| `MUSIC_VIDEOS` | music_videos | -| `NEW_PLEX_PASS_PRICES` | new_plex_pass_prices | -| `NEWS_PROVIDER_SUNSET_MODAL` | news-provider-sunset-modal | -| `NOMINATIM` | nominatim | -| `PASS` | pass | -| `PHOTOS_FAVORITES` | photos-favorites | -| `PHOTOS_METADATA_EDITION` | photos-metadata-edition | -| `PHOTOS_V6_EDIT` | photosV6-edit | -| `PHOTOS_V6_TV_ALBUMS` | photosV6-tv-albums | -| `PMS_HEALTH` | pms_health | -| `PREMIUM_DASHBOARD` | premium-dashboard | -| `PREMIUM_MUSIC_METADATA` | premium_music_metadata | -| `RADIO` | radio | -| `RATE_LIMIT_CLIENT_TOKEN` | rate-limit-client-token | -| `SCROBBLING_SERVICE_PLEX_TV` | scrobbling-service-plex-tv | -| `SESSION_BANDWIDTH_RESTRICTIONS` | session_bandwidth_restrictions | -| `SESSION_KICK` | session_kick | -| `SHARED_SERVER_NOTIFICATION` | shared_server_notification | -| `SHARED_SOURCE_NOTIFICATION` | shared_source_notification | -| `SIGNIN_NOTIFICATION` | signin_notification | -| `SIGNIN_WITH_APPLE` | signin_with_apple | -| `SILENCE_REMOVAL` | silence-removal | -| `SLEEP_TIMER` | sleep-timer | -| `SPRING_SERVE_AD_PROVIDER` | spring_serve_ad_provider | -| `SYNC` | sync | -| `SWEET_FADES` | sweet-fades | -| `TRANSCODER_CACHE` | transcoder_cache | -| `TRAILERS` | trailers | -| `TUNER_SHARING` | tuner-sharing | -| `TWO_FACTOR_AUTHENTICATION` | two-factor-authentication | -| `UNSUPPORTEDTUNERS` | unsupportedtuners | -| `UPGRADE3DS2` | upgrade-3ds2 | -| `VISUALIZERS` | visualizers | -| `VOD_SCHEMA` | vod-schema | -| `VOD_CLOUDFLARE` | vod_cloudflare | -| `VOLUME_LEVELING` | volume-leveling | -| `WATCH_TOGETHER_INVITE` | watch-together-invite | -| `WATCHLIST_RSS` | watchlist-rss | -| `WEB_SERVER_DASHBOARD` | web_server_dashboard | -| `WEBHOOKS` | webhooks | \ No newline at end of file diff --git a/docs/models/operations/GetAllLibrariesDirectory.md b/docs/models/operations/GetAllLibrariesDirectory.md index d2d6b3ca..f8f28615 100644 --- a/docs/models/operations/GetAllLibrariesDirectory.md +++ b/docs/models/operations/GetAllLibrariesDirectory.md @@ -3,26 +3,26 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `allowSync` | *boolean* | :heavy_check_mark: | N/A | true | -| `art` | *String* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg | -| `composite` | *String* | :heavy_check_mark: | N/A | /library/sections/1/composite/1705615584 | -| `filters` | *boolean* | :heavy_check_mark: | N/A | true | -| `refreshing` | *boolean* | :heavy_check_mark: | N/A | false | -| `thumb` | *String* | :heavy_check_mark: | N/A | /:/resources/movie.png | -| `key` | *String* | :heavy_check_mark: | N/A | 1 | -| `type` | *String* | :heavy_check_mark: | N/A | movie | -| `title` | *String* | :heavy_check_mark: | N/A | Movies | -| `agent` | *String* | :heavy_check_mark: | N/A | tv.plex.agents.movie | -| `scanner` | *String* | :heavy_check_mark: | N/A | Plex Movie | -| `language` | *String* | :heavy_check_mark: | N/A | en-US | -| `uuid` | *String* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | -| `updatedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | -| `createdAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | -| `scannedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | -| `content` | *boolean* | :heavy_check_mark: | N/A | true | -| `directory` | *boolean* | :heavy_check_mark: | N/A | true | -| `contentChangedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | -| `hidden` | *int* | :heavy_check_mark: | N/A | 0 | -| `location` | List<[Location](../../models/operations/Location.md)> | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `allowSync` | *boolean* | :heavy_check_mark: | N/A | true | +| `art` | *String* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg | +| `composite` | *String* | :heavy_check_mark: | N/A | /library/sections/1/composite/1705615584 | +| `filters` | *boolean* | :heavy_check_mark: | N/A | true | +| `refreshing` | *boolean* | :heavy_check_mark: | N/A | false | +| `thumb` | *String* | :heavy_check_mark: | N/A | /:/resources/movie.png | +| `key` | *String* | :heavy_check_mark: | N/A | 1 | +| `type` | *String* | :heavy_check_mark: | N/A | movie | +| `title` | *String* | :heavy_check_mark: | N/A | Movies | +| `agent` | *String* | :heavy_check_mark: | N/A | tv.plex.agents.movie | +| `scanner` | *String* | :heavy_check_mark: | N/A | Plex Movie | +| `language` | *String* | :heavy_check_mark: | N/A | en-US | +| `uuid` | *String* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | +| `updatedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | +| `createdAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | +| `scannedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | +| `content` | *boolean* | :heavy_check_mark: | N/A | true | +| `directory` | *boolean* | :heavy_check_mark: | N/A | true | +| `contentChangedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | +| `hidden` | *int* | :heavy_check_mark: | N/A | 0 | +| `location` | List<[GetAllLibrariesLocation](../../models/operations/GetAllLibrariesLocation.md)> | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetAllLibrariesLocation.md b/docs/models/operations/GetAllLibrariesLocation.md new file mode 100644 index 00000000..e764f720 --- /dev/null +++ b/docs/models/operations/GetAllLibrariesLocation.md @@ -0,0 +1,9 @@ +# GetAllLibrariesLocation + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *int* | :heavy_check_mark: | N/A | 1 | +| `path` | *String* | :heavy_check_mark: | N/A | /movies | \ No newline at end of file diff --git a/docs/models/operations/GetBannerImageRequest.md b/docs/models/operations/GetBannerImageRequest.md index 24cd2545..317203e4 100644 --- a/docs/models/operations/GetBannerImageRequest.md +++ b/docs/models/operations/GetBannerImageRequest.md @@ -10,4 +10,4 @@ | `height` | *long* | :heavy_check_mark: | N/A | 396 | | `minSize` | *long* | :heavy_check_mark: | N/A | 1 | | `upscale` | *long* | :heavy_check_mark: | N/A | 1 | -| `xPlexToken` | *String* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file +| `xPlexToken` | *String* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryDetailsRequest.md b/docs/models/operations/GetLibraryDetailsRequest.md index 0c09491a..514b7c30 100644 --- a/docs/models/operations/GetLibraryDetailsRequest.md +++ b/docs/models/operations/GetLibraryDetailsRequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | -| `includeDetails` | [Optional](../../models/operations/IncludeDetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts).
Only exists for backwards compatibility, media providers other than the server libraries have it on always.
| | \ No newline at end of file +| `includeDetails` | [Optional](../../models/operations/IncludeDetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts).
Only exists for backwards compatibility, media providers other than the server libraries have it on always.
| | +| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryItemsLocation.md b/docs/models/operations/GetLibraryItemsLocation.md new file mode 100644 index 00000000..b6c4191b --- /dev/null +++ b/docs/models/operations/GetLibraryItemsLocation.md @@ -0,0 +1,8 @@ +# GetLibraryItemsLocation + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `path` | *Optional* | :heavy_minus_sign: | N/A | /TV Shows/House | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryItemsMedia.md b/docs/models/operations/GetLibraryItemsMedia.md index 42a7a679..b030bc95 100644 --- a/docs/models/operations/GetLibraryItemsMedia.md +++ b/docs/models/operations/GetLibraryItemsMedia.md @@ -6,19 +6,19 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | | `id` | *int* | :heavy_check_mark: | N/A | 119534 | -| `duration` | *int* | :heavy_check_mark: | N/A | 11558112 | -| `bitrate` | *int* | :heavy_check_mark: | N/A | 25025 | -| `width` | *int* | :heavy_check_mark: | N/A | 3840 | -| `height` | *int* | :heavy_check_mark: | N/A | 2072 | -| `aspectRatio` | *double* | :heavy_check_mark: | N/A | 1.85 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 11558112 | +| `bitrate` | *Optional* | :heavy_minus_sign: | N/A | 25025 | +| `width` | *Optional* | :heavy_minus_sign: | N/A | 3840 | +| `height` | *Optional* | :heavy_minus_sign: | N/A | 2072 | +| `aspectRatio` | *Optional* | :heavy_minus_sign: | N/A | 1.85 | | `audioProfile` | *Optional* | :heavy_minus_sign: | N/A | dts | -| `audioChannels` | *int* | :heavy_check_mark: | N/A | 6 | -| `audioCodec` | *String* | :heavy_check_mark: | N/A | eac3 | -| `videoCodec` | *String* | :heavy_check_mark: | N/A | hevc | -| `videoResolution` | *String* | :heavy_check_mark: | N/A | 4k | +| `audioChannels` | *Optional* | :heavy_minus_sign: | N/A | 6 | +| `audioCodec` | *Optional* | :heavy_minus_sign: | N/A | eac3 | +| `videoCodec` | *Optional* | :heavy_minus_sign: | N/A | hevc | +| `videoResolution` | *Optional* | :heavy_minus_sign: | N/A | 4k | | `container` | *String* | :heavy_check_mark: | N/A | mkv | -| `videoFrameRate` | *String* | :heavy_check_mark: | N/A | 24p | -| `videoProfile` | *String* | :heavy_check_mark: | N/A | main 10 | +| `videoFrameRate` | *Optional* | :heavy_minus_sign: | N/A | 24p | +| `videoProfile` | *Optional* | :heavy_minus_sign: | N/A | main 10 | | `hasVoiceActivity` | *Optional* | :heavy_minus_sign: | N/A | false | | `optimizedForStreaming` | [Optional](../../models/operations/GetLibraryItemsOptimizedForStreaming.md) | :heavy_minus_sign: | N/A | 1 | | `has64bitOffsets` | *Optional* | :heavy_minus_sign: | N/A | false | diff --git a/docs/models/operations/GetLibraryItemsMetadata.md b/docs/models/operations/GetLibraryItemsMetadata.md index b28c4a03..09ec3b0d 100644 --- a/docs/models/operations/GetLibraryItemsMetadata.md +++ b/docs/models/operations/GetLibraryItemsMetadata.md @@ -52,6 +52,7 @@ | `writer` | List<[GetLibraryItemsWriter](../../models/operations/GetLibraryItemsWriter.md)> | :heavy_minus_sign: | N/A | | | `collection` | List<[GetLibraryItemsCollection](../../models/operations/GetLibraryItemsCollection.md)> | :heavy_minus_sign: | N/A | | | `role` | List<[GetLibraryItemsRole](../../models/operations/GetLibraryItemsRole.md)> | :heavy_minus_sign: | N/A | | +| `location` | List<[GetLibraryItemsLocation](../../models/operations/GetLibraryItemsLocation.md)> | :heavy_minus_sign: | N/A | | | `mediaGuid` | List<[GetLibraryItemsMediaGuid](../../models/operations/GetLibraryItemsMediaGuid.md)> | :heavy_minus_sign: | The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
| | | `ultraBlurColors` | [Optional](../../models/operations/GetLibraryItemsUltraBlurColors.md) | :heavy_minus_sign: | N/A | | | `metaDataRating` | List<[GetLibraryItemsMetaDataRating](../../models/operations/GetLibraryItemsMetaDataRating.md)> | :heavy_minus_sign: | N/A | | diff --git a/docs/models/operations/GetLibraryItemsPart.md b/docs/models/operations/GetLibraryItemsPart.md index 6bfc10b0..5abc2881 100644 --- a/docs/models/operations/GetLibraryItemsPart.md +++ b/docs/models/operations/GetLibraryItemsPart.md @@ -7,14 +7,14 @@ | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | `id` | *int* | :heavy_check_mark: | N/A | 119542 | | `key` | *String* | :heavy_check_mark: | N/A | /library/parts/119542/1680457526/file.mkv | -| `duration` | *int* | :heavy_check_mark: | N/A | 11558112 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 11558112 | | `file` | *String* | :heavy_check_mark: | N/A | /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv | | `size` | *long* | :heavy_check_mark: | N/A | 36158371307 | | `container` | *String* | :heavy_check_mark: | The container format of the media file.
| mkv | | `audioProfile` | *Optional* | :heavy_minus_sign: | N/A | dts | | `has64bitOffsets` | *Optional* | :heavy_minus_sign: | N/A | false | | `optimizedForStreaming` | *Optional* | :heavy_minus_sign: | N/A | false | -| `videoProfile` | *String* | :heavy_check_mark: | N/A | main 10 | +| `videoProfile` | *Optional* | :heavy_minus_sign: | N/A | main 10 | | `indexes` | *Optional* | :heavy_minus_sign: | N/A | sd | | `hasThumbnail` | [Optional](../../models/operations/GetLibraryItemsHasThumbnail.md) | :heavy_minus_sign: | N/A | 1 | | `stream` | List<[GetLibraryItemsStream](../../models/operations/GetLibraryItemsStream.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryItemsRequest.md b/docs/models/operations/GetLibraryItemsRequest.md index 57274524..814c84f1 100644 --- a/docs/models/operations/GetLibraryItemsRequest.md +++ b/docs/models/operations/GetLibraryItemsRequest.md @@ -5,10 +5,10 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | | `tag` | [Tag](../../models/operations/Tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | | | `includeGuids` | [Optional](../../models/operations/IncludeGuids.md) | :heavy_minus_sign: | Adds the Guids object to the response
| 1 | | `type` | [Optional](../../models/operations/GetLibraryItemsQueryParamType.md) | :heavy_minus_sign: | The type of media to retrieve.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | +| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | | `includeMeta` | [Optional](../../models/operations/GetLibraryItemsQueryParamIncludeMeta.md) | :heavy_minus_sign: | Adds the Meta object to the response
| 1 | | `xPlexContainerStart` | *Optional* | :heavy_minus_sign: | The index of the first item to return. If not specified, the first item will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 0
| 0 | | `xPlexContainerSize` | *Optional* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 50
| 50 | \ No newline at end of file diff --git a/docs/models/operations/GetMediaProvidersRequest.md b/docs/models/operations/GetMediaProvidersRequest.md index f191e033..43c327fb 100644 --- a/docs/models/operations/GetMediaProvidersRequest.md +++ b/docs/models/operations/GetMediaProvidersRequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | -| `xPlexToken` | *String* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `xPlexToken` | *String* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file diff --git a/docs/models/operations/GetMetadataChildrenMetadata.md b/docs/models/operations/GetMetadataChildrenMetadata.md index 2ed0f6b3..1f5d75ea 100644 --- a/docs/models/operations/GetMetadataChildrenMetadata.md +++ b/docs/models/operations/GetMetadataChildrenMetadata.md @@ -15,7 +15,7 @@ | `title` | *Optional* | :heavy_minus_sign: | N/A | Season 2 | | `parentKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/30072 | | `parentTitle` | *Optional* | :heavy_minus_sign: | N/A | Reacher | -| `summary` | *Optional* | :heavy_minus_sign: | N/A | Based on"Bad Luck and Trouble," when members of Reacher's old military unit start turning up dead, Reacher has just one thing on his mind—revenge. | +| `summary` | *Optional* | :heavy_minus_sign: | N/A | Based on"Bad Luck and Trouble," when members of Reacher's old military unit start turning up dead, Reacher has just one thing on his mind-revenge. | | `index` | *Optional* | :heavy_minus_sign: | N/A | 2 | | `parentIndex` | *Optional* | :heavy_minus_sign: | N/A | 1 | | `viewCount` | *Optional* | :heavy_minus_sign: | N/A | 11 | diff --git a/docs/models/operations/GetPinRequest.md b/docs/models/operations/GetPinRequest.md index 046a9069..4e86af24 100644 --- a/docs/models/operations/GetPinRequest.md +++ b/docs/models/operations/GetPinRequest.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `strong` | *Optional* | :heavy_minus_sign: | Determines the kind of code returned by the API call
Strong codes are used for Pin authentication flows
Non-Strong codes are used for `Plex.tv/link`
| | -| `clientID` | *Optional* | :heavy_minus_sign: | The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) | gcgzw5rz2xovp84b4vha3a40 | -| `clientName` | *Optional* | :heavy_minus_sign: | N/A | Plex Web | -| `deviceName` | *Optional* | :heavy_minus_sign: | N/A | Linux | -| `clientVersion` | *Optional* | :heavy_minus_sign: | N/A | 4.133.0 | -| `clientPlatform` | *Optional* | :heavy_minus_sign: | N/A | Chrome | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `strong` | *Optional* | :heavy_minus_sign: | Determines the kind of code returned by the API call
Strong codes are used for Pin authentication flows
Non-Strong codes are used for `Plex.tv/link`
| | +| `clientID` | *Optional* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | +| `clientName` | *Optional* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku | +| `deviceNickname` | *Optional* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `clientVersion` | *Optional* | :heavy_minus_sign: | The version of the client application. | 2.4.1 | +| `platform` | *Optional* | :heavy_minus_sign: | The platform of the client application. | Roku | \ No newline at end of file diff --git a/docs/models/operations/GetRecentlyAddedMetadata.md b/docs/models/operations/GetRecentlyAddedMetadata.md index 91aef71c..cdc052ce 100644 --- a/docs/models/operations/GetRecentlyAddedMetadata.md +++ b/docs/models/operations/GetRecentlyAddedMetadata.md @@ -52,6 +52,7 @@ | `writer` | List<[Writer](../../models/operations/Writer.md)> | :heavy_minus_sign: | N/A | | | `collection` | List<[Collection](../../models/operations/Collection.md)> | :heavy_minus_sign: | N/A | | | `role` | List<[Role](../../models/operations/Role.md)> | :heavy_minus_sign: | N/A | | +| `location` | List<[Location](../../models/operations/Location.md)> | :heavy_minus_sign: | N/A | | | `mediaGuid` | List<[MediaGuid](../../models/operations/MediaGuid.md)> | :heavy_minus_sign: | The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
| | | `ultraBlurColors` | [Optional](../../models/operations/UltraBlurColors.md) | :heavy_minus_sign: | N/A | | | `metaDataRating` | List<[MetaDataRating](../../models/operations/MetaDataRating.md)> | :heavy_minus_sign: | N/A | | diff --git a/docs/models/operations/GetRefreshLibraryMetadataRequest.md b/docs/models/operations/GetRefreshLibraryMetadataRequest.md index 253815cd..a00657e0 100644 --- a/docs/models/operations/GetRefreshLibraryMetadataRequest.md +++ b/docs/models/operations/GetRefreshLibraryMetadataRequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | -| `force` | [Optional](../../models/operations/Force.md) | :heavy_minus_sign: | Force the refresh even if the library is already being refreshed. | 0 | \ No newline at end of file +| `force` | [Optional](../../models/operations/Force.md) | :heavy_minus_sign: | Force the refresh even if the library is already being refreshed. | 0 | +| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesCollection.md b/docs/models/operations/GetSearchAllLibrariesCollection.md new file mode 100644 index 00000000..2a9166c0 --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesCollection.md @@ -0,0 +1,8 @@ +# GetSearchAllLibrariesCollection + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `tag` | *Optional* | :heavy_minus_sign: | N/A | Working NL Subs | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesCountry.md b/docs/models/operations/GetSearchAllLibrariesCountry.md new file mode 100644 index 00000000..e5884ad6 --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesCountry.md @@ -0,0 +1,8 @@ +# GetSearchAllLibrariesCountry + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `tag` | *Optional* | :heavy_minus_sign: | N/A | United States of America | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesDirector.md b/docs/models/operations/GetSearchAllLibrariesDirector.md new file mode 100644 index 00000000..73f1646b --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesDirector.md @@ -0,0 +1,8 @@ +# GetSearchAllLibrariesDirector + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `tag` | *Optional* | :heavy_minus_sign: | N/A | James Cameron | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesFlattenSeasons.md b/docs/models/operations/GetSearchAllLibrariesFlattenSeasons.md new file mode 100644 index 00000000..c9b70bb8 --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesFlattenSeasons.md @@ -0,0 +1,9 @@ +# GetSearchAllLibrariesFlattenSeasons + + +## Values + +| Name | Value | +| ------- | ------- | +| `False` | 0 | +| `True` | 1 | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesGenre.md b/docs/models/operations/GetSearchAllLibrariesGenre.md new file mode 100644 index 00000000..d18cc68f --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesGenre.md @@ -0,0 +1,8 @@ +# GetSearchAllLibrariesGenre + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `tag` | *Optional* | :heavy_minus_sign: | N/A | Adventure | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesHasThumbnail.md b/docs/models/operations/GetSearchAllLibrariesHasThumbnail.md new file mode 100644 index 00000000..bfdb1514 --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesHasThumbnail.md @@ -0,0 +1,9 @@ +# GetSearchAllLibrariesHasThumbnail + + +## Values + +| Name | Value | +| ------- | ------- | +| `False` | 0 | +| `True` | 1 | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesImage.md b/docs/models/operations/GetSearchAllLibrariesImage.md new file mode 100644 index 00000000..0b0b9fb6 --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesImage.md @@ -0,0 +1,10 @@ +# GetSearchAllLibrariesImage + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `alt` | *String* | :heavy_check_mark: | N/A | Episode 1 | +| `type` | [GetSearchAllLibrariesLibraryType](../../models/operations/GetSearchAllLibrariesLibraryType.md) | :heavy_check_mark: | N/A | background | +| `url` | *String* | :heavy_check_mark: | N/A | /library/metadata/45521/thumb/1644710589 | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesLibraryType.md b/docs/models/operations/GetSearchAllLibrariesLibraryType.md new file mode 100644 index 00000000..a3f90fe1 --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesLibraryType.md @@ -0,0 +1,11 @@ +# GetSearchAllLibrariesLibraryType + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `COVER_POSTER` | coverPoster | +| `BACKGROUND` | background | +| `SNAPSHOT` | snapshot | +| `CLEAR_LOGO` | clearLogo | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesLocation.md b/docs/models/operations/GetSearchAllLibrariesLocation.md new file mode 100644 index 00000000..25871288 --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesLocation.md @@ -0,0 +1,8 @@ +# GetSearchAllLibrariesLocation + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `path` | *Optional* | :heavy_minus_sign: | N/A | /TV Shows/House | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesMedia.md b/docs/models/operations/GetSearchAllLibrariesMedia.md new file mode 100644 index 00000000..58655ed2 --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesMedia.md @@ -0,0 +1,25 @@ +# GetSearchAllLibrariesMedia + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `id` | *int* | :heavy_check_mark: | N/A | 119534 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 11558112 | +| `bitrate` | *Optional* | :heavy_minus_sign: | N/A | 25025 | +| `width` | *Optional* | :heavy_minus_sign: | N/A | 3840 | +| `height` | *Optional* | :heavy_minus_sign: | N/A | 2072 | +| `aspectRatio` | *Optional* | :heavy_minus_sign: | N/A | 1.85 | +| `audioProfile` | *Optional* | :heavy_minus_sign: | N/A | dts | +| `audioChannels` | *Optional* | :heavy_minus_sign: | N/A | 6 | +| `audioCodec` | *Optional* | :heavy_minus_sign: | N/A | eac3 | +| `videoCodec` | *Optional* | :heavy_minus_sign: | N/A | hevc | +| `videoResolution` | *Optional* | :heavy_minus_sign: | N/A | 4k | +| `container` | *String* | :heavy_check_mark: | N/A | mkv | +| `videoFrameRate` | *Optional* | :heavy_minus_sign: | N/A | 24p | +| `videoProfile` | *Optional* | :heavy_minus_sign: | N/A | main 10 | +| `hasVoiceActivity` | *Optional* | :heavy_minus_sign: | N/A | false | +| `optimizedForStreaming` | [Optional](../../models/operations/GetSearchAllLibrariesOptimizedForStreaming.md) | :heavy_minus_sign: | N/A | 1 | +| `has64bitOffsets` | *Optional* | :heavy_minus_sign: | N/A | false | +| `part` | List<[GetSearchAllLibrariesPart](../../models/operations/GetSearchAllLibrariesPart.md)> | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesMediaContainer.md b/docs/models/operations/GetSearchAllLibrariesMediaContainer.md new file mode 100644 index 00000000..c8ad3a8a --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesMediaContainer.md @@ -0,0 +1,9 @@ +# GetSearchAllLibrariesMediaContainer + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `size` | *double* | :heavy_check_mark: | N/A | +| `searchResult` | List<[SearchResult](../../models/operations/SearchResult.md)> | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesMediaGuid.md b/docs/models/operations/GetSearchAllLibrariesMediaGuid.md new file mode 100644 index 00000000..4ba35ba3 --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesMediaGuid.md @@ -0,0 +1,8 @@ +# GetSearchAllLibrariesMediaGuid + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | Can be one of the following formats:
imdb://tt13015952, tmdb://2434012, tvdb://7945991
| imdb://tt13015952 | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesMetaDataRating.md b/docs/models/operations/GetSearchAllLibrariesMetaDataRating.md new file mode 100644 index 00000000..53c7bc91 --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesMetaDataRating.md @@ -0,0 +1,10 @@ +# GetSearchAllLibrariesMetaDataRating + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `image` | *String* | :heavy_check_mark: | A URI or path to the rating image. | themoviedb://image.rating | +| `value` | *float* | :heavy_check_mark: | The value of the rating. | 3 | +| `type` | *String* | :heavy_check_mark: | The type of rating (e.g., audience, critic). | audience | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesMetadata.md b/docs/models/operations/GetSearchAllLibrariesMetadata.md new file mode 100644 index 00000000..7443e3ac --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesMetadata.md @@ -0,0 +1,81 @@ +# GetSearchAllLibrariesMetadata + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ratingKey` | *String* | :heavy_check_mark: | The rating key (Media ID) of this media item.
Note: This is always an integer, but is represented as a string in the API.
| 58683 | +| `key` | *String* | :heavy_check_mark: | N/A | /library/metadata/58683 | +| `guid` | *String* | :heavy_check_mark: | N/A | plex://movie/5d7768ba96b655001fdc0408 | +| `studio` | *Optional* | :heavy_minus_sign: | N/A | 20th Century Studios | +| `skipChildren` | *Optional* | :heavy_minus_sign: | N/A | false | +| `librarySectionID` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Movies | +| `librarySectionKey` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/1 | +| `type` | [GetSearchAllLibrariesType](../../models/operations/GetSearchAllLibrariesType.md) | :heavy_check_mark: | The type of media content
| movie | +| `title` | *String* | :heavy_check_mark: | N/A | Avatar: The Way of Water | +| `slug` | *Optional* | :heavy_minus_sign: | N/A | 4-for-texas | +| `contentRating` | *Optional* | :heavy_minus_sign: | N/A | PG-13 | +| `summary` | *String* | :heavy_check_mark: | N/A | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home. | +| `rating` | *Optional* | :heavy_minus_sign: | N/A | 7.6 | +| `audienceRating` | *Optional* | :heavy_minus_sign: | N/A | 9.2 | +| `year` | *Optional* | :heavy_minus_sign: | N/A | 2022 | +| `seasonCount` | *Optional* | :heavy_minus_sign: | N/A | 2022 | +| `tagline` | *Optional* | :heavy_minus_sign: | N/A | Return to Pandora. | +| `flattenSeasons` | [Optional](../../models/operations/GetSearchAllLibrariesFlattenSeasons.md) | :heavy_minus_sign: | N/A | 1 | +| `showOrdering` | [Optional](../../models/operations/GetSearchAllLibrariesShowOrdering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show
None = Library default,
tmdbAiring = The Movie Database (Aired),
aired = TheTVDB (Aired),
dvd = TheTVDB (DVD),
absolute = TheTVDB (Absolute)).
| dvd | +| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 | +| `art` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 | +| `banner` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/58683/banner/1703239236 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 11558112 | +| `originallyAvailableAt` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | N/A | 2022-12-14 00:00:00 +0000 UTC | +| `addedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | +| `updatedAt` | *Optional* | :heavy_minus_sign: | Unix epoch datetime in seconds | 1556281940 | +| `audienceRatingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | +| `chapterSource` | *Optional* | :heavy_minus_sign: | N/A | media | +| `primaryExtraKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/58684 | +| `ratingImage` | *Optional* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe | +| `grandparentRatingKey` | *Optional* | :heavy_minus_sign: | N/A | 66 | +| `grandparentGuid` | *Optional* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 | +| `grandparentKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66 | +| `grandparentTitle` | *Optional* | :heavy_minus_sign: | N/A | Caprica | +| `grandparentThumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 | +| `parentSlug` | *Optional* | :heavy_minus_sign: | N/A | alice-in-borderland-2020 | +| `grandparentSlug` | *Optional* | :heavy_minus_sign: | N/A | alice-in-borderland-2020 | +| `grandparentArt` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/art/1705716261 | +| `grandparentTheme` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 | +| `media` | List<[GetSearchAllLibrariesMedia](../../models/operations/GetSearchAllLibrariesMedia.md)> | :heavy_minus_sign: | The Media object is only included when type query is `4` or higher.
| | +| `genre` | List<[GetSearchAllLibrariesGenre](../../models/operations/GetSearchAllLibrariesGenre.md)> | :heavy_minus_sign: | N/A | | +| `country` | List<[GetSearchAllLibrariesCountry](../../models/operations/GetSearchAllLibrariesCountry.md)> | :heavy_minus_sign: | N/A | | +| `director` | List<[GetSearchAllLibrariesDirector](../../models/operations/GetSearchAllLibrariesDirector.md)> | :heavy_minus_sign: | N/A | | +| `writer` | List<[GetSearchAllLibrariesWriter](../../models/operations/GetSearchAllLibrariesWriter.md)> | :heavy_minus_sign: | N/A | | +| `collection` | List<[GetSearchAllLibrariesCollection](../../models/operations/GetSearchAllLibrariesCollection.md)> | :heavy_minus_sign: | N/A | | +| `role` | List<[GetSearchAllLibrariesRole](../../models/operations/GetSearchAllLibrariesRole.md)> | :heavy_minus_sign: | N/A | | +| `location` | List<[GetSearchAllLibrariesLocation](../../models/operations/GetSearchAllLibrariesLocation.md)> | :heavy_minus_sign: | N/A | | +| `mediaGuid` | List<[GetSearchAllLibrariesMediaGuid](../../models/operations/GetSearchAllLibrariesMediaGuid.md)> | :heavy_minus_sign: | The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
| | +| `ultraBlurColors` | [Optional](../../models/operations/GetSearchAllLibrariesUltraBlurColors.md) | :heavy_minus_sign: | N/A | | +| `metaDataRating` | List<[GetSearchAllLibrariesMetaDataRating](../../models/operations/GetSearchAllLibrariesMetaDataRating.md)> | :heavy_minus_sign: | N/A | | +| `image` | List<[GetSearchAllLibrariesImage](../../models/operations/GetSearchAllLibrariesImage.md)> | :heavy_minus_sign: | N/A | | +| `titleSort` | *Optional* | :heavy_minus_sign: | N/A | Whale | +| `viewCount` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `lastViewedAt` | *Optional* | :heavy_minus_sign: | N/A | 1682752242 | +| `originalTitle` | *Optional* | :heavy_minus_sign: | N/A | 映画 ブラッククローバー 魔法帝の剣 | +| `viewOffset` | *Optional* | :heavy_minus_sign: | N/A | 5222500 | +| `skipCount` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `index` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `theme` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/1/theme/1705636920 | +| `leafCount` | *Optional* | :heavy_minus_sign: | N/A | 14 | +| `viewedLeafCount` | *Optional* | :heavy_minus_sign: | N/A | 0 | +| `childCount` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `hasPremiumExtras` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `hasPremiumPrimaryExtra` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `parentRatingKey` | *Optional* | :heavy_minus_sign: | The rating key of the parent item.
| 66 | +| `parentGuid` | *Optional* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 | +| `parentStudio` | *Optional* | :heavy_minus_sign: | N/A | UCP | +| `parentKey` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66 | +| `parentTitle` | *Optional* | :heavy_minus_sign: | N/A | Caprica | +| `parentIndex` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `parentYear` | *Optional* | :heavy_minus_sign: | N/A | 2010 | +| `parentThumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 | +| `parentTheme` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesOptimizedForStreaming.md b/docs/models/operations/GetSearchAllLibrariesOptimizedForStreaming.md new file mode 100644 index 00000000..0011a0e5 --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesOptimizedForStreaming.md @@ -0,0 +1,9 @@ +# GetSearchAllLibrariesOptimizedForStreaming + + +## Values + +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesPart.md b/docs/models/operations/GetSearchAllLibrariesPart.md new file mode 100644 index 00000000..0445864c --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesPart.md @@ -0,0 +1,20 @@ +# GetSearchAllLibrariesPart + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `id` | *int* | :heavy_check_mark: | N/A | 119542 | +| `key` | *String* | :heavy_check_mark: | N/A | /library/parts/119542/1680457526/file.mkv | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 11558112 | +| `file` | *String* | :heavy_check_mark: | N/A | /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv | +| `size` | *long* | :heavy_check_mark: | N/A | 36158371307 | +| `container` | *String* | :heavy_check_mark: | The container format of the media file.
| mkv | +| `audioProfile` | *Optional* | :heavy_minus_sign: | N/A | dts | +| `has64bitOffsets` | *Optional* | :heavy_minus_sign: | N/A | false | +| `optimizedForStreaming` | *Optional* | :heavy_minus_sign: | N/A | false | +| `videoProfile` | *Optional* | :heavy_minus_sign: | N/A | main 10 | +| `indexes` | *Optional* | :heavy_minus_sign: | N/A | sd | +| `hasThumbnail` | [Optional](../../models/operations/GetSearchAllLibrariesHasThumbnail.md) | :heavy_minus_sign: | N/A | 1 | +| `stream` | List<[GetSearchAllLibrariesStream](../../models/operations/GetSearchAllLibrariesStream.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesRequest.md b/docs/models/operations/GetSearchAllLibrariesRequest.md new file mode 100644 index 00000000..bc305f42 --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesRequest.md @@ -0,0 +1,13 @@ +# GetSearchAllLibrariesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `query` | *String* | :heavy_check_mark: | The search query term. | | +| `clientID` | *Optional* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | +| `limit` | *Optional* | :heavy_minus_sign: | Limit the number of results returned. | | +| `searchTypes` | List<[SearchTypes](../../models/operations/SearchTypes.md)> | :heavy_minus_sign: | A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv.
| movies,music,otherVideos,people,tv | +| `includeCollections` | [Optional](../../models/operations/QueryParamIncludeCollections.md) | :heavy_minus_sign: | Whether to include collections in the search results. | 1 | +| `includeExternalMedia` | [Optional](../../models/operations/QueryParamIncludeExternalMedia.md) | :heavy_minus_sign: | Whether to include external media in the search results. | 1 | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesResponse.md b/docs/models/operations/GetSearchAllLibrariesResponse.md new file mode 100644 index 00000000..f512dfa3 --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesResponse.md @@ -0,0 +1,11 @@ +# GetSearchAllLibrariesResponse + + +## 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](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](../../models/operations/GetSearchAllLibrariesResponseBody.md) | :heavy_minus_sign: | The libraries available on the Server | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesResponseBody.md b/docs/models/operations/GetSearchAllLibrariesResponseBody.md new file mode 100644 index 00000000..90896681 --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesResponseBody.md @@ -0,0 +1,10 @@ +# GetSearchAllLibrariesResponseBody + +The libraries available on the Server + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `mediaContainer` | [GetSearchAllLibrariesMediaContainer](../../models/operations/GetSearchAllLibrariesMediaContainer.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesRole.md b/docs/models/operations/GetSearchAllLibrariesRole.md new file mode 100644 index 00000000..726bdbbe --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesRole.md @@ -0,0 +1,13 @@ +# GetSearchAllLibrariesRole + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | The ID of the tag or actor. | 294129 | +| `filter` | *Optional* | :heavy_minus_sign: | The filter used to find the actor or tag. | actor=294129 | +| `thumb` | *Optional* | :heavy_minus_sign: | The thumbnail of the actor | https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg | +| `tag` | *Optional* | :heavy_minus_sign: | The name of the tag or actor. | Mike Smith | +| `tagKey` | *Optional* | :heavy_minus_sign: | Unique identifier for the tag. | 668e7e7b22bcad9064350c91 | +| `role` | *Optional* | :heavy_minus_sign: | The role of the actor or tag in the media. | Self | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesShowOrdering.md b/docs/models/operations/GetSearchAllLibrariesShowOrdering.md new file mode 100644 index 00000000..5876c454 --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesShowOrdering.md @@ -0,0 +1,20 @@ +# GetSearchAllLibrariesShowOrdering + +Setting that indicates the episode ordering for the show +None = Library default, +tmdbAiring = The Movie Database (Aired), +aired = TheTVDB (Aired), +dvd = TheTVDB (DVD), +absolute = TheTVDB (Absolute)). + + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `None` | None | +| `TmdbAiring` | tmdbAiring | +| `Aired` | aired | +| `Dvd` | dvd | +| `Absolute` | absolute | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesStream.md b/docs/models/operations/GetSearchAllLibrariesStream.md new file mode 100644 index 00000000..e6125a0e --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesStream.md @@ -0,0 +1,45 @@ +# GetSearchAllLibrariesStream + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `id` | *long* | :heavy_check_mark: | N/A | 272796 | +| `streamType` | *long* | :heavy_check_mark: | Type of stream (1 = video, 2 = audio, 3 = subtitle) | 1 | +| `default_` | *Optional* | :heavy_minus_sign: | Indicates if this is the default stream | true | +| `selected` | *Optional* | :heavy_minus_sign: | Indicates if the stream is selected | true | +| `codec` | *String* | :heavy_check_mark: | Codec used by the stream | h264 | +| `index` | *long* | :heavy_check_mark: | The index of the stream | 0 | +| `bitrate` | *Optional* | :heavy_minus_sign: | The bitrate of the stream in kbps | 6273 | +| `colorPrimaries` | *Optional* | :heavy_minus_sign: | The color primaries of the video stream | bt709 | +| `colorRange` | *Optional* | :heavy_minus_sign: | The color range of the video stream | tv | +| `colorSpace` | *Optional* | :heavy_minus_sign: | The color space of the video stream | bt709 | +| `colorTrc` | *Optional* | :heavy_minus_sign: | The transfer characteristics (TRC) of the video stream | bt709 | +| `bitDepth` | *Optional* | :heavy_minus_sign: | The bit depth of the video stream | 8 | +| `chromaLocation` | *Optional* | :heavy_minus_sign: | The chroma location of the video stream | left | +| `streamIdentifier` | *Optional* | :heavy_minus_sign: | The identifier of the video stream | 2 | +| `chromaSubsampling` | *Optional* | :heavy_minus_sign: | The chroma subsampling format | 4:2:0 | +| `codedHeight` | *Optional* | :heavy_minus_sign: | The coded height of the video stream | 1088 | +| `codedWidth` | *Optional* | :heavy_minus_sign: | The coded width of the video stream | 1920 | +| `frameRate` | *Optional* | :heavy_minus_sign: | The frame rate of the video stream | 29.97 | +| `hasScalingMatrix` | *Optional* | :heavy_minus_sign: | Indicates if the stream has a scaling matrix | false | +| `hearingImpaired` | *Optional* | :heavy_minus_sign: | N/A | false | +| `closedCaptions` | *Optional* | :heavy_minus_sign: | N/A | false | +| `embeddedInVideo` | *Optional* | :heavy_minus_sign: | N/A | 1 | +| `height` | *Optional* | :heavy_minus_sign: | The height of the video stream | 1080 | +| `level` | *Optional* | :heavy_minus_sign: | The level of the video codec | 40 | +| `profile` | *Optional* | :heavy_minus_sign: | The profile of the video codec | main | +| `refFrames` | *Optional* | :heavy_minus_sign: | Number of reference frames | 4 | +| `scanType` | *Optional* | :heavy_minus_sign: | The scan type (progressive or interlaced) | progressive | +| `width` | *Optional* | :heavy_minus_sign: | The width of the video stream | 1920 | +| `displayTitle` | *Optional* | :heavy_minus_sign: | Display title of the stream | 1080p (H.264) | +| `extendedDisplayTitle` | *Optional* | :heavy_minus_sign: | Extended display title of the stream | 1080p (H.264) | +| `channels` | *Optional* | :heavy_minus_sign: | Number of audio channels (for audio streams) | 2 | +| `language` | *Optional* | :heavy_minus_sign: | The language of the stream (for audio/subtitle streams) | English | +| `languageTag` | *Optional* | :heavy_minus_sign: | Language tag of the stream | en | +| `languageCode` | *Optional* | :heavy_minus_sign: | Language code of the stream | eng | +| `audioChannelLayout` | *Optional* | :heavy_minus_sign: | The audio channel layout | stereo | +| `samplingRate` | *Optional* | :heavy_minus_sign: | Sampling rate of the audio stream in Hz | 48000 | +| `title` | *Optional* | :heavy_minus_sign: | Title of the subtitle track (for subtitle streams) | English | +| `canAutoSync` | *Optional* | :heavy_minus_sign: | Indicates if the subtitle stream can auto-sync | false | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesType.md b/docs/models/operations/GetSearchAllLibrariesType.md new file mode 100644 index 00000000..6d5e31ee --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesType.md @@ -0,0 +1,14 @@ +# GetSearchAllLibrariesType + +The type of media content + + + +## Values + +| Name | Value | +| --------- | --------- | +| `Movie` | movie | +| `TvShow` | show | +| `Season` | season | +| `Episode` | episode | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesUltraBlurColors.md b/docs/models/operations/GetSearchAllLibrariesUltraBlurColors.md new file mode 100644 index 00000000..49657694 --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesUltraBlurColors.md @@ -0,0 +1,11 @@ +# GetSearchAllLibrariesUltraBlurColors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `topLeft` | *String* | :heavy_check_mark: | N/A | 11333b | +| `topRight` | *String* | :heavy_check_mark: | N/A | 0a232d | +| `bottomRight` | *String* | :heavy_check_mark: | N/A | 73958 | +| `bottomLeft` | *String* | :heavy_check_mark: | N/A | 1f5066 | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesWriter.md b/docs/models/operations/GetSearchAllLibrariesWriter.md new file mode 100644 index 00000000..f351dc21 --- /dev/null +++ b/docs/models/operations/GetSearchAllLibrariesWriter.md @@ -0,0 +1,8 @@ +# GetSearchAllLibrariesWriter + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `tag` | *Optional* | :heavy_minus_sign: | N/A | James Cameron | \ No newline at end of file diff --git a/docs/models/operations/GetServerResourcesRequest.md b/docs/models/operations/GetServerResourcesRequest.md index c5212001..1389fd89 100644 --- a/docs/models/operations/GetServerResourcesRequest.md +++ b/docs/models/operations/GetServerResourcesRequest.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `includeHttps` | [Optional](../../models/operations/IncludeHttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 | -| `includeRelay` | [Optional](../../models/operations/IncludeRelay.md) | :heavy_minus_sign: | Include Relay addresses in the results
E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
| 1 | -| `includeIPv6` | [Optional](../../models/operations/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 | -| `clientID` | *Optional* | :heavy_minus_sign: | The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) | gcgzw5rz2xovp84b4vha3a40 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `includeHttps` | [Optional](../../models/operations/IncludeHttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 | +| `includeRelay` | [Optional](../../models/operations/IncludeRelay.md) | :heavy_minus_sign: | Include Relay addresses in the results
E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
| 1 | +| `includeIPv6` | [Optional](../../models/operations/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 | +| `clientID` | *Optional* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | \ No newline at end of file diff --git a/docs/models/operations/GetThumbImageRequest.md b/docs/models/operations/GetThumbImageRequest.md index 9becb568..b31d8f83 100644 --- a/docs/models/operations/GetThumbImageRequest.md +++ b/docs/models/operations/GetThumbImageRequest.md @@ -10,4 +10,4 @@ | `height` | *long* | :heavy_check_mark: | N/A | 396 | | `minSize` | *long* | :heavy_check_mark: | N/A | 1 | | `upscale` | *long* | :heavy_check_mark: | N/A | 1 | -| `xPlexToken` | *String* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file +| `xPlexToken` | *String* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file diff --git a/docs/models/operations/GetTokenByPinIdRequest.md b/docs/models/operations/GetTokenByPinIdRequest.md index 429b1b4b..7feb8320 100644 --- a/docs/models/operations/GetTokenByPinIdRequest.md +++ b/docs/models/operations/GetTokenByPinIdRequest.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `pinID` | *long* | :heavy_check_mark: | The PinID to retrieve an access token for | | -| `clientID` | *Optional* | :heavy_minus_sign: | The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) | gcgzw5rz2xovp84b4vha3a40 | -| `clientName` | *Optional* | :heavy_minus_sign: | N/A | Plex Web | -| `deviceName` | *Optional* | :heavy_minus_sign: | N/A | Linux | -| `clientVersion` | *Optional* | :heavy_minus_sign: | N/A | 4.133.0 | -| `clientPlatform` | *Optional* | :heavy_minus_sign: | N/A | Chrome | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `pinID` | *long* | :heavy_check_mark: | The PinID to retrieve an access token for | | +| `clientID` | *Optional* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | +| `clientName` | *Optional* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku | +| `deviceNickname` | *Optional* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `clientVersion` | *Optional* | :heavy_minus_sign: | The version of the client application. | 2.4.1 | +| `platform` | *Optional* | :heavy_minus_sign: | The platform of the client application. | Roku | \ No newline at end of file diff --git a/docs/models/operations/GetTokenDetailsFeatures.md b/docs/models/operations/GetTokenDetailsFeatures.md deleted file mode 100644 index 2cea75c0..00000000 --- a/docs/models/operations/GetTokenDetailsFeatures.md +++ /dev/null @@ -1,102 +0,0 @@ -# GetTokenDetailsFeatures - - -## Values - -| Name | Value | -| ----------------------------------------- | ----------------------------------------- | -| `ANDROID_DOLBY_VISION` | Android - Dolby Vision | -| `ANDROID_PI_P` | Android - PiP | -| `CU_SUNSET` | CU Sunset | -| `HRK_ENABLE_EUR` | HRK_enable_EUR | -| `TREBLE_SHOW_FEATURES` | TREBLE-show-features | -| `AD_COUNTDOWN_TIMER` | ad-countdown-timer | -| `ADAPTIVE_BITRATE` | adaptive_bitrate | -| `ALBUM_TYPES` | album-types | -| `ALLOW_DVR` | allow_dvr | -| `AMAZON_LOOP_DEBUG` | amazon-loop-debug | -| `AVOD_AD_ANALYSIS` | avod-ad-analysis | -| `AVOD_NEW_MEDIA` | avod-new-media | -| `BLACKLIST_GET_SIGNIN` | blacklist_get_signin | -| `BOOST_VOICES` | boost-voices | -| `CAMERA_UPLOAD` | camera_upload | -| `CLIENT_RADIO_STATIONS` | client-radio-stations | -| `CLOUDFLARE_TURNSTILE_REQUIRED` | cloudflare-turnstile-required | -| `CLOUDSYNC` | cloudsync | -| `COLLECTIONS` | collections | -| `COMMENTS_AND_REPLIES_PUSH_NOTIFICATIONS` | comments_and_replies_push_notifications | -| `COMMUNITY_ACCESS_PLEX_TV` | community_access_plex_tv | -| `COMPANIONS_SONOS` | companions_sonos | -| `CONTENT_FILTER` | content_filter | -| `CUSTOM_HOME_REMOVAL` | custom-home-removal | -| `DISABLE_HOME_USER_FRIENDSHIPS` | disable_home_user_friendships | -| `DISABLE_SHARING_FRIENDSHIPS` | disable_sharing_friendships | -| `DOWNLOADS_GATING` | downloads-gating | -| `DRM_SUPPORT` | drm_support | -| `DVR` | dvr | -| `DVR_BLOCK_UNSUPPORTED_COUNTRIES` | dvr-block-unsupported-countries | -| `EPG_RECENT_CHANNELS` | epg-recent-channels | -| `EXCLUDE_RESTRICTIONS` | exclude restrictions | -| `FEDERATED_AUTH` | federated-auth | -| `FRIEND_REQUEST_PUSH_NOTIFICATIONS` | friend_request_push_notifications | -| `GRANDFATHER_SYNC` | grandfather-sync | -| `GUIDED_UPGRADE` | guided-upgrade | -| `HARDWARE_TRANSCODING` | hardware_transcoding | -| `HOME` | home | -| `HWTRANSCODE` | hwtranscode | -| `IMAGGA_V2` | imagga-v2 | -| `INCREASE_PASSWORD_COMPLEXITY` | increase-password-complexity | -| `IOS14_PRIVACY_BANNER` | ios14-privacy-banner | -| `ITERABLE_NOTIFICATION_TOKENS` | iterable-notification-tokens | -| `ITEM_CLUSTERS` | item_clusters | -| `KEEP_PAYMENT_METHOD` | keep-payment-method | -| `KEVIN_BACON` | kevin-bacon | -| `KOREA_CONSENT` | korea-consent | -| `LE_ISRG_ROOT_X1` | le_isrg_root_x1 | -| `LETS_ENCRYPT` | lets_encrypt | -| `LIGHTNING_DVR_PIVOT` | lightning-dvr-pivot | -| `LIVE_TV_SUPPORT_INCOMPLETE_SEGMENTS` | live-tv-support-incomplete-segments | -| `LIVETV` | livetv | -| `LYRICS` | lyrics | -| `METADATA_SEARCH` | metadata_search | -| `MUSIC_ANALYSIS` | music-analysis | -| `MUSIC_VIDEOS` | music_videos | -| `NEW_PLEX_PASS_PRICES` | new_plex_pass_prices | -| `NEWS_PROVIDER_SUNSET_MODAL` | news-provider-sunset-modal | -| `NOMINATIM` | nominatim | -| `PASS` | pass | -| `PHOTOS_FAVORITES` | photos-favorites | -| `PHOTOS_METADATA_EDITION` | photos-metadata-edition | -| `PHOTOS_V6_EDIT` | photosV6-edit | -| `PHOTOS_V6_TV_ALBUMS` | photosV6-tv-albums | -| `PMS_HEALTH` | pms_health | -| `PREMIUM_DASHBOARD` | premium-dashboard | -| `PREMIUM_MUSIC_METADATA` | premium_music_metadata | -| `RADIO` | radio | -| `RATE_LIMIT_CLIENT_TOKEN` | rate-limit-client-token | -| `SCROBBLING_SERVICE_PLEX_TV` | scrobbling-service-plex-tv | -| `SESSION_BANDWIDTH_RESTRICTIONS` | session_bandwidth_restrictions | -| `SESSION_KICK` | session_kick | -| `SHARED_SERVER_NOTIFICATION` | shared_server_notification | -| `SHARED_SOURCE_NOTIFICATION` | shared_source_notification | -| `SIGNIN_NOTIFICATION` | signin_notification | -| `SIGNIN_WITH_APPLE` | signin_with_apple | -| `SILENCE_REMOVAL` | silence-removal | -| `SLEEP_TIMER` | sleep-timer | -| `SPRING_SERVE_AD_PROVIDER` | spring_serve_ad_provider | -| `SYNC` | sync | -| `SWEET_FADES` | sweet-fades | -| `TRANSCODER_CACHE` | transcoder_cache | -| `TRAILERS` | trailers | -| `TUNER_SHARING` | tuner-sharing | -| `TWO_FACTOR_AUTHENTICATION` | two-factor-authentication | -| `UNSUPPORTEDTUNERS` | unsupportedtuners | -| `UPGRADE3DS2` | upgrade-3ds2 | -| `VISUALIZERS` | visualizers | -| `VOD_SCHEMA` | vod-schema | -| `VOD_CLOUDFLARE` | vod_cloudflare | -| `VOLUME_LEVELING` | volume-leveling | -| `WATCH_TOGETHER_INVITE` | watch-together-invite | -| `WATCHLIST_RSS` | watchlist-rss | -| `WEB_SERVER_DASHBOARD` | web_server_dashboard | -| `WEBHOOKS` | webhooks | \ No newline at end of file diff --git a/docs/models/operations/GetTokenDetailsSubscription.md b/docs/models/operations/GetTokenDetailsSubscription.md index 870177b6..1f06b227 100644 --- a/docs/models/operations/GetTokenDetailsSubscription.md +++ b/docs/models/operations/GetTokenDetailsSubscription.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `features` | List<[GetTokenDetailsFeatures](../../models/operations/GetTokenDetailsFeatures.md)> | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | +| `features` | List<*String*> | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | | `active` | *Optional* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true | | `subscribedAt` | *JsonNullable* | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z | | `status` | [Optional](../../models/operations/GetTokenDetailsAuthenticationResponseStatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive | diff --git a/docs/models/operations/GetTopWatchedContentRequest.md b/docs/models/operations/GetTopWatchedContentRequest.md index 033b6889..8f6501b0 100644 --- a/docs/models/operations/GetTopWatchedContentRequest.md +++ b/docs/models/operations/GetTopWatchedContentRequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [GetTopWatchedContentQueryParamType](../../models/operations/GetTopWatchedContentQueryParamType.md) | :heavy_check_mark: | The type of media to retrieve.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | -| `includeGuids` | *Optional* | :heavy_minus_sign: | Adds the Guids object to the response
| 1 | \ No newline at end of file +| `includeGuids` | *Optional* | :heavy_minus_sign: | Adds the Guids object to the response
| 1 | +| `type` | [GetTopWatchedContentQueryParamType](../../models/operations/GetTopWatchedContentQueryParamType.md) | :heavy_check_mark: | The type of media to retrieve.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | \ No newline at end of file diff --git a/docs/models/operations/GetWatchListRequest.md b/docs/models/operations/GetWatchListRequest.md index 6aa64e74..346899ad 100644 --- a/docs/models/operations/GetWatchListRequest.md +++ b/docs/models/operations/GetWatchListRequest.md @@ -13,4 +13,4 @@ | `includeExternalMedia` | [Optional](../../models/operations/IncludeExternalMedia.md) | :heavy_minus_sign: | include external media in the results
| | | `xPlexContainerStart` | *Optional* | :heavy_minus_sign: | The index of the first item to return. If not specified, the first item will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 0
| 0 | | `xPlexContainerSize` | *Optional* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 50
| 50 | -| `xPlexToken` | *String* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file +| `xPlexToken` | *String* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file diff --git a/docs/models/operations/Location.md b/docs/models/operations/Location.md index b49c986c..315b3bd7 100644 --- a/docs/models/operations/Location.md +++ b/docs/models/operations/Location.md @@ -5,5 +5,4 @@ | Field | Type | Required | Description | Example | | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `id` | *int* | :heavy_check_mark: | N/A | 1 | -| `path` | *String* | :heavy_check_mark: | N/A | /movies | \ No newline at end of file +| `path` | *Optional* | :heavy_minus_sign: | N/A | /TV Shows/House | \ No newline at end of file diff --git a/docs/models/operations/Media.md b/docs/models/operations/Media.md index 00727c8b..9dd6403b 100644 --- a/docs/models/operations/Media.md +++ b/docs/models/operations/Media.md @@ -6,19 +6,19 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | | `id` | *int* | :heavy_check_mark: | N/A | 119534 | -| `duration` | *int* | :heavy_check_mark: | N/A | 11558112 | -| `bitrate` | *int* | :heavy_check_mark: | N/A | 25025 | -| `width` | *int* | :heavy_check_mark: | N/A | 3840 | -| `height` | *int* | :heavy_check_mark: | N/A | 2072 | -| `aspectRatio` | *double* | :heavy_check_mark: | N/A | 1.85 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 11558112 | +| `bitrate` | *Optional* | :heavy_minus_sign: | N/A | 25025 | +| `width` | *Optional* | :heavy_minus_sign: | N/A | 3840 | +| `height` | *Optional* | :heavy_minus_sign: | N/A | 2072 | +| `aspectRatio` | *Optional* | :heavy_minus_sign: | N/A | 1.85 | | `audioProfile` | *Optional* | :heavy_minus_sign: | N/A | dts | -| `audioChannels` | *int* | :heavy_check_mark: | N/A | 6 | -| `audioCodec` | *String* | :heavy_check_mark: | N/A | eac3 | -| `videoCodec` | *String* | :heavy_check_mark: | N/A | hevc | -| `videoResolution` | *String* | :heavy_check_mark: | N/A | 4k | +| `audioChannels` | *Optional* | :heavy_minus_sign: | N/A | 6 | +| `audioCodec` | *Optional* | :heavy_minus_sign: | N/A | eac3 | +| `videoCodec` | *Optional* | :heavy_minus_sign: | N/A | hevc | +| `videoResolution` | *Optional* | :heavy_minus_sign: | N/A | 4k | | `container` | *String* | :heavy_check_mark: | N/A | mkv | -| `videoFrameRate` | *String* | :heavy_check_mark: | N/A | 24p | -| `videoProfile` | *String* | :heavy_check_mark: | N/A | main 10 | +| `videoFrameRate` | *Optional* | :heavy_minus_sign: | N/A | 24p | +| `videoProfile` | *Optional* | :heavy_minus_sign: | N/A | main 10 | | `hasVoiceActivity` | *Optional* | :heavy_minus_sign: | N/A | false | | `optimizedForStreaming` | [Optional](../../models/operations/OptimizedForStreaming.md) | :heavy_minus_sign: | N/A | 1 | | `has64bitOffsets` | *Optional* | :heavy_minus_sign: | N/A | false | diff --git a/docs/models/operations/Part.md b/docs/models/operations/Part.md index 8ac0e890..c7e2335f 100644 --- a/docs/models/operations/Part.md +++ b/docs/models/operations/Part.md @@ -7,14 +7,14 @@ | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | `id` | *int* | :heavy_check_mark: | N/A | 119542 | | `key` | *String* | :heavy_check_mark: | N/A | /library/parts/119542/1680457526/file.mkv | -| `duration` | *int* | :heavy_check_mark: | N/A | 11558112 | +| `duration` | *Optional* | :heavy_minus_sign: | N/A | 11558112 | | `file` | *String* | :heavy_check_mark: | N/A | /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv | | `size` | *long* | :heavy_check_mark: | N/A | 36158371307 | | `container` | *String* | :heavy_check_mark: | The container format of the media file.
| mkv | | `audioProfile` | *Optional* | :heavy_minus_sign: | N/A | dts | | `has64bitOffsets` | *Optional* | :heavy_minus_sign: | N/A | false | | `optimizedForStreaming` | *Optional* | :heavy_minus_sign: | N/A | false | -| `videoProfile` | *String* | :heavy_check_mark: | N/A | main 10 | +| `videoProfile` | *Optional* | :heavy_minus_sign: | N/A | main 10 | | `indexes` | *Optional* | :heavy_minus_sign: | N/A | sd | | `hasThumbnail` | [Optional](../../models/operations/HasThumbnail.md) | :heavy_minus_sign: | N/A | 1 | | `stream` | List<[Stream](../../models/operations/Stream.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/PostUsersSignInDataAuthenticationFeatures.md b/docs/models/operations/PostUsersSignInDataAuthenticationFeatures.md deleted file mode 100644 index 1c31654e..00000000 --- a/docs/models/operations/PostUsersSignInDataAuthenticationFeatures.md +++ /dev/null @@ -1,102 +0,0 @@ -# PostUsersSignInDataAuthenticationFeatures - - -## Values - -| Name | Value | -| ----------------------------------------- | ----------------------------------------- | -| `ANDROID_DOLBY_VISION` | Android - Dolby Vision | -| `ANDROID_PI_P` | Android - PiP | -| `CU_SUNSET` | CU Sunset | -| `HRK_ENABLE_EUR` | HRK_enable_EUR | -| `TREBLE_SHOW_FEATURES` | TREBLE-show-features | -| `AD_COUNTDOWN_TIMER` | ad-countdown-timer | -| `ADAPTIVE_BITRATE` | adaptive_bitrate | -| `ALBUM_TYPES` | album-types | -| `ALLOW_DVR` | allow_dvr | -| `AMAZON_LOOP_DEBUG` | amazon-loop-debug | -| `AVOD_AD_ANALYSIS` | avod-ad-analysis | -| `AVOD_NEW_MEDIA` | avod-new-media | -| `BLACKLIST_GET_SIGNIN` | blacklist_get_signin | -| `BOOST_VOICES` | boost-voices | -| `CAMERA_UPLOAD` | camera_upload | -| `CLIENT_RADIO_STATIONS` | client-radio-stations | -| `CLOUDFLARE_TURNSTILE_REQUIRED` | cloudflare-turnstile-required | -| `CLOUDSYNC` | cloudsync | -| `COLLECTIONS` | collections | -| `COMMENTS_AND_REPLIES_PUSH_NOTIFICATIONS` | comments_and_replies_push_notifications | -| `COMMUNITY_ACCESS_PLEX_TV` | community_access_plex_tv | -| `COMPANIONS_SONOS` | companions_sonos | -| `CONTENT_FILTER` | content_filter | -| `CUSTOM_HOME_REMOVAL` | custom-home-removal | -| `DISABLE_HOME_USER_FRIENDSHIPS` | disable_home_user_friendships | -| `DISABLE_SHARING_FRIENDSHIPS` | disable_sharing_friendships | -| `DOWNLOADS_GATING` | downloads-gating | -| `DRM_SUPPORT` | drm_support | -| `DVR` | dvr | -| `DVR_BLOCK_UNSUPPORTED_COUNTRIES` | dvr-block-unsupported-countries | -| `EPG_RECENT_CHANNELS` | epg-recent-channels | -| `EXCLUDE_RESTRICTIONS` | exclude restrictions | -| `FEDERATED_AUTH` | federated-auth | -| `FRIEND_REQUEST_PUSH_NOTIFICATIONS` | friend_request_push_notifications | -| `GRANDFATHER_SYNC` | grandfather-sync | -| `GUIDED_UPGRADE` | guided-upgrade | -| `HARDWARE_TRANSCODING` | hardware_transcoding | -| `HOME` | home | -| `HWTRANSCODE` | hwtranscode | -| `IMAGGA_V2` | imagga-v2 | -| `INCREASE_PASSWORD_COMPLEXITY` | increase-password-complexity | -| `IOS14_PRIVACY_BANNER` | ios14-privacy-banner | -| `ITERABLE_NOTIFICATION_TOKENS` | iterable-notification-tokens | -| `ITEM_CLUSTERS` | item_clusters | -| `KEEP_PAYMENT_METHOD` | keep-payment-method | -| `KEVIN_BACON` | kevin-bacon | -| `KOREA_CONSENT` | korea-consent | -| `LE_ISRG_ROOT_X1` | le_isrg_root_x1 | -| `LETS_ENCRYPT` | lets_encrypt | -| `LIGHTNING_DVR_PIVOT` | lightning-dvr-pivot | -| `LIVE_TV_SUPPORT_INCOMPLETE_SEGMENTS` | live-tv-support-incomplete-segments | -| `LIVETV` | livetv | -| `LYRICS` | lyrics | -| `METADATA_SEARCH` | metadata_search | -| `MUSIC_ANALYSIS` | music-analysis | -| `MUSIC_VIDEOS` | music_videos | -| `NEW_PLEX_PASS_PRICES` | new_plex_pass_prices | -| `NEWS_PROVIDER_SUNSET_MODAL` | news-provider-sunset-modal | -| `NOMINATIM` | nominatim | -| `PASS` | pass | -| `PHOTOS_FAVORITES` | photos-favorites | -| `PHOTOS_METADATA_EDITION` | photos-metadata-edition | -| `PHOTOS_V6_EDIT` | photosV6-edit | -| `PHOTOS_V6_TV_ALBUMS` | photosV6-tv-albums | -| `PMS_HEALTH` | pms_health | -| `PREMIUM_DASHBOARD` | premium-dashboard | -| `PREMIUM_MUSIC_METADATA` | premium_music_metadata | -| `RADIO` | radio | -| `RATE_LIMIT_CLIENT_TOKEN` | rate-limit-client-token | -| `SCROBBLING_SERVICE_PLEX_TV` | scrobbling-service-plex-tv | -| `SESSION_BANDWIDTH_RESTRICTIONS` | session_bandwidth_restrictions | -| `SESSION_KICK` | session_kick | -| `SHARED_SERVER_NOTIFICATION` | shared_server_notification | -| `SHARED_SOURCE_NOTIFICATION` | shared_source_notification | -| `SIGNIN_NOTIFICATION` | signin_notification | -| `SIGNIN_WITH_APPLE` | signin_with_apple | -| `SILENCE_REMOVAL` | silence-removal | -| `SLEEP_TIMER` | sleep-timer | -| `SPRING_SERVE_AD_PROVIDER` | spring_serve_ad_provider | -| `SYNC` | sync | -| `SWEET_FADES` | sweet-fades | -| `TRANSCODER_CACHE` | transcoder_cache | -| `TRAILERS` | trailers | -| `TUNER_SHARING` | tuner-sharing | -| `TWO_FACTOR_AUTHENTICATION` | two-factor-authentication | -| `UNSUPPORTEDTUNERS` | unsupportedtuners | -| `UPGRADE3DS2` | upgrade-3ds2 | -| `VISUALIZERS` | visualizers | -| `VOD_SCHEMA` | vod-schema | -| `VOD_CLOUDFLARE` | vod_cloudflare | -| `VOLUME_LEVELING` | volume-leveling | -| `WATCH_TOGETHER_INVITE` | watch-together-invite | -| `WATCHLIST_RSS` | watchlist-rss | -| `WEB_SERVER_DASHBOARD` | web_server_dashboard | -| `WEBHOOKS` | webhooks | \ No newline at end of file diff --git a/docs/models/operations/PostUsersSignInDataAuthenticationSubscription.md b/docs/models/operations/PostUsersSignInDataAuthenticationSubscription.md index e6e45488..8f9b045d 100644 --- a/docs/models/operations/PostUsersSignInDataAuthenticationSubscription.md +++ b/docs/models/operations/PostUsersSignInDataAuthenticationSubscription.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| `features` | List<[PostUsersSignInDataAuthenticationFeatures](../../models/operations/PostUsersSignInDataAuthenticationFeatures.md)> | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | +| `features` | List<*String*> | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | | `active` | *Optional* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true | | `subscribedAt` | *JsonNullable* | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z | | `status` | [Optional](../../models/operations/PostUsersSignInDataAuthenticationResponseStatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive | diff --git a/docs/models/operations/PostUsersSignInDataFeatures.md b/docs/models/operations/PostUsersSignInDataFeatures.md deleted file mode 100644 index cd436774..00000000 --- a/docs/models/operations/PostUsersSignInDataFeatures.md +++ /dev/null @@ -1,102 +0,0 @@ -# PostUsersSignInDataFeatures - - -## Values - -| Name | Value | -| ----------------------------------------- | ----------------------------------------- | -| `ANDROID_DOLBY_VISION` | Android - Dolby Vision | -| `ANDROID_PI_P` | Android - PiP | -| `CU_SUNSET` | CU Sunset | -| `HRK_ENABLE_EUR` | HRK_enable_EUR | -| `TREBLE_SHOW_FEATURES` | TREBLE-show-features | -| `AD_COUNTDOWN_TIMER` | ad-countdown-timer | -| `ADAPTIVE_BITRATE` | adaptive_bitrate | -| `ALBUM_TYPES` | album-types | -| `ALLOW_DVR` | allow_dvr | -| `AMAZON_LOOP_DEBUG` | amazon-loop-debug | -| `AVOD_AD_ANALYSIS` | avod-ad-analysis | -| `AVOD_NEW_MEDIA` | avod-new-media | -| `BLACKLIST_GET_SIGNIN` | blacklist_get_signin | -| `BOOST_VOICES` | boost-voices | -| `CAMERA_UPLOAD` | camera_upload | -| `CLIENT_RADIO_STATIONS` | client-radio-stations | -| `CLOUDFLARE_TURNSTILE_REQUIRED` | cloudflare-turnstile-required | -| `CLOUDSYNC` | cloudsync | -| `COLLECTIONS` | collections | -| `COMMENTS_AND_REPLIES_PUSH_NOTIFICATIONS` | comments_and_replies_push_notifications | -| `COMMUNITY_ACCESS_PLEX_TV` | community_access_plex_tv | -| `COMPANIONS_SONOS` | companions_sonos | -| `CONTENT_FILTER` | content_filter | -| `CUSTOM_HOME_REMOVAL` | custom-home-removal | -| `DISABLE_HOME_USER_FRIENDSHIPS` | disable_home_user_friendships | -| `DISABLE_SHARING_FRIENDSHIPS` | disable_sharing_friendships | -| `DOWNLOADS_GATING` | downloads-gating | -| `DRM_SUPPORT` | drm_support | -| `DVR` | dvr | -| `DVR_BLOCK_UNSUPPORTED_COUNTRIES` | dvr-block-unsupported-countries | -| `EPG_RECENT_CHANNELS` | epg-recent-channels | -| `EXCLUDE_RESTRICTIONS` | exclude restrictions | -| `FEDERATED_AUTH` | federated-auth | -| `FRIEND_REQUEST_PUSH_NOTIFICATIONS` | friend_request_push_notifications | -| `GRANDFATHER_SYNC` | grandfather-sync | -| `GUIDED_UPGRADE` | guided-upgrade | -| `HARDWARE_TRANSCODING` | hardware_transcoding | -| `HOME` | home | -| `HWTRANSCODE` | hwtranscode | -| `IMAGGA_V2` | imagga-v2 | -| `INCREASE_PASSWORD_COMPLEXITY` | increase-password-complexity | -| `IOS14_PRIVACY_BANNER` | ios14-privacy-banner | -| `ITERABLE_NOTIFICATION_TOKENS` | iterable-notification-tokens | -| `ITEM_CLUSTERS` | item_clusters | -| `KEEP_PAYMENT_METHOD` | keep-payment-method | -| `KEVIN_BACON` | kevin-bacon | -| `KOREA_CONSENT` | korea-consent | -| `LE_ISRG_ROOT_X1` | le_isrg_root_x1 | -| `LETS_ENCRYPT` | lets_encrypt | -| `LIGHTNING_DVR_PIVOT` | lightning-dvr-pivot | -| `LIVE_TV_SUPPORT_INCOMPLETE_SEGMENTS` | live-tv-support-incomplete-segments | -| `LIVETV` | livetv | -| `LYRICS` | lyrics | -| `METADATA_SEARCH` | metadata_search | -| `MUSIC_ANALYSIS` | music-analysis | -| `MUSIC_VIDEOS` | music_videos | -| `NEW_PLEX_PASS_PRICES` | new_plex_pass_prices | -| `NEWS_PROVIDER_SUNSET_MODAL` | news-provider-sunset-modal | -| `NOMINATIM` | nominatim | -| `PASS` | pass | -| `PHOTOS_FAVORITES` | photos-favorites | -| `PHOTOS_METADATA_EDITION` | photos-metadata-edition | -| `PHOTOS_V6_EDIT` | photosV6-edit | -| `PHOTOS_V6_TV_ALBUMS` | photosV6-tv-albums | -| `PMS_HEALTH` | pms_health | -| `PREMIUM_DASHBOARD` | premium-dashboard | -| `PREMIUM_MUSIC_METADATA` | premium_music_metadata | -| `RADIO` | radio | -| `RATE_LIMIT_CLIENT_TOKEN` | rate-limit-client-token | -| `SCROBBLING_SERVICE_PLEX_TV` | scrobbling-service-plex-tv | -| `SESSION_BANDWIDTH_RESTRICTIONS` | session_bandwidth_restrictions | -| `SESSION_KICK` | session_kick | -| `SHARED_SERVER_NOTIFICATION` | shared_server_notification | -| `SHARED_SOURCE_NOTIFICATION` | shared_source_notification | -| `SIGNIN_NOTIFICATION` | signin_notification | -| `SIGNIN_WITH_APPLE` | signin_with_apple | -| `SILENCE_REMOVAL` | silence-removal | -| `SLEEP_TIMER` | sleep-timer | -| `SPRING_SERVE_AD_PROVIDER` | spring_serve_ad_provider | -| `SYNC` | sync | -| `SWEET_FADES` | sweet-fades | -| `TRANSCODER_CACHE` | transcoder_cache | -| `TRAILERS` | trailers | -| `TUNER_SHARING` | tuner-sharing | -| `TWO_FACTOR_AUTHENTICATION` | two-factor-authentication | -| `UNSUPPORTEDTUNERS` | unsupportedtuners | -| `UPGRADE3DS2` | upgrade-3ds2 | -| `VISUALIZERS` | visualizers | -| `VOD_SCHEMA` | vod-schema | -| `VOD_CLOUDFLARE` | vod_cloudflare | -| `VOLUME_LEVELING` | volume-leveling | -| `WATCH_TOGETHER_INVITE` | watch-together-invite | -| `WATCHLIST_RSS` | watchlist-rss | -| `WEB_SERVER_DASHBOARD` | web_server_dashboard | -| `WEBHOOKS` | webhooks | \ No newline at end of file diff --git a/docs/models/operations/PostUsersSignInDataRequest.md b/docs/models/operations/PostUsersSignInDataRequest.md index 26110d80..30007801 100644 --- a/docs/models/operations/PostUsersSignInDataRequest.md +++ b/docs/models/operations/PostUsersSignInDataRequest.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `clientID` | *Optional* | :heavy_minus_sign: | The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) | gcgzw5rz2xovp84b4vha3a40 | -| `clientName` | *Optional* | :heavy_minus_sign: | N/A | Plex Web | -| `deviceName` | *Optional* | :heavy_minus_sign: | N/A | Linux | -| `clientVersion` | *Optional* | :heavy_minus_sign: | N/A | 4.133.0 | -| `clientPlatform` | *Optional* | :heavy_minus_sign: | N/A | Chrome | -| `requestBody` | [Optional](../../models/operations/PostUsersSignInDataRequestBody.md) | :heavy_minus_sign: | Login credentials | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `clientID` | *Optional* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | +| `clientName` | *Optional* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku | +| `deviceNickname` | *Optional* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | +| `clientVersion` | *Optional* | :heavy_minus_sign: | The version of the client application. | 2.4.1 | +| `platform` | *Optional* | :heavy_minus_sign: | The platform of the client application. | Roku | +| `requestBody` | [Optional](../../models/operations/PostUsersSignInDataRequestBody.md) | :heavy_minus_sign: | Login credentials | | \ No newline at end of file diff --git a/docs/models/operations/PostUsersSignInDataSubscription.md b/docs/models/operations/PostUsersSignInDataSubscription.md index 90e2ef87..d91abc2a 100644 --- a/docs/models/operations/PostUsersSignInDataSubscription.md +++ b/docs/models/operations/PostUsersSignInDataSubscription.md @@ -7,7 +7,7 @@ If the account’s Plex Pass subscription is active | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `features` | List<[PostUsersSignInDataFeatures](../../models/operations/PostUsersSignInDataFeatures.md)> | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | +| `features` | List<*String*> | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | | `active` | *Optional* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true | | `subscribedAt` | *JsonNullable* | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z | | `status` | [Optional](../../models/operations/PostUsersSignInDataAuthenticationStatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive | diff --git a/docs/models/operations/QueryParamIncludeCollections.md b/docs/models/operations/QueryParamIncludeCollections.md new file mode 100644 index 00000000..a140d9ec --- /dev/null +++ b/docs/models/operations/QueryParamIncludeCollections.md @@ -0,0 +1,11 @@ +# QueryParamIncludeCollections + +Whether to include collections in the search results. + + +## Values + +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/QueryParamIncludeExternalMedia.md b/docs/models/operations/QueryParamIncludeExternalMedia.md new file mode 100644 index 00000000..3e9e78d2 --- /dev/null +++ b/docs/models/operations/QueryParamIncludeExternalMedia.md @@ -0,0 +1,11 @@ +# QueryParamIncludeExternalMedia + +Whether to include external media in the search results. + + +## Values + +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/SearchResult.md b/docs/models/operations/SearchResult.md new file mode 100644 index 00000000..c29277f9 --- /dev/null +++ b/docs/models/operations/SearchResult.md @@ -0,0 +1,9 @@ +# SearchResult + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `score` | *float* | :heavy_check_mark: | N/A | +| `metadata` | [GetSearchAllLibrariesMetadata](../../models/operations/GetSearchAllLibrariesMetadata.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/SearchTypes.md b/docs/models/operations/SearchTypes.md new file mode 100644 index 00000000..32b99a0b --- /dev/null +++ b/docs/models/operations/SearchTypes.md @@ -0,0 +1,12 @@ +# SearchTypes + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `MOVIES` | movies | +| `MUSIC` | music | +| `OTHER_VIDEOS` | otherVideos | +| `PEOPLE` | people | +| `TV` | tv | \ No newline at end of file diff --git a/docs/models/operations/Subscription.md b/docs/models/operations/Subscription.md index 6f671dd0..4e1319f6 100644 --- a/docs/models/operations/Subscription.md +++ b/docs/models/operations/Subscription.md @@ -7,7 +7,7 @@ If the account’s Plex Pass subscription is active | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `features` | List<[Features](../../models/operations/Features.md)> | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | +| `features` | List<*String*> | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | | `active` | *Optional* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true | | `subscribedAt` | *JsonNullable* | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z | | `status` | [Optional](../../models/operations/GetTokenDetailsAuthenticationStatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive | diff --git a/docs/sdks/activities/README.md b/docs/sdks/activities/README.md index 10a0e59c..462b0ff8 100644 --- a/docs/sdks/activities/README.md +++ b/docs/sdks/activities/README.md @@ -38,11 +38,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerActivitiesResponse res = sdk.activities().getServerActivities() @@ -88,11 +88,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities() diff --git a/docs/sdks/authentication/README.md b/docs/sdks/authentication/README.md index 1f29fb98..1b5ada8d 100644 --- a/docs/sdks/authentication/README.md +++ b/docs/sdks/authentication/README.md @@ -37,11 +37,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetTransientTokenResponse res = sdk.authentication().getTransientToken() @@ -96,11 +96,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation() @@ -151,11 +151,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetTokenDetailsResponse res = sdk.authentication().getTokenDetails() @@ -208,11 +208,11 @@ public class Application { public static void main(String[] args) throws PostUsersSignInDataBadRequest, PostUsersSignInDataUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); PostUsersSignInDataRequest req = PostUsersSignInDataRequest.builder() diff --git a/docs/sdks/butler/README.md b/docs/sdks/butler/README.md index 01686c6c..4dbaa946 100644 --- a/docs/sdks/butler/README.md +++ b/docs/sdks/butler/README.md @@ -35,11 +35,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetButlerTasksResponse res = sdk.butler().getButlerTasks() @@ -90,11 +90,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); StartAllTasksResponse res = sdk.butler().startAllTasks() @@ -139,11 +139,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); StopAllTasksResponse res = sdk.butler().stopAllTasks() @@ -193,11 +193,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); StartTaskResponse res = sdk.butler().startTask() @@ -250,11 +250,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); StopTaskResponse res = sdk.butler().stopTask() diff --git a/docs/sdks/hubs/README.md b/docs/sdks/hubs/README.md index 3c7d3fe0..011db3ee 100644 --- a/docs/sdks/hubs/README.md +++ b/docs/sdks/hubs/README.md @@ -34,11 +34,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs() @@ -95,11 +95,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetRecentlyAddedRequest req = GetRecentlyAddedRequest.builder() @@ -161,11 +161,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs() diff --git a/docs/sdks/library/README.md b/docs/sdks/library/README.md index 9937e52b..e7cb2b1d 100644 --- a/docs/sdks/library/README.md +++ b/docs/sdks/library/README.md @@ -16,6 +16,7 @@ API Calls interacting with Plex Media Server Libraries * [getLibraryItems](#getlibraryitems) - Get Library Items * [getRefreshLibraryMetadata](#getrefreshlibrarymetadata) - Refresh Metadata Of The Library * [getSearchLibrary](#getsearchlibrary) - Search Library +* [getSearchAllLibraries](#getsearchalllibraries) - Search All Libraries * [getMetaDataByRatingKey](#getmetadatabyratingkey) - Get Metadata by RatingKey * [getMetadataChildren](#getmetadatachildren) - Get Items Children * [getTopWatchedContent](#gettopwatchedcontent) - Get Top Watched Content @@ -42,11 +43,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetFileHashResponse res = sdk.library().getFileHash() @@ -104,11 +105,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetRecentlyAddedLibraryRequest req = GetRecentlyAddedLibraryRequest.builder() @@ -189,11 +190,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetAllLibrariesResponse res = sdk.library().getAllLibraries() @@ -279,16 +280,16 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetLibraryDetailsResponse res = sdk.library().getLibraryDetails() - .sectionKey(9518) .includeDetails(IncludeDetails.ZERO) + .sectionKey(9518) .call(); if (res.object().isPresent()) { @@ -302,8 +303,8 @@ public class Application { | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | | `includeDetails` | [Optional](../../models/operations/IncludeDetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts).
Only exists for backwards compatibility, media providers other than the server libraries have it on always.
| | +| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | ### Response @@ -338,11 +339,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); DeleteLibraryResponse res = sdk.library().deleteLibrary() @@ -418,16 +419,16 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetLibraryItemsRequest req = GetLibraryItemsRequest.builder() - .sectionKey(9518) .tag(Tag.EDITION) + .sectionKey(9518) .includeGuids(IncludeGuids.Enable) .type(GetLibraryItemsQueryParamType.TvShow) .includeMeta(GetLibraryItemsQueryParamIncludeMeta.Enable) @@ -487,16 +488,16 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata() - .sectionKey(9518) .force(Force.ONE) + .sectionKey(9518) .call(); // handle response @@ -508,8 +509,8 @@ public class Application { | Parameter | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | | `force` | [Optional](../../models/operations/Force.md) | :heavy_minus_sign: | Force the refresh even if the library is already being refreshed. | 0 | +| `sectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | ### Response @@ -563,11 +564,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetSearchLibraryResponse res = sdk.library().getSearchLibrary() @@ -601,6 +602,77 @@ public class Application { | models/errors/GetSearchLibraryUnauthorized | 401 | application/json | | models/errors/SDKError | 4XX, 5XX | \*/\* | +## getSearchAllLibraries + +Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type. + + +### Example Usage + +```java +package hello.world; + +import dev.plexapi.sdk.PlexAPI; +import dev.plexapi.sdk.models.errors.GetSearchAllLibrariesBadRequest; +import dev.plexapi.sdk.models.errors.GetSearchAllLibrariesUnauthorized; +import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesRequest; +import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesResponse; +import dev.plexapi.sdk.models.operations.QueryParamIncludeCollections; +import dev.plexapi.sdk.models.operations.QueryParamIncludeExternalMedia; +import dev.plexapi.sdk.models.operations.SearchTypes; +import java.lang.Exception; +import java.util.List; + +public class Application { + + public static void main(String[] args) throws GetSearchAllLibrariesBadRequest, GetSearchAllLibrariesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") + .build(); + + GetSearchAllLibrariesRequest req = GetSearchAllLibrariesRequest.builder() + .query("") + .searchTypes(List.of( + SearchTypes.PEOPLE)) + .includeCollections(QueryParamIncludeCollections.Enable) + .includeExternalMedia(QueryParamIncludeExternalMedia.Enable) + .build(); + + GetSearchAllLibrariesResponse res = sdk.library().getSearchAllLibraries() + .request(req) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `request` | [GetSearchAllLibrariesRequest](../../models/operations/GetSearchAllLibrariesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[GetSearchAllLibrariesResponse](../../models/operations/GetSearchAllLibrariesResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| models/errors/GetSearchAllLibrariesBadRequest | 400 | application/json | +| models/errors/GetSearchAllLibrariesUnauthorized | 401 | application/json | +| models/errors/SDKError | 4XX, 5XX | \*/\* | + ## getMetaDataByRatingKey This endpoint will return the metadata of a library item specified with the ratingKey. @@ -623,11 +695,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetMetaDataByRatingKeyResponse res = sdk.library().getMetaDataByRatingKey() @@ -681,11 +753,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetMetadataChildrenResponse res = sdk.library().getMetadataChildren() @@ -742,16 +814,16 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent() - .type(GetTopWatchedContentQueryParamType.TvShow) .includeGuids(1L) + .type(GetTopWatchedContentQueryParamType.TvShow) .call(); if (res.object().isPresent()) { @@ -765,8 +837,8 @@ public class Application { | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [GetTopWatchedContentQueryParamType](../../models/operations/GetTopWatchedContentQueryParamType.md) | :heavy_check_mark: | The type of media to retrieve.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | | `includeGuids` | *Optional* | :heavy_minus_sign: | Adds the Guids object to the response
| 1 | +| `type` | [GetTopWatchedContentQueryParamType](../../models/operations/GetTopWatchedContentQueryParamType.md) | :heavy_check_mark: | The type of media to retrieve.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | ### Response @@ -802,11 +874,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetOnDeckResponse res = sdk.library().getOnDeck() diff --git a/docs/sdks/log/README.md b/docs/sdks/log/README.md index 6c86873a..084aa5d4 100644 --- a/docs/sdks/log/README.md +++ b/docs/sdks/log/README.md @@ -35,11 +35,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); LogLineResponse res = sdk.log().logLine() @@ -116,11 +116,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); String req = "level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman @@ -175,11 +175,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); EnablePaperTrailResponse res = sdk.log().enablePaperTrail() diff --git a/docs/sdks/media/README.md b/docs/sdks/media/README.md index 54d0641b..e1bd374c 100644 --- a/docs/sdks/media/README.md +++ b/docs/sdks/media/README.md @@ -35,11 +35,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); MarkPlayedResponse res = sdk.media().markPlayed() @@ -90,11 +90,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); MarkUnplayedResponse res = sdk.media().markUnplayed() @@ -146,11 +146,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); UpdatePlayProgressResponse res = sdk.media().updatePlayProgress() @@ -206,11 +206,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetBannerImageRequest req = GetBannerImageRequest.builder() @@ -273,11 +273,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetThumbImageRequest req = GetThumbImageRequest.builder() diff --git a/docs/sdks/playlists/README.md b/docs/sdks/playlists/README.md index 52ca104d..65462049 100644 --- a/docs/sdks/playlists/README.md +++ b/docs/sdks/playlists/README.md @@ -48,11 +48,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); CreatePlaylistRequest req = CreatePlaylistRequest.builder() @@ -114,11 +114,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetPlaylistsResponse res = sdk.playlists().getPlaylists() @@ -175,11 +175,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetPlaylistResponse res = sdk.playlists().getPlaylist() @@ -233,11 +233,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); DeletePlaylistResponse res = sdk.playlists().deletePlaylist() @@ -289,11 +289,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); UpdatePlaylistResponse res = sdk.playlists().updatePlaylist() @@ -353,11 +353,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents() @@ -413,11 +413,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents() @@ -470,11 +470,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents() @@ -533,11 +533,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); UploadPlaylistResponse res = sdk.playlists().uploadPlaylist() diff --git a/docs/sdks/plex/README.md b/docs/sdks/plex/README.md index 7c8b606b..44274541 100644 --- a/docs/sdks/plex/README.md +++ b/docs/sdks/plex/README.md @@ -37,11 +37,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetCompanionsDataResponse res = sdk.plex().getCompanionsData() @@ -93,11 +93,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetUserFriendsResponse res = sdk.plex().getUserFriends() @@ -148,11 +148,11 @@ public class Application { public static void main(String[] args) throws GetGeoDataBadRequest, GetGeoDataUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetGeoDataResponse res = sdk.plex().getGeoData() @@ -204,11 +204,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetHomeDataResponse res = sdk.plex().getHomeData() @@ -257,18 +257,18 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerResourcesResponse res = sdk.plex().getServerResources() .includeHttps(IncludeHttps.Enable) .includeRelay(IncludeRelay.Enable) .includeIPv6(IncludeIPv6.Enable) - .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") .call(); if (res.plexDevices().isPresent()) { @@ -280,13 +280,13 @@ public class Application { ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `includeHttps` | [Optional](../../models/operations/IncludeHttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 | -| `includeRelay` | [Optional](../../models/operations/IncludeRelay.md) | :heavy_minus_sign: | Include Relay addresses in the results
E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
| 1 | -| `includeIPv6` | [Optional](../../models/operations/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 | -| `clientID` | *Optional* | :heavy_minus_sign: | The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) | gcgzw5rz2xovp84b4vha3a40 | -| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `includeHttps` | [Optional](../../models/operations/IncludeHttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 | +| `includeRelay` | [Optional](../../models/operations/IncludeRelay.md) | :heavy_minus_sign: | Include Relay addresses in the results
E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
| 1 | +| `includeIPv6` | [Optional](../../models/operations/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 | +| `clientID` | *Optional* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | +| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | ### Response @@ -320,11 +320,11 @@ public class Application { public static void main(String[] args) throws GetPinBadRequest, Exception { PlexAPI sdk = PlexAPI.builder() - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetPinRequest req = GetPinRequest.builder() @@ -380,11 +380,11 @@ public class Application { public static void main(String[] args) throws GetTokenByPinIdBadRequest, GetTokenByPinIdResponseBody, Exception { PlexAPI sdk = PlexAPI.builder() - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetTokenByPinIdRequest req = GetTokenByPinIdRequest.builder() diff --git a/docs/sdks/plexapi/README.md b/docs/sdks/plexapi/README.md index 1baeb06d..e91fa370 100644 --- a/docs/sdks/plexapi/README.md +++ b/docs/sdks/plexapi/README.md @@ -25,4 +25,4 @@ The following SDKs are generated from the OpenAPI Specification. They are automa | Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - | | PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - | | Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - | -| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | - +| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | - diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index c5cf3b03..dde39798 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -45,11 +45,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); PerformSearchResponse res = sdk.search().performSearch() @@ -108,11 +108,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); PerformVoiceSearchResponse res = sdk.search().performVoiceSearch() @@ -167,11 +167,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetSearchResultsResponse res = sdk.search().getSearchResults() diff --git a/docs/sdks/server/README.md b/docs/sdks/server/README.md index 012a5847..0caec297 100644 --- a/docs/sdks/server/README.md +++ b/docs/sdks/server/README.md @@ -39,11 +39,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() @@ -89,11 +89,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerPreferencesResponse res = sdk.server().getServerPreferences() @@ -139,11 +139,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetAvailableClientsResponse res = sdk.server().getAvailableClients() @@ -189,11 +189,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetDevicesResponse res = sdk.server().getDevices() @@ -237,11 +237,11 @@ public class Application { public static void main(String[] args) throws GetServerIdentityRequestTimeout, Exception { PlexAPI sdk = PlexAPI.builder() - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerIdentityResponse res = sdk.server().getServerIdentity() @@ -286,11 +286,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount() @@ -340,11 +340,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetResizedPhotoRequest req = GetResizedPhotoRequest.builder() @@ -405,11 +405,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetMediaProvidersResponse res = sdk.server().getMediaProviders() @@ -425,9 +425,9 @@ public class Application { ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | -| `xPlexToken` | *String* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf | +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `xPlexToken` | *String* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf | ### Response @@ -462,11 +462,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetServerListResponse res = sdk.server().getServerList() diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md index 2fb06c9c..fe722eba 100644 --- a/docs/sdks/sessions/README.md +++ b/docs/sdks/sessions/README.md @@ -34,11 +34,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetSessionsResponse res = sdk.sessions().getSessions() @@ -85,11 +85,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetSessionHistoryResponse res = sdk.sessions().getSessionHistory() @@ -149,11 +149,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions() @@ -199,11 +199,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession() diff --git a/docs/sdks/statistics/README.md b/docs/sdks/statistics/README.md index 5806d1ca..a208605b 100644 --- a/docs/sdks/statistics/README.md +++ b/docs/sdks/statistics/README.md @@ -33,11 +33,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetStatisticsResponse res = sdk.statistics().getStatistics() @@ -90,11 +90,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics() @@ -147,11 +147,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics() diff --git a/docs/sdks/updater/README.md b/docs/sdks/updater/README.md index bf5bc237..435adc26 100644 --- a/docs/sdks/updater/README.md +++ b/docs/sdks/updater/README.md @@ -34,11 +34,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetUpdateStatusResponse res = sdk.updater().getUpdateStatus() @@ -85,11 +85,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); CheckForUpdatesResponse res = sdk.updater().checkForUpdates() @@ -143,11 +143,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); ApplyUpdatesResponse res = sdk.updater().applyUpdates() diff --git a/docs/sdks/video/README.md b/docs/sdks/video/README.md index 6ebec5bf..8d2e18d3 100644 --- a/docs/sdks/video/README.md +++ b/docs/sdks/video/README.md @@ -34,11 +34,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetTimelineRequest req = GetTimelineRequest.builder() @@ -103,11 +103,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder() diff --git a/docs/sdks/watchlist/README.md b/docs/sdks/watchlist/README.md index b52436d1..f53a51bc 100644 --- a/docs/sdks/watchlist/README.md +++ b/docs/sdks/watchlist/README.md @@ -33,11 +33,11 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .accessToken("") - .clientID("gcgzw5rz2xovp84b4vha3a40") - .clientName("Plex Web") - .clientVersion("4.133.0") - .clientPlatform("Chrome") - .deviceName("Linux") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .clientVersion("2.4.1") + .platform("Roku") + .deviceNickname("Roku 3") .build(); GetWatchListRequest req = GetWatchListRequest.builder() diff --git a/src/main/java/dev/plexapi/sdk/Activities.java b/src/main/java/dev/plexapi/sdk/Activities.java index aada74ce..8f1a52c2 100644 --- a/src/main/java/dev/plexapi/sdk/Activities.java +++ b/src/main/java/dev/plexapi/sdk/Activities.java @@ -17,19 +17,27 @@ import dev.plexapi.sdk.models.operations.GetServerActivitiesRequestBuilder; import dev.plexapi.sdk.models.operations.GetServerActivitiesResponse; import dev.plexapi.sdk.models.operations.GetServerActivitiesResponseBody; import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; +import dev.plexapi.sdk.utils.BackoffStrategy; 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.Options; +import dev.plexapi.sdk.utils.Retries.NonRetryableException; +import dev.plexapi.sdk.utils.Retries; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.io.InputStream; import java.lang.Exception; import java.lang.String; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.Optional; +import java.util.Optional; +import java.util.concurrent.TimeUnit; /** * 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. @@ -68,6 +76,22 @@ public class Activities implements * @throws Exception if the API call fails */ public GetServerActivitiesResponse getServerActivitiesDirect() throws Exception { + return getServerActivities(Optional.empty()); + } + + /** + * Get Server Activities + * Get Server Activities + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetServerActivitiesResponse getServerActivities( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -83,45 +107,62 @@ public class Activities implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getServerActivities", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getServerActivities", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getServerActivities", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getServerActivities", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getServerActivities", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getServerActivities", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getServerActivities", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -217,6 +258,24 @@ public class Activities implements */ public CancelServerActivitiesResponse cancelServerActivities( String activityUUID) throws Exception { + return cancelServerActivities(activityUUID, Optional.empty()); + } + + /** + * Cancel Server Activities + * Cancel Server Activities + * @param activityUUID The UUID of the activity to cancel. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public CancelServerActivitiesResponse cancelServerActivities( + String activityUUID, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } CancelServerActivitiesRequest request = CancelServerActivitiesRequest .builder() @@ -240,45 +299,62 @@ public class Activities implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "cancelServerActivities", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "cancelServerActivities", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "cancelServerActivities", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "cancelServerActivities", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "cancelServerActivities", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "cancelServerActivities", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "cancelServerActivities", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") diff --git a/src/main/java/dev/plexapi/sdk/Authentication.java b/src/main/java/dev/plexapi/sdk/Authentication.java index 6114fde2..8b64cccd 100644 --- a/src/main/java/dev/plexapi/sdk/Authentication.java +++ b/src/main/java/dev/plexapi/sdk/Authentication.java @@ -30,11 +30,16 @@ import dev.plexapi.sdk.models.operations.PostUsersSignInDataResponse; import dev.plexapi.sdk.models.operations.PostUsersSignInDataUserPlexAccount; import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; import dev.plexapi.sdk.models.operations.Scope; +import dev.plexapi.sdk.utils.BackoffStrategy; 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.Options; +import dev.plexapi.sdk.utils.Retries.NonRetryableException; +import dev.plexapi.sdk.utils.Retries; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.SerializedBody; import dev.plexapi.sdk.utils.Utils.JsonShape; import dev.plexapi.sdk.utils.Utils; @@ -44,9 +49,12 @@ import java.lang.Object; import java.lang.String; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; -import java.util.Optional; +import java.util.Optional; +import java.util.concurrent.TimeUnit; /** * API Calls regarding authentication for Plex Media Server @@ -101,6 +109,27 @@ public class Authentication implements public GetTransientTokenResponse getTransientToken( GetTransientTokenQueryParamType type, Scope scope) throws Exception { + return getTransientToken(type, scope, Optional.empty()); + } + + /** + * Get a Transient Token + * This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted. + * + * @param type `delegation` - This is the only supported `type` parameter. + * @param scope `all` - This is the only supported `scope` parameter. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetTransientTokenResponse getTransientToken( + GetTransientTokenQueryParamType type, + Scope scope, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetTransientTokenRequest request = GetTransientTokenRequest .builder() @@ -128,45 +157,62 @@ public class Authentication implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getTransientToken", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getTransientToken", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getTransientToken", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getTransientToken", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getTransientToken", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getTransientToken", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getTransientToken", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -255,6 +301,26 @@ public class Authentication implements */ public GetSourceConnectionInformationResponse getSourceConnectionInformation( String source) throws Exception { + return getSourceConnectionInformation(source, Optional.empty()); + } + + /** + * Get Source Connection Information + * If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token. + * Note: requires Plex Media Server >= 1.15.4. + * + * @param source The source identifier with an included prefix. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetSourceConnectionInformationResponse getSourceConnectionInformation( + String source, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetSourceConnectionInformationRequest request = GetSourceConnectionInformationRequest .builder() @@ -281,45 +347,62 @@ public class Authentication implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getSourceConnectionInformation", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getSourceConnectionInformation", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getSourceConnectionInformation", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getSourceConnectionInformation", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getSourceConnectionInformation", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getSourceConnectionInformation", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getSourceConnectionInformation", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -402,18 +485,24 @@ public class Authentication implements * @throws Exception if the API call fails */ public GetTokenDetailsResponse getTokenDetailsDirect() throws Exception { - return getTokenDetails(Optional.empty()); + return getTokenDetails(Optional.empty(), Optional.empty()); } /** * Get Token Details * Get the User data from the provided X-Plex-Token * @param serverURL Overrides the server URL. + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetTokenDetailsResponse getTokenDetails( - Optional serverURL) throws Exception { + Optional serverURL, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl(GET_TOKEN_DETAILS_SERVERS[0], new HashMap()); if (serverURL.isPresent() && !serverURL.get().isBlank()) { _baseUrl = serverURL.get(); @@ -431,45 +520,62 @@ public class Authentication implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getTokenDetails", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getTokenDetails", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getTokenDetails", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getTokenDetails", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getTokenDetails", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getTokenDetails", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getTokenDetails", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -565,7 +671,7 @@ public class Authentication implements */ public PostUsersSignInDataResponse postUsersSignInData( PostUsersSignInDataRequest request) throws Exception { - return postUsersSignInData(request, Optional.empty()); + return postUsersSignInData(request, Optional.empty(), Optional.empty()); } /** @@ -573,12 +679,18 @@ public class Authentication implements * Sign in user with username and password and return user data with Plex authentication token * @param request The request object containing all of the parameters for the API call. * @param serverURL Overrides the server URL. + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public PostUsersSignInDataResponse postUsersSignInData( PostUsersSignInDataRequest request, - Optional serverURL) throws Exception { + Optional serverURL, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl(POST_USERS_SIGN_IN_DATA_SERVERS[0], new HashMap()); if (serverURL.isPresent() && !serverURL.get().isBlank()) { _baseUrl = serverURL.get(); @@ -601,52 +713,65 @@ public class Authentication implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - PostUsersSignInDataRequest.class, - request, - this.sdkConfiguration.globals)); + _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "post-users-sign-in-data", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "post-users-sign-in-data", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "post-users-sign-in-data", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "post-users-sign-in-data", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "post-users-sign-in-data", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "post-users-sign-in-data", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "post-users-sign-in-data", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") diff --git a/src/main/java/dev/plexapi/sdk/Butler.java b/src/main/java/dev/plexapi/sdk/Butler.java index 03491621..2be0ad4b 100644 --- a/src/main/java/dev/plexapi/sdk/Butler.java +++ b/src/main/java/dev/plexapi/sdk/Butler.java @@ -32,19 +32,27 @@ import dev.plexapi.sdk.models.operations.StopTaskRequest; import dev.plexapi.sdk.models.operations.StopTaskRequestBuilder; import dev.plexapi.sdk.models.operations.StopTaskResponse; import dev.plexapi.sdk.models.operations.TaskName; +import dev.plexapi.sdk.utils.BackoffStrategy; 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.Options; +import dev.plexapi.sdk.utils.Retries.NonRetryableException; +import dev.plexapi.sdk.utils.Retries; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.io.InputStream; import java.lang.Exception; import java.lang.String; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.Optional; +import java.util.Optional; +import java.util.concurrent.TimeUnit; /** * Butler is the task manager of the Plex Media Server Ecosystem. @@ -80,6 +88,22 @@ public class Butler implements * @throws Exception if the API call fails */ public GetButlerTasksResponse getButlerTasksDirect() throws Exception { + return getButlerTasks(Optional.empty()); + } + + /** + * Get Butler tasks + * Returns a list of butler tasks + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetButlerTasksResponse getButlerTasks( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -95,45 +119,62 @@ public class Butler implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getButlerTasks", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getButlerTasks", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getButlerTasks", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getButlerTasks", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getButlerTasks", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getButlerTasks", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getButlerTasks", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -237,6 +278,27 @@ public class Butler implements * @throws Exception if the API call fails */ public StartAllTasksResponse startAllTasksDirect() throws Exception { + return startAllTasks(Optional.empty()); + } + + /** + * Start all Butler tasks + * This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria: + * 1. Any tasks not scheduled to run on the current day will be skipped. + * 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately. + * 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window. + * 4. If we are outside the configured window, the task will start immediately. + * + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public StartAllTasksResponse startAllTasks( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -252,45 +314,62 @@ public class Butler implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "startAllTasks", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "startAllTasks", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "startAllTasks", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "startAllTasks", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "startAllTasks", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "startAllTasks", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "startAllTasks", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -375,6 +454,23 @@ public class Butler implements * @throws Exception if the API call fails */ public StopAllTasksResponse stopAllTasksDirect() throws Exception { + return stopAllTasks(Optional.empty()); + } + + /** + * Stop all Butler tasks + * This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue. + * + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public StopAllTasksResponse stopAllTasks( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -390,45 +486,62 @@ public class Butler implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "stopAllTasks", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "stopAllTasks", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "stopAllTasks", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "stopAllTasks", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "stopAllTasks", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "stopAllTasks", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "stopAllTasks", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -523,6 +636,29 @@ public class Butler implements */ public StartTaskResponse startTask( TaskName taskName) throws Exception { + return startTask(taskName, Optional.empty()); + } + + /** + * Start a single Butler task + * This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria: + * 1. Any tasks not scheduled to run on the current day will be skipped. + * 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately. + * 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window. + * 4. If we are outside the configured window, the task will start immediately. + * + * @param taskName the name of the task to be started. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public StartTaskResponse startTask( + TaskName taskName, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } StartTaskRequest request = StartTaskRequest .builder() @@ -546,45 +682,62 @@ public class Butler implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "startTask", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "startTask", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "startTask", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "startTask", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "startTask", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "startTask", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "startTask", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -671,6 +824,25 @@ public class Butler implements */ public StopTaskResponse stopTask( PathParamTaskName taskName) throws Exception { + return stopTask(taskName, Optional.empty()); + } + + /** + * Stop a single Butler task + * This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint. + * + * @param taskName The name of the task to be started. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public StopTaskResponse stopTask( + PathParamTaskName taskName, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } StopTaskRequest request = StopTaskRequest .builder() @@ -694,45 +866,62 @@ public class Butler implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "stopTask", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "stopTask", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "stopTask", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "stopTask", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "stopTask", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "stopTask", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "stopTask", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") diff --git a/src/main/java/dev/plexapi/sdk/Hubs.java b/src/main/java/dev/plexapi/sdk/Hubs.java index 43a2e0d7..31f3ef86 100644 --- a/src/main/java/dev/plexapi/sdk/Hubs.java +++ b/src/main/java/dev/plexapi/sdk/Hubs.java @@ -25,11 +25,16 @@ import dev.plexapi.sdk.models.operations.GetRecentlyAddedResponseBody; import dev.plexapi.sdk.models.operations.OnlyTransient; import dev.plexapi.sdk.models.operations.QueryParamOnlyTransient; import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; +import dev.plexapi.sdk.utils.BackoffStrategy; 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.Options; +import dev.plexapi.sdk.utils.Retries.NonRetryableException; +import dev.plexapi.sdk.utils.Retries; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.io.InputStream; import java.lang.Double; @@ -37,8 +42,11 @@ import java.lang.Exception; import java.lang.String; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.Optional; +import java.util.Optional; +import java.util.concurrent.TimeUnit; /** * Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows. @@ -72,7 +80,7 @@ public class Hubs implements * @throws Exception if the API call fails */ public GetGlobalHubsResponse getGlobalHubsDirect() throws Exception { - return getGlobalHubs(Optional.empty(), Optional.empty()); + return getGlobalHubs(Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -80,12 +88,18 @@ public class Hubs implements * Get Global Hubs filtered by the parameters provided. * @param count The number of items to return with each hub. * @param onlyTransient Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetGlobalHubsResponse getGlobalHubs( Optional count, - Optional onlyTransient) throws Exception { + Optional onlyTransient, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetGlobalHubsRequest request = GetGlobalHubsRequest .builder() @@ -113,45 +127,62 @@ public class Hubs implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getGlobalHubs", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getGlobalHubs", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getGlobalHubs", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getGlobalHubs", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getGlobalHubs", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getGlobalHubs", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getGlobalHubs", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -249,6 +280,25 @@ public class Hubs implements */ public GetRecentlyAddedResponse getRecentlyAdded( GetRecentlyAddedRequest request) throws Exception { + return getRecentlyAdded(request, Optional.empty()); + } + + /** + * Get Recently Added + * This endpoint will return the recently added content. + * + * @param request The request object containing all of the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetRecentlyAddedResponse getRecentlyAdded( + GetRecentlyAddedRequest request, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -269,45 +319,62 @@ public class Hubs implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "get-recently-added", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-recently-added", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "get-recently-added", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-recently-added", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "get-recently-added", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "get-recently-added", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "get-recently-added", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -373,7 +440,7 @@ public class Hubs implements */ public GetLibraryHubsResponse getLibraryHubs( double sectionId) throws Exception { - return getLibraryHubs(sectionId, Optional.empty(), Optional.empty()); + return getLibraryHubs(sectionId, Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -383,13 +450,19 @@ public class Hubs implements * @param sectionId the Id of the library to query * @param count The number of items to return with each hub. * @param onlyTransient Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetLibraryHubsResponse getLibraryHubs( double sectionId, Optional count, - Optional onlyTransient) throws Exception { + Optional onlyTransient, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetLibraryHubsRequest request = GetLibraryHubsRequest .builder() @@ -420,45 +493,62 @@ public class Hubs implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getLibraryHubs", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getLibraryHubs", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getLibraryHubs", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getLibraryHubs", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getLibraryHubs", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getLibraryHubs", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getLibraryHubs", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") diff --git a/src/main/java/dev/plexapi/sdk/Library.java b/src/main/java/dev/plexapi/sdk/Library.java index 4908acae..5c82038c 100644 --- a/src/main/java/dev/plexapi/sdk/Library.java +++ b/src/main/java/dev/plexapi/sdk/Library.java @@ -25,6 +25,8 @@ import dev.plexapi.sdk.models.errors.GetRecentlyAddedLibraryBadRequest; import dev.plexapi.sdk.models.errors.GetRecentlyAddedLibraryUnauthorized; import dev.plexapi.sdk.models.errors.GetRefreshLibraryMetadataBadRequest; import dev.plexapi.sdk.models.errors.GetRefreshLibraryMetadataUnauthorized; +import dev.plexapi.sdk.models.errors.GetSearchAllLibrariesBadRequest; +import dev.plexapi.sdk.models.errors.GetSearchAllLibrariesUnauthorized; import dev.plexapi.sdk.models.errors.GetSearchLibraryBadRequest; import dev.plexapi.sdk.models.errors.GetSearchLibraryUnauthorized; import dev.plexapi.sdk.models.errors.GetTopWatchedContentBadRequest; @@ -66,6 +68,10 @@ import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryResponseBody; import dev.plexapi.sdk.models.operations.GetRefreshLibraryMetadataRequest; import dev.plexapi.sdk.models.operations.GetRefreshLibraryMetadataRequestBuilder; import dev.plexapi.sdk.models.operations.GetRefreshLibraryMetadataResponse; +import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesRequest; +import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesRequestBuilder; +import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesResponse; +import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesResponseBody; import dev.plexapi.sdk.models.operations.GetSearchLibraryQueryParamType; import dev.plexapi.sdk.models.operations.GetSearchLibraryRequest; import dev.plexapi.sdk.models.operations.GetSearchLibraryRequestBuilder; @@ -78,11 +84,16 @@ 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.SDKMethodInterfaces.*; +import dev.plexapi.sdk.utils.BackoffStrategy; 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.Options; +import dev.plexapi.sdk.utils.Retries.NonRetryableException; +import dev.plexapi.sdk.utils.Retries; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.io.InputStream; import java.lang.Double; @@ -91,8 +102,11 @@ import java.lang.Long; import java.lang.String; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.Optional; +import java.util.Optional; +import java.util.concurrent.TimeUnit; /** * API Calls interacting with Plex Media Server Libraries @@ -107,6 +121,7 @@ public class Library implements MethodCallGetLibraryItems, MethodCallGetRefreshLibraryMetadata, MethodCallGetSearchLibrary, + MethodCallGetSearchAllLibraries, MethodCallGetMetaDataByRatingKey, MethodCallGetMetadataChildren, MethodCallGetTopWatchedContent, @@ -137,7 +152,7 @@ public class Library implements */ public GetFileHashResponse getFileHash( String url) throws Exception { - return getFileHash(url, Optional.empty()); + return getFileHash(url, Optional.empty(), Optional.empty()); } /** @@ -145,12 +160,18 @@ public class Library implements * This resource returns hash values for local files * @param url This is the path to the local file, must be prefixed by `file://` * @param type Item type + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetFileHashResponse getFileHash( String url, - Optional type) throws Exception { + Optional type, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetFileHashRequest request = GetFileHashRequest .builder() @@ -178,45 +199,62 @@ public class Library implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getFileHash", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getFileHash", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getFileHash", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getFileHash", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getFileHash", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getFileHash", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getFileHash", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -303,6 +341,25 @@ public class Library implements */ public GetRecentlyAddedLibraryResponse getRecentlyAddedLibrary( GetRecentlyAddedLibraryRequest request) throws Exception { + return getRecentlyAddedLibrary(request, Optional.empty()); + } + + /** + * Get Recently Added + * This endpoint will return the recently added content. + * + * @param request The request object containing all of the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetRecentlyAddedLibraryResponse getRecentlyAddedLibrary( + GetRecentlyAddedLibraryRequest request, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -323,45 +380,62 @@ public class Library implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "get-recently-added-library", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-recently-added-library", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "get-recently-added-library", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-recently-added-library", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "get-recently-added-library", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "get-recently-added-library", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "get-recently-added-library", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -467,6 +541,28 @@ public class Library implements * @throws Exception if the API call fails */ public GetAllLibrariesResponse getAllLibrariesDirect() throws Exception { + return getAllLibraries(Optional.empty()); + } + + /** + * Get All Libraries + * A library section (commonly referred to as just a library) is a collection of media. + * Libraries are typed, and depending on their type provide either a flat or a hierarchical view of the media. + * For example, a music library has an artist > albums > tracks structure, whereas a movie library is flat. + * + * Libraries have features beyond just being a collection of media; for starters, they include information about supported types, filters and sorts. + * This allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year). + * + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetAllLibrariesResponse getAllLibraries( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -482,45 +578,62 @@ public class Library implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "get-all-libraries", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-all-libraries", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "get-all-libraries", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-all-libraries", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "get-all-libraries", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "get-all-libraries", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "get-all-libraries", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -696,7 +809,7 @@ public class Library implements */ public GetLibraryDetailsResponse getLibraryDetails( int sectionKey) throws Exception { - return getLibraryDetails(sectionKey, Optional.empty()); + return getLibraryDetails(Optional.empty(), sectionKey, Optional.empty()); } /** @@ -741,23 +854,29 @@ public class Library implements * * > **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. * - * @param sectionKey The unique key of the Plex library. - Note: This is unique in the context of the Plex server. - * @param includeDetails Whether or not to include details for a section (types, filters, and sorts). Only exists for backwards compatibility, media providers other than the server libraries have it on always. + * @param sectionKey The unique key of the Plex library. + Note: This is unique in the context of the Plex server. + + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetLibraryDetailsResponse getLibraryDetails( + Optional includeDetails, int sectionKey, - Optional includeDetails) throws Exception { + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetLibraryDetailsRequest request = GetLibraryDetailsRequest .builder() - .sectionKey(sectionKey) .includeDetails(includeDetails) + .sectionKey(sectionKey) .build(); String _baseUrl = Utils.templateUrl( @@ -782,45 +901,62 @@ public class Library implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "get-library-details", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-library-details", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "get-library-details", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-library-details", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "get-library-details", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "get-library-details", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "get-library-details", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -918,6 +1054,26 @@ public class Library implements */ public DeleteLibraryResponse deleteLibrary( int sectionKey) throws Exception { + return deleteLibrary(sectionKey, Optional.empty()); + } + + /** + * Delete Library Section + * Delete a library using a specific section id + * @param sectionKey The unique key of the Plex library. + Note: This is unique in the context of the Plex server. + + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public DeleteLibraryResponse deleteLibrary( + int sectionKey, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } DeleteLibraryRequest request = DeleteLibraryRequest .builder() @@ -941,45 +1097,62 @@ public class Library implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "deleteLibrary", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "deleteLibrary", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "deleteLibrary", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "deleteLibrary", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "deleteLibrary", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "deleteLibrary", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "deleteLibrary", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -1104,6 +1277,44 @@ public class Library implements */ public GetLibraryItemsResponse getLibraryItems( GetLibraryItemsRequest request) throws Exception { + return getLibraryItems(request, Optional.empty()); + } + + /** + * Get Library Items + * Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values: + * - `all`: All items in the section. + * - `unwatched`: Items that have not been played. + * - `newest`: Items that are recently released. + * - `recentlyAdded`: Items that are recently added to the library. + * - `recentlyViewed`: Items that were recently viewed. + * - `onDeck`: Items to continue watching. + * - `collection`: Items categorized by collection. + * - `edition`: Items categorized by edition. + * - `genre`: Items categorized by genre. + * - `year`: Items categorized by year of release. + * - `decade`: Items categorized by decade. + * - `director`: Items categorized by director. + * - `actor`: Items categorized by starring actor. + * - `country`: Items categorized by country of origin. + * - `contentRating`: Items categorized by content rating. + * - `rating`: Items categorized by rating. + * - `resolution`: Items categorized by resolution. + * - `firstCharacter`: Items categorized by the first letter. + * - `folder`: Items categorized by folder. + * + * @param request The request object containing all of the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetLibraryItemsResponse getLibraryItems( + GetLibraryItemsRequest request, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -1126,45 +1337,62 @@ public class Library implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "get-library-items", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-library-items", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "get-library-items", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-library-items", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "get-library-items", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "get-library-items", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "get-library-items", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -1264,28 +1492,34 @@ public class Library implements */ public GetRefreshLibraryMetadataResponse getRefreshLibraryMetadata( int sectionKey) throws Exception { - return getRefreshLibraryMetadata(sectionKey, Optional.empty()); + return getRefreshLibraryMetadata(Optional.empty(), sectionKey, Optional.empty()); } /** * Refresh Metadata Of The Library * This endpoint Refreshes all the Metadata of the library. * + * @param force Force the refresh even if the library is already being refreshed. * @param sectionKey The unique key of the Plex library. Note: This is unique in the context of the Plex server. - * @param force Force the refresh even if the library is already being refreshed. + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetRefreshLibraryMetadataResponse getRefreshLibraryMetadata( + Optional force, int sectionKey, - Optional force) throws Exception { + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetRefreshLibraryMetadataRequest request = GetRefreshLibraryMetadataRequest .builder() - .sectionKey(sectionKey) .force(force) + .sectionKey(sectionKey) .build(); String _baseUrl = Utils.templateUrl( @@ -1310,45 +1544,62 @@ public class Library implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "get-refresh-library-metadata", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-refresh-library-metadata", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "get-refresh-library-metadata", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-refresh-library-metadata", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "get-refresh-library-metadata", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "get-refresh-library-metadata", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "get-refresh-library-metadata", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -1479,6 +1730,52 @@ public class Library implements public GetSearchLibraryResponse getSearchLibrary( int sectionKey, GetSearchLibraryQueryParamType type) throws Exception { + return getSearchLibrary(sectionKey, type, Optional.empty()); + } + + /** + * Search Library + * Search for content within a specific section of the library. + * + * ### Types + * Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls: + * + * - **Type Object Attributes**: + * - `type`: Metadata type (if standard Plex type). + * - `title`: Title for this content type (e.g., "Movies"). + * + * - **Filter Objects**: + * - Subset of the media query language. + * - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`. + * + * - **Sort Objects**: + * - Description of sort fields. + * - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`. + * + * > **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. + * + * @param sectionKey The unique key of the Plex library. + Note: This is unique in the context of the Plex server. + + * @param type The type of media to retrieve. + 1 = movie + 2 = show + 3 = season + 4 = episode + E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetSearchLibraryResponse getSearchLibrary( + int sectionKey, + GetSearchLibraryQueryParamType type, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetSearchLibraryRequest request = GetSearchLibraryRequest .builder() @@ -1508,45 +1805,62 @@ public class Library implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "get-search-library", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-search-library", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "get-search-library", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-search-library", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "get-search-library", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "get-search-library", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "get-search-library", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -1624,6 +1938,199 @@ public class Library implements + /** + * Search All Libraries + * Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type. + * + * @return The call builder + */ + public GetSearchAllLibrariesRequestBuilder getSearchAllLibraries() { + return new GetSearchAllLibrariesRequestBuilder(this); + } + + /** + * Search All Libraries + * Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type. + * + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetSearchAllLibrariesResponse getSearchAllLibraries( + GetSearchAllLibrariesRequest request) throws Exception { + return getSearchAllLibraries(request, Optional.empty()); + } + + /** + * Search All Libraries + * Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type. + * + * @param request The request object containing all of the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetSearchAllLibrariesResponse getSearchAllLibraries( + GetSearchAllLibrariesRequest request, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } + String _baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); + String _url = Utils.generateURL( + _baseUrl, + "/library/search"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + _req.addQueryParams(Utils.getQueryParams( + GetSearchAllLibrariesRequest.class, + request, + this.sdkConfiguration.globals)); + _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); + } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "get-search-all-libraries", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "get-search-all-libraries", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "get-search-all-libraries", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetSearchAllLibrariesResponse.Builder _resBuilder = + GetSearchAllLibrariesResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + GetSearchAllLibrariesResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + GetSearchAllLibrariesResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _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(), "400")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + GetSearchAllLibrariesBadRequest _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.extractByteArrayFromBody(_httpRes)); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + GetSearchAllLibrariesUnauthorized _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _out.withRawResponse(Optional.ofNullable(_httpRes)); + + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.extractByteArrayFromBody(_httpRes)); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "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 Metadata by RatingKey * This endpoint will return the metadata of a library item specified with the ratingKey. @@ -1644,6 +2151,25 @@ public class Library implements */ public GetMetaDataByRatingKeyResponse getMetaDataByRatingKey( long ratingKey) throws Exception { + return getMetaDataByRatingKey(ratingKey, Optional.empty()); + } + + /** + * Get Metadata by RatingKey + * This endpoint will return the metadata of a library item specified with the ratingKey. + * + * @param ratingKey the id of the library item to return the children of. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetMetaDataByRatingKeyResponse getMetaDataByRatingKey( + long ratingKey, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetMetaDataByRatingKeyRequest request = GetMetaDataByRatingKeyRequest .builder() @@ -1667,45 +2193,62 @@ public class Library implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "get-meta-data-by-rating-key", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-meta-data-by-rating-key", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "get-meta-data-by-rating-key", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-meta-data-by-rating-key", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "get-meta-data-by-rating-key", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "get-meta-data-by-rating-key", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "get-meta-data-by-rating-key", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -1803,7 +2346,7 @@ public class Library implements */ public GetMetadataChildrenResponse getMetadataChildren( double ratingKey) throws Exception { - return getMetadataChildren(ratingKey, Optional.empty()); + return getMetadataChildren(ratingKey, Optional.empty(), Optional.empty()); } /** @@ -1813,12 +2356,18 @@ public class Library implements * @param ratingKey the id of the library item to return the children of. * @param includeElements Adds additional elements to the response. Supported types are (Stream) + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetMetadataChildrenResponse getMetadataChildren( double ratingKey, - Optional includeElements) throws Exception { + Optional includeElements, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetMetadataChildrenRequest request = GetMetadataChildrenRequest .builder() @@ -1848,45 +2397,62 @@ public class Library implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getMetadataChildren", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getMetadataChildren", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getMetadataChildren", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getMetadataChildren", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getMetadataChildren", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getMetadataChildren", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getMetadataChildren", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -1990,13 +2556,15 @@ public class Library implements */ public GetTopWatchedContentResponse getTopWatchedContent( GetTopWatchedContentQueryParamType type) throws Exception { - return getTopWatchedContent(type, Optional.empty()); + return getTopWatchedContent(Optional.empty(), type, Optional.empty()); } /** * Get Top Watched Content * This endpoint will return the top watched content from libraries of a certain type * + * @param includeGuids Adds the Guids object to the response + * @param type The type of media to retrieve. 1 = movie 2 = show @@ -2004,19 +2572,23 @@ public class Library implements 4 = episode E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - * @param includeGuids Adds the Guids object to the response - + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetTopWatchedContentResponse getTopWatchedContent( + Optional includeGuids, GetTopWatchedContentQueryParamType type, - Optional includeGuids) throws Exception { + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetTopWatchedContentRequest request = GetTopWatchedContentRequest .builder() - .type(type) .includeGuids(includeGuids) + .type(type) .build(); String _baseUrl = Utils.templateUrl( @@ -2039,45 +2611,62 @@ public class Library implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getTopWatchedContent", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getTopWatchedContent", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getTopWatchedContent", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getTopWatchedContent", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getTopWatchedContent", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getTopWatchedContent", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getTopWatchedContent", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -2173,6 +2762,23 @@ public class Library implements * @throws Exception if the API call fails */ public GetOnDeckResponse getOnDeckDirect() throws Exception { + return getOnDeck(Optional.empty()); + } + + /** + * Get On Deck + * This endpoint will return the on deck content. + * + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetOnDeckResponse getOnDeck( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -2188,45 +2794,62 @@ public class Library implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getOnDeck", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getOnDeck", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getOnDeck", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getOnDeck", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getOnDeck", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getOnDeck", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getOnDeck", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") diff --git a/src/main/java/dev/plexapi/sdk/Log.java b/src/main/java/dev/plexapi/sdk/Log.java index 28ca5d90..44e6ada0 100644 --- a/src/main/java/dev/plexapi/sdk/Log.java +++ b/src/main/java/dev/plexapi/sdk/Log.java @@ -21,11 +21,16 @@ import dev.plexapi.sdk.models.operations.LogLineResponse; import dev.plexapi.sdk.models.operations.LogMultiLineRequestBuilder; import dev.plexapi.sdk.models.operations.LogMultiLineResponse; import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; +import dev.plexapi.sdk.utils.BackoffStrategy; 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.Options; +import dev.plexapi.sdk.utils.Retries.NonRetryableException; +import dev.plexapi.sdk.utils.Retries; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.SerializedBody; import dev.plexapi.sdk.utils.Utils.JsonShape; import dev.plexapi.sdk.utils.Utils; @@ -35,8 +40,11 @@ import java.lang.Object; import java.lang.String; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.Optional; +import java.util.Optional; +import java.util.concurrent.TimeUnit; /** * Submit logs to the Log Handler for Plex Media Server @@ -84,6 +92,35 @@ public class Log implements Level level, String message, String source) throws Exception { + return logLine(level, message, source, Optional.empty()); + } + + /** + * Logging a single line message. + * This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log. + * + * @param level An integer log level to write to the PMS log with. + 0: Error + 1: Warning + 2: Info + 3: Debug + 4: Verbose + + * @param message The text of the message to write to the log. + * @param source a string indicating the source of the message. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public LogLineResponse logLine( + Level level, + String message, + String source, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } LogLineRequest request = LogLineRequest .builder() @@ -112,45 +149,62 @@ public class Log implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "logLine", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "logLine", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "logLine", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "logLine", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "logLine", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "logLine", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "logLine", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -277,6 +331,45 @@ public class Log implements */ public LogMultiLineResponse logMultiLine( String request) throws Exception { + return logMultiLine(request, Optional.empty()); + } + + /** + * Logging a multi-line message + * This endpoint allows for the batch addition of log entries to the main Plex Media Server log. + * It accepts a text/plain request body, where each line represents a distinct log entry. + * Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'. + * + * Log entries are separated by a newline character (`\n`). + * Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters. + * This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests. + * + * The 'level' parameter specifies the log entry's severity or importance, with the following integer values: + * - `0`: Error - Critical issues that require immediate attention. + * - `1`: Warning - Important events that are not critical but may indicate potential issues. + * - `2`: Info - General informational messages about system operation. + * - `3`: Debug - Detailed information useful for debugging purposes. + * - `4`: Verbose - Highly detailed diagnostic information for in-depth analysis. + * + * The 'message' parameter contains the log text, and 'source' identifies the log message's origin (e.g., an application name or module). + * + * Example of a single log entry format: + * `level=4&message=Sample%20log%20entry&source=applicationName` + * + * Ensure each parameter is properly URL-encoded to avoid interpretation issues. + * + * @param request The request object containing all of the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public LogMultiLineResponse logMultiLine( + String request, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -305,45 +398,62 @@ public class Log implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "logMultiLine", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "logMultiLine", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "logMultiLine", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "logMultiLine", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "logMultiLine", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "logMultiLine", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "logMultiLine", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -428,6 +538,23 @@ public class Log implements * @throws Exception if the API call fails */ public EnablePaperTrailResponse enablePaperTrailDirect() throws Exception { + return enablePaperTrail(Optional.empty()); + } + + /** + * Enabling Papertrail + * This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time. + * + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public EnablePaperTrailResponse enablePaperTrail( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -443,45 +570,62 @@ public class Log implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "enablePaperTrail", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "enablePaperTrail", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "enablePaperTrail", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "enablePaperTrail", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "enablePaperTrail", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "enablePaperTrail", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "enablePaperTrail", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") diff --git a/src/main/java/dev/plexapi/sdk/Media.java b/src/main/java/dev/plexapi/sdk/Media.java index ce4c711e..9955706b 100644 --- a/src/main/java/dev/plexapi/sdk/Media.java +++ b/src/main/java/dev/plexapi/sdk/Media.java @@ -32,19 +32,27 @@ import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; import dev.plexapi.sdk.models.operations.UpdatePlayProgressRequest; import dev.plexapi.sdk.models.operations.UpdatePlayProgressRequestBuilder; import dev.plexapi.sdk.models.operations.UpdatePlayProgressResponse; +import dev.plexapi.sdk.utils.BackoffStrategy; 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.Options; +import dev.plexapi.sdk.utils.Retries.NonRetryableException; +import dev.plexapi.sdk.utils.Retries; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.io.InputStream; import java.lang.Exception; import java.lang.String; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.Optional; +import java.util.Optional; +import java.util.concurrent.TimeUnit; /** * API Calls interacting with Plex Media Server Media @@ -82,6 +90,24 @@ public class Media implements */ public MarkPlayedResponse markPlayed( double key) throws Exception { + return markPlayed(key, Optional.empty()); + } + + /** + * Mark Media Played + * This will mark the provided media key as Played. + * @param key The media key to mark as played + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public MarkPlayedResponse markPlayed( + double key, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } MarkPlayedRequest request = MarkPlayedRequest .builder() @@ -108,45 +134,62 @@ public class Media implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "markPlayed", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "markPlayed", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "markPlayed", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "markPlayed", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "markPlayed", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "markPlayed", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "markPlayed", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -231,6 +274,24 @@ public class Media implements */ public MarkUnplayedResponse markUnplayed( double key) throws Exception { + return markUnplayed(key, Optional.empty()); + } + + /** + * Mark Media Unplayed + * This will mark the provided media key as Unplayed. + * @param key The media key to mark as Unplayed + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public MarkUnplayedResponse markUnplayed( + double key, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } MarkUnplayedRequest request = MarkUnplayedRequest .builder() @@ -257,45 +318,62 @@ public class Media implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "markUnplayed", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "markUnplayed", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "markUnplayed", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "markUnplayed", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "markUnplayed", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "markUnplayed", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "markUnplayed", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -386,6 +464,29 @@ public class Media implements String key, double time, String state) throws Exception { + return updatePlayProgress(key, time, state, Optional.empty()); + } + + /** + * Update Media Play Progress + * This API command can be used to update the play progress of a media item. + * + * @param key the media key + * @param time The time, in milliseconds, used to set the media playback progress. + * @param state The playback state of the media item. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public UpdatePlayProgressResponse updatePlayProgress( + String key, + double time, + String state, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } UpdatePlayProgressRequest request = UpdatePlayProgressRequest .builder() @@ -414,45 +515,62 @@ public class Media implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "updatePlayProgress", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "updatePlayProgress", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "updatePlayProgress", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "updatePlayProgress", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "updatePlayProgress", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "updatePlayProgress", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "updatePlayProgress", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -537,6 +655,24 @@ public class Media implements */ public GetBannerImageResponse getBannerImage( GetBannerImageRequest request) throws Exception { + return getBannerImage(request, Optional.empty()); + } + + /** + * Get Banner Image + * Gets the banner image of the media item + * @param request The request object containing all of the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetBannerImageResponse getBannerImage( + GetBannerImageRequest request, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -554,50 +690,68 @@ public class Media implements GetBannerImageRequest.class, request, this.sdkConfiguration.globals)); + _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "get-banner-image", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-banner-image", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "get-banner-image", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-banner-image", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "get-banner-image", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "get-banner-image", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "get-banner-image", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -693,6 +847,24 @@ public class Media implements */ public GetThumbImageResponse getThumbImage( GetThumbImageRequest request) throws Exception { + return getThumbImage(request, Optional.empty()); + } + + /** + * Get Thumb Image + * Gets the thumbnail image of the media item + * @param request The request object containing all of the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetThumbImageResponse getThumbImage( + GetThumbImageRequest request, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -710,50 +882,68 @@ public class Media implements GetThumbImageRequest.class, request, this.sdkConfiguration.globals)); + _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "get-thumb-image", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-thumb-image", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "get-thumb-image", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-thumb-image", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "get-thumb-image", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "get-thumb-image", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "get-thumb-image", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") diff --git a/src/main/java/dev/plexapi/sdk/Playlists.java b/src/main/java/dev/plexapi/sdk/Playlists.java index 3fd57515..4fd81189 100644 --- a/src/main/java/dev/plexapi/sdk/Playlists.java +++ b/src/main/java/dev/plexapi/sdk/Playlists.java @@ -61,11 +61,16 @@ import dev.plexapi.sdk.models.operations.UpdatePlaylistResponse; import dev.plexapi.sdk.models.operations.UploadPlaylistRequest; import dev.plexapi.sdk.models.operations.UploadPlaylistRequestBuilder; import dev.plexapi.sdk.models.operations.UploadPlaylistResponse; +import dev.plexapi.sdk.utils.BackoffStrategy; 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.Options; +import dev.plexapi.sdk.utils.Retries.NonRetryableException; +import dev.plexapi.sdk.utils.Retries; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.io.InputStream; import java.lang.Double; @@ -73,8 +78,11 @@ import java.lang.Exception; import java.lang.String; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.Optional; +import java.util.Optional; +import java.util.concurrent.TimeUnit; /** * 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"). @@ -125,6 +133,27 @@ public class Playlists implements */ public CreatePlaylistResponse createPlaylist( CreatePlaylistRequest request) throws Exception { + return createPlaylist(request, Optional.empty()); + } + + /** + * Create a Playlist + * Create a new playlist. By default the playlist is blank. To create a playlist along with a first item, pass: + * - `uri` - The content URI for what we're playing (e.g. `server://1234/com.plexapp.plugins.library/library/metadata/1`). + * - `playQueueID` - To create a playlist from an existing play queue. + * + * @param request The request object containing all of the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public CreatePlaylistResponse createPlaylist( + CreatePlaylistRequest request, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -145,45 +174,62 @@ public class Playlists implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "createPlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "createPlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "createPlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "createPlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "createPlaylist", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "createPlaylist", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "createPlaylist", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -277,7 +323,7 @@ public class Playlists implements * @throws Exception if the API call fails */ public GetPlaylistsResponse getPlaylistsDirect() throws Exception { - return getPlaylists(Optional.empty(), Optional.empty()); + return getPlaylists(Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -285,12 +331,18 @@ public class Playlists implements * Get All Playlists given the specified filters. * @param playlistType limit to a type of playlist. * @param smart type of playlists to return (default is all). + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetPlaylistsResponse getPlaylists( Optional playlistType, - Optional smart) throws Exception { + Optional smart, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetPlaylistsRequest request = GetPlaylistsRequest .builder() @@ -318,45 +370,62 @@ public class Playlists implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getPlaylists", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getPlaylists", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getPlaylists", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getPlaylists", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getPlaylists", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getPlaylists", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getPlaylists", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -456,6 +525,26 @@ public class Playlists implements */ public GetPlaylistResponse getPlaylist( double playlistID) throws Exception { + return getPlaylist(playlistID, Optional.empty()); + } + + /** + * Retrieve Playlist + * Gets detailed metadata for a playlist. A playlist for many purposes (rating, editing metadata, tagging), can be treated like a regular metadata item: + * Smart playlist details contain the `content` attribute. This is the content URI for the generator. This can then be parsed by a client to provide smart playlist editing. + * + * @param playlistID the ID of the playlist + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetPlaylistResponse getPlaylist( + double playlistID, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetPlaylistRequest request = GetPlaylistRequest .builder() @@ -479,45 +568,62 @@ public class Playlists implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getPlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getPlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getPlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getPlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getPlaylist", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getPlaylist", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getPlaylist", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -615,6 +721,25 @@ public class Playlists implements */ public DeletePlaylistResponse deletePlaylist( double playlistID) throws Exception { + return deletePlaylist(playlistID, Optional.empty()); + } + + /** + * Deletes a Playlist + * This endpoint will delete a playlist + * + * @param playlistID the ID of the playlist + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public DeletePlaylistResponse deletePlaylist( + double playlistID, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } DeletePlaylistRequest request = DeletePlaylistRequest .builder() @@ -638,45 +763,62 @@ public class Playlists implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "deletePlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "deletePlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "deletePlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "deletePlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "deletePlaylist", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "deletePlaylist", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "deletePlaylist", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -763,7 +905,7 @@ public class Playlists implements */ public UpdatePlaylistResponse updatePlaylist( double playlistID) throws Exception { - return updatePlaylist(playlistID, Optional.empty(), Optional.empty()); + return updatePlaylist(playlistID, Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -773,13 +915,19 @@ public class Playlists implements * @param playlistID the ID of the playlist * @param title name of the playlist * @param summary summary description of the playlist + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public UpdatePlaylistResponse updatePlaylist( double playlistID, Optional title, - Optional summary) throws Exception { + Optional summary, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } UpdatePlaylistRequest request = UpdatePlaylistRequest .builder() @@ -810,45 +958,62 @@ public class Playlists implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "updatePlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "updatePlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "updatePlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "updatePlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "updatePlaylist", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "updatePlaylist", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "updatePlaylist", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -949,6 +1114,36 @@ public class Playlists implements public GetPlaylistContentsResponse getPlaylistContents( double playlistID, GetPlaylistContentsQueryParamType type) throws Exception { + return getPlaylistContents(playlistID, type, Optional.empty()); + } + + /** + * Retrieve Playlist Contents + * Gets the contents of a playlist. Should be paged by clients via standard mechanisms. + * By default leaves are returned (e.g. episodes, movies). In order to return other types you can use the `type` parameter. + * For example, you could use this to display a list of recently added albums vis a smart playlist. + * Note that for dumb playlists, items have a `playlistItemID` attribute which is used for deleting or moving items. + * + * @param playlistID the ID of the playlist + * @param type The type of media to retrieve. + 1 = movie + 2 = show + 3 = season + 4 = episode + E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetPlaylistContentsResponse getPlaylistContents( + double playlistID, + GetPlaylistContentsQueryParamType type, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetPlaylistContentsRequest request = GetPlaylistContentsRequest .builder() @@ -978,45 +1173,62 @@ public class Playlists implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getPlaylistContents", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getPlaylistContents", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getPlaylistContents", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getPlaylistContents", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getPlaylistContents", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getPlaylistContents", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getPlaylistContents", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -1114,6 +1326,25 @@ public class Playlists implements */ public ClearPlaylistContentsResponse clearPlaylistContents( double playlistID) throws Exception { + return clearPlaylistContents(playlistID, Optional.empty()); + } + + /** + * Delete Playlist Contents + * Clears a playlist, only works with dumb playlists. Returns the playlist. + * + * @param playlistID the ID of the playlist + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public ClearPlaylistContentsResponse clearPlaylistContents( + double playlistID, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } ClearPlaylistContentsRequest request = ClearPlaylistContentsRequest .builder() @@ -1137,45 +1368,62 @@ public class Playlists implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "clearPlaylistContents", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "clearPlaylistContents", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "clearPlaylistContents", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "clearPlaylistContents", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "clearPlaylistContents", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "clearPlaylistContents", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "clearPlaylistContents", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -1266,7 +1514,7 @@ public class Playlists implements public AddPlaylistContentsResponse addPlaylistContents( double playlistID, String uri) throws Exception { - return addPlaylistContents(playlistID, uri, Optional.empty()); + return addPlaylistContents(playlistID, uri, Optional.empty(), Optional.empty()); } /** @@ -1277,13 +1525,19 @@ public class Playlists implements * @param playlistID the ID of the playlist * @param uri the content URI for the playlist * @param playQueueID the play queue to add to a playlist + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public AddPlaylistContentsResponse addPlaylistContents( double playlistID, String uri, - Optional playQueueID) throws Exception { + Optional playQueueID, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } AddPlaylistContentsRequest request = AddPlaylistContentsRequest .builder() @@ -1314,45 +1568,62 @@ public class Playlists implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "addPlaylistContents", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "addPlaylistContents", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "addPlaylistContents", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "addPlaylistContents", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "addPlaylistContents", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "addPlaylistContents", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "addPlaylistContents", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -1464,6 +1735,39 @@ public class Playlists implements String path, QueryParamForce force, long sectionID) throws Exception { + return uploadPlaylist(path, force, sectionID, Optional.empty()); + } + + /** + * Upload Playlist + * Imports m3u playlists by passing a path on the server to scan for m3u-formatted playlist files, or a path to a single playlist file. + * + * @param path absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server. + If the `path` argument is a directory, that path will be scanned for playlist files to be processed. + Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it. + The GUID of each playlist is based on the filename. + If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it. + The GUID of each playlist is based on the filename. + + * @param force Force overwriting of duplicate playlists. + By default, a playlist file uploaded with the same path will overwrite the existing playlist. + The `force` argument is used to disable overwriting. + If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded. + + * @param sectionID Possibly the section ID to upload the playlist to, we are not certain. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public UploadPlaylistResponse uploadPlaylist( + String path, + QueryParamForce force, + long sectionID, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } UploadPlaylistRequest request = UploadPlaylistRequest .builder() @@ -1492,45 +1796,62 @@ public class Playlists implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "uploadPlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "uploadPlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "uploadPlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "uploadPlaylist", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "uploadPlaylist", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "uploadPlaylist", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "uploadPlaylist", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") diff --git a/src/main/java/dev/plexapi/sdk/Plex.java b/src/main/java/dev/plexapi/sdk/Plex.java index 97bec702..cc26db9d 100644 --- a/src/main/java/dev/plexapi/sdk/Plex.java +++ b/src/main/java/dev/plexapi/sdk/Plex.java @@ -47,20 +47,28 @@ import dev.plexapi.sdk.models.operations.IncludeRelay; import dev.plexapi.sdk.models.operations.PlexDevice; import dev.plexapi.sdk.models.operations.ResponseBody; import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; +import dev.plexapi.sdk.utils.BackoffStrategy; 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.Options; +import dev.plexapi.sdk.utils.Retries.NonRetryableException; +import dev.plexapi.sdk.utils.Retries; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.io.InputStream; import java.lang.Exception; import java.lang.String; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; -import java.util.Optional; +import java.util.Optional; +import java.util.concurrent.TimeUnit; /** * API Calls that perform operations directly against https://Plex.tv @@ -140,18 +148,24 @@ public class Plex implements * @throws Exception if the API call fails */ public GetCompanionsDataResponse getCompanionsDataDirect() throws Exception { - return getCompanionsData(Optional.empty()); + return getCompanionsData(Optional.empty(), Optional.empty()); } /** * Get Companions Data * Get Companions Data * @param serverURL Overrides the server URL. + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetCompanionsDataResponse getCompanionsData( - Optional serverURL) throws Exception { + Optional serverURL, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl(GET_COMPANIONS_DATA_SERVERS[0], new HashMap()); if (serverURL.isPresent() && !serverURL.get().isBlank()) { _baseUrl = serverURL.get(); @@ -169,45 +183,62 @@ public class Plex implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getCompanionsData", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getCompanionsData", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getCompanionsData", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getCompanionsData", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getCompanionsData", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getCompanionsData", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getCompanionsData", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -301,18 +332,24 @@ public class Plex implements * @throws Exception if the API call fails */ public GetUserFriendsResponse getUserFriendsDirect() throws Exception { - return getUserFriends(Optional.empty()); + return getUserFriends(Optional.empty(), Optional.empty()); } /** * Get list of friends of the user logged in * Get friends of provided auth token. * @param serverURL Overrides the server URL. + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetUserFriendsResponse getUserFriends( - Optional serverURL) throws Exception { + Optional serverURL, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl(GET_USER_FRIENDS_SERVERS[0], new HashMap()); if (serverURL.isPresent() && !serverURL.get().isBlank()) { _baseUrl = serverURL.get(); @@ -330,45 +367,62 @@ public class Plex implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getUserFriends", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getUserFriends", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getUserFriends", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getUserFriends", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getUserFriends", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getUserFriends", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getUserFriends", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -462,18 +516,24 @@ public class Plex implements * @throws Exception if the API call fails */ public GetGeoDataResponse getGeoDataDirect() throws Exception { - return getGeoData(Optional.empty()); + return getGeoData(Optional.empty(), Optional.empty()); } /** * Get Geo Data * Returns the geolocation and locale data of the caller * @param serverURL Overrides the server URL. + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetGeoDataResponse getGeoData( - Optional serverURL) throws Exception { + Optional serverURL, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl(GET_GEO_DATA_SERVERS[0], new HashMap()); if (serverURL.isPresent() && !serverURL.get().isBlank()) { _baseUrl = serverURL.get(); @@ -488,45 +548,62 @@ public class Plex implements SDKConfiguration.USER_AGENT); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getGeoData", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getGeoData", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getGeoData", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getGeoData", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getGeoData", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getGeoData", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getGeoData", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -620,6 +697,22 @@ public class Plex implements * @throws Exception if the API call fails */ public GetHomeDataResponse getHomeDataDirect() throws Exception { + return getHomeData(Optional.empty()); + } + + /** + * Get Plex Home Data + * Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetHomeDataResponse getHomeData( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -635,45 +728,62 @@ public class Plex implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getHomeData", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getHomeData", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getHomeData", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getHomeData", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getHomeData", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getHomeData", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getHomeData", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -767,7 +877,7 @@ public class Plex implements * @throws Exception if the API call fails */ public GetServerResourcesResponse getServerResourcesDirect() throws Exception { - return getServerResources(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + return getServerResources(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -778,8 +888,9 @@ public class Plex implements E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400 * @param includeIPv6 Include IPv6 entries in the results - * @param clientID The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * @param clientID An opaque identifier unique to the client (UUID, serial number, or other unique device ID) * @param serverURL Overrides the server URL. + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ @@ -788,7 +899,12 @@ public class Plex implements Optional includeRelay, Optional includeIPv6, Optional clientID, - Optional serverURL) throws Exception { + Optional serverURL, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetServerResourcesRequest request = GetServerResourcesRequest .builder() @@ -815,50 +931,68 @@ public class Plex implements GetServerResourcesRequest.class, request, this.sdkConfiguration.globals)); + _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "get-server-resources", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-server-resources", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "get-server-resources", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-server-resources", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "get-server-resources", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "get-server-resources", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "get-server-resources", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -954,7 +1088,7 @@ public class Plex implements */ public GetPinResponse getPin( GetPinRequest request) throws Exception { - return getPin(request, Optional.empty()); + return getPin(request, Optional.empty(), Optional.empty()); } /** @@ -962,12 +1096,18 @@ public class Plex implements * Retrieve a Pin ID from Plex.tv to use for authentication flows * @param request The request object containing all of the parameters for the API call. * @param serverURL Overrides the server URL. + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetPinResponse getPin( GetPinRequest request, - Optional serverURL) throws Exception { + Optional serverURL, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl(GET_PIN_SERVERS[0], new HashMap()); if (serverURL.isPresent() && !serverURL.get().isBlank()) { _baseUrl = serverURL.get(); @@ -985,47 +1125,65 @@ public class Plex implements GetPinRequest.class, request, this.sdkConfiguration.globals)); + _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getPin", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getPin", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getPin", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getPin", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getPin", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getPin", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getPin", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -1105,7 +1263,7 @@ public class Plex implements */ public GetTokenByPinIdResponse getTokenByPinId( GetTokenByPinIdRequest request) throws Exception { - return getTokenByPinId(request, Optional.empty()); + return getTokenByPinId(request, Optional.empty(), Optional.empty()); } /** @@ -1113,12 +1271,18 @@ public class Plex implements * Retrieve an Access Token from Plex.tv after the Pin has been authenticated * @param request The request object containing all of the parameters for the API call. * @param serverURL Overrides the server URL. + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetTokenByPinIdResponse getTokenByPinId( GetTokenByPinIdRequest request, - Optional serverURL) throws Exception { + Optional serverURL, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl(GET_TOKEN_BY_PIN_ID_SERVERS[0], new HashMap()); if (serverURL.isPresent() && !serverURL.get().isBlank()) { _baseUrl = serverURL.get(); @@ -1133,52 +1297,65 @@ public class Plex implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetTokenByPinIdRequest.class, - request, - this.sdkConfiguration.globals)); + _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getTokenByPinId", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getTokenByPinId", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getTokenByPinId", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getTokenByPinId", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getTokenByPinId", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getTokenByPinId", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getTokenByPinId", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") diff --git a/src/main/java/dev/plexapi/sdk/PlexAPI.java b/src/main/java/dev/plexapi/sdk/PlexAPI.java index 1ac9055c..21674739 100644 --- a/src/main/java/dev/plexapi/sdk/PlexAPI.java +++ b/src/main/java/dev/plexapi/sdk/PlexAPI.java @@ -39,7 +39,7 @@ import java.util.Optional; * | Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - | * | PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - | * | Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - | - * | C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | - + * | C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | - * */ public class PlexAPI { @@ -465,11 +465,11 @@ public class PlexAPI { * @return The builder instance. */ public Builder clientID(String clientID) { - if (!this.sdkConfiguration.globals.get("parameters").containsKey("queryParam")) { - this.sdkConfiguration.globals.get("parameters").put("queryParam", new java.util.HashMap<>()); + if (!this.sdkConfiguration.globals.get("parameters").containsKey("header")) { + this.sdkConfiguration.globals.get("parameters").put("header", new java.util.HashMap<>()); } - this.sdkConfiguration.globals.get("parameters").get("queryParam").put("clientID", clientID); + this.sdkConfiguration.globals.get("parameters").get("header").put("clientID", clientID); return this; } @@ -481,11 +481,11 @@ public class PlexAPI { * @return The builder instance. */ public Builder clientName(String clientName) { - if (!this.sdkConfiguration.globals.get("parameters").containsKey("queryParam")) { - this.sdkConfiguration.globals.get("parameters").put("queryParam", new java.util.HashMap<>()); + if (!this.sdkConfiguration.globals.get("parameters").containsKey("header")) { + this.sdkConfiguration.globals.get("parameters").put("header", new java.util.HashMap<>()); } - this.sdkConfiguration.globals.get("parameters").get("queryParam").put("clientName", clientName); + this.sdkConfiguration.globals.get("parameters").get("header").put("clientName", clientName); return this; } @@ -497,43 +497,43 @@ public class PlexAPI { * @return The builder instance. */ public Builder clientVersion(String clientVersion) { - if (!this.sdkConfiguration.globals.get("parameters").containsKey("queryParam")) { - this.sdkConfiguration.globals.get("parameters").put("queryParam", new java.util.HashMap<>()); + if (!this.sdkConfiguration.globals.get("parameters").containsKey("header")) { + this.sdkConfiguration.globals.get("parameters").put("header", new java.util.HashMap<>()); } - this.sdkConfiguration.globals.get("parameters").get("queryParam").put("clientVersion", clientVersion); + this.sdkConfiguration.globals.get("parameters").get("header").put("clientVersion", clientVersion); return this; } /** - * Allows setting the clientPlatform parameter for all supported operations. + * Allows setting the platform parameter for all supported operations. * - * @param clientPlatform The value to set. + * @param platform The value to set. * @return The builder instance. */ - public Builder clientPlatform(String clientPlatform) { - if (!this.sdkConfiguration.globals.get("parameters").containsKey("queryParam")) { - this.sdkConfiguration.globals.get("parameters").put("queryParam", new java.util.HashMap<>()); + public Builder platform(String platform) { + if (!this.sdkConfiguration.globals.get("parameters").containsKey("header")) { + this.sdkConfiguration.globals.get("parameters").put("header", new java.util.HashMap<>()); } - this.sdkConfiguration.globals.get("parameters").get("queryParam").put("clientPlatform", clientPlatform); + this.sdkConfiguration.globals.get("parameters").get("header").put("platform", platform); return this; } /** - * Allows setting the deviceName parameter for all supported operations. + * Allows setting the deviceNickname parameter for all supported operations. * - * @param deviceName The value to set. + * @param deviceNickname The value to set. * @return The builder instance. */ - public Builder deviceName(String deviceName) { - if (!this.sdkConfiguration.globals.get("parameters").containsKey("queryParam")) { - this.sdkConfiguration.globals.get("parameters").put("queryParam", new java.util.HashMap<>()); + public Builder deviceNickname(String deviceNickname) { + if (!this.sdkConfiguration.globals.get("parameters").containsKey("header")) { + this.sdkConfiguration.globals.get("parameters").put("header", new java.util.HashMap<>()); } - this.sdkConfiguration.globals.get("parameters").get("queryParam").put("deviceName", deviceName); + this.sdkConfiguration.globals.get("parameters").get("header").put("deviceNickname", deviceNickname); return this; } diff --git a/src/main/java/dev/plexapi/sdk/SDKConfiguration.java b/src/main/java/dev/plexapi/sdk/SDKConfiguration.java index b0f1dd22..aa026352 100644 --- a/src/main/java/dev/plexapi/sdk/SDKConfiguration.java +++ b/src/main/java/dev/plexapi/sdk/SDKConfiguration.java @@ -36,8 +36,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.7.0"; - public static final String GEN_VERSION = "2.428.1"; + public static final String SDK_VERSION = "0.8.0"; + public static final String GEN_VERSION = "2.429.0"; private static final String BASE_PACKAGE = "dev.plexapi.sdk"; public static final String USER_AGENT = String.format("speakeasy-sdk/%s %s %s %s %s", diff --git a/src/main/java/dev/plexapi/sdk/Search.java b/src/main/java/dev/plexapi/sdk/Search.java index 79fa01f5..d5942b55 100644 --- a/src/main/java/dev/plexapi/sdk/Search.java +++ b/src/main/java/dev/plexapi/sdk/Search.java @@ -23,11 +23,16 @@ import dev.plexapi.sdk.models.operations.PerformVoiceSearchRequest; import dev.plexapi.sdk.models.operations.PerformVoiceSearchRequestBuilder; import dev.plexapi.sdk.models.operations.PerformVoiceSearchResponse; import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; +import dev.plexapi.sdk.utils.BackoffStrategy; 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.Options; +import dev.plexapi.sdk.utils.Retries.NonRetryableException; +import dev.plexapi.sdk.utils.Retries; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.io.InputStream; import java.lang.Double; @@ -35,8 +40,11 @@ import java.lang.Exception; import java.lang.String; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.Optional; +import java.util.Optional; +import java.util.concurrent.TimeUnit; /** * API Calls that perform search operations with Plex Media Server @@ -96,7 +104,7 @@ public class Search implements */ public PerformSearchResponse performSearch( String query) throws Exception { - return performSearch(query, Optional.empty(), Optional.empty()); + return performSearch(query, Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -117,13 +125,19 @@ public class Search implements * @param query The query term * @param sectionId This gives context to the search, and can result in re-ordering of search result hubs * @param limit The number of items to return per hub + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public PerformSearchResponse performSearch( String query, Optional sectionId, - Optional limit) throws Exception { + Optional limit, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } PerformSearchRequest request = PerformSearchRequest .builder() @@ -152,45 +166,62 @@ public class Search implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "performSearch", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "performSearch", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "performSearch", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "performSearch", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "performSearch", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "performSearch", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "performSearch", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -283,7 +314,7 @@ public class Search implements */ public PerformVoiceSearchResponse performVoiceSearch( String query) throws Exception { - return performVoiceSearch(query, Optional.empty(), Optional.empty()); + return performVoiceSearch(query, Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -296,13 +327,19 @@ public class Search implements * @param query The query term * @param sectionId This gives context to the search, and can result in re-ordering of search result hubs * @param limit The number of items to return per hub + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public PerformVoiceSearchResponse performVoiceSearch( String query, Optional sectionId, - Optional limit) throws Exception { + Optional limit, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } PerformVoiceSearchRequest request = PerformVoiceSearchRequest .builder() @@ -331,45 +368,62 @@ public class Search implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "performVoiceSearch", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "performVoiceSearch", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "performVoiceSearch", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "performVoiceSearch", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "performVoiceSearch", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "performVoiceSearch", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "performVoiceSearch", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -454,6 +508,24 @@ public class Search implements */ public GetSearchResultsResponse getSearchResults( String query) throws Exception { + return getSearchResults(query, Optional.empty()); + } + + /** + * Get Search Results + * This will search the database for the string provided. + * @param query The search query string to use + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetSearchResultsResponse getSearchResults( + String query, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetSearchResultsRequest request = GetSearchResultsRequest .builder() @@ -480,45 +552,62 @@ public class Search implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getSearchResults", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getSearchResults", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getSearchResults", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getSearchResults", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getSearchResults", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getSearchResults", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getSearchResults", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") diff --git a/src/main/java/dev/plexapi/sdk/Server.java b/src/main/java/dev/plexapi/sdk/Server.java index e093e156..28069009 100644 --- a/src/main/java/dev/plexapi/sdk/Server.java +++ b/src/main/java/dev/plexapi/sdk/Server.java @@ -52,19 +52,27 @@ import dev.plexapi.sdk.models.operations.GetServerPreferencesRequestBuilder; import dev.plexapi.sdk.models.operations.GetServerPreferencesResponse; import dev.plexapi.sdk.models.operations.GetServerPreferencesResponseBody; import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; +import dev.plexapi.sdk.utils.BackoffStrategy; 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.Options; +import dev.plexapi.sdk.utils.Retries.NonRetryableException; +import dev.plexapi.sdk.utils.Retries; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.io.InputStream; import java.lang.Exception; import java.lang.String; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.Optional; +import java.util.Optional; +import java.util.concurrent.TimeUnit; /** * Operations against the Plex Media Server System. @@ -104,6 +112,22 @@ public class Server implements * @throws Exception if the API call fails */ public GetServerCapabilitiesResponse getServerCapabilitiesDirect() throws Exception { + return getServerCapabilities(Optional.empty()); + } + + /** + * Get Server Capabilities + * Get Server Capabilities + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetServerCapabilitiesResponse getServerCapabilities( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -119,45 +143,62 @@ public class Server implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getServerCapabilities", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getServerCapabilities", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getServerCapabilities", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getServerCapabilities", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getServerCapabilities", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getServerCapabilities", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getServerCapabilities", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -251,6 +292,22 @@ public class Server implements * @throws Exception if the API call fails */ public GetServerPreferencesResponse getServerPreferencesDirect() throws Exception { + return getServerPreferences(Optional.empty()); + } + + /** + * Get Server Preferences + * Get Server Preferences + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetServerPreferencesResponse getServerPreferences( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -266,45 +323,62 @@ public class Server implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getServerPreferences", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getServerPreferences", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getServerPreferences", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getServerPreferences", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getServerPreferences", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getServerPreferences", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getServerPreferences", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -398,6 +472,22 @@ public class Server implements * @throws Exception if the API call fails */ public GetAvailableClientsResponse getAvailableClientsDirect() throws Exception { + return getAvailableClients(Optional.empty()); + } + + /** + * Get Available Clients + * Get Available Clients + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetAvailableClientsResponse getAvailableClients( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -413,45 +503,62 @@ public class Server implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getAvailableClients", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getAvailableClients", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getAvailableClients", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getAvailableClients", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getAvailableClients", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getAvailableClients", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getAvailableClients", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -545,6 +652,22 @@ public class Server implements * @throws Exception if the API call fails */ public GetDevicesResponse getDevicesDirect() throws Exception { + return getDevices(Optional.empty()); + } + + /** + * Get Devices + * Get Devices + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetDevicesResponse getDevices( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -560,45 +683,62 @@ public class Server implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getDevices", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getDevices", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getDevices", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getDevices", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getDevices", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getDevices", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getDevices", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -692,6 +832,22 @@ public class Server implements * @throws Exception if the API call fails */ public GetServerIdentityResponse getServerIdentityDirect() throws Exception { + return getServerIdentity(Optional.empty()); + } + + /** + * Get Server Identity + * This request is useful to determine if the server is online or offline + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetServerIdentityResponse getServerIdentity( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -704,45 +860,62 @@ public class Server implements SDKConfiguration.USER_AGENT); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "get-server-identity", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "408", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-server-identity", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "get-server-identity", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-server-identity", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "get-server-identity", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "get-server-identity", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "get-server-identity", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -820,6 +993,22 @@ public class Server implements * @throws Exception if the API call fails */ public GetMyPlexAccountResponse getMyPlexAccountDirect() throws Exception { + return getMyPlexAccount(Optional.empty()); + } + + /** + * Get MyPlex Account + * Returns MyPlex Account Information + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetMyPlexAccountResponse getMyPlexAccount( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -835,45 +1024,62 @@ public class Server implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getMyPlexAccount", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getMyPlexAccount", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getMyPlexAccount", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getMyPlexAccount", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getMyPlexAccount", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getMyPlexAccount", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getMyPlexAccount", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -971,6 +1177,25 @@ public class Server implements */ public GetResizedPhotoResponse getResizedPhoto( GetResizedPhotoRequest request) throws Exception { + return getResizedPhoto(request, Optional.empty()); + } + + /** + * Get a Resized Photo + * Plex's Photo transcoder is used throughout the service to serve images at specified sizes. + * + * @param request The request object containing all of the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetResizedPhotoResponse getResizedPhoto( + GetResizedPhotoRequest request, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -991,45 +1216,62 @@ public class Server implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getResizedPhoto", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getResizedPhoto", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getResizedPhoto", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getResizedPhoto", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getResizedPhoto", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getResizedPhoto", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getResizedPhoto", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -1108,12 +1350,30 @@ public class Server implements /** * Get Media Providers * Retrieves media providers and their features from the Plex server. - * @param xPlexToken Plex Authentication Token + * @param xPlexToken An authentication token, obtained from plex.tv * @return The response from the API call * @throws Exception if the API call fails */ public GetMediaProvidersResponse getMediaProviders( String xPlexToken) throws Exception { + return getMediaProviders(xPlexToken, Optional.empty()); + } + + /** + * Get Media Providers + * Retrieves media providers and their features from the Plex server. + * @param xPlexToken An authentication token, obtained from plex.tv + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetMediaProvidersResponse getMediaProviders( + String xPlexToken, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetMediaProvidersRequest request = GetMediaProvidersRequest .builder() @@ -1130,55 +1390,68 @@ public class Server implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetMediaProvidersRequest.class, - request, - this.sdkConfiguration.globals)); + _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "get-media-providers", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-media-providers", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "get-media-providers", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-media-providers", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "get-media-providers", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "get-media-providers", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "get-media-providers", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -1272,6 +1545,22 @@ public class Server implements * @throws Exception if the API call fails */ public GetServerListResponse getServerListDirect() throws Exception { + return getServerList(Optional.empty()); + } + + /** + * Get Server List + * Get Server List + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetServerListResponse getServerList( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -1287,45 +1576,62 @@ public class Server implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getServerList", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getServerList", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getServerList", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getServerList", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getServerList", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getServerList", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getServerList", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") diff --git a/src/main/java/dev/plexapi/sdk/Sessions.java b/src/main/java/dev/plexapi/sdk/Sessions.java index 403ede4d..e40422c0 100644 --- a/src/main/java/dev/plexapi/sdk/Sessions.java +++ b/src/main/java/dev/plexapi/sdk/Sessions.java @@ -29,11 +29,16 @@ import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; import dev.plexapi.sdk.models.operations.StopTranscodeSessionRequest; import dev.plexapi.sdk.models.operations.StopTranscodeSessionRequestBuilder; import dev.plexapi.sdk.models.operations.StopTranscodeSessionResponse; +import dev.plexapi.sdk.utils.BackoffStrategy; 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.Options; +import dev.plexapi.sdk.utils.Retries.NonRetryableException; +import dev.plexapi.sdk.utils.Retries; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.io.InputStream; import java.lang.Exception; @@ -41,8 +46,11 @@ import java.lang.Long; import java.lang.String; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.Optional; +import java.util.Optional; +import java.util.concurrent.TimeUnit; /** * API Calls that perform search operations with Plex Media Server Sessions @@ -77,6 +85,22 @@ public class Sessions implements * @throws Exception if the API call fails */ public GetSessionsResponse getSessionsDirect() throws Exception { + return getSessions(Optional.empty()); + } + + /** + * Get Active Sessions + * This will retrieve the "Now Playing" Information of the PMS. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetSessionsResponse getSessions( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -92,45 +116,62 @@ public class Sessions implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getSessions", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getSessions", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getSessions", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getSessions", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getSessions", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getSessions", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getSessions", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -224,7 +265,7 @@ public class Sessions implements * @throws Exception if the API call fails */ public GetSessionHistoryResponse getSessionHistoryDirect() throws Exception { - return getSessionHistory(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + return getSessionHistory(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -239,6 +280,7 @@ public class Sessions implements * @param librarySectionID Filters the results based on the id of a valid library section + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ @@ -246,7 +288,12 @@ public class Sessions implements Optional sort, Optional accountId, Optional filter, - Optional librarySectionID) throws Exception { + Optional librarySectionID, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetSessionHistoryRequest request = GetSessionHistoryRequest .builder() @@ -276,45 +323,62 @@ public class Sessions implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getSessionHistory", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getSessionHistory", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getSessionHistory", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getSessionHistory", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getSessionHistory", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getSessionHistory", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getSessionHistory", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -408,6 +472,22 @@ public class Sessions implements * @throws Exception if the API call fails */ public GetTranscodeSessionsResponse getTranscodeSessionsDirect() throws Exception { + return getTranscodeSessions(Optional.empty()); + } + + /** + * Get Transcode Sessions + * Get Transcode Sessions + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetTranscodeSessionsResponse getTranscodeSessions( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -423,45 +503,62 @@ public class Sessions implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getTranscodeSessions", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getTranscodeSessions", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getTranscodeSessions", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getTranscodeSessions", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getTranscodeSessions", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getTranscodeSessions", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getTranscodeSessions", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -557,6 +654,24 @@ public class Sessions implements */ public StopTranscodeSessionResponse stopTranscodeSession( String sessionKey) throws Exception { + return stopTranscodeSession(sessionKey, Optional.empty()); + } + + /** + * Stop a Transcode Session + * Stop a Transcode Session + * @param sessionKey the Key of the transcode session to stop + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public StopTranscodeSessionResponse stopTranscodeSession( + String sessionKey, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } StopTranscodeSessionRequest request = StopTranscodeSessionRequest .builder() @@ -580,45 +695,62 @@ public class Sessions implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "stopTranscodeSession", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "stopTranscodeSession", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "stopTranscodeSession", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "stopTranscodeSession", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "stopTranscodeSession", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "stopTranscodeSession", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "stopTranscodeSession", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") diff --git a/src/main/java/dev/plexapi/sdk/Statistics.java b/src/main/java/dev/plexapi/sdk/Statistics.java index f0873e0b..0ab883ed 100644 --- a/src/main/java/dev/plexapi/sdk/Statistics.java +++ b/src/main/java/dev/plexapi/sdk/Statistics.java @@ -25,11 +25,16 @@ import dev.plexapi.sdk.models.operations.GetStatisticsRequestBuilder; import dev.plexapi.sdk.models.operations.GetStatisticsResponse; import dev.plexapi.sdk.models.operations.GetStatisticsResponseBody; import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; +import dev.plexapi.sdk.utils.BackoffStrategy; 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.Options; +import dev.plexapi.sdk.utils.Retries.NonRetryableException; +import dev.plexapi.sdk.utils.Retries; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.io.InputStream; import java.lang.Exception; @@ -37,8 +42,11 @@ import java.lang.Long; import java.lang.String; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.Optional; +import java.util.Optional; +import java.util.concurrent.TimeUnit; /** * API Calls that perform operations with Plex Media Server Statistics @@ -72,7 +80,7 @@ public class Statistics implements * @throws Exception if the API call fails */ public GetStatisticsResponse getStatisticsDirect() throws Exception { - return getStatistics(Optional.empty()); + return getStatistics(Optional.empty(), Optional.empty()); } /** @@ -81,11 +89,17 @@ public class Statistics implements * @param timespan The timespan to retrieve statistics for the exact meaning of this parameter is not known + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetStatisticsResponse getStatistics( - Optional timespan) throws Exception { + Optional timespan, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetStatisticsRequest request = GetStatisticsRequest .builder() @@ -112,45 +126,62 @@ public class Statistics implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getStatistics", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getStatistics", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getStatistics", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getStatistics", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getStatistics", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getStatistics", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getStatistics", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -244,7 +275,7 @@ public class Statistics implements * @throws Exception if the API call fails */ public GetResourcesStatisticsResponse getResourcesStatisticsDirect() throws Exception { - return getResourcesStatistics(Optional.empty()); + return getResourcesStatistics(Optional.empty(), Optional.empty()); } /** @@ -253,11 +284,17 @@ public class Statistics implements * @param timespan The timespan to retrieve statistics for the exact meaning of this parameter is not known + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetResourcesStatisticsResponse getResourcesStatistics( - Optional timespan) throws Exception { + Optional timespan, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetResourcesStatisticsRequest request = GetResourcesStatisticsRequest .builder() @@ -284,45 +321,62 @@ public class Statistics implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getResourcesStatistics", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getResourcesStatistics", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getResourcesStatistics", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getResourcesStatistics", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getResourcesStatistics", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getResourcesStatistics", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getResourcesStatistics", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -416,7 +470,7 @@ public class Statistics implements * @throws Exception if the API call fails */ public GetBandwidthStatisticsResponse getBandwidthStatisticsDirect() throws Exception { - return getBandwidthStatistics(Optional.empty()); + return getBandwidthStatistics(Optional.empty(), Optional.empty()); } /** @@ -425,11 +479,17 @@ public class Statistics implements * @param timespan The timespan to retrieve statistics for the exact meaning of this parameter is not known + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetBandwidthStatisticsResponse getBandwidthStatistics( - Optional timespan) throws Exception { + Optional timespan, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } GetBandwidthStatisticsRequest request = GetBandwidthStatisticsRequest .builder() @@ -456,45 +516,62 @@ public class Statistics implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getBandwidthStatistics", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getBandwidthStatistics", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getBandwidthStatistics", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getBandwidthStatistics", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getBandwidthStatistics", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getBandwidthStatistics", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getBandwidthStatistics", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") diff --git a/src/main/java/dev/plexapi/sdk/Updater.java b/src/main/java/dev/plexapi/sdk/Updater.java index 14e60e8c..b241868f 100644 --- a/src/main/java/dev/plexapi/sdk/Updater.java +++ b/src/main/java/dev/plexapi/sdk/Updater.java @@ -25,19 +25,27 @@ import dev.plexapi.sdk.models.operations.GetUpdateStatusResponseBody; import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; import dev.plexapi.sdk.models.operations.Skip; import dev.plexapi.sdk.models.operations.Tonight; +import dev.plexapi.sdk.utils.BackoffStrategy; 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.Options; +import dev.plexapi.sdk.utils.Retries.NonRetryableException; +import dev.plexapi.sdk.utils.Retries; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.io.InputStream; import java.lang.Exception; import java.lang.String; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.Optional; +import java.util.Optional; +import java.util.concurrent.TimeUnit; /** * This describes the API for searching and applying updates to the Plex Media Server. @@ -72,6 +80,22 @@ public class Updater implements * @throws Exception if the API call fails */ public GetUpdateStatusResponse getUpdateStatusDirect() throws Exception { + return getUpdateStatus(Optional.empty()); + } + + /** + * Querying status of updates + * Querying status of updates + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetUpdateStatusResponse getUpdateStatus( + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -87,45 +111,62 @@ public class Updater implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getUpdateStatus", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getUpdateStatus", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getUpdateStatus", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getUpdateStatus", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getUpdateStatus", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getUpdateStatus", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getUpdateStatus", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -219,18 +260,24 @@ public class Updater implements * @throws Exception if the API call fails */ public CheckForUpdatesResponse checkForUpdatesDirect() throws Exception { - return checkForUpdates(Optional.empty()); + return checkForUpdates(Optional.empty(), Optional.empty()); } /** * Checking for updates * Checking for updates * @param download Indicate that you want to start download any updates found. + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public CheckForUpdatesResponse checkForUpdates( - Optional download) throws Exception { + Optional download, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } CheckForUpdatesRequest request = CheckForUpdatesRequest .builder() @@ -257,45 +304,62 @@ public class Updater implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "checkForUpdates", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "checkForUpdates", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "checkForUpdates", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "checkForUpdates", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "checkForUpdates", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "checkForUpdates", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "checkForUpdates", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -380,7 +444,7 @@ public class Updater implements * @throws Exception if the API call fails */ public ApplyUpdatesResponse applyUpdatesDirect() throws Exception { - return applyUpdates(Optional.empty(), Optional.empty()); + return applyUpdates(Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -389,12 +453,18 @@ public class Updater implements * * @param tonight Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install * @param skip Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`. + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public ApplyUpdatesResponse applyUpdates( Optional tonight, - Optional skip) throws Exception { + Optional skip, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } ApplyUpdatesRequest request = ApplyUpdatesRequest .builder() @@ -422,45 +492,62 @@ public class Updater implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "applyUpdates", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "500", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "applyUpdates", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "applyUpdates", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "applyUpdates", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "applyUpdates", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "applyUpdates", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "applyUpdates", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") diff --git a/src/main/java/dev/plexapi/sdk/Video.java b/src/main/java/dev/plexapi/sdk/Video.java index 19699f3d..a858021d 100644 --- a/src/main/java/dev/plexapi/sdk/Video.java +++ b/src/main/java/dev/plexapi/sdk/Video.java @@ -17,19 +17,27 @@ import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequest; import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequestBuilder; import dev.plexapi.sdk.models.operations.StartUniversalTranscodeResponse; +import dev.plexapi.sdk.utils.BackoffStrategy; 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.Options; +import dev.plexapi.sdk.utils.Retries.NonRetryableException; +import dev.plexapi.sdk.utils.Retries; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.io.InputStream; import java.lang.Exception; import java.lang.String; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.Optional; +import java.util.Optional; +import java.util.concurrent.TimeUnit; /** * API Calls that perform operations with Plex Media Server Videos @@ -64,6 +72,24 @@ public class Video implements */ public GetTimelineResponse getTimeline( GetTimelineRequest request) throws Exception { + return getTimeline(request, Optional.empty()); + } + + /** + * Get the timeline for a media item + * Get the timeline for a media item + * @param request The request object containing all of the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetTimelineResponse getTimeline( + GetTimelineRequest request, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -84,45 +110,62 @@ public class Video implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "getTimeline", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getTimeline", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "getTimeline", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "getTimeline", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "getTimeline", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "getTimeline", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "getTimeline", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") @@ -207,6 +250,24 @@ public class Video implements */ public StartUniversalTranscodeResponse startUniversalTranscode( StartUniversalTranscodeRequest request) throws Exception { + return startUniversalTranscode(request, Optional.empty()); + } + + /** + * Start Universal Transcode + * Begin a Universal Transcode Session + * @param request The request object containing all of the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public StartUniversalTranscodeResponse startUniversalTranscode( + StartUniversalTranscodeRequest request, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl( this.sdkConfiguration.serverUrl, this.sdkConfiguration.getServerVariableDefaults()); String _url = Utils.generateURL( @@ -227,45 +288,62 @@ public class Video implements this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "startUniversalTranscode", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "startUniversalTranscode", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "startUniversalTranscode", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "startUniversalTranscode", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "startUniversalTranscode", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "startUniversalTranscode", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "startUniversalTranscode", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") diff --git a/src/main/java/dev/plexapi/sdk/Watchlist.java b/src/main/java/dev/plexapi/sdk/Watchlist.java index b6bc3503..0f8beae9 100644 --- a/src/main/java/dev/plexapi/sdk/Watchlist.java +++ b/src/main/java/dev/plexapi/sdk/Watchlist.java @@ -13,20 +13,28 @@ import dev.plexapi.sdk.models.operations.GetWatchListRequestBuilder; import dev.plexapi.sdk.models.operations.GetWatchListResponse; import dev.plexapi.sdk.models.operations.GetWatchListResponseBody; import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; +import dev.plexapi.sdk.utils.BackoffStrategy; 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.Options; +import dev.plexapi.sdk.utils.Retries.NonRetryableException; +import dev.plexapi.sdk.utils.Retries; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.io.InputStream; import java.lang.Exception; import java.lang.String; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; -import java.util.Optional; +import java.util.Optional; +import java.util.concurrent.TimeUnit; /** * API Calls that perform operations with Plex Media Server Watchlists @@ -70,7 +78,7 @@ public class Watchlist implements */ public GetWatchListResponse getWatchList( GetWatchListRequest request) throws Exception { - return getWatchList(request, Optional.empty()); + return getWatchList(request, Optional.empty(), Optional.empty()); } /** @@ -78,12 +86,18 @@ public class Watchlist implements * Get User Watchlist * @param request The request object containing all of the parameters for the API call. * @param serverURL Overrides the server URL. + * @param options additional options * @return The response from the API call * @throws Exception if the API call fails */ public GetWatchListResponse getWatchList( GetWatchListRequest request, - Optional serverURL) throws Exception { + Optional serverURL, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } String _baseUrl = Utils.templateUrl(GET_WATCH_LIST_SERVERS[0], new HashMap()); if (serverURL.isPresent() && !serverURL.get().isBlank()) { _baseUrl = serverURL.get(); @@ -103,50 +117,68 @@ public class Watchlist implements GetWatchListRequest.class, request, this.sdkConfiguration.globals)); + _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); HTTPClient _client = this.sdkConfiguration.defaultClient; - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - "get-watch-list", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-watch-list", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - "get-watch-list", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - "get-watch-list", - Optional.of(List.of()), - sdkConfiguration.securitySource()), - Optional.empty(), - Optional.of(_e)); + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "get-watch-list", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "get-watch-list", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "get-watch-list", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); String _contentType = _httpRes .headers() .firstValue("Content-Type") diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesBadRequest.java new file mode 100644 index 00000000..e8629b51 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesBadRequest.java @@ -0,0 +1,172 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +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.io.InputStream; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +/** + * GetSearchAllLibrariesBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly. + */ +public class GetSearchAllLibrariesBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetSearchAllLibrariesBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSearchAllLibrariesBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + public Optional> errors(){ + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + public Optional> rawResponse(){ + return (Optional>) rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchAllLibrariesBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetSearchAllLibrariesBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchAllLibrariesBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchAllLibrariesBadRequest withRawResponse(Optional> 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; + } + GetSearchAllLibrariesBadRequest other = (GetSearchAllLibrariesBadRequest) o; + return + Objects.deepEquals(this.errors, other.errors) && + Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetSearchAllLibrariesBadRequest build() { + return new GetSearchAllLibrariesBadRequest( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesErrors.java new file mode 100644 index 00000000..3e5a7104 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesErrors.java @@ -0,0 +1,194 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.errors; + + +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.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; + + +public class GetSearchAllLibrariesErrors { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("code") + private Optional code; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("message") + private Optional message; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + @JsonCreator + public GetSearchAllLibrariesErrors( + @JsonProperty("code") Optional code, + @JsonProperty("message") Optional message, + @JsonProperty("status") Optional status) { + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(status, "status"); + this.code = code; + this.message = message; + this.status = status; + } + + public GetSearchAllLibrariesErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); + } + + @JsonIgnore + public Optional code() { + return code; + } + + @JsonIgnore + public Optional message() { + return message; + } + + @JsonIgnore + public Optional status() { + return status; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchAllLibrariesErrors withCode(int code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public GetSearchAllLibrariesErrors withCode(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public GetSearchAllLibrariesErrors withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + public GetSearchAllLibrariesErrors withMessage(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public GetSearchAllLibrariesErrors withStatus(int status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + public GetSearchAllLibrariesErrors withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesErrors other = (GetSearchAllLibrariesErrors) o; + return + Objects.deepEquals(this.code, other.code) && + Objects.deepEquals(this.message, other.message) && + Objects.deepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return Objects.hash( + code, + message, + status); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesErrors.class, + "code", code, + "message", message, + "status", status); + } + + public final static class Builder { + + private Optional code = Optional.empty(); + + private Optional message = Optional.empty(); + + private Optional status = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder code(int code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public Builder code(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + public Builder message(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public Builder status(int status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public GetSearchAllLibrariesErrors build() { + return new GetSearchAllLibrariesErrors( + code, + message, + status); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesLibraryErrors.java new file mode 100644 index 00000000..89e6ec1d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesLibraryErrors.java @@ -0,0 +1,194 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.errors; + + +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.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; + + +public class GetSearchAllLibrariesLibraryErrors { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("code") + private Optional code; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("message") + private Optional message; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + @JsonCreator + public GetSearchAllLibrariesLibraryErrors( + @JsonProperty("code") Optional code, + @JsonProperty("message") Optional message, + @JsonProperty("status") Optional status) { + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(status, "status"); + this.code = code; + this.message = message; + this.status = status; + } + + public GetSearchAllLibrariesLibraryErrors() { + this(Optional.empty(), Optional.empty(), Optional.empty()); + } + + @JsonIgnore + public Optional code() { + return code; + } + + @JsonIgnore + public Optional message() { + return message; + } + + @JsonIgnore + public Optional status() { + return status; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchAllLibrariesLibraryErrors withCode(int code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public GetSearchAllLibrariesLibraryErrors withCode(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public GetSearchAllLibrariesLibraryErrors withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + public GetSearchAllLibrariesLibraryErrors withMessage(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public GetSearchAllLibrariesLibraryErrors withStatus(int status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + public GetSearchAllLibrariesLibraryErrors withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesLibraryErrors other = (GetSearchAllLibrariesLibraryErrors) o; + return + Objects.deepEquals(this.code, other.code) && + Objects.deepEquals(this.message, other.message) && + Objects.deepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return Objects.hash( + code, + message, + status); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesLibraryErrors.class, + "code", code, + "message", message, + "status", status); + } + + public final static class Builder { + + private Optional code = Optional.empty(); + + private Optional message = Optional.empty(); + + private Optional status = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder code(int code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public Builder code(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + public Builder message(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public Builder status(int status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public GetSearchAllLibrariesLibraryErrors build() { + return new GetSearchAllLibrariesLibraryErrors( + code, + message, + status); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesUnauthorized.java new file mode 100644 index 00000000..895fa414 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesUnauthorized.java @@ -0,0 +1,172 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +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.io.InputStream; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +/** + * GetSearchAllLibrariesUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +public class GetSearchAllLibrariesUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetSearchAllLibrariesUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSearchAllLibrariesUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + public Optional> errors(){ + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + public Optional> rawResponse(){ + return (Optional>) rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchAllLibrariesUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetSearchAllLibrariesUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchAllLibrariesUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchAllLibrariesUnauthorized withRawResponse(Optional> 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; + } + GetSearchAllLibrariesUnauthorized other = (GetSearchAllLibrariesUnauthorized) o; + return + Objects.deepEquals(this.errors, other.errors) && + Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetSearchAllLibrariesUnauthorized build() { + return new GetSearchAllLibrariesUnauthorized( + errors, + rawResponse); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsRequestBuilder.java index 1758781b..fe2b3e50 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.String; @@ -14,6 +16,7 @@ public class AddPlaylistContentsRequestBuilder { private Double playlistID; private String uri; private Optional playQueueID = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallAddPlaylistContents sdk; public AddPlaylistContentsRequestBuilder(SDKMethodInterfaces.MethodCallAddPlaylistContents sdk) { @@ -43,12 +46,27 @@ public class AddPlaylistContentsRequestBuilder { this.playQueueID = playQueueID; return this; } + + public AddPlaylistContentsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AddPlaylistContentsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public AddPlaylistContentsResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.addPlaylistContents( playlistID, uri, - playQueueID); + playQueueID, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesRequestBuilder.java index afa2efd7..cea725f9 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.util.Optional; @@ -11,6 +13,7 @@ public class ApplyUpdatesRequestBuilder { private Optional tonight = Optional.empty(); private Optional skip = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallApplyUpdates sdk; public ApplyUpdatesRequestBuilder(SDKMethodInterfaces.MethodCallApplyUpdates sdk) { @@ -40,11 +43,26 @@ public class ApplyUpdatesRequestBuilder { this.skip = skip; return this; } + + public ApplyUpdatesRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public ApplyUpdatesRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public ApplyUpdatesResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.applyUpdates( tonight, - skip); + skip, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesRequestBuilder.java index c1297b2a..2d350b3b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesRequestBuilder.java @@ -4,12 +4,16 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.String; +import java.util.Optional; public class CancelServerActivitiesRequestBuilder { private String activityUUID; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallCancelServerActivities sdk; public CancelServerActivitiesRequestBuilder(SDKMethodInterfaces.MethodCallCancelServerActivities sdk) { @@ -21,10 +25,25 @@ public class CancelServerActivitiesRequestBuilder { this.activityUUID = activityUUID; return this; } + + public CancelServerActivitiesRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public CancelServerActivitiesRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public CancelServerActivitiesResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.cancelServerActivities( - activityUUID); + activityUUID, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesRequestBuilder.java index b0a8f421..135f29b4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesRequestBuilder.java @@ -4,12 +4,15 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.util.Optional; public class CheckForUpdatesRequestBuilder { private Optional download = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallCheckForUpdates sdk; public CheckForUpdatesRequestBuilder(SDKMethodInterfaces.MethodCallCheckForUpdates sdk) { @@ -27,10 +30,25 @@ public class CheckForUpdatesRequestBuilder { this.download = download; return this; } + + public CheckForUpdatesRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public CheckForUpdatesRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public CheckForUpdatesResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.checkForUpdates( - download); + download, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/ClearPlaylistContentsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/ClearPlaylistContentsRequestBuilder.java index 242779f5..20bd1d89 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/ClearPlaylistContentsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/ClearPlaylistContentsRequestBuilder.java @@ -4,12 +4,16 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; +import java.util.Optional; public class ClearPlaylistContentsRequestBuilder { private Double playlistID; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallClearPlaylistContents sdk; public ClearPlaylistContentsRequestBuilder(SDKMethodInterfaces.MethodCallClearPlaylistContents sdk) { @@ -21,10 +25,25 @@ public class ClearPlaylistContentsRequestBuilder { this.playlistID = playlistID; return this; } + + public ClearPlaylistContentsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public ClearPlaylistContentsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public ClearPlaylistContentsResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.clearPlaylistContents( - playlistID); + playlistID, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistRequestBuilder.java index 187b5ae7..04db1574 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistRequestBuilder.java @@ -4,11 +4,15 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class CreatePlaylistRequestBuilder { private CreatePlaylistRequest request; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallCreatePlaylist sdk; public CreatePlaylistRequestBuilder(SDKMethodInterfaces.MethodCallCreatePlaylist sdk) { @@ -20,10 +24,25 @@ public class CreatePlaylistRequestBuilder { this.request = request; return this; } + + public CreatePlaylistRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public CreatePlaylistRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public CreatePlaylistResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.createPlaylist( - request); + request, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/DeleteLibraryRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/DeleteLibraryRequestBuilder.java index 3b59bfdc..dd4981a3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/DeleteLibraryRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/DeleteLibraryRequestBuilder.java @@ -4,12 +4,16 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; +import java.util.Optional; public class DeleteLibraryRequestBuilder { private Integer sectionKey; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallDeleteLibrary sdk; public DeleteLibraryRequestBuilder(SDKMethodInterfaces.MethodCallDeleteLibrary sdk) { @@ -21,10 +25,25 @@ public class DeleteLibraryRequestBuilder { this.sectionKey = sectionKey; return this; } + + public DeleteLibraryRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public DeleteLibraryRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public DeleteLibraryResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.deleteLibrary( - sectionKey); + sectionKey, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/DeletePlaylistRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/DeletePlaylistRequestBuilder.java index 1e109c4f..c873498f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/DeletePlaylistRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/DeletePlaylistRequestBuilder.java @@ -4,12 +4,16 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; +import java.util.Optional; public class DeletePlaylistRequestBuilder { private Double playlistID; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallDeletePlaylist sdk; public DeletePlaylistRequestBuilder(SDKMethodInterfaces.MethodCallDeletePlaylist sdk) { @@ -21,10 +25,25 @@ public class DeletePlaylistRequestBuilder { this.playlistID = playlistID; return this; } + + public DeletePlaylistRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public DeletePlaylistRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public DeletePlaylistResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.deletePlaylist( - playlistID); + playlistID, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/EnablePaperTrailRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/EnablePaperTrailRequestBuilder.java index c6e1fdc4..0b834989 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/EnablePaperTrailRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/EnablePaperTrailRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class EnablePaperTrailRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallEnablePaperTrail sdk; public EnablePaperTrailRequestBuilder(SDKMethodInterfaces.MethodCallEnablePaperTrail sdk) { this.sdk = sdk; } + + public EnablePaperTrailRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public EnablePaperTrailRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public EnablePaperTrailResponse call() throws Exception { - - return sdk.enablePaperTrailDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.enablePaperTrail( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Features.java b/src/main/java/dev/plexapi/sdk/models/operations/Features.java deleted file mode 100644 index 51914148..00000000 --- a/src/main/java/dev/plexapi/sdk/models/operations/Features.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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; - -public enum Features { - ANDROID_DOLBY_VISION("Android - Dolby Vision"), - ANDROID_PI_P("Android - PiP"), - CU_SUNSET("CU Sunset"), - HRK_ENABLE_EUR("HRK_enable_EUR"), - TREBLE_SHOW_FEATURES("TREBLE-show-features"), - AD_COUNTDOWN_TIMER("ad-countdown-timer"), - ADAPTIVE_BITRATE("adaptive_bitrate"), - ALBUM_TYPES("album-types"), - ALLOW_DVR("allow_dvr"), - AMAZON_LOOP_DEBUG("amazon-loop-debug"), - AVOD_AD_ANALYSIS("avod-ad-analysis"), - AVOD_NEW_MEDIA("avod-new-media"), - BLACKLIST_GET_SIGNIN("blacklist_get_signin"), - BOOST_VOICES("boost-voices"), - CAMERA_UPLOAD("camera_upload"), - CLIENT_RADIO_STATIONS("client-radio-stations"), - CLOUDFLARE_TURNSTILE_REQUIRED("cloudflare-turnstile-required"), - CLOUDSYNC("cloudsync"), - COLLECTIONS("collections"), - COMMENTS_AND_REPLIES_PUSH_NOTIFICATIONS("comments_and_replies_push_notifications"), - COMMUNITY_ACCESS_PLEX_TV("community_access_plex_tv"), - COMPANIONS_SONOS("companions_sonos"), - CONTENT_FILTER("content_filter"), - CUSTOM_HOME_REMOVAL("custom-home-removal"), - DISABLE_HOME_USER_FRIENDSHIPS("disable_home_user_friendships"), - DISABLE_SHARING_FRIENDSHIPS("disable_sharing_friendships"), - DOWNLOADS_GATING("downloads-gating"), - DRM_SUPPORT("drm_support"), - DVR("dvr"), - DVR_BLOCK_UNSUPPORTED_COUNTRIES("dvr-block-unsupported-countries"), - EPG_RECENT_CHANNELS("epg-recent-channels"), - EXCLUDE_RESTRICTIONS("exclude restrictions"), - FEDERATED_AUTH("federated-auth"), - FRIEND_REQUEST_PUSH_NOTIFICATIONS("friend_request_push_notifications"), - GRANDFATHER_SYNC("grandfather-sync"), - GUIDED_UPGRADE("guided-upgrade"), - HARDWARE_TRANSCODING("hardware_transcoding"), - HOME("home"), - HWTRANSCODE("hwtranscode"), - IMAGGA_V2("imagga-v2"), - INCREASE_PASSWORD_COMPLEXITY("increase-password-complexity"), - IOS14_PRIVACY_BANNER("ios14-privacy-banner"), - ITERABLE_NOTIFICATION_TOKENS("iterable-notification-tokens"), - ITEM_CLUSTERS("item_clusters"), - KEEP_PAYMENT_METHOD("keep-payment-method"), - KEVIN_BACON("kevin-bacon"), - KOREA_CONSENT("korea-consent"), - LE_ISRG_ROOT_X1("le_isrg_root_x1"), - LETS_ENCRYPT("lets_encrypt"), - LIGHTNING_DVR_PIVOT("lightning-dvr-pivot"), - LIVE_TV_SUPPORT_INCOMPLETE_SEGMENTS("live-tv-support-incomplete-segments"), - LIVETV("livetv"), - LYRICS("lyrics"), - METADATA_SEARCH("metadata_search"), - MUSIC_ANALYSIS("music-analysis"), - MUSIC_VIDEOS("music_videos"), - NEW_PLEX_PASS_PRICES("new_plex_pass_prices"), - NEWS_PROVIDER_SUNSET_MODAL("news-provider-sunset-modal"), - NOMINATIM("nominatim"), - PASS("pass"), - PHOTOS_FAVORITES("photos-favorites"), - PHOTOS_METADATA_EDITION("photos-metadata-edition"), - PHOTOS_V6_EDIT("photosV6-edit"), - PHOTOS_V6_TV_ALBUMS("photosV6-tv-albums"), - PMS_HEALTH("pms_health"), - PREMIUM_DASHBOARD("premium-dashboard"), - PREMIUM_MUSIC_METADATA("premium_music_metadata"), - RADIO("radio"), - RATE_LIMIT_CLIENT_TOKEN("rate-limit-client-token"), - SCROBBLING_SERVICE_PLEX_TV("scrobbling-service-plex-tv"), - SESSION_BANDWIDTH_RESTRICTIONS("session_bandwidth_restrictions"), - SESSION_KICK("session_kick"), - SHARED_SERVER_NOTIFICATION("shared_server_notification"), - SHARED_SOURCE_NOTIFICATION("shared_source_notification"), - SIGNIN_NOTIFICATION("signin_notification"), - SIGNIN_WITH_APPLE("signin_with_apple"), - SILENCE_REMOVAL("silence-removal"), - SLEEP_TIMER("sleep-timer"), - SPRING_SERVE_AD_PROVIDER("spring_serve_ad_provider"), - SYNC("sync"), - SWEET_FADES("sweet-fades"), - TRANSCODER_CACHE("transcoder_cache"), - TRAILERS("trailers"), - TUNER_SHARING("tuner-sharing"), - TWO_FACTOR_AUTHENTICATION("two-factor-authentication"), - UNSUPPORTEDTUNERS("unsupportedtuners"), - UPGRADE3DS2("upgrade-3ds2"), - VISUALIZERS("visualizers"), - VOD_SCHEMA("vod-schema"), - VOD_CLOUDFLARE("vod_cloudflare"), - VOLUME_LEVELING("volume-leveling"), - WATCH_TOGETHER_INVITE("watch-together-invite"), - WATCHLIST_RSS("watchlist-rss"), - WEB_SERVER_DASHBOARD("web_server_dashboard"), - WEBHOOKS("webhooks"); - - @JsonValue - private final String value; - - private Features(String value) { - this.value = value; - } - - public String value() { - return value; - } -} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesDirectory.java b/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesDirectory.java index 6405c5df..f86d4dea 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesDirectory.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesDirectory.java @@ -93,7 +93,7 @@ public class GetAllLibrariesDirectory { private int hidden; @JsonProperty("Location") - private List location; + private List location; @JsonCreator public GetAllLibrariesDirectory( @@ -117,7 +117,7 @@ public class GetAllLibrariesDirectory { @JsonProperty("directory") boolean directory, @JsonProperty("contentChangedAt") long contentChangedAt, @JsonProperty("hidden") int hidden, - @JsonProperty("Location") List location) { + @JsonProperty("Location") List location) { Utils.checkNotNull(allowSync, "allowSync"); Utils.checkNotNull(art, "art"); Utils.checkNotNull(composite, "composite"); @@ -275,7 +275,7 @@ public class GetAllLibrariesDirectory { } @JsonIgnore - public List location() { + public List location() { return location; } @@ -415,7 +415,7 @@ public class GetAllLibrariesDirectory { return this; } - public GetAllLibrariesDirectory withLocation(List location) { + public GetAllLibrariesDirectory withLocation(List location) { Utils.checkNotNull(location, "location"); this.location = location; return this; @@ -548,7 +548,7 @@ public class GetAllLibrariesDirectory { private Integer hidden; - private List location; + private List location; private Builder() { // force use of static builder() method @@ -686,7 +686,7 @@ public class GetAllLibrariesDirectory { return this; } - public Builder location(List location) { + public Builder location(List location) { Utils.checkNotNull(location, "location"); this.location = location; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesLocation.java b/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesLocation.java new file mode 100644 index 00000000..3faa90b8 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesLocation.java @@ -0,0 +1,119 @@ +/* + * 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.Override; +import java.lang.String; +import java.util.Objects; + + +public class GetAllLibrariesLocation { + + @JsonProperty("id") + private int id; + + @JsonProperty("path") + private String path; + + @JsonCreator + public GetAllLibrariesLocation( + @JsonProperty("id") int id, + @JsonProperty("path") String path) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(path, "path"); + this.id = id; + this.path = path; + } + + @JsonIgnore + public int id() { + return id; + } + + @JsonIgnore + public String path() { + return path; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetAllLibrariesLocation withId(int id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public GetAllLibrariesLocation withPath(String path) { + Utils.checkNotNull(path, "path"); + this.path = path; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllLibrariesLocation other = (GetAllLibrariesLocation) o; + return + Objects.deepEquals(this.id, other.id) && + Objects.deepEquals(this.path, other.path); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + path); + } + + @Override + public String toString() { + return Utils.toString(GetAllLibrariesLocation.class, + "id", id, + "path", path); + } + + public final static class Builder { + + private Integer id; + + private String path; + + private Builder() { + // force use of static builder() method + } + + public Builder id(int id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder path(String path) { + Utils.checkNotNull(path, "path"); + this.path = path; + return this; + } + + public GetAllLibrariesLocation build() { + return new GetAllLibrariesLocation( + id, + path); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesRequestBuilder.java index d2760b32..085d11f7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetAllLibrariesRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetAllLibraries sdk; public GetAllLibrariesRequestBuilder(SDKMethodInterfaces.MethodCallGetAllLibraries sdk) { this.sdk = sdk; } + + public GetAllLibrariesRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetAllLibrariesRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetAllLibrariesResponse call() throws Exception { - - return sdk.getAllLibrariesDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getAllLibraries( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetAvailableClientsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetAvailableClientsRequestBuilder.java index 3198ed08..6edd1a8c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetAvailableClientsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetAvailableClientsRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetAvailableClientsRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetAvailableClients sdk; public GetAvailableClientsRequestBuilder(SDKMethodInterfaces.MethodCallGetAvailableClients sdk) { this.sdk = sdk; } + + public GetAvailableClientsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetAvailableClientsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetAvailableClientsResponse call() throws Exception { - - return sdk.getAvailableClientsDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getAvailableClients( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetBandwidthStatisticsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetBandwidthStatisticsRequestBuilder.java index 46adc70d..de4a5166 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetBandwidthStatisticsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetBandwidthStatisticsRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.util.Optional; @@ -11,6 +13,7 @@ import java.util.Optional; public class GetBandwidthStatisticsRequestBuilder { private Optional timespan = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetBandwidthStatistics sdk; public GetBandwidthStatisticsRequestBuilder(SDKMethodInterfaces.MethodCallGetBandwidthStatistics sdk) { @@ -28,10 +31,25 @@ public class GetBandwidthStatisticsRequestBuilder { this.timespan = timespan; return this; } + + public GetBandwidthStatisticsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetBandwidthStatisticsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetBandwidthStatisticsResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getBandwidthStatistics( - timespan); + timespan, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetBannerImageRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetBannerImageRequest.java index f7b1e79b..b2ec64b7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetBannerImageRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetBannerImageRequest.java @@ -36,9 +36,9 @@ public class GetBannerImageRequest { private long upscale; /** - * Plex Authentication Token + * An authentication token, obtained from plex.tv */ - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Token") + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Token") private String xPlexToken; @JsonCreator @@ -92,7 +92,7 @@ public class GetBannerImageRequest { } /** - * Plex Authentication Token + * An authentication token, obtained from plex.tv */ @JsonIgnore public String xPlexToken() { @@ -137,7 +137,7 @@ public class GetBannerImageRequest { } /** - * Plex Authentication Token + * An authentication token, obtained from plex.tv */ public GetBannerImageRequest withXPlexToken(String xPlexToken) { Utils.checkNotNull(xPlexToken, "xPlexToken"); @@ -237,7 +237,7 @@ public class GetBannerImageRequest { } /** - * Plex Authentication Token + * An authentication token, obtained from plex.tv */ public Builder xPlexToken(String xPlexToken) { Utils.checkNotNull(xPlexToken, "xPlexToken"); diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetBannerImageRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetBannerImageRequestBuilder.java index 7cd6b8f6..3359137d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetBannerImageRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetBannerImageRequestBuilder.java @@ -4,11 +4,15 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetBannerImageRequestBuilder { private GetBannerImageRequest request; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetBannerImage sdk; public GetBannerImageRequestBuilder(SDKMethodInterfaces.MethodCallGetBannerImage sdk) { @@ -20,10 +24,25 @@ public class GetBannerImageRequestBuilder { this.request = request; return this; } + + public GetBannerImageRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetBannerImageRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetBannerImageResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getBannerImage( - request); + request, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetButlerTasksRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetButlerTasksRequestBuilder.java index 5e683331..beb680b5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetButlerTasksRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetButlerTasksRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetButlerTasksRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetButlerTasks sdk; public GetButlerTasksRequestBuilder(SDKMethodInterfaces.MethodCallGetButlerTasks sdk) { this.sdk = sdk; } + + public GetButlerTasksRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetButlerTasksRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetButlerTasksResponse call() throws Exception { - - return sdk.getButlerTasksDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getButlerTasks( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetCompanionsDataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetCompanionsDataRequestBuilder.java index cdbb8870..5d8a7cfe 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetCompanionsDataRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetCompanionsDataRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.String; import java.util.Optional; @@ -11,6 +13,7 @@ import java.util.Optional; public class GetCompanionsDataRequestBuilder { private Optional serverURL = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetCompanionsData sdk; public GetCompanionsDataRequestBuilder(SDKMethodInterfaces.MethodCallGetCompanionsData sdk) { @@ -28,10 +31,25 @@ public class GetCompanionsDataRequestBuilder { this.serverURL = serverURL; return this; } + + public GetCompanionsDataRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetCompanionsDataRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetCompanionsDataResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getCompanionsData( - serverURL); + serverURL, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetDevicesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetDevicesRequestBuilder.java index a7a6546b..f2458328 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetDevicesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetDevicesRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetDevicesRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetDevices sdk; public GetDevicesRequestBuilder(SDKMethodInterfaces.MethodCallGetDevices sdk) { this.sdk = sdk; } + + public GetDevicesRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetDevicesRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetDevicesResponse call() throws Exception { - - return sdk.getDevicesDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getDevices( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetFileHashRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetFileHashRequestBuilder.java index ad431d38..833185c3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetFileHashRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetFileHashRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.String; @@ -13,6 +15,7 @@ public class GetFileHashRequestBuilder { private String url; private Optional type = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetFileHash sdk; public GetFileHashRequestBuilder(SDKMethodInterfaces.MethodCallGetFileHash sdk) { @@ -36,11 +39,26 @@ public class GetFileHashRequestBuilder { this.type = type; return this; } + + public GetFileHashRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetFileHashRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetFileHashResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getFileHash( url, - type); + type, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetGeoDataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetGeoDataRequestBuilder.java index d37c1bed..ef112453 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetGeoDataRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetGeoDataRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.String; import java.util.Optional; @@ -11,6 +13,7 @@ import java.util.Optional; public class GetGeoDataRequestBuilder { private Optional serverURL = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetGeoData sdk; public GetGeoDataRequestBuilder(SDKMethodInterfaces.MethodCallGetGeoData sdk) { @@ -28,10 +31,25 @@ public class GetGeoDataRequestBuilder { this.serverURL = serverURL; return this; } + + public GetGeoDataRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetGeoDataRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetGeoDataResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getGeoData( - serverURL); + serverURL, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsRequestBuilder.java index 35b22bb3..02421d68 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.util.Optional; @@ -12,6 +14,7 @@ public class GetGlobalHubsRequestBuilder { private Optional count = Optional.empty(); private Optional onlyTransient = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetGlobalHubs sdk; public GetGlobalHubsRequestBuilder(SDKMethodInterfaces.MethodCallGetGlobalHubs sdk) { @@ -41,11 +44,26 @@ public class GetGlobalHubsRequestBuilder { this.onlyTransient = onlyTransient; return this; } + + public GetGlobalHubsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetGlobalHubsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetGlobalHubsResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getGlobalHubs( count, - onlyTransient); + onlyTransient, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetHomeDataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetHomeDataRequestBuilder.java index 016d51c0..7a481029 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetHomeDataRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetHomeDataRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetHomeDataRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetHomeData sdk; public GetHomeDataRequestBuilder(SDKMethodInterfaces.MethodCallGetHomeData sdk) { this.sdk = sdk; } + + public GetHomeDataRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetHomeDataRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetHomeDataResponse call() throws Exception { - - return sdk.getHomeDataDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getHomeData( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequest.java index 4bfca0bb..19fae299 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequest.java @@ -21,14 +21,6 @@ import java.util.Optional; public class GetLibraryDetailsRequest { - /** - * The unique key of the Plex library. - * Note: This is unique in the context of the Plex server. - * - */ - @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey") - private int sectionKey; - /** * Whether or not to include details for a section (types, filters, and sorts). * Only exists for backwards compatibility, media providers other than the server libraries have it on always. @@ -37,29 +29,27 @@ public class GetLibraryDetailsRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeDetails") private Optional includeDetails; - @JsonCreator - public GetLibraryDetailsRequest( - int sectionKey, - Optional includeDetails) { - Utils.checkNotNull(sectionKey, "sectionKey"); - Utils.checkNotNull(includeDetails, "includeDetails"); - this.sectionKey = sectionKey; - this.includeDetails = includeDetails; - } - - public GetLibraryDetailsRequest( - int sectionKey) { - this(sectionKey, Optional.empty()); - } - /** * The unique key of the Plex library. * Note: This is unique in the context of the Plex server. * */ - @JsonIgnore - public int sectionKey() { - return sectionKey; + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey") + private int sectionKey; + + @JsonCreator + public GetLibraryDetailsRequest( + Optional includeDetails, + int sectionKey) { + Utils.checkNotNull(includeDetails, "includeDetails"); + Utils.checkNotNull(sectionKey, "sectionKey"); + this.includeDetails = includeDetails; + this.sectionKey = sectionKey; + } + + public GetLibraryDetailsRequest( + int sectionKey) { + this(Optional.empty(), sectionKey); } /** @@ -73,19 +63,18 @@ public class GetLibraryDetailsRequest { return (Optional) includeDetails; } - public final static Builder builder() { - return new Builder(); - } - /** * The unique key of the Plex library. * Note: This is unique in the context of the Plex server. * */ - public GetLibraryDetailsRequest withSectionKey(int sectionKey) { - Utils.checkNotNull(sectionKey, "sectionKey"); - this.sectionKey = sectionKey; - return this; + @JsonIgnore + public int sectionKey() { + return sectionKey; + } + + public final static Builder builder() { + return new Builder(); } /** @@ -109,6 +98,17 @@ public class GetLibraryDetailsRequest { this.includeDetails = includeDetails; return this; } + + /** + * The unique key of the Plex library. + * Note: This is unique in the context of the Plex server. + * + */ + public GetLibraryDetailsRequest withSectionKey(int sectionKey) { + Utils.checkNotNull(sectionKey, "sectionKey"); + this.sectionKey = sectionKey; + return this; + } @Override public boolean equals(java.lang.Object o) { @@ -120,45 +120,34 @@ public class GetLibraryDetailsRequest { } GetLibraryDetailsRequest other = (GetLibraryDetailsRequest) o; return - Objects.deepEquals(this.sectionKey, other.sectionKey) && - Objects.deepEquals(this.includeDetails, other.includeDetails); + Objects.deepEquals(this.includeDetails, other.includeDetails) && + Objects.deepEquals(this.sectionKey, other.sectionKey); } @Override public int hashCode() { return Objects.hash( - sectionKey, - includeDetails); + includeDetails, + sectionKey); } @Override public String toString() { return Utils.toString(GetLibraryDetailsRequest.class, - "sectionKey", sectionKey, - "includeDetails", includeDetails); + "includeDetails", includeDetails, + "sectionKey", sectionKey); } public final static class Builder { - private Integer sectionKey; + private Optional includeDetails; - private Optional includeDetails; + private Integer sectionKey; private Builder() { // force use of static builder() method } - /** - * The unique key of the Plex library. - * Note: This is unique in the context of the Plex server. - * - */ - public Builder sectionKey(int sectionKey) { - Utils.checkNotNull(sectionKey, "sectionKey"); - this.sectionKey = sectionKey; - return this; - } - /** * Whether or not to include details for a section (types, filters, and sorts). * Only exists for backwards compatibility, media providers other than the server libraries have it on always. @@ -180,13 +169,24 @@ public class GetLibraryDetailsRequest { this.includeDetails = includeDetails; return this; } + + /** + * The unique key of the Plex library. + * Note: This is unique in the context of the Plex server. + * + */ + public Builder sectionKey(int sectionKey) { + Utils.checkNotNull(sectionKey, "sectionKey"); + this.sectionKey = sectionKey; + return this; + } public GetLibraryDetailsRequest build() { if (includeDetails == null) { includeDetails = _SINGLETON_VALUE_IncludeDetails.value(); } return new GetLibraryDetailsRequest( - sectionKey, - includeDetails); + includeDetails, + sectionKey); } private static final LazySingletonValue> _SINGLETON_VALUE_IncludeDetails = diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequestBuilder.java index a9721778..17e3d339 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequestBuilder.java @@ -6,28 +6,25 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.core.type.TypeReference; import dev.plexapi.sdk.utils.LazySingletonValue; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; import java.util.Optional; public class GetLibraryDetailsRequestBuilder { - private Integer sectionKey; private Optional includeDetails = Utils.readDefaultOrConstValue( "includeDetails", "0", new TypeReference>() {}); + private Integer sectionKey; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetLibraryDetails sdk; public GetLibraryDetailsRequestBuilder(SDKMethodInterfaces.MethodCallGetLibraryDetails sdk) { this.sdk = sdk; } - - public GetLibraryDetailsRequestBuilder sectionKey(int sectionKey) { - Utils.checkNotNull(sectionKey, "sectionKey"); - this.sectionKey = sectionKey; - return this; - } public GetLibraryDetailsRequestBuilder includeDetails(IncludeDetails includeDetails) { Utils.checkNotNull(includeDetails, "includeDetails"); @@ -41,13 +38,34 @@ public class GetLibraryDetailsRequestBuilder { return this; } + public GetLibraryDetailsRequestBuilder sectionKey(int sectionKey) { + Utils.checkNotNull(sectionKey, "sectionKey"); + this.sectionKey = sectionKey; + return this; + } + + public GetLibraryDetailsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetLibraryDetailsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + public GetLibraryDetailsResponse call() throws Exception { if (includeDetails == null) { includeDetails = _SINGLETON_VALUE_IncludeDetails.value(); - } + } Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getLibraryDetails( + includeDetails, sectionKey, - includeDetails); + options); } private static final LazySingletonValue> _SINGLETON_VALUE_IncludeDetails = diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRequestBuilder.java index 09e90e4e..7be00acd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.util.Optional; @@ -13,6 +15,7 @@ public class GetLibraryHubsRequestBuilder { private Double sectionId; private Optional count = Optional.empty(); private Optional onlyTransient = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetLibraryHubs sdk; public GetLibraryHubsRequestBuilder(SDKMethodInterfaces.MethodCallGetLibraryHubs sdk) { @@ -48,12 +51,27 @@ public class GetLibraryHubsRequestBuilder { this.onlyTransient = onlyTransient; return this; } + + public GetLibraryHubsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetLibraryHubsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetLibraryHubsResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getLibraryHubs( sectionId, count, - onlyTransient); + onlyTransient, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLocation.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLocation.java new file mode 100644 index 00000000..20f4dc67 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLocation.java @@ -0,0 +1,109 @@ +/* + * 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.util.Objects; +import java.util.Optional; + + +public class GetLibraryItemsLocation { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("path") + private Optional path; + + @JsonCreator + public GetLibraryItemsLocation( + @JsonProperty("path") Optional path) { + Utils.checkNotNull(path, "path"); + this.path = path; + } + + public GetLibraryItemsLocation() { + this(Optional.empty()); + } + + @JsonIgnore + public Optional path() { + return path; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetLibraryItemsLocation withPath(String path) { + Utils.checkNotNull(path, "path"); + this.path = Optional.ofNullable(path); + return this; + } + + public GetLibraryItemsLocation withPath(Optional path) { + Utils.checkNotNull(path, "path"); + this.path = path; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryItemsLocation other = (GetLibraryItemsLocation) o; + return + Objects.deepEquals(this.path, other.path); + } + + @Override + public int hashCode() { + return Objects.hash( + path); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryItemsLocation.class, + "path", path); + } + + public final static class Builder { + + private Optional path = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder path(String path) { + Utils.checkNotNull(path, "path"); + this.path = Optional.ofNullable(path); + return this; + } + + public Builder path(Optional path) { + Utils.checkNotNull(path, "path"); + this.path = path; + return this; + } + + public GetLibraryItemsLocation build() { + return new GetLibraryItemsLocation( + path); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMedia.java index 6d9e7134..27c6b220 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMedia.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMedia.java @@ -29,45 +29,56 @@ public class GetLibraryItemsMedia { @JsonProperty("id") private int id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") - private int duration; + private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("bitrate") - private int bitrate; + private Optional bitrate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("width") - private int width; + private Optional width; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("height") - private int height; + private Optional height; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("aspectRatio") - private double aspectRatio; + private Optional aspectRatio; @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioProfile") private Optional audioProfile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioChannels") - private int audioChannels; + private Optional audioChannels; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioCodec") - private String audioCodec; + private Optional audioCodec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoCodec") - private String videoCodec; + private Optional videoCodec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoResolution") - private String videoResolution; + private Optional videoResolution; @JsonProperty("container") private String container; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoFrameRate") - private String videoFrameRate; + private Optional videoFrameRate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoProfile") - private String videoProfile; + private Optional videoProfile; @JsonInclude(Include.NON_ABSENT) @JsonProperty("hasVoiceActivity") @@ -87,19 +98,19 @@ public class GetLibraryItemsMedia { @JsonCreator public GetLibraryItemsMedia( @JsonProperty("id") int id, - @JsonProperty("duration") int duration, - @JsonProperty("bitrate") int bitrate, - @JsonProperty("width") int width, - @JsonProperty("height") int height, - @JsonProperty("aspectRatio") double aspectRatio, + @JsonProperty("duration") Optional duration, + @JsonProperty("bitrate") Optional bitrate, + @JsonProperty("width") Optional width, + @JsonProperty("height") Optional height, + @JsonProperty("aspectRatio") Optional aspectRatio, @JsonProperty("audioProfile") Optional audioProfile, - @JsonProperty("audioChannels") int audioChannels, - @JsonProperty("audioCodec") String audioCodec, - @JsonProperty("videoCodec") String videoCodec, - @JsonProperty("videoResolution") String videoResolution, + @JsonProperty("audioChannels") Optional audioChannels, + @JsonProperty("audioCodec") Optional audioCodec, + @JsonProperty("videoCodec") Optional videoCodec, + @JsonProperty("videoResolution") Optional videoResolution, @JsonProperty("container") String container, - @JsonProperty("videoFrameRate") String videoFrameRate, - @JsonProperty("videoProfile") String videoProfile, + @JsonProperty("videoFrameRate") Optional videoFrameRate, + @JsonProperty("videoProfile") Optional videoProfile, @JsonProperty("hasVoiceActivity") Optional hasVoiceActivity, @JsonProperty("optimizedForStreaming") Optional optimizedForStreaming, @JsonProperty("has64bitOffsets") Optional has64bitOffsets, @@ -144,20 +155,9 @@ public class GetLibraryItemsMedia { public GetLibraryItemsMedia( int id, - int duration, - int bitrate, - int width, - int height, - double aspectRatio, - int audioChannels, - String audioCodec, - String videoCodec, - String videoResolution, String container, - String videoFrameRate, - String videoProfile, List part) { - this(id, duration, bitrate, width, height, aspectRatio, Optional.empty(), audioChannels, audioCodec, videoCodec, videoResolution, container, videoFrameRate, videoProfile, Optional.empty(), Optional.empty(), Optional.empty(), part); + this(id, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), container, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), part); } @JsonIgnore @@ -166,27 +166,27 @@ public class GetLibraryItemsMedia { } @JsonIgnore - public int duration() { + public Optional duration() { return duration; } @JsonIgnore - public int bitrate() { + public Optional bitrate() { return bitrate; } @JsonIgnore - public int width() { + public Optional width() { return width; } @JsonIgnore - public int height() { + public Optional height() { return height; } @JsonIgnore - public double aspectRatio() { + public Optional aspectRatio() { return aspectRatio; } @@ -196,22 +196,22 @@ public class GetLibraryItemsMedia { } @JsonIgnore - public int audioChannels() { + public Optional audioChannels() { return audioChannels; } @JsonIgnore - public String audioCodec() { + public Optional audioCodec() { return audioCodec; } @JsonIgnore - public String videoCodec() { + public Optional videoCodec() { return videoCodec; } @JsonIgnore - public String videoResolution() { + public Optional videoResolution() { return videoResolution; } @@ -221,12 +221,12 @@ public class GetLibraryItemsMedia { } @JsonIgnore - public String videoFrameRate() { + public Optional videoFrameRate() { return videoFrameRate; } @JsonIgnore - public String videoProfile() { + public Optional videoProfile() { return videoProfile; } @@ -262,30 +262,60 @@ public class GetLibraryItemsMedia { } public GetLibraryItemsMedia withDuration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public GetLibraryItemsMedia withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; return this; } public GetLibraryItemsMedia withBitrate(int bitrate) { + Utils.checkNotNull(bitrate, "bitrate"); + this.bitrate = Optional.ofNullable(bitrate); + return this; + } + + public GetLibraryItemsMedia withBitrate(Optional bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = bitrate; return this; } public GetLibraryItemsMedia withWidth(int width) { + Utils.checkNotNull(width, "width"); + this.width = Optional.ofNullable(width); + return this; + } + + public GetLibraryItemsMedia withWidth(Optional width) { Utils.checkNotNull(width, "width"); this.width = width; return this; } public GetLibraryItemsMedia withHeight(int height) { + Utils.checkNotNull(height, "height"); + this.height = Optional.ofNullable(height); + return this; + } + + public GetLibraryItemsMedia withHeight(Optional height) { Utils.checkNotNull(height, "height"); this.height = height; return this; } public GetLibraryItemsMedia withAspectRatio(double aspectRatio) { + Utils.checkNotNull(aspectRatio, "aspectRatio"); + this.aspectRatio = Optional.ofNullable(aspectRatio); + return this; + } + + public GetLibraryItemsMedia withAspectRatio(Optional aspectRatio) { Utils.checkNotNull(aspectRatio, "aspectRatio"); this.aspectRatio = aspectRatio; return this; @@ -304,24 +334,48 @@ public class GetLibraryItemsMedia { } public GetLibraryItemsMedia withAudioChannels(int audioChannels) { + Utils.checkNotNull(audioChannels, "audioChannels"); + this.audioChannels = Optional.ofNullable(audioChannels); + return this; + } + + public GetLibraryItemsMedia withAudioChannels(Optional audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = audioChannels; return this; } public GetLibraryItemsMedia withAudioCodec(String audioCodec) { + Utils.checkNotNull(audioCodec, "audioCodec"); + this.audioCodec = Optional.ofNullable(audioCodec); + return this; + } + + public GetLibraryItemsMedia withAudioCodec(Optional audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = audioCodec; return this; } public GetLibraryItemsMedia withVideoCodec(String videoCodec) { + Utils.checkNotNull(videoCodec, "videoCodec"); + this.videoCodec = Optional.ofNullable(videoCodec); + return this; + } + + public GetLibraryItemsMedia withVideoCodec(Optional videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = videoCodec; return this; } public GetLibraryItemsMedia withVideoResolution(String videoResolution) { + Utils.checkNotNull(videoResolution, "videoResolution"); + this.videoResolution = Optional.ofNullable(videoResolution); + return this; + } + + public GetLibraryItemsMedia withVideoResolution(Optional videoResolution) { Utils.checkNotNull(videoResolution, "videoResolution"); this.videoResolution = videoResolution; return this; @@ -334,12 +388,24 @@ public class GetLibraryItemsMedia { } public GetLibraryItemsMedia withVideoFrameRate(String videoFrameRate) { + Utils.checkNotNull(videoFrameRate, "videoFrameRate"); + this.videoFrameRate = Optional.ofNullable(videoFrameRate); + return this; + } + + public GetLibraryItemsMedia withVideoFrameRate(Optional videoFrameRate) { Utils.checkNotNull(videoFrameRate, "videoFrameRate"); this.videoFrameRate = videoFrameRate; return this; } public GetLibraryItemsMedia withVideoProfile(String videoProfile) { + Utils.checkNotNull(videoProfile, "videoProfile"); + this.videoProfile = Optional.ofNullable(videoProfile); + return this; + } + + public GetLibraryItemsMedia withVideoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; return this; @@ -467,31 +533,31 @@ public class GetLibraryItemsMedia { private Integer id; - private Integer duration; + private Optional duration = Optional.empty(); - private Integer bitrate; + private Optional bitrate = Optional.empty(); - private Integer width; + private Optional width = Optional.empty(); - private Integer height; + private Optional height = Optional.empty(); - private Double aspectRatio; + private Optional aspectRatio = Optional.empty(); private Optional audioProfile = Optional.empty(); - private Integer audioChannels; + private Optional audioChannels = Optional.empty(); - private String audioCodec; + private Optional audioCodec = Optional.empty(); - private String videoCodec; + private Optional videoCodec = Optional.empty(); - private String videoResolution; + private Optional videoResolution = Optional.empty(); private String container; - private String videoFrameRate; + private Optional videoFrameRate = Optional.empty(); - private String videoProfile; + private Optional videoProfile = Optional.empty(); private Optional hasVoiceActivity = Optional.empty(); @@ -512,30 +578,60 @@ public class GetLibraryItemsMedia { } public Builder duration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public Builder duration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; return this; } public Builder bitrate(int bitrate) { + Utils.checkNotNull(bitrate, "bitrate"); + this.bitrate = Optional.ofNullable(bitrate); + return this; + } + + public Builder bitrate(Optional bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = bitrate; return this; } public Builder width(int width) { + Utils.checkNotNull(width, "width"); + this.width = Optional.ofNullable(width); + return this; + } + + public Builder width(Optional width) { Utils.checkNotNull(width, "width"); this.width = width; return this; } public Builder height(int height) { + Utils.checkNotNull(height, "height"); + this.height = Optional.ofNullable(height); + return this; + } + + public Builder height(Optional height) { Utils.checkNotNull(height, "height"); this.height = height; return this; } public Builder aspectRatio(double aspectRatio) { + Utils.checkNotNull(aspectRatio, "aspectRatio"); + this.aspectRatio = Optional.ofNullable(aspectRatio); + return this; + } + + public Builder aspectRatio(Optional aspectRatio) { Utils.checkNotNull(aspectRatio, "aspectRatio"); this.aspectRatio = aspectRatio; return this; @@ -554,24 +650,48 @@ public class GetLibraryItemsMedia { } public Builder audioChannels(int audioChannels) { + Utils.checkNotNull(audioChannels, "audioChannels"); + this.audioChannels = Optional.ofNullable(audioChannels); + return this; + } + + public Builder audioChannels(Optional audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = audioChannels; return this; } public Builder audioCodec(String audioCodec) { + Utils.checkNotNull(audioCodec, "audioCodec"); + this.audioCodec = Optional.ofNullable(audioCodec); + return this; + } + + public Builder audioCodec(Optional audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = audioCodec; return this; } public Builder videoCodec(String videoCodec) { + Utils.checkNotNull(videoCodec, "videoCodec"); + this.videoCodec = Optional.ofNullable(videoCodec); + return this; + } + + public Builder videoCodec(Optional videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = videoCodec; return this; } public Builder videoResolution(String videoResolution) { + Utils.checkNotNull(videoResolution, "videoResolution"); + this.videoResolution = Optional.ofNullable(videoResolution); + return this; + } + + public Builder videoResolution(Optional videoResolution) { Utils.checkNotNull(videoResolution, "videoResolution"); this.videoResolution = videoResolution; return this; @@ -584,12 +704,24 @@ public class GetLibraryItemsMedia { } public Builder videoFrameRate(String videoFrameRate) { + Utils.checkNotNull(videoFrameRate, "videoFrameRate"); + this.videoFrameRate = Optional.ofNullable(videoFrameRate); + return this; + } + + public Builder videoFrameRate(Optional videoFrameRate) { Utils.checkNotNull(videoFrameRate, "videoFrameRate"); this.videoFrameRate = videoFrameRate; return this; } public Builder videoProfile(String videoProfile) { + Utils.checkNotNull(videoProfile, "videoProfile"); + this.videoProfile = Optional.ofNullable(videoProfile); + return this; + } + + public Builder videoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMetadata.java index daf1f24b..b22081c1 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMetadata.java @@ -237,6 +237,10 @@ public class GetLibraryItemsMetadata { @JsonProperty("Role") private Optional> role; + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Location") + private Optional> location; + /** * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. * @@ -398,6 +402,7 @@ public class GetLibraryItemsMetadata { @JsonProperty("Writer") Optional> writer, @JsonProperty("Collection") Optional> collection, @JsonProperty("Role") Optional> role, + @JsonProperty("Location") Optional> location, @JsonProperty("Guid") Optional> mediaGuid, @JsonProperty("UltraBlurColors") Optional ultraBlurColors, @JsonProperty("Rating") Optional> metaDataRating, @@ -471,6 +476,7 @@ public class GetLibraryItemsMetadata { Utils.checkNotNull(writer, "writer"); Utils.checkNotNull(collection, "collection"); Utils.checkNotNull(role, "role"); + Utils.checkNotNull(location, "location"); Utils.checkNotNull(mediaGuid, "mediaGuid"); Utils.checkNotNull(ultraBlurColors, "ultraBlurColors"); Utils.checkNotNull(metaDataRating, "metaDataRating"); @@ -544,6 +550,7 @@ public class GetLibraryItemsMetadata { this.writer = writer; this.collection = collection; this.role = role; + this.location = location; this.mediaGuid = mediaGuid; this.ultraBlurColors = ultraBlurColors; this.metaDataRating = metaDataRating; @@ -580,7 +587,7 @@ public class GetLibraryItemsMetadata { String title, String summary, long addedAt) { - this(ratingKey, key, guid, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), type, title, Optional.empty(), Optional.empty(), summary, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), addedAt, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(ratingKey, key, guid, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), type, title, Optional.empty(), Optional.empty(), summary, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), addedAt, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -855,6 +862,12 @@ public class GetLibraryItemsMetadata { return (Optional>) role; } + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> location() { + return (Optional>) location; + } + /** * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. * @@ -1567,6 +1580,18 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withLocation(List location) { + Utils.checkNotNull(location, "location"); + this.location = Optional.ofNullable(location); + return this; + } + + public GetLibraryItemsMetadata withLocation(Optional> location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + /** * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. * @@ -1952,6 +1977,7 @@ public class GetLibraryItemsMetadata { Objects.deepEquals(this.writer, other.writer) && Objects.deepEquals(this.collection, other.collection) && Objects.deepEquals(this.role, other.role) && + Objects.deepEquals(this.location, other.location) && Objects.deepEquals(this.mediaGuid, other.mediaGuid) && Objects.deepEquals(this.ultraBlurColors, other.ultraBlurColors) && Objects.deepEquals(this.metaDataRating, other.metaDataRating) && @@ -2030,6 +2056,7 @@ public class GetLibraryItemsMetadata { writer, collection, role, + location, mediaGuid, ultraBlurColors, metaDataRating, @@ -2108,6 +2135,7 @@ public class GetLibraryItemsMetadata { "writer", writer, "collection", collection, "role", role, + "location", location, "mediaGuid", mediaGuid, "ultraBlurColors", ultraBlurColors, "metaDataRating", metaDataRating, @@ -2232,6 +2260,8 @@ public class GetLibraryItemsMetadata { private Optional> role = Optional.empty(); + private Optional> location = Optional.empty(); + private Optional> mediaGuid = Optional.empty(); private Optional ultraBlurColors = Optional.empty(); @@ -2854,6 +2884,18 @@ public class GetLibraryItemsMetadata { return this; } + public Builder location(List location) { + Utils.checkNotNull(location, "location"); + this.location = Optional.ofNullable(location); + return this; + } + + public Builder location(Optional> location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + /** * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. * @@ -3233,6 +3275,7 @@ public class GetLibraryItemsMetadata { writer, collection, role, + location, mediaGuid, ultraBlurColors, metaDataRating, diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsPart.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsPart.java index fde85b1c..f757bf8b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsPart.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsPart.java @@ -32,8 +32,9 @@ public class GetLibraryItemsPart { @JsonProperty("key") private String key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") - private int duration; + private Optional duration; @JsonProperty("file") private String file; @@ -60,8 +61,9 @@ public class GetLibraryItemsPart { @JsonProperty("optimizedForStreaming") private Optional optimizedForStreaming; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoProfile") - private String videoProfile; + private Optional videoProfile; @JsonInclude(Include.NON_ABSENT) @JsonProperty("indexes") @@ -79,14 +81,14 @@ public class GetLibraryItemsPart { public GetLibraryItemsPart( @JsonProperty("id") int id, @JsonProperty("key") String key, - @JsonProperty("duration") int duration, + @JsonProperty("duration") Optional duration, @JsonProperty("file") String file, @JsonProperty("size") long size, @JsonProperty("container") String container, @JsonProperty("audioProfile") Optional audioProfile, @JsonProperty("has64bitOffsets") Optional has64bitOffsets, @JsonProperty("optimizedForStreaming") Optional optimizedForStreaming, - @JsonProperty("videoProfile") String videoProfile, + @JsonProperty("videoProfile") Optional videoProfile, @JsonProperty("indexes") Optional indexes, @JsonProperty("hasThumbnail") Optional hasThumbnail, @JsonProperty("Stream") Optional> stream) { @@ -121,12 +123,10 @@ public class GetLibraryItemsPart { public GetLibraryItemsPart( int id, String key, - int duration, String file, long size, - String container, - String videoProfile) { - this(id, key, duration, file, size, container, Optional.empty(), Optional.empty(), Optional.empty(), videoProfile, Optional.empty(), Optional.empty(), Optional.empty()); + String container) { + this(id, key, Optional.empty(), file, size, container, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore @@ -140,7 +140,7 @@ public class GetLibraryItemsPart { } @JsonIgnore - public int duration() { + public Optional duration() { return duration; } @@ -179,7 +179,7 @@ public class GetLibraryItemsPart { } @JsonIgnore - public String videoProfile() { + public Optional videoProfile() { return videoProfile; } @@ -217,6 +217,12 @@ public class GetLibraryItemsPart { } public GetLibraryItemsPart withDuration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public GetLibraryItemsPart withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; return this; @@ -281,6 +287,12 @@ public class GetLibraryItemsPart { } public GetLibraryItemsPart withVideoProfile(String videoProfile) { + Utils.checkNotNull(videoProfile, "videoProfile"); + this.videoProfile = Optional.ofNullable(videoProfile); + return this; + } + + public GetLibraryItemsPart withVideoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; return this; @@ -389,7 +401,7 @@ public class GetLibraryItemsPart { private String key; - private Integer duration; + private Optional duration = Optional.empty(); private String file; @@ -403,7 +415,7 @@ public class GetLibraryItemsPart { private Optional optimizedForStreaming = Optional.empty(); - private String videoProfile; + private Optional videoProfile = Optional.empty(); private Optional indexes = Optional.empty(); @@ -428,6 +440,12 @@ public class GetLibraryItemsPart { } public Builder duration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public Builder duration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; return this; @@ -492,6 +510,12 @@ public class GetLibraryItemsPart { } public Builder videoProfile(String videoProfile) { + Utils.checkNotNull(videoProfile, "videoProfile"); + this.videoProfile = Optional.ofNullable(videoProfile); + return this; + } + + public Builder videoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequest.java index d6984b2c..df75d0da 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequest.java @@ -21,14 +21,6 @@ import java.util.Optional; public class GetLibraryItemsRequest { - /** - * The unique key of the Plex library. - * Note: This is unique in the context of the Plex server. - * - */ - @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey") - private int sectionKey; - /** * A key representing a specific tag within the section. */ @@ -54,6 +46,14 @@ public class GetLibraryItemsRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=type") private Optional type; + /** + * The unique key of the Plex library. + * Note: This is unique in the context of the Plex server. + * + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey") + private int sectionKey; + /** * Adds the Meta object to the response * @@ -81,43 +81,33 @@ public class GetLibraryItemsRequest { @JsonCreator public GetLibraryItemsRequest( - int sectionKey, Tag tag, Optional includeGuids, Optional type, + int sectionKey, Optional includeMeta, Optional xPlexContainerStart, Optional xPlexContainerSize) { - Utils.checkNotNull(sectionKey, "sectionKey"); Utils.checkNotNull(tag, "tag"); Utils.checkNotNull(includeGuids, "includeGuids"); Utils.checkNotNull(type, "type"); + Utils.checkNotNull(sectionKey, "sectionKey"); Utils.checkNotNull(includeMeta, "includeMeta"); Utils.checkNotNull(xPlexContainerStart, "xPlexContainerStart"); Utils.checkNotNull(xPlexContainerSize, "xPlexContainerSize"); - this.sectionKey = sectionKey; this.tag = tag; this.includeGuids = includeGuids; this.type = type; + this.sectionKey = sectionKey; this.includeMeta = includeMeta; this.xPlexContainerStart = xPlexContainerStart; this.xPlexContainerSize = xPlexContainerSize; } public GetLibraryItemsRequest( - int sectionKey, - Tag tag) { - this(sectionKey, tag, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); - } - - /** - * The unique key of the Plex library. - * Note: This is unique in the context of the Plex server. - * - */ - @JsonIgnore - public int sectionKey() { - return sectionKey; + Tag tag, + int sectionKey) { + this(tag, Optional.empty(), Optional.empty(), sectionKey, Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -153,6 +143,16 @@ public class GetLibraryItemsRequest { return (Optional) type; } + /** + * The unique key of the Plex library. + * Note: This is unique in the context of the Plex server. + * + */ + @JsonIgnore + public int sectionKey() { + return sectionKey; + } + /** * Adds the Meta object to the response * @@ -189,17 +189,6 @@ public class GetLibraryItemsRequest { return new Builder(); } - /** - * The unique key of the Plex library. - * Note: This is unique in the context of the Plex server. - * - */ - public GetLibraryItemsRequest withSectionKey(int sectionKey) { - Utils.checkNotNull(sectionKey, "sectionKey"); - this.sectionKey = sectionKey; - return this; - } - /** * A key representing a specific tag within the section. */ @@ -259,6 +248,17 @@ public class GetLibraryItemsRequest { return this; } + /** + * The unique key of the Plex library. + * Note: This is unique in the context of the Plex server. + * + */ + public GetLibraryItemsRequest withSectionKey(int sectionKey) { + Utils.checkNotNull(sectionKey, "sectionKey"); + this.sectionKey = sectionKey; + return this; + } + /** * Adds the Meta object to the response * @@ -337,10 +337,10 @@ public class GetLibraryItemsRequest { } GetLibraryItemsRequest other = (GetLibraryItemsRequest) o; return - Objects.deepEquals(this.sectionKey, other.sectionKey) && Objects.deepEquals(this.tag, other.tag) && Objects.deepEquals(this.includeGuids, other.includeGuids) && Objects.deepEquals(this.type, other.type) && + Objects.deepEquals(this.sectionKey, other.sectionKey) && Objects.deepEquals(this.includeMeta, other.includeMeta) && Objects.deepEquals(this.xPlexContainerStart, other.xPlexContainerStart) && Objects.deepEquals(this.xPlexContainerSize, other.xPlexContainerSize); @@ -349,10 +349,10 @@ public class GetLibraryItemsRequest { @Override public int hashCode() { return Objects.hash( - sectionKey, tag, includeGuids, type, + sectionKey, includeMeta, xPlexContainerStart, xPlexContainerSize); @@ -361,10 +361,10 @@ public class GetLibraryItemsRequest { @Override public String toString() { return Utils.toString(GetLibraryItemsRequest.class, - "sectionKey", sectionKey, "tag", tag, "includeGuids", includeGuids, "type", type, + "sectionKey", sectionKey, "includeMeta", includeMeta, "xPlexContainerStart", xPlexContainerStart, "xPlexContainerSize", xPlexContainerSize); @@ -372,14 +372,14 @@ public class GetLibraryItemsRequest { public final static class Builder { - private Integer sectionKey; - private Tag tag; private Optional includeGuids; private Optional type = Optional.empty(); + private Integer sectionKey; + private Optional includeMeta; private Optional xPlexContainerStart; @@ -390,17 +390,6 @@ public class GetLibraryItemsRequest { // force use of static builder() method } - /** - * The unique key of the Plex library. - * Note: This is unique in the context of the Plex server. - * - */ - public Builder sectionKey(int sectionKey) { - Utils.checkNotNull(sectionKey, "sectionKey"); - this.sectionKey = sectionKey; - return this; - } - /** * A key representing a specific tag within the section. */ @@ -460,6 +449,17 @@ public class GetLibraryItemsRequest { return this; } + /** + * The unique key of the Plex library. + * Note: This is unique in the context of the Plex server. + * + */ + public Builder sectionKey(int sectionKey) { + Utils.checkNotNull(sectionKey, "sectionKey"); + this.sectionKey = sectionKey; + return this; + } + /** * Adds the Meta object to the response * @@ -541,10 +541,10 @@ public class GetLibraryItemsRequest { if (xPlexContainerSize == null) { xPlexContainerSize = _SINGLETON_VALUE_XPlexContainerSize.value(); } return new GetLibraryItemsRequest( - sectionKey, tag, includeGuids, type, + sectionKey, includeMeta, xPlexContainerStart, xPlexContainerSize); diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequestBuilder.java index e10e71d7..453eca89 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequestBuilder.java @@ -4,11 +4,15 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetLibraryItemsRequestBuilder { private GetLibraryItemsRequest request; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetLibraryItems sdk; public GetLibraryItemsRequestBuilder(SDKMethodInterfaces.MethodCallGetLibraryItems sdk) { @@ -20,10 +24,25 @@ public class GetLibraryItemsRequestBuilder { this.request = request; return this; } + + public GetLibraryItemsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetLibraryItemsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetLibraryItemsResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getLibraryItems( - request); + request, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequest.java index 5917f174..1ea8219c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequest.java @@ -17,9 +17,9 @@ import java.util.Objects; public class GetMediaProvidersRequest { /** - * Plex Authentication Token + * An authentication token, obtained from plex.tv */ - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Token") + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Token") private String xPlexToken; @JsonCreator @@ -30,7 +30,7 @@ public class GetMediaProvidersRequest { } /** - * Plex Authentication Token + * An authentication token, obtained from plex.tv */ @JsonIgnore public String xPlexToken() { @@ -42,7 +42,7 @@ public class GetMediaProvidersRequest { } /** - * Plex Authentication Token + * An authentication token, obtained from plex.tv */ public GetMediaProvidersRequest withXPlexToken(String xPlexToken) { Utils.checkNotNull(xPlexToken, "xPlexToken"); @@ -84,7 +84,7 @@ public class GetMediaProvidersRequest { } /** - * Plex Authentication Token + * An authentication token, obtained from plex.tv */ public Builder xPlexToken(String xPlexToken) { Utils.checkNotNull(xPlexToken, "xPlexToken"); diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequestBuilder.java index 15d64b60..62dda9ec 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequestBuilder.java @@ -4,12 +4,16 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.String; +import java.util.Optional; public class GetMediaProvidersRequestBuilder { private String xPlexToken; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetMediaProviders sdk; public GetMediaProvidersRequestBuilder(SDKMethodInterfaces.MethodCallGetMediaProviders sdk) { @@ -21,10 +25,25 @@ public class GetMediaProvidersRequestBuilder { this.xPlexToken = xPlexToken; return this; } + + public GetMediaProvidersRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetMediaProvidersRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetMediaProvidersResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getMediaProviders( - xPlexToken); + xPlexToken, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMetaDataByRatingKeyRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMetaDataByRatingKeyRequestBuilder.java index 818eccbd..0ccdf1c7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMetaDataByRatingKeyRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMetaDataByRatingKeyRequestBuilder.java @@ -4,12 +4,16 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Long; +import java.util.Optional; public class GetMetaDataByRatingKeyRequestBuilder { private Long ratingKey; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetMetaDataByRatingKey sdk; public GetMetaDataByRatingKeyRequestBuilder(SDKMethodInterfaces.MethodCallGetMetaDataByRatingKey sdk) { @@ -21,10 +25,25 @@ public class GetMetaDataByRatingKeyRequestBuilder { this.ratingKey = ratingKey; return this; } + + public GetMetaDataByRatingKeyRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetMetaDataByRatingKeyRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetMetaDataByRatingKeyResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getMetaDataByRatingKey( - ratingKey); + ratingKey, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenRequestBuilder.java index 1404d80b..803e07df 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.String; @@ -13,6 +15,7 @@ public class GetMetadataChildrenRequestBuilder { private Double ratingKey; private Optional includeElements = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetMetadataChildren sdk; public GetMetadataChildrenRequestBuilder(SDKMethodInterfaces.MethodCallGetMetadataChildren sdk) { @@ -36,11 +39,26 @@ public class GetMetadataChildrenRequestBuilder { this.includeElements = includeElements; return this; } + + public GetMetadataChildrenRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetMetadataChildrenRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetMetadataChildrenResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getMetadataChildren( ratingKey, - includeElements); + includeElements, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMyPlexAccountRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMyPlexAccountRequestBuilder.java index a8a465c5..cc67e591 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMyPlexAccountRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMyPlexAccountRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetMyPlexAccountRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetMyPlexAccount sdk; public GetMyPlexAccountRequestBuilder(SDKMethodInterfaces.MethodCallGetMyPlexAccount sdk) { this.sdk = sdk; } + + public GetMyPlexAccountRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetMyPlexAccountRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetMyPlexAccountResponse call() throws Exception { - - return sdk.getMyPlexAccountDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getMyPlexAccount( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetOnDeckRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetOnDeckRequestBuilder.java index a38f4b36..82c9dff3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetOnDeckRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetOnDeckRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetOnDeckRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetOnDeck sdk; public GetOnDeckRequestBuilder(SDKMethodInterfaces.MethodCallGetOnDeck sdk) { this.sdk = sdk; } + + public GetOnDeckRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetOnDeckRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetOnDeckResponse call() throws Exception { - - return sdk.getOnDeckDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getOnDeck( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequest.java index 1ac6cad2..636dc96f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequest.java @@ -30,43 +30,55 @@ public class GetPinRequest { private Optional strong; /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Client-Identifier") + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier") private Optional clientID; - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Product") + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Product") private Optional clientName; - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Device") - private Optional deviceName; + /** + * A relatively friendly name for the client device + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Device") + private Optional deviceNickname; - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Version") + /** + * The version of the client application. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Version") private Optional clientVersion; - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Platform") - private Optional clientPlatform; + /** + * The platform of the client application. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Platform") + private Optional platform; @JsonCreator public GetPinRequest( Optional strong, Optional clientID, Optional clientName, - Optional deviceName, + Optional deviceNickname, Optional clientVersion, - Optional clientPlatform) { + Optional platform) { Utils.checkNotNull(strong, "strong"); Utils.checkNotNull(clientID, "clientID"); Utils.checkNotNull(clientName, "clientName"); - Utils.checkNotNull(deviceName, "deviceName"); + Utils.checkNotNull(deviceNickname, "deviceNickname"); Utils.checkNotNull(clientVersion, "clientVersion"); - Utils.checkNotNull(clientPlatform, "clientPlatform"); + Utils.checkNotNull(platform, "platform"); this.strong = strong; this.clientID = clientID; this.clientName = clientName; - this.deviceName = deviceName; + this.deviceNickname = deviceNickname; this.clientVersion = clientVersion; - this.clientPlatform = clientPlatform; + this.platform = platform; } public GetPinRequest() { @@ -85,31 +97,43 @@ public class GetPinRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @JsonIgnore public Optional clientID() { return clientID; } + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ @JsonIgnore public Optional clientName() { return clientName; } + /** + * A relatively friendly name for the client device + */ @JsonIgnore - public Optional deviceName() { - return deviceName; + public Optional deviceNickname() { + return deviceNickname; } + /** + * The version of the client application. + */ @JsonIgnore public Optional clientVersion() { return clientVersion; } + /** + * The platform of the client application. + */ @JsonIgnore - public Optional clientPlatform() { - return clientPlatform; + public Optional platform() { + return platform; } public final static Builder builder() { @@ -141,7 +165,7 @@ public class GetPinRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public GetPinRequest withClientID(String clientID) { Utils.checkNotNull(clientID, "clientID"); @@ -150,7 +174,7 @@ public class GetPinRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public GetPinRequest withClientID(Optional clientID) { Utils.checkNotNull(clientID, "clientID"); @@ -158,51 +182,75 @@ public class GetPinRequest { return this; } + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ public GetPinRequest withClientName(String clientName) { Utils.checkNotNull(clientName, "clientName"); this.clientName = Optional.ofNullable(clientName); return this; } + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ public GetPinRequest withClientName(Optional clientName) { Utils.checkNotNull(clientName, "clientName"); this.clientName = clientName; return this; } - public GetPinRequest withDeviceName(String deviceName) { - Utils.checkNotNull(deviceName, "deviceName"); - this.deviceName = Optional.ofNullable(deviceName); + /** + * A relatively friendly name for the client device + */ + public GetPinRequest withDeviceNickname(String deviceNickname) { + Utils.checkNotNull(deviceNickname, "deviceNickname"); + this.deviceNickname = Optional.ofNullable(deviceNickname); return this; } - public GetPinRequest withDeviceName(Optional deviceName) { - Utils.checkNotNull(deviceName, "deviceName"); - this.deviceName = deviceName; + /** + * A relatively friendly name for the client device + */ + public GetPinRequest withDeviceNickname(Optional deviceNickname) { + Utils.checkNotNull(deviceNickname, "deviceNickname"); + this.deviceNickname = deviceNickname; return this; } + /** + * The version of the client application. + */ public GetPinRequest withClientVersion(String clientVersion) { Utils.checkNotNull(clientVersion, "clientVersion"); this.clientVersion = Optional.ofNullable(clientVersion); return this; } + /** + * The version of the client application. + */ public GetPinRequest withClientVersion(Optional clientVersion) { Utils.checkNotNull(clientVersion, "clientVersion"); this.clientVersion = clientVersion; return this; } - public GetPinRequest withClientPlatform(String clientPlatform) { - Utils.checkNotNull(clientPlatform, "clientPlatform"); - this.clientPlatform = Optional.ofNullable(clientPlatform); + /** + * The platform of the client application. + */ + public GetPinRequest withPlatform(String platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = Optional.ofNullable(platform); return this; } - public GetPinRequest withClientPlatform(Optional clientPlatform) { - Utils.checkNotNull(clientPlatform, "clientPlatform"); - this.clientPlatform = clientPlatform; + /** + * The platform of the client application. + */ + public GetPinRequest withPlatform(Optional platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = platform; return this; } @@ -219,9 +267,9 @@ public class GetPinRequest { Objects.deepEquals(this.strong, other.strong) && Objects.deepEquals(this.clientID, other.clientID) && Objects.deepEquals(this.clientName, other.clientName) && - Objects.deepEquals(this.deviceName, other.deviceName) && + Objects.deepEquals(this.deviceNickname, other.deviceNickname) && Objects.deepEquals(this.clientVersion, other.clientVersion) && - Objects.deepEquals(this.clientPlatform, other.clientPlatform); + Objects.deepEquals(this.platform, other.platform); } @Override @@ -230,9 +278,9 @@ public class GetPinRequest { strong, clientID, clientName, - deviceName, + deviceNickname, clientVersion, - clientPlatform); + platform); } @Override @@ -241,9 +289,9 @@ public class GetPinRequest { "strong", strong, "clientID", clientID, "clientName", clientName, - "deviceName", deviceName, + "deviceNickname", deviceNickname, "clientVersion", clientVersion, - "clientPlatform", clientPlatform); + "platform", platform); } public final static class Builder { @@ -254,11 +302,11 @@ public class GetPinRequest { private Optional clientName = Optional.empty(); - private Optional deviceName = Optional.empty(); + private Optional deviceNickname = Optional.empty(); private Optional clientVersion = Optional.empty(); - private Optional clientPlatform = Optional.empty(); + private Optional platform = Optional.empty(); private Builder() { // force use of static builder() method @@ -289,7 +337,7 @@ public class GetPinRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public Builder clientID(String clientID) { Utils.checkNotNull(clientID, "clientID"); @@ -298,7 +346,7 @@ public class GetPinRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public Builder clientID(Optional clientID) { Utils.checkNotNull(clientID, "clientID"); @@ -306,51 +354,75 @@ public class GetPinRequest { return this; } + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ public Builder clientName(String clientName) { Utils.checkNotNull(clientName, "clientName"); this.clientName = Optional.ofNullable(clientName); return this; } + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ public Builder clientName(Optional clientName) { Utils.checkNotNull(clientName, "clientName"); this.clientName = clientName; return this; } - public Builder deviceName(String deviceName) { - Utils.checkNotNull(deviceName, "deviceName"); - this.deviceName = Optional.ofNullable(deviceName); + /** + * A relatively friendly name for the client device + */ + public Builder deviceNickname(String deviceNickname) { + Utils.checkNotNull(deviceNickname, "deviceNickname"); + this.deviceNickname = Optional.ofNullable(deviceNickname); return this; } - public Builder deviceName(Optional deviceName) { - Utils.checkNotNull(deviceName, "deviceName"); - this.deviceName = deviceName; + /** + * A relatively friendly name for the client device + */ + public Builder deviceNickname(Optional deviceNickname) { + Utils.checkNotNull(deviceNickname, "deviceNickname"); + this.deviceNickname = deviceNickname; return this; } + /** + * The version of the client application. + */ public Builder clientVersion(String clientVersion) { Utils.checkNotNull(clientVersion, "clientVersion"); this.clientVersion = Optional.ofNullable(clientVersion); return this; } + /** + * The version of the client application. + */ public Builder clientVersion(Optional clientVersion) { Utils.checkNotNull(clientVersion, "clientVersion"); this.clientVersion = clientVersion; return this; } - public Builder clientPlatform(String clientPlatform) { - Utils.checkNotNull(clientPlatform, "clientPlatform"); - this.clientPlatform = Optional.ofNullable(clientPlatform); + /** + * The platform of the client application. + */ + public Builder platform(String platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = Optional.ofNullable(platform); return this; } - public Builder clientPlatform(Optional clientPlatform) { - Utils.checkNotNull(clientPlatform, "clientPlatform"); - this.clientPlatform = clientPlatform; + /** + * The platform of the client application. + */ + public Builder platform(Optional platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = platform; return this; } @@ -361,9 +433,9 @@ public class GetPinRequest { strong, clientID, clientName, - deviceName, + deviceNickname, clientVersion, - clientPlatform); + platform); } private static final LazySingletonValue> _SINGLETON_VALUE_Strong = diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequestBuilder.java index d7a9516b..d79a5f1f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.String; import java.util.Optional; @@ -12,6 +14,7 @@ public class GetPinRequestBuilder { private GetPinRequest request; private Optional serverURL = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetPin sdk; public GetPinRequestBuilder(SDKMethodInterfaces.MethodCallGetPin sdk) { @@ -35,11 +38,26 @@ public class GetPinRequestBuilder { this.serverURL = serverURL; return this; } + + public GetPinRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetPinRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetPinResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getPin( request, - serverURL); + serverURL, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRequestBuilder.java index 37cf4497..a7194401 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRequestBuilder.java @@ -4,13 +4,17 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; +import java.util.Optional; public class GetPlaylistContentsRequestBuilder { private Double playlistID; private GetPlaylistContentsQueryParamType type; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetPlaylistContents sdk; public GetPlaylistContentsRequestBuilder(SDKMethodInterfaces.MethodCallGetPlaylistContents sdk) { @@ -28,11 +32,26 @@ public class GetPlaylistContentsRequestBuilder { this.type = type; return this; } + + public GetPlaylistContentsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetPlaylistContentsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetPlaylistContentsResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getPlaylistContents( playlistID, - type); + type, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistRequestBuilder.java index 4fdbd0ee..ec7d9a61 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistRequestBuilder.java @@ -4,12 +4,16 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; +import java.util.Optional; public class GetPlaylistRequestBuilder { private Double playlistID; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetPlaylist sdk; public GetPlaylistRequestBuilder(SDKMethodInterfaces.MethodCallGetPlaylist sdk) { @@ -21,10 +25,25 @@ public class GetPlaylistRequestBuilder { this.playlistID = playlistID; return this; } + + public GetPlaylistRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetPlaylistRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetPlaylistResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getPlaylist( - playlistID); + playlistID, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsRequestBuilder.java index c4ae92e4..e732784f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.util.Optional; @@ -11,6 +13,7 @@ public class GetPlaylistsRequestBuilder { private Optional playlistType = Optional.empty(); private Optional smart = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetPlaylists sdk; public GetPlaylistsRequestBuilder(SDKMethodInterfaces.MethodCallGetPlaylists sdk) { @@ -40,11 +43,26 @@ public class GetPlaylistsRequestBuilder { this.smart = smart; return this; } + + public GetPlaylistsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetPlaylistsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetPlaylistsResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getPlaylists( playlistType, - smart); + smart, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryRequestBuilder.java index 7c05a5ca..cb345a4e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryRequestBuilder.java @@ -4,11 +4,15 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetRecentlyAddedLibraryRequestBuilder { private GetRecentlyAddedLibraryRequest request; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetRecentlyAddedLibrary sdk; public GetRecentlyAddedLibraryRequestBuilder(SDKMethodInterfaces.MethodCallGetRecentlyAddedLibrary sdk) { @@ -20,10 +24,25 @@ public class GetRecentlyAddedLibraryRequestBuilder { this.request = request; return this; } + + public GetRecentlyAddedLibraryRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetRecentlyAddedLibraryRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetRecentlyAddedLibraryResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getRecentlyAddedLibrary( - request); + request, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedMetadata.java index af0bcece..2eb1c694 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedMetadata.java @@ -237,6 +237,10 @@ public class GetRecentlyAddedMetadata { @JsonProperty("Role") private Optional> role; + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Location") + private Optional> location; + /** * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. * @@ -398,6 +402,7 @@ public class GetRecentlyAddedMetadata { @JsonProperty("Writer") Optional> writer, @JsonProperty("Collection") Optional> collection, @JsonProperty("Role") Optional> role, + @JsonProperty("Location") Optional> location, @JsonProperty("Guid") Optional> mediaGuid, @JsonProperty("UltraBlurColors") Optional ultraBlurColors, @JsonProperty("Rating") Optional> metaDataRating, @@ -471,6 +476,7 @@ public class GetRecentlyAddedMetadata { Utils.checkNotNull(writer, "writer"); Utils.checkNotNull(collection, "collection"); Utils.checkNotNull(role, "role"); + Utils.checkNotNull(location, "location"); Utils.checkNotNull(mediaGuid, "mediaGuid"); Utils.checkNotNull(ultraBlurColors, "ultraBlurColors"); Utils.checkNotNull(metaDataRating, "metaDataRating"); @@ -544,6 +550,7 @@ public class GetRecentlyAddedMetadata { this.writer = writer; this.collection = collection; this.role = role; + this.location = location; this.mediaGuid = mediaGuid; this.ultraBlurColors = ultraBlurColors; this.metaDataRating = metaDataRating; @@ -580,7 +587,7 @@ public class GetRecentlyAddedMetadata { String title, String summary, long addedAt) { - this(ratingKey, key, guid, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), type, title, Optional.empty(), Optional.empty(), summary, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), addedAt, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(ratingKey, key, guid, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), type, title, Optional.empty(), Optional.empty(), summary, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), addedAt, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -855,6 +862,12 @@ public class GetRecentlyAddedMetadata { return (Optional>) role; } + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> location() { + return (Optional>) location; + } + /** * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. * @@ -1567,6 +1580,18 @@ public class GetRecentlyAddedMetadata { return this; } + public GetRecentlyAddedMetadata withLocation(List location) { + Utils.checkNotNull(location, "location"); + this.location = Optional.ofNullable(location); + return this; + } + + public GetRecentlyAddedMetadata withLocation(Optional> location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + /** * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. * @@ -1952,6 +1977,7 @@ public class GetRecentlyAddedMetadata { Objects.deepEquals(this.writer, other.writer) && Objects.deepEquals(this.collection, other.collection) && Objects.deepEquals(this.role, other.role) && + Objects.deepEquals(this.location, other.location) && Objects.deepEquals(this.mediaGuid, other.mediaGuid) && Objects.deepEquals(this.ultraBlurColors, other.ultraBlurColors) && Objects.deepEquals(this.metaDataRating, other.metaDataRating) && @@ -2030,6 +2056,7 @@ public class GetRecentlyAddedMetadata { writer, collection, role, + location, mediaGuid, ultraBlurColors, metaDataRating, @@ -2108,6 +2135,7 @@ public class GetRecentlyAddedMetadata { "writer", writer, "collection", collection, "role", role, + "location", location, "mediaGuid", mediaGuid, "ultraBlurColors", ultraBlurColors, "metaDataRating", metaDataRating, @@ -2232,6 +2260,8 @@ public class GetRecentlyAddedMetadata { private Optional> role = Optional.empty(); + private Optional> location = Optional.empty(); + private Optional> mediaGuid = Optional.empty(); private Optional ultraBlurColors = Optional.empty(); @@ -2854,6 +2884,18 @@ public class GetRecentlyAddedMetadata { return this; } + public Builder location(List location) { + Utils.checkNotNull(location, "location"); + this.location = Optional.ofNullable(location); + return this; + } + + public Builder location(Optional> location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + /** * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. * @@ -3233,6 +3275,7 @@ public class GetRecentlyAddedMetadata { writer, collection, role, + location, mediaGuid, ultraBlurColors, metaDataRating, diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedRequestBuilder.java index e7b3cadd..600b8da0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedRequestBuilder.java @@ -4,11 +4,15 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetRecentlyAddedRequestBuilder { private GetRecentlyAddedRequest request; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetRecentlyAdded sdk; public GetRecentlyAddedRequestBuilder(SDKMethodInterfaces.MethodCallGetRecentlyAdded sdk) { @@ -20,10 +24,25 @@ public class GetRecentlyAddedRequestBuilder { this.request = request; return this; } + + public GetRecentlyAddedRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetRecentlyAddedRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetRecentlyAddedResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getRecentlyAdded( - request); + request, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequest.java index 3a84bb1d..1f15ddd4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequest.java @@ -19,6 +19,12 @@ import java.util.Optional; public class GetRefreshLibraryMetadataRequest { + /** + * Force the refresh even if the library is already being refreshed. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=force") + private Optional force; + /** * The unique key of the Plex library. * Note: This is unique in the context of the Plex server. @@ -27,25 +33,28 @@ public class GetRefreshLibraryMetadataRequest { @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey") private int sectionKey; - /** - * Force the refresh even if the library is already being refreshed. - */ - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=force") - private Optional force; - @JsonCreator public GetRefreshLibraryMetadataRequest( - int sectionKey, - Optional force) { - Utils.checkNotNull(sectionKey, "sectionKey"); + Optional force, + int sectionKey) { Utils.checkNotNull(force, "force"); - this.sectionKey = sectionKey; + Utils.checkNotNull(sectionKey, "sectionKey"); this.force = force; + this.sectionKey = sectionKey; } public GetRefreshLibraryMetadataRequest( int sectionKey) { - this(sectionKey, Optional.empty()); + this(Optional.empty(), sectionKey); + } + + /** + * Force the refresh even if the library is already being refreshed. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional force() { + return (Optional) force; } /** @@ -58,30 +67,10 @@ public class GetRefreshLibraryMetadataRequest { return sectionKey; } - /** - * Force the refresh even if the library is already being refreshed. - */ - @SuppressWarnings("unchecked") - @JsonIgnore - public Optional force() { - return (Optional) force; - } - public final static Builder builder() { return new Builder(); } - /** - * The unique key of the Plex library. - * Note: This is unique in the context of the Plex server. - * - */ - public GetRefreshLibraryMetadataRequest withSectionKey(int sectionKey) { - Utils.checkNotNull(sectionKey, "sectionKey"); - this.sectionKey = sectionKey; - return this; - } - /** * Force the refresh even if the library is already being refreshed. */ @@ -99,6 +88,17 @@ public class GetRefreshLibraryMetadataRequest { this.force = force; return this; } + + /** + * The unique key of the Plex library. + * Note: This is unique in the context of the Plex server. + * + */ + public GetRefreshLibraryMetadataRequest withSectionKey(int sectionKey) { + Utils.checkNotNull(sectionKey, "sectionKey"); + this.sectionKey = sectionKey; + return this; + } @Override public boolean equals(java.lang.Object o) { @@ -110,45 +110,34 @@ public class GetRefreshLibraryMetadataRequest { } GetRefreshLibraryMetadataRequest other = (GetRefreshLibraryMetadataRequest) o; return - Objects.deepEquals(this.sectionKey, other.sectionKey) && - Objects.deepEquals(this.force, other.force); + Objects.deepEquals(this.force, other.force) && + Objects.deepEquals(this.sectionKey, other.sectionKey); } @Override public int hashCode() { return Objects.hash( - sectionKey, - force); + force, + sectionKey); } @Override public String toString() { return Utils.toString(GetRefreshLibraryMetadataRequest.class, - "sectionKey", sectionKey, - "force", force); + "force", force, + "sectionKey", sectionKey); } public final static class Builder { - private Integer sectionKey; + private Optional force = Optional.empty(); - private Optional force = Optional.empty(); + private Integer sectionKey; private Builder() { // force use of static builder() method } - /** - * The unique key of the Plex library. - * Note: This is unique in the context of the Plex server. - * - */ - public Builder sectionKey(int sectionKey) { - Utils.checkNotNull(sectionKey, "sectionKey"); - this.sectionKey = sectionKey; - return this; - } - /** * Force the refresh even if the library is already being refreshed. */ @@ -166,11 +155,22 @@ public class GetRefreshLibraryMetadataRequest { this.force = force; return this; } + + /** + * The unique key of the Plex library. + * Note: This is unique in the context of the Plex server. + * + */ + public Builder sectionKey(int sectionKey) { + Utils.checkNotNull(sectionKey, "sectionKey"); + this.sectionKey = sectionKey; + return this; + } public GetRefreshLibraryMetadataRequest build() { return new GetRefreshLibraryMetadataRequest( - sectionKey, - force); + force, + sectionKey); } } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequestBuilder.java index 5b9a8c1c..c507db2c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequestBuilder.java @@ -4,25 +4,22 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; import java.util.Optional; public class GetRefreshLibraryMetadataRequestBuilder { - private Integer sectionKey; private Optional force = Optional.empty(); + private Integer sectionKey; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetRefreshLibraryMetadata sdk; public GetRefreshLibraryMetadataRequestBuilder(SDKMethodInterfaces.MethodCallGetRefreshLibraryMetadata sdk) { this.sdk = sdk; } - - public GetRefreshLibraryMetadataRequestBuilder sectionKey(int sectionKey) { - Utils.checkNotNull(sectionKey, "sectionKey"); - this.sectionKey = sectionKey; - return this; - } public GetRefreshLibraryMetadataRequestBuilder force(Force force) { Utils.checkNotNull(force, "force"); @@ -36,10 +33,31 @@ public class GetRefreshLibraryMetadataRequestBuilder { return this; } - public GetRefreshLibraryMetadataResponse call() throws Exception { + public GetRefreshLibraryMetadataRequestBuilder sectionKey(int sectionKey) { + Utils.checkNotNull(sectionKey, "sectionKey"); + this.sectionKey = sectionKey; + return this; + } + + public GetRefreshLibraryMetadataRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + public GetRefreshLibraryMetadataRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public GetRefreshLibraryMetadataResponse call() throws Exception { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getRefreshLibraryMetadata( + force, sectionKey, - force); + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoRequestBuilder.java index bc5b65f0..6b023148 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoRequestBuilder.java @@ -4,11 +4,15 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetResizedPhotoRequestBuilder { private GetResizedPhotoRequest request; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetResizedPhoto sdk; public GetResizedPhotoRequestBuilder(SDKMethodInterfaces.MethodCallGetResizedPhoto sdk) { @@ -20,10 +24,25 @@ public class GetResizedPhotoRequestBuilder { this.request = request; return this; } + + public GetResizedPhotoRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetResizedPhotoRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetResizedPhotoResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getResizedPhoto( - request); + request, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsRequestBuilder.java index 60bcfd7f..8ad8ae19 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.util.Optional; @@ -11,6 +13,7 @@ import java.util.Optional; public class GetResourcesStatisticsRequestBuilder { private Optional timespan = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetResourcesStatistics sdk; public GetResourcesStatisticsRequestBuilder(SDKMethodInterfaces.MethodCallGetResourcesStatistics sdk) { @@ -28,10 +31,25 @@ public class GetResourcesStatisticsRequestBuilder { this.timespan = timespan; return this; } + + public GetResourcesStatisticsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetResourcesStatisticsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetResourcesStatisticsResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getResourcesStatistics( - timespan); + timespan, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesCollection.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesCollection.java new file mode 100644 index 00000000..20198ebf --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesCollection.java @@ -0,0 +1,109 @@ +/* + * 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.util.Objects; +import java.util.Optional; + + +public class GetSearchAllLibrariesCollection { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tag") + private Optional tag; + + @JsonCreator + public GetSearchAllLibrariesCollection( + @JsonProperty("tag") Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + } + + public GetSearchAllLibrariesCollection() { + this(Optional.empty()); + } + + @JsonIgnore + public Optional tag() { + return tag; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchAllLibrariesCollection withTag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + return this; + } + + public GetSearchAllLibrariesCollection withTag(Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesCollection other = (GetSearchAllLibrariesCollection) o; + return + Objects.deepEquals(this.tag, other.tag); + } + + @Override + public int hashCode() { + return Objects.hash( + tag); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesCollection.class, + "tag", tag); + } + + public final static class Builder { + + private Optional tag = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder tag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + return this; + } + + public Builder tag(Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + return this; + } + + public GetSearchAllLibrariesCollection build() { + return new GetSearchAllLibrariesCollection( + tag); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesCountry.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesCountry.java new file mode 100644 index 00000000..cd4b4bd6 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesCountry.java @@ -0,0 +1,109 @@ +/* + * 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.util.Objects; +import java.util.Optional; + + +public class GetSearchAllLibrariesCountry { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tag") + private Optional tag; + + @JsonCreator + public GetSearchAllLibrariesCountry( + @JsonProperty("tag") Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + } + + public GetSearchAllLibrariesCountry() { + this(Optional.empty()); + } + + @JsonIgnore + public Optional tag() { + return tag; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchAllLibrariesCountry withTag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + return this; + } + + public GetSearchAllLibrariesCountry withTag(Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesCountry other = (GetSearchAllLibrariesCountry) o; + return + Objects.deepEquals(this.tag, other.tag); + } + + @Override + public int hashCode() { + return Objects.hash( + tag); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesCountry.class, + "tag", tag); + } + + public final static class Builder { + + private Optional tag = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder tag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + return this; + } + + public Builder tag(Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + return this; + } + + public GetSearchAllLibrariesCountry build() { + return new GetSearchAllLibrariesCountry( + tag); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesDirector.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesDirector.java new file mode 100644 index 00000000..d304acfc --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesDirector.java @@ -0,0 +1,109 @@ +/* + * 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.util.Objects; +import java.util.Optional; + + +public class GetSearchAllLibrariesDirector { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tag") + private Optional tag; + + @JsonCreator + public GetSearchAllLibrariesDirector( + @JsonProperty("tag") Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + } + + public GetSearchAllLibrariesDirector() { + this(Optional.empty()); + } + + @JsonIgnore + public Optional tag() { + return tag; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchAllLibrariesDirector withTag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + return this; + } + + public GetSearchAllLibrariesDirector withTag(Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesDirector other = (GetSearchAllLibrariesDirector) o; + return + Objects.deepEquals(this.tag, other.tag); + } + + @Override + public int hashCode() { + return Objects.hash( + tag); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesDirector.class, + "tag", tag); + } + + public final static class Builder { + + private Optional tag = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder tag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + return this; + } + + public Builder tag(Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + return this; + } + + public GetSearchAllLibrariesDirector build() { + return new GetSearchAllLibrariesDirector( + tag); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesFlattenSeasons.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesFlattenSeasons.java new file mode 100644 index 00000000..d1b4d015 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesFlattenSeasons.java @@ -0,0 +1,24 @@ +/* + * 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; + +public enum GetSearchAllLibrariesFlattenSeasons { + False("0"), + True("1"); + + @JsonValue + private final String value; + + private GetSearchAllLibrariesFlattenSeasons(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesGenre.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesGenre.java new file mode 100644 index 00000000..e0db548f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesGenre.java @@ -0,0 +1,109 @@ +/* + * 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.util.Objects; +import java.util.Optional; + + +public class GetSearchAllLibrariesGenre { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tag") + private Optional tag; + + @JsonCreator + public GetSearchAllLibrariesGenre( + @JsonProperty("tag") Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + } + + public GetSearchAllLibrariesGenre() { + this(Optional.empty()); + } + + @JsonIgnore + public Optional tag() { + return tag; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchAllLibrariesGenre withTag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + return this; + } + + public GetSearchAllLibrariesGenre withTag(Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesGenre other = (GetSearchAllLibrariesGenre) o; + return + Objects.deepEquals(this.tag, other.tag); + } + + @Override + public int hashCode() { + return Objects.hash( + tag); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesGenre.class, + "tag", tag); + } + + public final static class Builder { + + private Optional tag = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder tag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + return this; + } + + public Builder tag(Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + return this; + } + + public GetSearchAllLibrariesGenre build() { + return new GetSearchAllLibrariesGenre( + tag); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesHasThumbnail.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesHasThumbnail.java new file mode 100644 index 00000000..9a202dea --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesHasThumbnail.java @@ -0,0 +1,24 @@ +/* + * 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; + +public enum GetSearchAllLibrariesHasThumbnail { + False("0"), + True("1"); + + @JsonValue + private final String value; + + private GetSearchAllLibrariesHasThumbnail(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesImage.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesImage.java new file mode 100644 index 00000000..8de5c0bf --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesImage.java @@ -0,0 +1,147 @@ +/* + * 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.Override; +import java.lang.String; +import java.util.Objects; + + +public class GetSearchAllLibrariesImage { + + @JsonProperty("alt") + private String alt; + + @JsonProperty("type") + private GetSearchAllLibrariesLibraryType type; + + @JsonProperty("url") + private String url; + + @JsonCreator + public GetSearchAllLibrariesImage( + @JsonProperty("alt") String alt, + @JsonProperty("type") GetSearchAllLibrariesLibraryType type, + @JsonProperty("url") String url) { + Utils.checkNotNull(alt, "alt"); + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(url, "url"); + this.alt = alt; + this.type = type; + this.url = url; + } + + @JsonIgnore + public String alt() { + return alt; + } + + @JsonIgnore + public GetSearchAllLibrariesLibraryType type() { + return type; + } + + @JsonIgnore + public String url() { + return url; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchAllLibrariesImage withAlt(String alt) { + Utils.checkNotNull(alt, "alt"); + this.alt = alt; + return this; + } + + public GetSearchAllLibrariesImage withType(GetSearchAllLibrariesLibraryType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public GetSearchAllLibrariesImage withUrl(String url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesImage other = (GetSearchAllLibrariesImage) o; + return + Objects.deepEquals(this.alt, other.alt) && + Objects.deepEquals(this.type, other.type) && + Objects.deepEquals(this.url, other.url); + } + + @Override + public int hashCode() { + return Objects.hash( + alt, + type, + url); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesImage.class, + "alt", alt, + "type", type, + "url", url); + } + + public final static class Builder { + + private String alt; + + private GetSearchAllLibrariesLibraryType type; + + private String url; + + private Builder() { + // force use of static builder() method + } + + public Builder alt(String alt) { + Utils.checkNotNull(alt, "alt"); + this.alt = alt; + return this; + } + + public Builder type(GetSearchAllLibrariesLibraryType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public Builder url(String url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + public GetSearchAllLibrariesImage build() { + return new GetSearchAllLibrariesImage( + alt, + type, + url); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLibraryType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLibraryType.java new file mode 100644 index 00000000..324fe763 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLibraryType.java @@ -0,0 +1,26 @@ +/* + * 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; + +public enum GetSearchAllLibrariesLibraryType { + COVER_POSTER("coverPoster"), + BACKGROUND("background"), + SNAPSHOT("snapshot"), + CLEAR_LOGO("clearLogo"); + + @JsonValue + private final String value; + + private GetSearchAllLibrariesLibraryType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLocation.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLocation.java new file mode 100644 index 00000000..10b9a7ec --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLocation.java @@ -0,0 +1,109 @@ +/* + * 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.util.Objects; +import java.util.Optional; + + +public class GetSearchAllLibrariesLocation { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("path") + private Optional path; + + @JsonCreator + public GetSearchAllLibrariesLocation( + @JsonProperty("path") Optional path) { + Utils.checkNotNull(path, "path"); + this.path = path; + } + + public GetSearchAllLibrariesLocation() { + this(Optional.empty()); + } + + @JsonIgnore + public Optional path() { + return path; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchAllLibrariesLocation withPath(String path) { + Utils.checkNotNull(path, "path"); + this.path = Optional.ofNullable(path); + return this; + } + + public GetSearchAllLibrariesLocation withPath(Optional path) { + Utils.checkNotNull(path, "path"); + this.path = path; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesLocation other = (GetSearchAllLibrariesLocation) o; + return + Objects.deepEquals(this.path, other.path); + } + + @Override + public int hashCode() { + return Objects.hash( + path); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesLocation.class, + "path", path); + } + + public final static class Builder { + + private Optional path = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder path(String path) { + Utils.checkNotNull(path, "path"); + this.path = Optional.ofNullable(path); + return this; + } + + public Builder path(Optional path) { + Utils.checkNotNull(path, "path"); + this.path = path; + return this; + } + + public GetSearchAllLibrariesLocation build() { + return new GetSearchAllLibrariesLocation( + path); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMedia.java new file mode 100644 index 00000000..6e69f8f8 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMedia.java @@ -0,0 +1,803 @@ +/* + * 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 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.Double; +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 GetSearchAllLibrariesMedia { + + @JsonProperty("id") + private int id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("duration") + private Optional duration; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("bitrate") + private Optional bitrate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("width") + private Optional width; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("height") + private Optional height; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("aspectRatio") + private Optional aspectRatio; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("audioProfile") + private Optional audioProfile; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("audioChannels") + private Optional audioChannels; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("audioCodec") + private Optional audioCodec; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("videoCodec") + private Optional videoCodec; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("videoResolution") + private Optional videoResolution; + + @JsonProperty("container") + private String container; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("videoFrameRate") + private Optional videoFrameRate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("videoProfile") + private Optional videoProfile; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("hasVoiceActivity") + private Optional hasVoiceActivity; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("optimizedForStreaming") + private Optional optimizedForStreaming; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("has64bitOffsets") + private Optional has64bitOffsets; + + @JsonProperty("Part") + private List part; + + @JsonCreator + public GetSearchAllLibrariesMedia( + @JsonProperty("id") int id, + @JsonProperty("duration") Optional duration, + @JsonProperty("bitrate") Optional bitrate, + @JsonProperty("width") Optional width, + @JsonProperty("height") Optional height, + @JsonProperty("aspectRatio") Optional aspectRatio, + @JsonProperty("audioProfile") Optional audioProfile, + @JsonProperty("audioChannels") Optional audioChannels, + @JsonProperty("audioCodec") Optional audioCodec, + @JsonProperty("videoCodec") Optional videoCodec, + @JsonProperty("videoResolution") Optional videoResolution, + @JsonProperty("container") String container, + @JsonProperty("videoFrameRate") Optional videoFrameRate, + @JsonProperty("videoProfile") Optional videoProfile, + @JsonProperty("hasVoiceActivity") Optional hasVoiceActivity, + @JsonProperty("optimizedForStreaming") Optional optimizedForStreaming, + @JsonProperty("has64bitOffsets") Optional has64bitOffsets, + @JsonProperty("Part") List part) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(duration, "duration"); + Utils.checkNotNull(bitrate, "bitrate"); + Utils.checkNotNull(width, "width"); + Utils.checkNotNull(height, "height"); + Utils.checkNotNull(aspectRatio, "aspectRatio"); + Utils.checkNotNull(audioProfile, "audioProfile"); + Utils.checkNotNull(audioChannels, "audioChannels"); + Utils.checkNotNull(audioCodec, "audioCodec"); + Utils.checkNotNull(videoCodec, "videoCodec"); + Utils.checkNotNull(videoResolution, "videoResolution"); + Utils.checkNotNull(container, "container"); + Utils.checkNotNull(videoFrameRate, "videoFrameRate"); + Utils.checkNotNull(videoProfile, "videoProfile"); + Utils.checkNotNull(hasVoiceActivity, "hasVoiceActivity"); + Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); + Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); + Utils.checkNotNull(part, "part"); + this.id = id; + this.duration = duration; + this.bitrate = bitrate; + this.width = width; + this.height = height; + this.aspectRatio = aspectRatio; + this.audioProfile = audioProfile; + this.audioChannels = audioChannels; + this.audioCodec = audioCodec; + this.videoCodec = videoCodec; + this.videoResolution = videoResolution; + this.container = container; + this.videoFrameRate = videoFrameRate; + this.videoProfile = videoProfile; + this.hasVoiceActivity = hasVoiceActivity; + this.optimizedForStreaming = optimizedForStreaming; + this.has64bitOffsets = has64bitOffsets; + this.part = part; + } + + public GetSearchAllLibrariesMedia( + int id, + String container, + List part) { + this(id, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), container, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), part); + } + + @JsonIgnore + public int id() { + return id; + } + + @JsonIgnore + public Optional duration() { + return duration; + } + + @JsonIgnore + public Optional bitrate() { + return bitrate; + } + + @JsonIgnore + public Optional width() { + return width; + } + + @JsonIgnore + public Optional height() { + return height; + } + + @JsonIgnore + public Optional aspectRatio() { + return aspectRatio; + } + + @JsonIgnore + public Optional audioProfile() { + return audioProfile; + } + + @JsonIgnore + public Optional audioChannels() { + return audioChannels; + } + + @JsonIgnore + public Optional audioCodec() { + return audioCodec; + } + + @JsonIgnore + public Optional videoCodec() { + return videoCodec; + } + + @JsonIgnore + public Optional videoResolution() { + return videoResolution; + } + + @JsonIgnore + public String container() { + return container; + } + + @JsonIgnore + public Optional videoFrameRate() { + return videoFrameRate; + } + + @JsonIgnore + public Optional videoProfile() { + return videoProfile; + } + + @JsonIgnore + public Optional hasVoiceActivity() { + return hasVoiceActivity; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional optimizedForStreaming() { + return (Optional) optimizedForStreaming; + } + + @JsonIgnore + public Optional has64bitOffsets() { + return has64bitOffsets; + } + + @JsonIgnore + public List part() { + return part; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchAllLibrariesMedia withId(int id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public GetSearchAllLibrariesMedia withDuration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public GetSearchAllLibrariesMedia withDuration(Optional duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = duration; + return this; + } + + public GetSearchAllLibrariesMedia withBitrate(int bitrate) { + Utils.checkNotNull(bitrate, "bitrate"); + this.bitrate = Optional.ofNullable(bitrate); + return this; + } + + public GetSearchAllLibrariesMedia withBitrate(Optional bitrate) { + Utils.checkNotNull(bitrate, "bitrate"); + this.bitrate = bitrate; + return this; + } + + public GetSearchAllLibrariesMedia withWidth(int width) { + Utils.checkNotNull(width, "width"); + this.width = Optional.ofNullable(width); + return this; + } + + public GetSearchAllLibrariesMedia withWidth(Optional width) { + Utils.checkNotNull(width, "width"); + this.width = width; + return this; + } + + public GetSearchAllLibrariesMedia withHeight(int height) { + Utils.checkNotNull(height, "height"); + this.height = Optional.ofNullable(height); + return this; + } + + public GetSearchAllLibrariesMedia withHeight(Optional height) { + Utils.checkNotNull(height, "height"); + this.height = height; + return this; + } + + public GetSearchAllLibrariesMedia withAspectRatio(double aspectRatio) { + Utils.checkNotNull(aspectRatio, "aspectRatio"); + this.aspectRatio = Optional.ofNullable(aspectRatio); + return this; + } + + public GetSearchAllLibrariesMedia withAspectRatio(Optional aspectRatio) { + Utils.checkNotNull(aspectRatio, "aspectRatio"); + this.aspectRatio = aspectRatio; + return this; + } + + public GetSearchAllLibrariesMedia withAudioProfile(String audioProfile) { + Utils.checkNotNull(audioProfile, "audioProfile"); + this.audioProfile = Optional.ofNullable(audioProfile); + return this; + } + + public GetSearchAllLibrariesMedia withAudioProfile(Optional audioProfile) { + Utils.checkNotNull(audioProfile, "audioProfile"); + this.audioProfile = audioProfile; + return this; + } + + public GetSearchAllLibrariesMedia withAudioChannels(int audioChannels) { + Utils.checkNotNull(audioChannels, "audioChannels"); + this.audioChannels = Optional.ofNullable(audioChannels); + return this; + } + + public GetSearchAllLibrariesMedia withAudioChannels(Optional audioChannels) { + Utils.checkNotNull(audioChannels, "audioChannels"); + this.audioChannels = audioChannels; + return this; + } + + public GetSearchAllLibrariesMedia withAudioCodec(String audioCodec) { + Utils.checkNotNull(audioCodec, "audioCodec"); + this.audioCodec = Optional.ofNullable(audioCodec); + return this; + } + + public GetSearchAllLibrariesMedia withAudioCodec(Optional audioCodec) { + Utils.checkNotNull(audioCodec, "audioCodec"); + this.audioCodec = audioCodec; + return this; + } + + public GetSearchAllLibrariesMedia withVideoCodec(String videoCodec) { + Utils.checkNotNull(videoCodec, "videoCodec"); + this.videoCodec = Optional.ofNullable(videoCodec); + return this; + } + + public GetSearchAllLibrariesMedia withVideoCodec(Optional videoCodec) { + Utils.checkNotNull(videoCodec, "videoCodec"); + this.videoCodec = videoCodec; + return this; + } + + public GetSearchAllLibrariesMedia withVideoResolution(String videoResolution) { + Utils.checkNotNull(videoResolution, "videoResolution"); + this.videoResolution = Optional.ofNullable(videoResolution); + return this; + } + + public GetSearchAllLibrariesMedia withVideoResolution(Optional videoResolution) { + Utils.checkNotNull(videoResolution, "videoResolution"); + this.videoResolution = videoResolution; + return this; + } + + public GetSearchAllLibrariesMedia withContainer(String container) { + Utils.checkNotNull(container, "container"); + this.container = container; + return this; + } + + public GetSearchAllLibrariesMedia withVideoFrameRate(String videoFrameRate) { + Utils.checkNotNull(videoFrameRate, "videoFrameRate"); + this.videoFrameRate = Optional.ofNullable(videoFrameRate); + return this; + } + + public GetSearchAllLibrariesMedia withVideoFrameRate(Optional videoFrameRate) { + Utils.checkNotNull(videoFrameRate, "videoFrameRate"); + this.videoFrameRate = videoFrameRate; + return this; + } + + public GetSearchAllLibrariesMedia withVideoProfile(String videoProfile) { + Utils.checkNotNull(videoProfile, "videoProfile"); + this.videoProfile = Optional.ofNullable(videoProfile); + return this; + } + + public GetSearchAllLibrariesMedia withVideoProfile(Optional videoProfile) { + Utils.checkNotNull(videoProfile, "videoProfile"); + this.videoProfile = videoProfile; + return this; + } + + public GetSearchAllLibrariesMedia withHasVoiceActivity(boolean hasVoiceActivity) { + Utils.checkNotNull(hasVoiceActivity, "hasVoiceActivity"); + this.hasVoiceActivity = Optional.ofNullable(hasVoiceActivity); + return this; + } + + public GetSearchAllLibrariesMedia withHasVoiceActivity(Optional hasVoiceActivity) { + Utils.checkNotNull(hasVoiceActivity, "hasVoiceActivity"); + this.hasVoiceActivity = hasVoiceActivity; + return this; + } + + public GetSearchAllLibrariesMedia withOptimizedForStreaming(GetSearchAllLibrariesOptimizedForStreaming optimizedForStreaming) { + Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); + this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming); + return this; + } + + public GetSearchAllLibrariesMedia withOptimizedForStreaming(Optional optimizedForStreaming) { + Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); + this.optimizedForStreaming = optimizedForStreaming; + return this; + } + + public GetSearchAllLibrariesMedia withHas64bitOffsets(boolean has64bitOffsets) { + Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); + this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); + return this; + } + + public GetSearchAllLibrariesMedia withHas64bitOffsets(Optional has64bitOffsets) { + Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); + this.has64bitOffsets = has64bitOffsets; + return this; + } + + public GetSearchAllLibrariesMedia withPart(List part) { + Utils.checkNotNull(part, "part"); + this.part = part; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesMedia other = (GetSearchAllLibrariesMedia) o; + return + Objects.deepEquals(this.id, other.id) && + Objects.deepEquals(this.duration, other.duration) && + Objects.deepEquals(this.bitrate, other.bitrate) && + Objects.deepEquals(this.width, other.width) && + Objects.deepEquals(this.height, other.height) && + Objects.deepEquals(this.aspectRatio, other.aspectRatio) && + Objects.deepEquals(this.audioProfile, other.audioProfile) && + Objects.deepEquals(this.audioChannels, other.audioChannels) && + Objects.deepEquals(this.audioCodec, other.audioCodec) && + Objects.deepEquals(this.videoCodec, other.videoCodec) && + Objects.deepEquals(this.videoResolution, other.videoResolution) && + Objects.deepEquals(this.container, other.container) && + Objects.deepEquals(this.videoFrameRate, other.videoFrameRate) && + Objects.deepEquals(this.videoProfile, other.videoProfile) && + Objects.deepEquals(this.hasVoiceActivity, other.hasVoiceActivity) && + Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Objects.deepEquals(this.part, other.part); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + duration, + bitrate, + width, + height, + aspectRatio, + audioProfile, + audioChannels, + audioCodec, + videoCodec, + videoResolution, + container, + videoFrameRate, + videoProfile, + hasVoiceActivity, + optimizedForStreaming, + has64bitOffsets, + part); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesMedia.class, + "id", id, + "duration", duration, + "bitrate", bitrate, + "width", width, + "height", height, + "aspectRatio", aspectRatio, + "audioProfile", audioProfile, + "audioChannels", audioChannels, + "audioCodec", audioCodec, + "videoCodec", videoCodec, + "videoResolution", videoResolution, + "container", container, + "videoFrameRate", videoFrameRate, + "videoProfile", videoProfile, + "hasVoiceActivity", hasVoiceActivity, + "optimizedForStreaming", optimizedForStreaming, + "has64bitOffsets", has64bitOffsets, + "part", part); + } + + public final static class Builder { + + private Integer id; + + private Optional duration = Optional.empty(); + + private Optional bitrate = Optional.empty(); + + private Optional width = Optional.empty(); + + private Optional height = Optional.empty(); + + private Optional aspectRatio = Optional.empty(); + + private Optional audioProfile = Optional.empty(); + + private Optional audioChannels = Optional.empty(); + + private Optional audioCodec = Optional.empty(); + + private Optional videoCodec = Optional.empty(); + + private Optional videoResolution = Optional.empty(); + + private String container; + + private Optional videoFrameRate = Optional.empty(); + + private Optional videoProfile = Optional.empty(); + + private Optional hasVoiceActivity = Optional.empty(); + + private Optional optimizedForStreaming; + + private Optional has64bitOffsets = Optional.empty(); + + private List part; + + private Builder() { + // force use of static builder() method + } + + public Builder id(int id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder duration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public Builder duration(Optional duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = duration; + return this; + } + + public Builder bitrate(int bitrate) { + Utils.checkNotNull(bitrate, "bitrate"); + this.bitrate = Optional.ofNullable(bitrate); + return this; + } + + public Builder bitrate(Optional bitrate) { + Utils.checkNotNull(bitrate, "bitrate"); + this.bitrate = bitrate; + return this; + } + + public Builder width(int width) { + Utils.checkNotNull(width, "width"); + this.width = Optional.ofNullable(width); + return this; + } + + public Builder width(Optional width) { + Utils.checkNotNull(width, "width"); + this.width = width; + return this; + } + + public Builder height(int height) { + Utils.checkNotNull(height, "height"); + this.height = Optional.ofNullable(height); + return this; + } + + public Builder height(Optional height) { + Utils.checkNotNull(height, "height"); + this.height = height; + return this; + } + + public Builder aspectRatio(double aspectRatio) { + Utils.checkNotNull(aspectRatio, "aspectRatio"); + this.aspectRatio = Optional.ofNullable(aspectRatio); + return this; + } + + public Builder aspectRatio(Optional aspectRatio) { + Utils.checkNotNull(aspectRatio, "aspectRatio"); + this.aspectRatio = aspectRatio; + return this; + } + + public Builder audioProfile(String audioProfile) { + Utils.checkNotNull(audioProfile, "audioProfile"); + this.audioProfile = Optional.ofNullable(audioProfile); + return this; + } + + public Builder audioProfile(Optional audioProfile) { + Utils.checkNotNull(audioProfile, "audioProfile"); + this.audioProfile = audioProfile; + return this; + } + + public Builder audioChannels(int audioChannels) { + Utils.checkNotNull(audioChannels, "audioChannels"); + this.audioChannels = Optional.ofNullable(audioChannels); + return this; + } + + public Builder audioChannels(Optional audioChannels) { + Utils.checkNotNull(audioChannels, "audioChannels"); + this.audioChannels = audioChannels; + return this; + } + + public Builder audioCodec(String audioCodec) { + Utils.checkNotNull(audioCodec, "audioCodec"); + this.audioCodec = Optional.ofNullable(audioCodec); + return this; + } + + public Builder audioCodec(Optional audioCodec) { + Utils.checkNotNull(audioCodec, "audioCodec"); + this.audioCodec = audioCodec; + return this; + } + + public Builder videoCodec(String videoCodec) { + Utils.checkNotNull(videoCodec, "videoCodec"); + this.videoCodec = Optional.ofNullable(videoCodec); + return this; + } + + public Builder videoCodec(Optional videoCodec) { + Utils.checkNotNull(videoCodec, "videoCodec"); + this.videoCodec = videoCodec; + return this; + } + + public Builder videoResolution(String videoResolution) { + Utils.checkNotNull(videoResolution, "videoResolution"); + this.videoResolution = Optional.ofNullable(videoResolution); + return this; + } + + public Builder videoResolution(Optional videoResolution) { + Utils.checkNotNull(videoResolution, "videoResolution"); + this.videoResolution = videoResolution; + return this; + } + + public Builder container(String container) { + Utils.checkNotNull(container, "container"); + this.container = container; + return this; + } + + public Builder videoFrameRate(String videoFrameRate) { + Utils.checkNotNull(videoFrameRate, "videoFrameRate"); + this.videoFrameRate = Optional.ofNullable(videoFrameRate); + return this; + } + + public Builder videoFrameRate(Optional videoFrameRate) { + Utils.checkNotNull(videoFrameRate, "videoFrameRate"); + this.videoFrameRate = videoFrameRate; + return this; + } + + public Builder videoProfile(String videoProfile) { + Utils.checkNotNull(videoProfile, "videoProfile"); + this.videoProfile = Optional.ofNullable(videoProfile); + return this; + } + + public Builder videoProfile(Optional videoProfile) { + Utils.checkNotNull(videoProfile, "videoProfile"); + this.videoProfile = videoProfile; + return this; + } + + public Builder hasVoiceActivity(boolean hasVoiceActivity) { + Utils.checkNotNull(hasVoiceActivity, "hasVoiceActivity"); + this.hasVoiceActivity = Optional.ofNullable(hasVoiceActivity); + return this; + } + + public Builder hasVoiceActivity(Optional hasVoiceActivity) { + Utils.checkNotNull(hasVoiceActivity, "hasVoiceActivity"); + this.hasVoiceActivity = hasVoiceActivity; + return this; + } + + public Builder optimizedForStreaming(GetSearchAllLibrariesOptimizedForStreaming optimizedForStreaming) { + Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); + this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming); + return this; + } + + public Builder optimizedForStreaming(Optional optimizedForStreaming) { + Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); + this.optimizedForStreaming = optimizedForStreaming; + return this; + } + + public Builder has64bitOffsets(boolean has64bitOffsets) { + Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); + this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); + return this; + } + + public Builder has64bitOffsets(Optional has64bitOffsets) { + Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); + this.has64bitOffsets = has64bitOffsets; + return this; + } + + public Builder part(List part) { + Utils.checkNotNull(part, "part"); + this.part = part; + return this; + } + + public GetSearchAllLibrariesMedia build() { + if (optimizedForStreaming == null) { + optimizedForStreaming = _SINGLETON_VALUE_OptimizedForStreaming.value(); + } return new GetSearchAllLibrariesMedia( + id, + duration, + bitrate, + width, + height, + aspectRatio, + audioProfile, + audioChannels, + audioCodec, + videoCodec, + videoResolution, + container, + videoFrameRate, + videoProfile, + hasVoiceActivity, + optimizedForStreaming, + has64bitOffsets, + part); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_OptimizedForStreaming = + new LazySingletonValue<>( + "optimizedForStreaming", + "0", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMediaContainer.java new file mode 100644 index 00000000..e784db1c --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMediaContainer.java @@ -0,0 +1,120 @@ +/* + * 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.Double; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Objects; + + +public class GetSearchAllLibrariesMediaContainer { + + @JsonProperty("size") + private double size; + + @JsonProperty("SearchResult") + private List searchResult; + + @JsonCreator + public GetSearchAllLibrariesMediaContainer( + @JsonProperty("size") double size, + @JsonProperty("SearchResult") List searchResult) { + Utils.checkNotNull(size, "size"); + Utils.checkNotNull(searchResult, "searchResult"); + this.size = size; + this.searchResult = searchResult; + } + + @JsonIgnore + public double size() { + return size; + } + + @JsonIgnore + public List searchResult() { + return searchResult; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchAllLibrariesMediaContainer withSize(double size) { + Utils.checkNotNull(size, "size"); + this.size = size; + return this; + } + + public GetSearchAllLibrariesMediaContainer withSearchResult(List searchResult) { + Utils.checkNotNull(searchResult, "searchResult"); + this.searchResult = searchResult; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesMediaContainer other = (GetSearchAllLibrariesMediaContainer) o; + return + Objects.deepEquals(this.size, other.size) && + Objects.deepEquals(this.searchResult, other.searchResult); + } + + @Override + public int hashCode() { + return Objects.hash( + size, + searchResult); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesMediaContainer.class, + "size", size, + "searchResult", searchResult); + } + + public final static class Builder { + + private Double size; + + private List searchResult; + + private Builder() { + // force use of static builder() method + } + + public Builder size(double size) { + Utils.checkNotNull(size, "size"); + this.size = size; + return this; + } + + public Builder searchResult(List searchResult) { + Utils.checkNotNull(searchResult, "searchResult"); + this.searchResult = searchResult; + return this; + } + + public GetSearchAllLibrariesMediaContainer build() { + return new GetSearchAllLibrariesMediaContainer( + size, + searchResult); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMediaGuid.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMediaGuid.java new file mode 100644 index 00000000..a75e8b07 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMediaGuid.java @@ -0,0 +1,109 @@ +/* + * 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.Override; +import java.lang.String; +import java.util.Objects; + + +public class GetSearchAllLibrariesMediaGuid { + + /** + * Can be one of the following formats: + * imdb://tt13015952, tmdb://2434012, tvdb://7945991 + * + */ + @JsonProperty("id") + private String id; + + @JsonCreator + public GetSearchAllLibrariesMediaGuid( + @JsonProperty("id") String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + } + + /** + * Can be one of the following formats: + * imdb://tt13015952, tmdb://2434012, tvdb://7945991 + * + */ + @JsonIgnore + public String id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Can be one of the following formats: + * imdb://tt13015952, tmdb://2434012, tvdb://7945991 + * + */ + public GetSearchAllLibrariesMediaGuid withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesMediaGuid other = (GetSearchAllLibrariesMediaGuid) o; + return + Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return Objects.hash( + id); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesMediaGuid.class, + "id", id); + } + + public final static class Builder { + + private String id; + + private Builder() { + // force use of static builder() method + } + + /** + * Can be one of the following formats: + * imdb://tt13015952, tmdb://2434012, tvdb://7945991 + * + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public GetSearchAllLibrariesMediaGuid build() { + return new GetSearchAllLibrariesMediaGuid( + id); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMetaDataRating.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMetaDataRating.java new file mode 100644 index 00000000..6f959cc7 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMetaDataRating.java @@ -0,0 +1,184 @@ +/* + * 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.Float; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; + + +public class GetSearchAllLibrariesMetaDataRating { + + /** + * A URI or path to the rating image. + */ + @JsonProperty("image") + private String image; + + /** + * The value of the rating. + */ + @JsonProperty("value") + private float value; + + /** + * The type of rating (e.g., audience, critic). + */ + @JsonProperty("type") + private String type; + + @JsonCreator + public GetSearchAllLibrariesMetaDataRating( + @JsonProperty("image") String image, + @JsonProperty("value") float value, + @JsonProperty("type") String type) { + Utils.checkNotNull(image, "image"); + Utils.checkNotNull(value, "value"); + Utils.checkNotNull(type, "type"); + this.image = image; + this.value = value; + this.type = type; + } + + /** + * A URI or path to the rating image. + */ + @JsonIgnore + public String image() { + return image; + } + + /** + * The value of the rating. + */ + @JsonIgnore + public float value() { + return value; + } + + /** + * The type of rating (e.g., audience, critic). + */ + @JsonIgnore + public String type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * A URI or path to the rating image. + */ + public GetSearchAllLibrariesMetaDataRating withImage(String image) { + Utils.checkNotNull(image, "image"); + this.image = image; + return this; + } + + /** + * The value of the rating. + */ + public GetSearchAllLibrariesMetaDataRating withValue(float value) { + Utils.checkNotNull(value, "value"); + this.value = value; + return this; + } + + /** + * The type of rating (e.g., audience, critic). + */ + public GetSearchAllLibrariesMetaDataRating withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesMetaDataRating other = (GetSearchAllLibrariesMetaDataRating) o; + return + Objects.deepEquals(this.image, other.image) && + Objects.deepEquals(this.value, other.value) && + Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return Objects.hash( + image, + value, + type); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesMetaDataRating.class, + "image", image, + "value", value, + "type", type); + } + + public final static class Builder { + + private String image; + + private Float value; + + private String type; + + private Builder() { + // force use of static builder() method + } + + /** + * A URI or path to the rating image. + */ + public Builder image(String image) { + Utils.checkNotNull(image, "image"); + this.image = image; + return this; + } + + /** + * The value of the rating. + */ + public Builder value(float value) { + Utils.checkNotNull(value, "value"); + this.value = value; + return this; + } + + /** + * The type of rating (e.g., audience, critic). + */ + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public GetSearchAllLibrariesMetaDataRating build() { + return new GetSearchAllLibrariesMetaDataRating( + image, + value, + type); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMetadata.java new file mode 100644 index 00000000..f6cbf612 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMetadata.java @@ -0,0 +1,3314 @@ +/* + * 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 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.Double; +import java.lang.Integer; +import java.lang.Long; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.time.LocalDate; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + + +public class GetSearchAllLibrariesMetadata { + + /** + * The rating key (Media ID) of this media item. + * Note: This is always an integer, but is represented as a string in the API. + * + */ + @JsonProperty("ratingKey") + private String ratingKey; + + @JsonProperty("key") + private String key; + + @JsonProperty("guid") + private String guid; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("studio") + private Optional studio; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("skipChildren") + private Optional skipChildren; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("librarySectionID") + private Optional librarySectionID; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("librarySectionTitle") + private Optional librarySectionTitle; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("librarySectionKey") + private Optional librarySectionKey; + + /** + * The type of media content + * + */ + @JsonProperty("type") + private GetSearchAllLibrariesType type; + + @JsonProperty("title") + private String title; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("slug") + private Optional slug; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("contentRating") + private Optional contentRating; + + @JsonProperty("summary") + private String summary; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("rating") + private Optional rating; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("audienceRating") + private Optional audienceRating; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("year") + private Optional year; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("seasonCount") + private Optional seasonCount; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tagline") + private Optional tagline; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("flattenSeasons") + private Optional flattenSeasons; + + /** + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * aired = TheTVDB (Aired), + * dvd = TheTVDB (DVD), + * absolute = TheTVDB (Absolute)). + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("showOrdering") + private Optional showOrdering; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("thumb") + private Optional thumb; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("art") + private Optional art; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("banner") + private Optional banner; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("duration") + private Optional duration; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("originallyAvailableAt") + private Optional originallyAvailableAt; + + /** + * Unix epoch datetime in seconds + */ + @JsonProperty("addedAt") + private long addedAt; + + /** + * Unix epoch datetime in seconds + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("updatedAt") + private Optional updatedAt; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("audienceRatingImage") + private Optional audienceRatingImage; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("chapterSource") + private Optional chapterSource; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("primaryExtraKey") + private Optional primaryExtraKey; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("ratingImage") + private Optional ratingImage; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("grandparentRatingKey") + private Optional grandparentRatingKey; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("grandparentGuid") + private Optional grandparentGuid; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("grandparentKey") + private Optional grandparentKey; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("grandparentTitle") + private Optional grandparentTitle; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("grandparentThumb") + private Optional grandparentThumb; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("parentSlug") + private Optional parentSlug; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("grandparentSlug") + private Optional grandparentSlug; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("grandparentArt") + private Optional grandparentArt; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("grandparentTheme") + private Optional grandparentTheme; + + /** + * The Media object is only included when type query is `4` or higher. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Media") + private Optional> media; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Genre") + private Optional> genre; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Country") + private Optional> country; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Director") + private Optional> director; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Writer") + private Optional> writer; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Collection") + private Optional> collection; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Role") + private Optional> role; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Location") + private Optional> location; + + /** + * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Guid") + private Optional> mediaGuid; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("UltraBlurColors") + private Optional ultraBlurColors; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Rating") + private Optional> metaDataRating; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Image") + private Optional> image; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("titleSort") + private Optional titleSort; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("viewCount") + private Optional viewCount; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lastViewedAt") + private Optional lastViewedAt; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("originalTitle") + private Optional originalTitle; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("viewOffset") + private Optional viewOffset; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("skipCount") + private Optional skipCount; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("index") + private Optional index; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("theme") + private Optional theme; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("leafCount") + private Optional leafCount; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("viewedLeafCount") + private Optional viewedLeafCount; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("childCount") + private Optional childCount; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("hasPremiumExtras") + private Optional hasPremiumExtras; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("hasPremiumPrimaryExtra") + private Optional hasPremiumPrimaryExtra; + + /** + * The rating key of the parent item. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("parentRatingKey") + private Optional parentRatingKey; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("parentGuid") + private Optional parentGuid; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("parentStudio") + private Optional parentStudio; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("parentKey") + private Optional parentKey; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("parentTitle") + private Optional parentTitle; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("parentIndex") + private Optional parentIndex; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("parentYear") + private Optional parentYear; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("parentThumb") + private Optional parentThumb; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("parentTheme") + private Optional parentTheme; + + @JsonCreator + public GetSearchAllLibrariesMetadata( + @JsonProperty("ratingKey") String ratingKey, + @JsonProperty("key") String key, + @JsonProperty("guid") String guid, + @JsonProperty("studio") Optional studio, + @JsonProperty("skipChildren") Optional skipChildren, + @JsonProperty("librarySectionID") Optional librarySectionID, + @JsonProperty("librarySectionTitle") Optional librarySectionTitle, + @JsonProperty("librarySectionKey") Optional librarySectionKey, + @JsonProperty("type") GetSearchAllLibrariesType type, + @JsonProperty("title") String title, + @JsonProperty("slug") Optional slug, + @JsonProperty("contentRating") Optional contentRating, + @JsonProperty("summary") String summary, + @JsonProperty("rating") Optional rating, + @JsonProperty("audienceRating") Optional audienceRating, + @JsonProperty("year") Optional year, + @JsonProperty("seasonCount") Optional seasonCount, + @JsonProperty("tagline") Optional tagline, + @JsonProperty("flattenSeasons") Optional flattenSeasons, + @JsonProperty("showOrdering") Optional showOrdering, + @JsonProperty("thumb") Optional thumb, + @JsonProperty("art") Optional art, + @JsonProperty("banner") Optional banner, + @JsonProperty("duration") Optional duration, + @JsonProperty("originallyAvailableAt") Optional originallyAvailableAt, + @JsonProperty("addedAt") long addedAt, + @JsonProperty("updatedAt") Optional updatedAt, + @JsonProperty("audienceRatingImage") Optional audienceRatingImage, + @JsonProperty("chapterSource") Optional chapterSource, + @JsonProperty("primaryExtraKey") Optional primaryExtraKey, + @JsonProperty("ratingImage") Optional ratingImage, + @JsonProperty("grandparentRatingKey") Optional grandparentRatingKey, + @JsonProperty("grandparentGuid") Optional grandparentGuid, + @JsonProperty("grandparentKey") Optional grandparentKey, + @JsonProperty("grandparentTitle") Optional grandparentTitle, + @JsonProperty("grandparentThumb") Optional grandparentThumb, + @JsonProperty("parentSlug") Optional parentSlug, + @JsonProperty("grandparentSlug") Optional grandparentSlug, + @JsonProperty("grandparentArt") Optional grandparentArt, + @JsonProperty("grandparentTheme") Optional grandparentTheme, + @JsonProperty("Media") Optional> media, + @JsonProperty("Genre") Optional> genre, + @JsonProperty("Country") Optional> country, + @JsonProperty("Director") Optional> director, + @JsonProperty("Writer") Optional> writer, + @JsonProperty("Collection") Optional> collection, + @JsonProperty("Role") Optional> role, + @JsonProperty("Location") Optional> location, + @JsonProperty("Guid") Optional> mediaGuid, + @JsonProperty("UltraBlurColors") Optional ultraBlurColors, + @JsonProperty("Rating") Optional> metaDataRating, + @JsonProperty("Image") Optional> image, + @JsonProperty("titleSort") Optional titleSort, + @JsonProperty("viewCount") Optional viewCount, + @JsonProperty("lastViewedAt") Optional lastViewedAt, + @JsonProperty("originalTitle") Optional originalTitle, + @JsonProperty("viewOffset") Optional viewOffset, + @JsonProperty("skipCount") Optional skipCount, + @JsonProperty("index") Optional index, + @JsonProperty("theme") Optional theme, + @JsonProperty("leafCount") Optional leafCount, + @JsonProperty("viewedLeafCount") Optional viewedLeafCount, + @JsonProperty("childCount") Optional childCount, + @JsonProperty("hasPremiumExtras") Optional hasPremiumExtras, + @JsonProperty("hasPremiumPrimaryExtra") Optional hasPremiumPrimaryExtra, + @JsonProperty("parentRatingKey") Optional parentRatingKey, + @JsonProperty("parentGuid") Optional parentGuid, + @JsonProperty("parentStudio") Optional parentStudio, + @JsonProperty("parentKey") Optional parentKey, + @JsonProperty("parentTitle") Optional parentTitle, + @JsonProperty("parentIndex") Optional parentIndex, + @JsonProperty("parentYear") Optional parentYear, + @JsonProperty("parentThumb") Optional parentThumb, + @JsonProperty("parentTheme") Optional parentTheme) { + Utils.checkNotNull(ratingKey, "ratingKey"); + Utils.checkNotNull(key, "key"); + Utils.checkNotNull(guid, "guid"); + Utils.checkNotNull(studio, "studio"); + Utils.checkNotNull(skipChildren, "skipChildren"); + Utils.checkNotNull(librarySectionID, "librarySectionID"); + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + Utils.checkNotNull(librarySectionKey, "librarySectionKey"); + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(title, "title"); + Utils.checkNotNull(slug, "slug"); + Utils.checkNotNull(contentRating, "contentRating"); + Utils.checkNotNull(summary, "summary"); + Utils.checkNotNull(rating, "rating"); + Utils.checkNotNull(audienceRating, "audienceRating"); + Utils.checkNotNull(year, "year"); + Utils.checkNotNull(seasonCount, "seasonCount"); + Utils.checkNotNull(tagline, "tagline"); + Utils.checkNotNull(flattenSeasons, "flattenSeasons"); + Utils.checkNotNull(showOrdering, "showOrdering"); + Utils.checkNotNull(thumb, "thumb"); + Utils.checkNotNull(art, "art"); + Utils.checkNotNull(banner, "banner"); + Utils.checkNotNull(duration, "duration"); + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + Utils.checkNotNull(addedAt, "addedAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); + Utils.checkNotNull(chapterSource, "chapterSource"); + Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); + Utils.checkNotNull(ratingImage, "ratingImage"); + Utils.checkNotNull(grandparentRatingKey, "grandparentRatingKey"); + Utils.checkNotNull(grandparentGuid, "grandparentGuid"); + Utils.checkNotNull(grandparentKey, "grandparentKey"); + Utils.checkNotNull(grandparentTitle, "grandparentTitle"); + Utils.checkNotNull(grandparentThumb, "grandparentThumb"); + Utils.checkNotNull(parentSlug, "parentSlug"); + Utils.checkNotNull(grandparentSlug, "grandparentSlug"); + Utils.checkNotNull(grandparentArt, "grandparentArt"); + Utils.checkNotNull(grandparentTheme, "grandparentTheme"); + Utils.checkNotNull(media, "media"); + Utils.checkNotNull(genre, "genre"); + Utils.checkNotNull(country, "country"); + Utils.checkNotNull(director, "director"); + Utils.checkNotNull(writer, "writer"); + Utils.checkNotNull(collection, "collection"); + Utils.checkNotNull(role, "role"); + Utils.checkNotNull(location, "location"); + Utils.checkNotNull(mediaGuid, "mediaGuid"); + Utils.checkNotNull(ultraBlurColors, "ultraBlurColors"); + Utils.checkNotNull(metaDataRating, "metaDataRating"); + Utils.checkNotNull(image, "image"); + Utils.checkNotNull(titleSort, "titleSort"); + Utils.checkNotNull(viewCount, "viewCount"); + Utils.checkNotNull(lastViewedAt, "lastViewedAt"); + Utils.checkNotNull(originalTitle, "originalTitle"); + Utils.checkNotNull(viewOffset, "viewOffset"); + Utils.checkNotNull(skipCount, "skipCount"); + Utils.checkNotNull(index, "index"); + Utils.checkNotNull(theme, "theme"); + Utils.checkNotNull(leafCount, "leafCount"); + Utils.checkNotNull(viewedLeafCount, "viewedLeafCount"); + Utils.checkNotNull(childCount, "childCount"); + Utils.checkNotNull(hasPremiumExtras, "hasPremiumExtras"); + Utils.checkNotNull(hasPremiumPrimaryExtra, "hasPremiumPrimaryExtra"); + Utils.checkNotNull(parentRatingKey, "parentRatingKey"); + Utils.checkNotNull(parentGuid, "parentGuid"); + Utils.checkNotNull(parentStudio, "parentStudio"); + Utils.checkNotNull(parentKey, "parentKey"); + Utils.checkNotNull(parentTitle, "parentTitle"); + Utils.checkNotNull(parentIndex, "parentIndex"); + Utils.checkNotNull(parentYear, "parentYear"); + Utils.checkNotNull(parentThumb, "parentThumb"); + Utils.checkNotNull(parentTheme, "parentTheme"); + this.ratingKey = ratingKey; + this.key = key; + this.guid = guid; + this.studio = studio; + this.skipChildren = skipChildren; + this.librarySectionID = librarySectionID; + this.librarySectionTitle = librarySectionTitle; + this.librarySectionKey = librarySectionKey; + this.type = type; + this.title = title; + this.slug = slug; + this.contentRating = contentRating; + this.summary = summary; + this.rating = rating; + this.audienceRating = audienceRating; + this.year = year; + this.seasonCount = seasonCount; + this.tagline = tagline; + this.flattenSeasons = flattenSeasons; + this.showOrdering = showOrdering; + this.thumb = thumb; + this.art = art; + this.banner = banner; + this.duration = duration; + this.originallyAvailableAt = originallyAvailableAt; + this.addedAt = addedAt; + this.updatedAt = updatedAt; + this.audienceRatingImage = audienceRatingImage; + this.chapterSource = chapterSource; + this.primaryExtraKey = primaryExtraKey; + this.ratingImage = ratingImage; + this.grandparentRatingKey = grandparentRatingKey; + this.grandparentGuid = grandparentGuid; + this.grandparentKey = grandparentKey; + this.grandparentTitle = grandparentTitle; + this.grandparentThumb = grandparentThumb; + this.parentSlug = parentSlug; + this.grandparentSlug = grandparentSlug; + this.grandparentArt = grandparentArt; + this.grandparentTheme = grandparentTheme; + this.media = media; + this.genre = genre; + this.country = country; + this.director = director; + this.writer = writer; + this.collection = collection; + this.role = role; + this.location = location; + this.mediaGuid = mediaGuid; + this.ultraBlurColors = ultraBlurColors; + this.metaDataRating = metaDataRating; + this.image = image; + this.titleSort = titleSort; + this.viewCount = viewCount; + this.lastViewedAt = lastViewedAt; + this.originalTitle = originalTitle; + this.viewOffset = viewOffset; + this.skipCount = skipCount; + this.index = index; + this.theme = theme; + this.leafCount = leafCount; + this.viewedLeafCount = viewedLeafCount; + this.childCount = childCount; + this.hasPremiumExtras = hasPremiumExtras; + this.hasPremiumPrimaryExtra = hasPremiumPrimaryExtra; + this.parentRatingKey = parentRatingKey; + this.parentGuid = parentGuid; + this.parentStudio = parentStudio; + this.parentKey = parentKey; + this.parentTitle = parentTitle; + this.parentIndex = parentIndex; + this.parentYear = parentYear; + this.parentThumb = parentThumb; + this.parentTheme = parentTheme; + } + + public GetSearchAllLibrariesMetadata( + String ratingKey, + String key, + String guid, + GetSearchAllLibrariesType type, + String title, + String summary, + long addedAt) { + this(ratingKey, key, guid, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), type, title, Optional.empty(), Optional.empty(), summary, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), addedAt, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * The rating key (Media ID) of this media item. + * Note: This is always an integer, but is represented as a string in the API. + * + */ + @JsonIgnore + public String ratingKey() { + return ratingKey; + } + + @JsonIgnore + public String key() { + return key; + } + + @JsonIgnore + public String guid() { + return guid; + } + + @JsonIgnore + public Optional studio() { + return studio; + } + + @JsonIgnore + public Optional skipChildren() { + return skipChildren; + } + + @JsonIgnore + public Optional librarySectionID() { + return librarySectionID; + } + + @JsonIgnore + public Optional librarySectionTitle() { + return librarySectionTitle; + } + + @JsonIgnore + public Optional librarySectionKey() { + return librarySectionKey; + } + + /** + * The type of media content + * + */ + @JsonIgnore + public GetSearchAllLibrariesType type() { + return type; + } + + @JsonIgnore + public String title() { + return title; + } + + @JsonIgnore + public Optional slug() { + return slug; + } + + @JsonIgnore + public Optional contentRating() { + return contentRating; + } + + @JsonIgnore + public String summary() { + return summary; + } + + @JsonIgnore + public Optional rating() { + return rating; + } + + @JsonIgnore + public Optional audienceRating() { + return audienceRating; + } + + @JsonIgnore + public Optional year() { + return year; + } + + @JsonIgnore + public Optional seasonCount() { + return seasonCount; + } + + @JsonIgnore + public Optional tagline() { + return tagline; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional flattenSeasons() { + return (Optional) flattenSeasons; + } + + /** + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * aired = TheTVDB (Aired), + * dvd = TheTVDB (DVD), + * absolute = TheTVDB (Absolute)). + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional showOrdering() { + return (Optional) showOrdering; + } + + @JsonIgnore + public Optional thumb() { + return thumb; + } + + @JsonIgnore + public Optional art() { + return art; + } + + @JsonIgnore + public Optional banner() { + return banner; + } + + @JsonIgnore + public Optional duration() { + return duration; + } + + @JsonIgnore + public Optional originallyAvailableAt() { + return originallyAvailableAt; + } + + /** + * Unix epoch datetime in seconds + */ + @JsonIgnore + public long addedAt() { + return addedAt; + } + + /** + * Unix epoch datetime in seconds + */ + @JsonIgnore + public Optional updatedAt() { + return updatedAt; + } + + @JsonIgnore + public Optional audienceRatingImage() { + return audienceRatingImage; + } + + @JsonIgnore + public Optional chapterSource() { + return chapterSource; + } + + @JsonIgnore + public Optional primaryExtraKey() { + return primaryExtraKey; + } + + @JsonIgnore + public Optional ratingImage() { + return ratingImage; + } + + @JsonIgnore + public Optional grandparentRatingKey() { + return grandparentRatingKey; + } + + @JsonIgnore + public Optional grandparentGuid() { + return grandparentGuid; + } + + @JsonIgnore + public Optional grandparentKey() { + return grandparentKey; + } + + @JsonIgnore + public Optional grandparentTitle() { + return grandparentTitle; + } + + @JsonIgnore + public Optional grandparentThumb() { + return grandparentThumb; + } + + @JsonIgnore + public Optional parentSlug() { + return parentSlug; + } + + @JsonIgnore + public Optional grandparentSlug() { + return grandparentSlug; + } + + @JsonIgnore + public Optional grandparentArt() { + return grandparentArt; + } + + @JsonIgnore + public Optional grandparentTheme() { + return grandparentTheme; + } + + /** + * The Media object is only included when type query is `4` or higher. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> media() { + return (Optional>) media; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> genre() { + return (Optional>) genre; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> country() { + return (Optional>) country; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> director() { + return (Optional>) director; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> writer() { + return (Optional>) writer; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> collection() { + return (Optional>) collection; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> role() { + return (Optional>) role; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> location() { + return (Optional>) location; + } + + /** + * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> mediaGuid() { + return (Optional>) mediaGuid; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ultraBlurColors() { + return (Optional) ultraBlurColors; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> metaDataRating() { + return (Optional>) metaDataRating; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> image() { + return (Optional>) image; + } + + @JsonIgnore + public Optional titleSort() { + return titleSort; + } + + @JsonIgnore + public Optional viewCount() { + return viewCount; + } + + @JsonIgnore + public Optional lastViewedAt() { + return lastViewedAt; + } + + @JsonIgnore + public Optional originalTitle() { + return originalTitle; + } + + @JsonIgnore + public Optional viewOffset() { + return viewOffset; + } + + @JsonIgnore + public Optional skipCount() { + return skipCount; + } + + @JsonIgnore + public Optional index() { + return index; + } + + @JsonIgnore + public Optional theme() { + return theme; + } + + @JsonIgnore + public Optional leafCount() { + return leafCount; + } + + @JsonIgnore + public Optional viewedLeafCount() { + return viewedLeafCount; + } + + @JsonIgnore + public Optional childCount() { + return childCount; + } + + @JsonIgnore + public Optional hasPremiumExtras() { + return hasPremiumExtras; + } + + @JsonIgnore + public Optional hasPremiumPrimaryExtra() { + return hasPremiumPrimaryExtra; + } + + /** + * The rating key of the parent item. + * + */ + @JsonIgnore + public Optional parentRatingKey() { + return parentRatingKey; + } + + @JsonIgnore + public Optional parentGuid() { + return parentGuid; + } + + @JsonIgnore + public Optional parentStudio() { + return parentStudio; + } + + @JsonIgnore + public Optional parentKey() { + return parentKey; + } + + @JsonIgnore + public Optional parentTitle() { + return parentTitle; + } + + @JsonIgnore + public Optional parentIndex() { + return parentIndex; + } + + @JsonIgnore + public Optional parentYear() { + return parentYear; + } + + @JsonIgnore + public Optional parentThumb() { + return parentThumb; + } + + @JsonIgnore + public Optional parentTheme() { + return parentTheme; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The rating key (Media ID) of this media item. + * Note: This is always an integer, but is represented as a string in the API. + * + */ + public GetSearchAllLibrariesMetadata withRatingKey(String ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = ratingKey; + return this; + } + + public GetSearchAllLibrariesMetadata withKey(String key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public GetSearchAllLibrariesMetadata withGuid(String guid) { + Utils.checkNotNull(guid, "guid"); + this.guid = guid; + return this; + } + + public GetSearchAllLibrariesMetadata withStudio(String studio) { + Utils.checkNotNull(studio, "studio"); + this.studio = Optional.ofNullable(studio); + return this; + } + + public GetSearchAllLibrariesMetadata withStudio(Optional studio) { + Utils.checkNotNull(studio, "studio"); + this.studio = studio; + return this; + } + + public GetSearchAllLibrariesMetadata withSkipChildren(boolean skipChildren) { + Utils.checkNotNull(skipChildren, "skipChildren"); + this.skipChildren = Optional.ofNullable(skipChildren); + return this; + } + + public GetSearchAllLibrariesMetadata withSkipChildren(Optional skipChildren) { + Utils.checkNotNull(skipChildren, "skipChildren"); + this.skipChildren = skipChildren; + return this; + } + + public GetSearchAllLibrariesMetadata withLibrarySectionID(long librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = Optional.ofNullable(librarySectionID); + return this; + } + + public GetSearchAllLibrariesMetadata withLibrarySectionID(Optional librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = librarySectionID; + return this; + } + + public GetSearchAllLibrariesMetadata withLibrarySectionTitle(String librarySectionTitle) { + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); + return this; + } + + public GetSearchAllLibrariesMetadata withLibrarySectionTitle(Optional librarySectionTitle) { + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + this.librarySectionTitle = librarySectionTitle; + return this; + } + + public GetSearchAllLibrariesMetadata withLibrarySectionKey(String librarySectionKey) { + Utils.checkNotNull(librarySectionKey, "librarySectionKey"); + this.librarySectionKey = Optional.ofNullable(librarySectionKey); + return this; + } + + public GetSearchAllLibrariesMetadata withLibrarySectionKey(Optional librarySectionKey) { + Utils.checkNotNull(librarySectionKey, "librarySectionKey"); + this.librarySectionKey = librarySectionKey; + return this; + } + + /** + * The type of media content + * + */ + public GetSearchAllLibrariesMetadata withType(GetSearchAllLibrariesType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public GetSearchAllLibrariesMetadata withTitle(String title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public GetSearchAllLibrariesMetadata withSlug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = Optional.ofNullable(slug); + return this; + } + + public GetSearchAllLibrariesMetadata withSlug(Optional slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public GetSearchAllLibrariesMetadata withContentRating(String contentRating) { + Utils.checkNotNull(contentRating, "contentRating"); + this.contentRating = Optional.ofNullable(contentRating); + return this; + } + + public GetSearchAllLibrariesMetadata withContentRating(Optional contentRating) { + Utils.checkNotNull(contentRating, "contentRating"); + this.contentRating = contentRating; + return this; + } + + public GetSearchAllLibrariesMetadata withSummary(String summary) { + Utils.checkNotNull(summary, "summary"); + this.summary = summary; + return this; + } + + public GetSearchAllLibrariesMetadata withRating(double rating) { + Utils.checkNotNull(rating, "rating"); + this.rating = Optional.ofNullable(rating); + return this; + } + + public GetSearchAllLibrariesMetadata withRating(Optional rating) { + Utils.checkNotNull(rating, "rating"); + this.rating = rating; + return this; + } + + public GetSearchAllLibrariesMetadata withAudienceRating(double audienceRating) { + Utils.checkNotNull(audienceRating, "audienceRating"); + this.audienceRating = Optional.ofNullable(audienceRating); + return this; + } + + public GetSearchAllLibrariesMetadata withAudienceRating(Optional audienceRating) { + Utils.checkNotNull(audienceRating, "audienceRating"); + this.audienceRating = audienceRating; + return this; + } + + public GetSearchAllLibrariesMetadata withYear(int year) { + Utils.checkNotNull(year, "year"); + this.year = Optional.ofNullable(year); + return this; + } + + public GetSearchAllLibrariesMetadata withYear(Optional year) { + Utils.checkNotNull(year, "year"); + this.year = year; + return this; + } + + public GetSearchAllLibrariesMetadata withSeasonCount(int seasonCount) { + Utils.checkNotNull(seasonCount, "seasonCount"); + this.seasonCount = Optional.ofNullable(seasonCount); + return this; + } + + public GetSearchAllLibrariesMetadata withSeasonCount(Optional seasonCount) { + Utils.checkNotNull(seasonCount, "seasonCount"); + this.seasonCount = seasonCount; + return this; + } + + public GetSearchAllLibrariesMetadata withTagline(String tagline) { + Utils.checkNotNull(tagline, "tagline"); + this.tagline = Optional.ofNullable(tagline); + return this; + } + + public GetSearchAllLibrariesMetadata withTagline(Optional tagline) { + Utils.checkNotNull(tagline, "tagline"); + this.tagline = tagline; + return this; + } + + public GetSearchAllLibrariesMetadata withFlattenSeasons(GetSearchAllLibrariesFlattenSeasons flattenSeasons) { + Utils.checkNotNull(flattenSeasons, "flattenSeasons"); + this.flattenSeasons = Optional.ofNullable(flattenSeasons); + return this; + } + + public GetSearchAllLibrariesMetadata withFlattenSeasons(Optional flattenSeasons) { + Utils.checkNotNull(flattenSeasons, "flattenSeasons"); + this.flattenSeasons = flattenSeasons; + return this; + } + + /** + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * aired = TheTVDB (Aired), + * dvd = TheTVDB (DVD), + * absolute = TheTVDB (Absolute)). + * + */ + public GetSearchAllLibrariesMetadata withShowOrdering(GetSearchAllLibrariesShowOrdering showOrdering) { + Utils.checkNotNull(showOrdering, "showOrdering"); + this.showOrdering = Optional.ofNullable(showOrdering); + return this; + } + + /** + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * aired = TheTVDB (Aired), + * dvd = TheTVDB (DVD), + * absolute = TheTVDB (Absolute)). + * + */ + public GetSearchAllLibrariesMetadata withShowOrdering(Optional showOrdering) { + Utils.checkNotNull(showOrdering, "showOrdering"); + this.showOrdering = showOrdering; + return this; + } + + public GetSearchAllLibrariesMetadata withThumb(String thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = Optional.ofNullable(thumb); + return this; + } + + public GetSearchAllLibrariesMetadata withThumb(Optional thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = thumb; + return this; + } + + public GetSearchAllLibrariesMetadata withArt(String art) { + Utils.checkNotNull(art, "art"); + this.art = Optional.ofNullable(art); + return this; + } + + public GetSearchAllLibrariesMetadata withArt(Optional art) { + Utils.checkNotNull(art, "art"); + this.art = art; + return this; + } + + public GetSearchAllLibrariesMetadata withBanner(String banner) { + Utils.checkNotNull(banner, "banner"); + this.banner = Optional.ofNullable(banner); + return this; + } + + public GetSearchAllLibrariesMetadata withBanner(Optional banner) { + Utils.checkNotNull(banner, "banner"); + this.banner = banner; + return this; + } + + public GetSearchAllLibrariesMetadata withDuration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public GetSearchAllLibrariesMetadata withDuration(Optional duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = duration; + return this; + } + + public GetSearchAllLibrariesMetadata withOriginallyAvailableAt(LocalDate originallyAvailableAt) { + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt); + return this; + } + + public GetSearchAllLibrariesMetadata withOriginallyAvailableAt(Optional originallyAvailableAt) { + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + this.originallyAvailableAt = originallyAvailableAt; + return this; + } + + /** + * Unix epoch datetime in seconds + */ + public GetSearchAllLibrariesMetadata withAddedAt(long addedAt) { + Utils.checkNotNull(addedAt, "addedAt"); + this.addedAt = addedAt; + return this; + } + + /** + * Unix epoch datetime in seconds + */ + public GetSearchAllLibrariesMetadata withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + * Unix epoch datetime in seconds + */ + public GetSearchAllLibrariesMetadata withUpdatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public GetSearchAllLibrariesMetadata withAudienceRatingImage(String audienceRatingImage) { + Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); + this.audienceRatingImage = Optional.ofNullable(audienceRatingImage); + return this; + } + + public GetSearchAllLibrariesMetadata withAudienceRatingImage(Optional audienceRatingImage) { + Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); + this.audienceRatingImage = audienceRatingImage; + return this; + } + + public GetSearchAllLibrariesMetadata withChapterSource(String chapterSource) { + Utils.checkNotNull(chapterSource, "chapterSource"); + this.chapterSource = Optional.ofNullable(chapterSource); + return this; + } + + public GetSearchAllLibrariesMetadata withChapterSource(Optional chapterSource) { + Utils.checkNotNull(chapterSource, "chapterSource"); + this.chapterSource = chapterSource; + return this; + } + + public GetSearchAllLibrariesMetadata withPrimaryExtraKey(String primaryExtraKey) { + Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); + this.primaryExtraKey = Optional.ofNullable(primaryExtraKey); + return this; + } + + public GetSearchAllLibrariesMetadata withPrimaryExtraKey(Optional primaryExtraKey) { + Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); + this.primaryExtraKey = primaryExtraKey; + return this; + } + + public GetSearchAllLibrariesMetadata withRatingImage(String ratingImage) { + Utils.checkNotNull(ratingImage, "ratingImage"); + this.ratingImage = Optional.ofNullable(ratingImage); + return this; + } + + public GetSearchAllLibrariesMetadata withRatingImage(Optional ratingImage) { + Utils.checkNotNull(ratingImage, "ratingImage"); + this.ratingImage = ratingImage; + return this; + } + + public GetSearchAllLibrariesMetadata withGrandparentRatingKey(String grandparentRatingKey) { + Utils.checkNotNull(grandparentRatingKey, "grandparentRatingKey"); + this.grandparentRatingKey = Optional.ofNullable(grandparentRatingKey); + return this; + } + + public GetSearchAllLibrariesMetadata withGrandparentRatingKey(Optional grandparentRatingKey) { + Utils.checkNotNull(grandparentRatingKey, "grandparentRatingKey"); + this.grandparentRatingKey = grandparentRatingKey; + return this; + } + + public GetSearchAllLibrariesMetadata withGrandparentGuid(String grandparentGuid) { + Utils.checkNotNull(grandparentGuid, "grandparentGuid"); + this.grandparentGuid = Optional.ofNullable(grandparentGuid); + return this; + } + + public GetSearchAllLibrariesMetadata withGrandparentGuid(Optional grandparentGuid) { + Utils.checkNotNull(grandparentGuid, "grandparentGuid"); + this.grandparentGuid = grandparentGuid; + return this; + } + + public GetSearchAllLibrariesMetadata withGrandparentKey(String grandparentKey) { + Utils.checkNotNull(grandparentKey, "grandparentKey"); + this.grandparentKey = Optional.ofNullable(grandparentKey); + return this; + } + + public GetSearchAllLibrariesMetadata withGrandparentKey(Optional grandparentKey) { + Utils.checkNotNull(grandparentKey, "grandparentKey"); + this.grandparentKey = grandparentKey; + return this; + } + + public GetSearchAllLibrariesMetadata withGrandparentTitle(String grandparentTitle) { + Utils.checkNotNull(grandparentTitle, "grandparentTitle"); + this.grandparentTitle = Optional.ofNullable(grandparentTitle); + return this; + } + + public GetSearchAllLibrariesMetadata withGrandparentTitle(Optional grandparentTitle) { + Utils.checkNotNull(grandparentTitle, "grandparentTitle"); + this.grandparentTitle = grandparentTitle; + return this; + } + + public GetSearchAllLibrariesMetadata withGrandparentThumb(String grandparentThumb) { + Utils.checkNotNull(grandparentThumb, "grandparentThumb"); + this.grandparentThumb = Optional.ofNullable(grandparentThumb); + return this; + } + + public GetSearchAllLibrariesMetadata withGrandparentThumb(Optional grandparentThumb) { + Utils.checkNotNull(grandparentThumb, "grandparentThumb"); + this.grandparentThumb = grandparentThumb; + return this; + } + + public GetSearchAllLibrariesMetadata withParentSlug(String parentSlug) { + Utils.checkNotNull(parentSlug, "parentSlug"); + this.parentSlug = Optional.ofNullable(parentSlug); + return this; + } + + public GetSearchAllLibrariesMetadata withParentSlug(Optional parentSlug) { + Utils.checkNotNull(parentSlug, "parentSlug"); + this.parentSlug = parentSlug; + return this; + } + + public GetSearchAllLibrariesMetadata withGrandparentSlug(String grandparentSlug) { + Utils.checkNotNull(grandparentSlug, "grandparentSlug"); + this.grandparentSlug = Optional.ofNullable(grandparentSlug); + return this; + } + + public GetSearchAllLibrariesMetadata withGrandparentSlug(Optional grandparentSlug) { + Utils.checkNotNull(grandparentSlug, "grandparentSlug"); + this.grandparentSlug = grandparentSlug; + return this; + } + + public GetSearchAllLibrariesMetadata withGrandparentArt(String grandparentArt) { + Utils.checkNotNull(grandparentArt, "grandparentArt"); + this.grandparentArt = Optional.ofNullable(grandparentArt); + return this; + } + + public GetSearchAllLibrariesMetadata withGrandparentArt(Optional grandparentArt) { + Utils.checkNotNull(grandparentArt, "grandparentArt"); + this.grandparentArt = grandparentArt; + return this; + } + + public GetSearchAllLibrariesMetadata withGrandparentTheme(String grandparentTheme) { + Utils.checkNotNull(grandparentTheme, "grandparentTheme"); + this.grandparentTheme = Optional.ofNullable(grandparentTheme); + return this; + } + + public GetSearchAllLibrariesMetadata withGrandparentTheme(Optional grandparentTheme) { + Utils.checkNotNull(grandparentTheme, "grandparentTheme"); + this.grandparentTheme = grandparentTheme; + return this; + } + + /** + * The Media object is only included when type query is `4` or higher. + * + */ + public GetSearchAllLibrariesMetadata withMedia(List media) { + Utils.checkNotNull(media, "media"); + this.media = Optional.ofNullable(media); + return this; + } + + /** + * The Media object is only included when type query is `4` or higher. + * + */ + public GetSearchAllLibrariesMetadata withMedia(Optional> media) { + Utils.checkNotNull(media, "media"); + this.media = media; + return this; + } + + public GetSearchAllLibrariesMetadata withGenre(List genre) { + Utils.checkNotNull(genre, "genre"); + this.genre = Optional.ofNullable(genre); + return this; + } + + public GetSearchAllLibrariesMetadata withGenre(Optional> genre) { + Utils.checkNotNull(genre, "genre"); + this.genre = genre; + return this; + } + + public GetSearchAllLibrariesMetadata withCountry(List country) { + Utils.checkNotNull(country, "country"); + this.country = Optional.ofNullable(country); + return this; + } + + public GetSearchAllLibrariesMetadata withCountry(Optional> country) { + Utils.checkNotNull(country, "country"); + this.country = country; + return this; + } + + public GetSearchAllLibrariesMetadata withDirector(List director) { + Utils.checkNotNull(director, "director"); + this.director = Optional.ofNullable(director); + return this; + } + + public GetSearchAllLibrariesMetadata withDirector(Optional> director) { + Utils.checkNotNull(director, "director"); + this.director = director; + return this; + } + + public GetSearchAllLibrariesMetadata withWriter(List writer) { + Utils.checkNotNull(writer, "writer"); + this.writer = Optional.ofNullable(writer); + return this; + } + + public GetSearchAllLibrariesMetadata withWriter(Optional> writer) { + Utils.checkNotNull(writer, "writer"); + this.writer = writer; + return this; + } + + public GetSearchAllLibrariesMetadata withCollection(List collection) { + Utils.checkNotNull(collection, "collection"); + this.collection = Optional.ofNullable(collection); + return this; + } + + public GetSearchAllLibrariesMetadata withCollection(Optional> collection) { + Utils.checkNotNull(collection, "collection"); + this.collection = collection; + return this; + } + + public GetSearchAllLibrariesMetadata withRole(List role) { + Utils.checkNotNull(role, "role"); + this.role = Optional.ofNullable(role); + return this; + } + + public GetSearchAllLibrariesMetadata withRole(Optional> role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + public GetSearchAllLibrariesMetadata withLocation(List location) { + Utils.checkNotNull(location, "location"); + this.location = Optional.ofNullable(location); + return this; + } + + public GetSearchAllLibrariesMetadata withLocation(Optional> location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + + /** + * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + * + */ + public GetSearchAllLibrariesMetadata withMediaGuid(List mediaGuid) { + Utils.checkNotNull(mediaGuid, "mediaGuid"); + this.mediaGuid = Optional.ofNullable(mediaGuid); + return this; + } + + /** + * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + * + */ + public GetSearchAllLibrariesMetadata withMediaGuid(Optional> mediaGuid) { + Utils.checkNotNull(mediaGuid, "mediaGuid"); + this.mediaGuid = mediaGuid; + return this; + } + + public GetSearchAllLibrariesMetadata withUltraBlurColors(GetSearchAllLibrariesUltraBlurColors ultraBlurColors) { + Utils.checkNotNull(ultraBlurColors, "ultraBlurColors"); + this.ultraBlurColors = Optional.ofNullable(ultraBlurColors); + return this; + } + + public GetSearchAllLibrariesMetadata withUltraBlurColors(Optional ultraBlurColors) { + Utils.checkNotNull(ultraBlurColors, "ultraBlurColors"); + this.ultraBlurColors = ultraBlurColors; + return this; + } + + public GetSearchAllLibrariesMetadata withMetaDataRating(List metaDataRating) { + Utils.checkNotNull(metaDataRating, "metaDataRating"); + this.metaDataRating = Optional.ofNullable(metaDataRating); + return this; + } + + public GetSearchAllLibrariesMetadata withMetaDataRating(Optional> metaDataRating) { + Utils.checkNotNull(metaDataRating, "metaDataRating"); + this.metaDataRating = metaDataRating; + return this; + } + + public GetSearchAllLibrariesMetadata withImage(List image) { + Utils.checkNotNull(image, "image"); + this.image = Optional.ofNullable(image); + return this; + } + + public GetSearchAllLibrariesMetadata withImage(Optional> image) { + Utils.checkNotNull(image, "image"); + this.image = image; + return this; + } + + public GetSearchAllLibrariesMetadata withTitleSort(String titleSort) { + Utils.checkNotNull(titleSort, "titleSort"); + this.titleSort = Optional.ofNullable(titleSort); + return this; + } + + public GetSearchAllLibrariesMetadata withTitleSort(Optional titleSort) { + Utils.checkNotNull(titleSort, "titleSort"); + this.titleSort = titleSort; + return this; + } + + public GetSearchAllLibrariesMetadata withViewCount(int viewCount) { + Utils.checkNotNull(viewCount, "viewCount"); + this.viewCount = Optional.ofNullable(viewCount); + return this; + } + + public GetSearchAllLibrariesMetadata withViewCount(Optional viewCount) { + Utils.checkNotNull(viewCount, "viewCount"); + this.viewCount = viewCount; + return this; + } + + public GetSearchAllLibrariesMetadata withLastViewedAt(int lastViewedAt) { + Utils.checkNotNull(lastViewedAt, "lastViewedAt"); + this.lastViewedAt = Optional.ofNullable(lastViewedAt); + return this; + } + + public GetSearchAllLibrariesMetadata withLastViewedAt(Optional lastViewedAt) { + Utils.checkNotNull(lastViewedAt, "lastViewedAt"); + this.lastViewedAt = lastViewedAt; + return this; + } + + public GetSearchAllLibrariesMetadata withOriginalTitle(String originalTitle) { + Utils.checkNotNull(originalTitle, "originalTitle"); + this.originalTitle = Optional.ofNullable(originalTitle); + return this; + } + + public GetSearchAllLibrariesMetadata withOriginalTitle(Optional originalTitle) { + Utils.checkNotNull(originalTitle, "originalTitle"); + this.originalTitle = originalTitle; + return this; + } + + public GetSearchAllLibrariesMetadata withViewOffset(int viewOffset) { + Utils.checkNotNull(viewOffset, "viewOffset"); + this.viewOffset = Optional.ofNullable(viewOffset); + return this; + } + + public GetSearchAllLibrariesMetadata withViewOffset(Optional viewOffset) { + Utils.checkNotNull(viewOffset, "viewOffset"); + this.viewOffset = viewOffset; + return this; + } + + public GetSearchAllLibrariesMetadata withSkipCount(int skipCount) { + Utils.checkNotNull(skipCount, "skipCount"); + this.skipCount = Optional.ofNullable(skipCount); + return this; + } + + public GetSearchAllLibrariesMetadata withSkipCount(Optional skipCount) { + Utils.checkNotNull(skipCount, "skipCount"); + this.skipCount = skipCount; + return this; + } + + public GetSearchAllLibrariesMetadata withIndex(int index) { + Utils.checkNotNull(index, "index"); + this.index = Optional.ofNullable(index); + return this; + } + + public GetSearchAllLibrariesMetadata withIndex(Optional index) { + Utils.checkNotNull(index, "index"); + this.index = index; + return this; + } + + public GetSearchAllLibrariesMetadata withTheme(String theme) { + Utils.checkNotNull(theme, "theme"); + this.theme = Optional.ofNullable(theme); + return this; + } + + public GetSearchAllLibrariesMetadata withTheme(Optional theme) { + Utils.checkNotNull(theme, "theme"); + this.theme = theme; + return this; + } + + public GetSearchAllLibrariesMetadata withLeafCount(int leafCount) { + Utils.checkNotNull(leafCount, "leafCount"); + this.leafCount = Optional.ofNullable(leafCount); + return this; + } + + public GetSearchAllLibrariesMetadata withLeafCount(Optional leafCount) { + Utils.checkNotNull(leafCount, "leafCount"); + this.leafCount = leafCount; + return this; + } + + public GetSearchAllLibrariesMetadata withViewedLeafCount(int viewedLeafCount) { + Utils.checkNotNull(viewedLeafCount, "viewedLeafCount"); + this.viewedLeafCount = Optional.ofNullable(viewedLeafCount); + return this; + } + + public GetSearchAllLibrariesMetadata withViewedLeafCount(Optional viewedLeafCount) { + Utils.checkNotNull(viewedLeafCount, "viewedLeafCount"); + this.viewedLeafCount = viewedLeafCount; + return this; + } + + public GetSearchAllLibrariesMetadata withChildCount(int childCount) { + Utils.checkNotNull(childCount, "childCount"); + this.childCount = Optional.ofNullable(childCount); + return this; + } + + public GetSearchAllLibrariesMetadata withChildCount(Optional childCount) { + Utils.checkNotNull(childCount, "childCount"); + this.childCount = childCount; + return this; + } + + public GetSearchAllLibrariesMetadata withHasPremiumExtras(String hasPremiumExtras) { + Utils.checkNotNull(hasPremiumExtras, "hasPremiumExtras"); + this.hasPremiumExtras = Optional.ofNullable(hasPremiumExtras); + return this; + } + + public GetSearchAllLibrariesMetadata withHasPremiumExtras(Optional hasPremiumExtras) { + Utils.checkNotNull(hasPremiumExtras, "hasPremiumExtras"); + this.hasPremiumExtras = hasPremiumExtras; + return this; + } + + public GetSearchAllLibrariesMetadata withHasPremiumPrimaryExtra(String hasPremiumPrimaryExtra) { + Utils.checkNotNull(hasPremiumPrimaryExtra, "hasPremiumPrimaryExtra"); + this.hasPremiumPrimaryExtra = Optional.ofNullable(hasPremiumPrimaryExtra); + return this; + } + + public GetSearchAllLibrariesMetadata withHasPremiumPrimaryExtra(Optional hasPremiumPrimaryExtra) { + Utils.checkNotNull(hasPremiumPrimaryExtra, "hasPremiumPrimaryExtra"); + this.hasPremiumPrimaryExtra = hasPremiumPrimaryExtra; + return this; + } + + /** + * The rating key of the parent item. + * + */ + public GetSearchAllLibrariesMetadata withParentRatingKey(String parentRatingKey) { + Utils.checkNotNull(parentRatingKey, "parentRatingKey"); + this.parentRatingKey = Optional.ofNullable(parentRatingKey); + return this; + } + + /** + * The rating key of the parent item. + * + */ + public GetSearchAllLibrariesMetadata withParentRatingKey(Optional parentRatingKey) { + Utils.checkNotNull(parentRatingKey, "parentRatingKey"); + this.parentRatingKey = parentRatingKey; + return this; + } + + public GetSearchAllLibrariesMetadata withParentGuid(String parentGuid) { + Utils.checkNotNull(parentGuid, "parentGuid"); + this.parentGuid = Optional.ofNullable(parentGuid); + return this; + } + + public GetSearchAllLibrariesMetadata withParentGuid(Optional parentGuid) { + Utils.checkNotNull(parentGuid, "parentGuid"); + this.parentGuid = parentGuid; + return this; + } + + public GetSearchAllLibrariesMetadata withParentStudio(String parentStudio) { + Utils.checkNotNull(parentStudio, "parentStudio"); + this.parentStudio = Optional.ofNullable(parentStudio); + return this; + } + + public GetSearchAllLibrariesMetadata withParentStudio(Optional parentStudio) { + Utils.checkNotNull(parentStudio, "parentStudio"); + this.parentStudio = parentStudio; + return this; + } + + public GetSearchAllLibrariesMetadata withParentKey(String parentKey) { + Utils.checkNotNull(parentKey, "parentKey"); + this.parentKey = Optional.ofNullable(parentKey); + return this; + } + + public GetSearchAllLibrariesMetadata withParentKey(Optional parentKey) { + Utils.checkNotNull(parentKey, "parentKey"); + this.parentKey = parentKey; + return this; + } + + public GetSearchAllLibrariesMetadata withParentTitle(String parentTitle) { + Utils.checkNotNull(parentTitle, "parentTitle"); + this.parentTitle = Optional.ofNullable(parentTitle); + return this; + } + + public GetSearchAllLibrariesMetadata withParentTitle(Optional parentTitle) { + Utils.checkNotNull(parentTitle, "parentTitle"); + this.parentTitle = parentTitle; + return this; + } + + public GetSearchAllLibrariesMetadata withParentIndex(int parentIndex) { + Utils.checkNotNull(parentIndex, "parentIndex"); + this.parentIndex = Optional.ofNullable(parentIndex); + return this; + } + + public GetSearchAllLibrariesMetadata withParentIndex(Optional parentIndex) { + Utils.checkNotNull(parentIndex, "parentIndex"); + this.parentIndex = parentIndex; + return this; + } + + public GetSearchAllLibrariesMetadata withParentYear(int parentYear) { + Utils.checkNotNull(parentYear, "parentYear"); + this.parentYear = Optional.ofNullable(parentYear); + return this; + } + + public GetSearchAllLibrariesMetadata withParentYear(Optional parentYear) { + Utils.checkNotNull(parentYear, "parentYear"); + this.parentYear = parentYear; + return this; + } + + public GetSearchAllLibrariesMetadata withParentThumb(String parentThumb) { + Utils.checkNotNull(parentThumb, "parentThumb"); + this.parentThumb = Optional.ofNullable(parentThumb); + return this; + } + + public GetSearchAllLibrariesMetadata withParentThumb(Optional parentThumb) { + Utils.checkNotNull(parentThumb, "parentThumb"); + this.parentThumb = parentThumb; + return this; + } + + public GetSearchAllLibrariesMetadata withParentTheme(String parentTheme) { + Utils.checkNotNull(parentTheme, "parentTheme"); + this.parentTheme = Optional.ofNullable(parentTheme); + return this; + } + + public GetSearchAllLibrariesMetadata withParentTheme(Optional parentTheme) { + Utils.checkNotNull(parentTheme, "parentTheme"); + this.parentTheme = parentTheme; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesMetadata other = (GetSearchAllLibrariesMetadata) o; + return + Objects.deepEquals(this.ratingKey, other.ratingKey) && + Objects.deepEquals(this.key, other.key) && + Objects.deepEquals(this.guid, other.guid) && + Objects.deepEquals(this.studio, other.studio) && + Objects.deepEquals(this.skipChildren, other.skipChildren) && + Objects.deepEquals(this.librarySectionID, other.librarySectionID) && + Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Objects.deepEquals(this.librarySectionKey, other.librarySectionKey) && + Objects.deepEquals(this.type, other.type) && + Objects.deepEquals(this.title, other.title) && + Objects.deepEquals(this.slug, other.slug) && + Objects.deepEquals(this.contentRating, other.contentRating) && + Objects.deepEquals(this.summary, other.summary) && + Objects.deepEquals(this.rating, other.rating) && + Objects.deepEquals(this.audienceRating, other.audienceRating) && + Objects.deepEquals(this.year, other.year) && + Objects.deepEquals(this.seasonCount, other.seasonCount) && + Objects.deepEquals(this.tagline, other.tagline) && + Objects.deepEquals(this.flattenSeasons, other.flattenSeasons) && + Objects.deepEquals(this.showOrdering, other.showOrdering) && + Objects.deepEquals(this.thumb, other.thumb) && + Objects.deepEquals(this.art, other.art) && + Objects.deepEquals(this.banner, other.banner) && + Objects.deepEquals(this.duration, other.duration) && + Objects.deepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && + Objects.deepEquals(this.addedAt, other.addedAt) && + Objects.deepEquals(this.updatedAt, other.updatedAt) && + Objects.deepEquals(this.audienceRatingImage, other.audienceRatingImage) && + Objects.deepEquals(this.chapterSource, other.chapterSource) && + Objects.deepEquals(this.primaryExtraKey, other.primaryExtraKey) && + Objects.deepEquals(this.ratingImage, other.ratingImage) && + Objects.deepEquals(this.grandparentRatingKey, other.grandparentRatingKey) && + Objects.deepEquals(this.grandparentGuid, other.grandparentGuid) && + Objects.deepEquals(this.grandparentKey, other.grandparentKey) && + Objects.deepEquals(this.grandparentTitle, other.grandparentTitle) && + Objects.deepEquals(this.grandparentThumb, other.grandparentThumb) && + Objects.deepEquals(this.parentSlug, other.parentSlug) && + Objects.deepEquals(this.grandparentSlug, other.grandparentSlug) && + Objects.deepEquals(this.grandparentArt, other.grandparentArt) && + Objects.deepEquals(this.grandparentTheme, other.grandparentTheme) && + Objects.deepEquals(this.media, other.media) && + Objects.deepEquals(this.genre, other.genre) && + Objects.deepEquals(this.country, other.country) && + Objects.deepEquals(this.director, other.director) && + Objects.deepEquals(this.writer, other.writer) && + Objects.deepEquals(this.collection, other.collection) && + Objects.deepEquals(this.role, other.role) && + Objects.deepEquals(this.location, other.location) && + Objects.deepEquals(this.mediaGuid, other.mediaGuid) && + Objects.deepEquals(this.ultraBlurColors, other.ultraBlurColors) && + Objects.deepEquals(this.metaDataRating, other.metaDataRating) && + Objects.deepEquals(this.image, other.image) && + Objects.deepEquals(this.titleSort, other.titleSort) && + Objects.deepEquals(this.viewCount, other.viewCount) && + Objects.deepEquals(this.lastViewedAt, other.lastViewedAt) && + Objects.deepEquals(this.originalTitle, other.originalTitle) && + Objects.deepEquals(this.viewOffset, other.viewOffset) && + Objects.deepEquals(this.skipCount, other.skipCount) && + Objects.deepEquals(this.index, other.index) && + Objects.deepEquals(this.theme, other.theme) && + Objects.deepEquals(this.leafCount, other.leafCount) && + Objects.deepEquals(this.viewedLeafCount, other.viewedLeafCount) && + Objects.deepEquals(this.childCount, other.childCount) && + Objects.deepEquals(this.hasPremiumExtras, other.hasPremiumExtras) && + Objects.deepEquals(this.hasPremiumPrimaryExtra, other.hasPremiumPrimaryExtra) && + Objects.deepEquals(this.parentRatingKey, other.parentRatingKey) && + Objects.deepEquals(this.parentGuid, other.parentGuid) && + Objects.deepEquals(this.parentStudio, other.parentStudio) && + Objects.deepEquals(this.parentKey, other.parentKey) && + Objects.deepEquals(this.parentTitle, other.parentTitle) && + Objects.deepEquals(this.parentIndex, other.parentIndex) && + Objects.deepEquals(this.parentYear, other.parentYear) && + Objects.deepEquals(this.parentThumb, other.parentThumb) && + Objects.deepEquals(this.parentTheme, other.parentTheme); + } + + @Override + public int hashCode() { + return Objects.hash( + ratingKey, + key, + guid, + studio, + skipChildren, + librarySectionID, + librarySectionTitle, + librarySectionKey, + type, + title, + slug, + contentRating, + summary, + rating, + audienceRating, + year, + seasonCount, + tagline, + flattenSeasons, + showOrdering, + thumb, + art, + banner, + duration, + originallyAvailableAt, + addedAt, + updatedAt, + audienceRatingImage, + chapterSource, + primaryExtraKey, + ratingImage, + grandparentRatingKey, + grandparentGuid, + grandparentKey, + grandparentTitle, + grandparentThumb, + parentSlug, + grandparentSlug, + grandparentArt, + grandparentTheme, + media, + genre, + country, + director, + writer, + collection, + role, + location, + mediaGuid, + ultraBlurColors, + metaDataRating, + image, + titleSort, + viewCount, + lastViewedAt, + originalTitle, + viewOffset, + skipCount, + index, + theme, + leafCount, + viewedLeafCount, + childCount, + hasPremiumExtras, + hasPremiumPrimaryExtra, + parentRatingKey, + parentGuid, + parentStudio, + parentKey, + parentTitle, + parentIndex, + parentYear, + parentThumb, + parentTheme); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesMetadata.class, + "ratingKey", ratingKey, + "key", key, + "guid", guid, + "studio", studio, + "skipChildren", skipChildren, + "librarySectionID", librarySectionID, + "librarySectionTitle", librarySectionTitle, + "librarySectionKey", librarySectionKey, + "type", type, + "title", title, + "slug", slug, + "contentRating", contentRating, + "summary", summary, + "rating", rating, + "audienceRating", audienceRating, + "year", year, + "seasonCount", seasonCount, + "tagline", tagline, + "flattenSeasons", flattenSeasons, + "showOrdering", showOrdering, + "thumb", thumb, + "art", art, + "banner", banner, + "duration", duration, + "originallyAvailableAt", originallyAvailableAt, + "addedAt", addedAt, + "updatedAt", updatedAt, + "audienceRatingImage", audienceRatingImage, + "chapterSource", chapterSource, + "primaryExtraKey", primaryExtraKey, + "ratingImage", ratingImage, + "grandparentRatingKey", grandparentRatingKey, + "grandparentGuid", grandparentGuid, + "grandparentKey", grandparentKey, + "grandparentTitle", grandparentTitle, + "grandparentThumb", grandparentThumb, + "parentSlug", parentSlug, + "grandparentSlug", grandparentSlug, + "grandparentArt", grandparentArt, + "grandparentTheme", grandparentTheme, + "media", media, + "genre", genre, + "country", country, + "director", director, + "writer", writer, + "collection", collection, + "role", role, + "location", location, + "mediaGuid", mediaGuid, + "ultraBlurColors", ultraBlurColors, + "metaDataRating", metaDataRating, + "image", image, + "titleSort", titleSort, + "viewCount", viewCount, + "lastViewedAt", lastViewedAt, + "originalTitle", originalTitle, + "viewOffset", viewOffset, + "skipCount", skipCount, + "index", index, + "theme", theme, + "leafCount", leafCount, + "viewedLeafCount", viewedLeafCount, + "childCount", childCount, + "hasPremiumExtras", hasPremiumExtras, + "hasPremiumPrimaryExtra", hasPremiumPrimaryExtra, + "parentRatingKey", parentRatingKey, + "parentGuid", parentGuid, + "parentStudio", parentStudio, + "parentKey", parentKey, + "parentTitle", parentTitle, + "parentIndex", parentIndex, + "parentYear", parentYear, + "parentThumb", parentThumb, + "parentTheme", parentTheme); + } + + public final static class Builder { + + private String ratingKey; + + private String key; + + private String guid; + + private Optional studio = Optional.empty(); + + private Optional skipChildren = Optional.empty(); + + private Optional librarySectionID = Optional.empty(); + + private Optional librarySectionTitle = Optional.empty(); + + private Optional librarySectionKey = Optional.empty(); + + private GetSearchAllLibrariesType type; + + private String title; + + private Optional slug = Optional.empty(); + + private Optional contentRating = Optional.empty(); + + private String summary; + + private Optional rating = Optional.empty(); + + private Optional audienceRating = Optional.empty(); + + private Optional year = Optional.empty(); + + private Optional seasonCount = Optional.empty(); + + private Optional tagline = Optional.empty(); + + private Optional flattenSeasons; + + private Optional showOrdering = Optional.empty(); + + private Optional thumb = Optional.empty(); + + private Optional art = Optional.empty(); + + private Optional banner = Optional.empty(); + + private Optional duration = Optional.empty(); + + private Optional originallyAvailableAt = Optional.empty(); + + private Long addedAt; + + private Optional updatedAt = Optional.empty(); + + private Optional audienceRatingImage = Optional.empty(); + + private Optional chapterSource = Optional.empty(); + + private Optional primaryExtraKey = Optional.empty(); + + private Optional ratingImage = Optional.empty(); + + private Optional grandparentRatingKey = Optional.empty(); + + private Optional grandparentGuid = Optional.empty(); + + private Optional grandparentKey = Optional.empty(); + + private Optional grandparentTitle = Optional.empty(); + + private Optional grandparentThumb = Optional.empty(); + + private Optional parentSlug = Optional.empty(); + + private Optional grandparentSlug = Optional.empty(); + + private Optional grandparentArt = Optional.empty(); + + private Optional grandparentTheme = Optional.empty(); + + private Optional> media = Optional.empty(); + + private Optional> genre = Optional.empty(); + + private Optional> country = Optional.empty(); + + private Optional> director = Optional.empty(); + + private Optional> writer = Optional.empty(); + + private Optional> collection = Optional.empty(); + + private Optional> role = Optional.empty(); + + private Optional> location = Optional.empty(); + + private Optional> mediaGuid = Optional.empty(); + + private Optional ultraBlurColors = Optional.empty(); + + private Optional> metaDataRating = Optional.empty(); + + private Optional> image = Optional.empty(); + + private Optional titleSort = Optional.empty(); + + private Optional viewCount = Optional.empty(); + + private Optional lastViewedAt = Optional.empty(); + + private Optional originalTitle = Optional.empty(); + + private Optional viewOffset = Optional.empty(); + + private Optional skipCount = Optional.empty(); + + private Optional index = Optional.empty(); + + private Optional theme = Optional.empty(); + + private Optional leafCount = Optional.empty(); + + private Optional viewedLeafCount = Optional.empty(); + + private Optional childCount = Optional.empty(); + + private Optional hasPremiumExtras = Optional.empty(); + + private Optional hasPremiumPrimaryExtra = Optional.empty(); + + private Optional parentRatingKey = Optional.empty(); + + private Optional parentGuid = Optional.empty(); + + private Optional parentStudio = Optional.empty(); + + private Optional parentKey = Optional.empty(); + + private Optional parentTitle = Optional.empty(); + + private Optional parentIndex = Optional.empty(); + + private Optional parentYear = Optional.empty(); + + private Optional parentThumb = Optional.empty(); + + private Optional parentTheme = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The rating key (Media ID) of this media item. + * Note: This is always an integer, but is represented as a string in the API. + * + */ + public Builder ratingKey(String ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = ratingKey; + return this; + } + + public Builder key(String key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public Builder guid(String guid) { + Utils.checkNotNull(guid, "guid"); + this.guid = guid; + return this; + } + + public Builder studio(String studio) { + Utils.checkNotNull(studio, "studio"); + this.studio = Optional.ofNullable(studio); + return this; + } + + public Builder studio(Optional studio) { + Utils.checkNotNull(studio, "studio"); + this.studio = studio; + return this; + } + + public Builder skipChildren(boolean skipChildren) { + Utils.checkNotNull(skipChildren, "skipChildren"); + this.skipChildren = Optional.ofNullable(skipChildren); + return this; + } + + public Builder skipChildren(Optional skipChildren) { + Utils.checkNotNull(skipChildren, "skipChildren"); + this.skipChildren = skipChildren; + return this; + } + + public Builder librarySectionID(long librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = Optional.ofNullable(librarySectionID); + return this; + } + + public Builder librarySectionID(Optional librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = librarySectionID; + return this; + } + + public Builder librarySectionTitle(String librarySectionTitle) { + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); + return this; + } + + public Builder librarySectionTitle(Optional librarySectionTitle) { + Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); + this.librarySectionTitle = librarySectionTitle; + return this; + } + + public Builder librarySectionKey(String librarySectionKey) { + Utils.checkNotNull(librarySectionKey, "librarySectionKey"); + this.librarySectionKey = Optional.ofNullable(librarySectionKey); + return this; + } + + public Builder librarySectionKey(Optional librarySectionKey) { + Utils.checkNotNull(librarySectionKey, "librarySectionKey"); + this.librarySectionKey = librarySectionKey; + return this; + } + + /** + * The type of media content + * + */ + public Builder type(GetSearchAllLibrariesType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public Builder title(String title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public Builder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = Optional.ofNullable(slug); + return this; + } + + public Builder slug(Optional slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public Builder contentRating(String contentRating) { + Utils.checkNotNull(contentRating, "contentRating"); + this.contentRating = Optional.ofNullable(contentRating); + return this; + } + + public Builder contentRating(Optional contentRating) { + Utils.checkNotNull(contentRating, "contentRating"); + this.contentRating = contentRating; + return this; + } + + public Builder summary(String summary) { + Utils.checkNotNull(summary, "summary"); + this.summary = summary; + return this; + } + + public Builder rating(double rating) { + Utils.checkNotNull(rating, "rating"); + this.rating = Optional.ofNullable(rating); + return this; + } + + public Builder rating(Optional rating) { + Utils.checkNotNull(rating, "rating"); + this.rating = rating; + return this; + } + + public Builder audienceRating(double audienceRating) { + Utils.checkNotNull(audienceRating, "audienceRating"); + this.audienceRating = Optional.ofNullable(audienceRating); + return this; + } + + public Builder audienceRating(Optional audienceRating) { + Utils.checkNotNull(audienceRating, "audienceRating"); + this.audienceRating = audienceRating; + return this; + } + + public Builder year(int year) { + Utils.checkNotNull(year, "year"); + this.year = Optional.ofNullable(year); + return this; + } + + public Builder year(Optional year) { + Utils.checkNotNull(year, "year"); + this.year = year; + return this; + } + + public Builder seasonCount(int seasonCount) { + Utils.checkNotNull(seasonCount, "seasonCount"); + this.seasonCount = Optional.ofNullable(seasonCount); + return this; + } + + public Builder seasonCount(Optional seasonCount) { + Utils.checkNotNull(seasonCount, "seasonCount"); + this.seasonCount = seasonCount; + return this; + } + + public Builder tagline(String tagline) { + Utils.checkNotNull(tagline, "tagline"); + this.tagline = Optional.ofNullable(tagline); + return this; + } + + public Builder tagline(Optional tagline) { + Utils.checkNotNull(tagline, "tagline"); + this.tagline = tagline; + return this; + } + + public Builder flattenSeasons(GetSearchAllLibrariesFlattenSeasons flattenSeasons) { + Utils.checkNotNull(flattenSeasons, "flattenSeasons"); + this.flattenSeasons = Optional.ofNullable(flattenSeasons); + return this; + } + + public Builder flattenSeasons(Optional flattenSeasons) { + Utils.checkNotNull(flattenSeasons, "flattenSeasons"); + this.flattenSeasons = flattenSeasons; + return this; + } + + /** + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * aired = TheTVDB (Aired), + * dvd = TheTVDB (DVD), + * absolute = TheTVDB (Absolute)). + * + */ + public Builder showOrdering(GetSearchAllLibrariesShowOrdering showOrdering) { + Utils.checkNotNull(showOrdering, "showOrdering"); + this.showOrdering = Optional.ofNullable(showOrdering); + return this; + } + + /** + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * aired = TheTVDB (Aired), + * dvd = TheTVDB (DVD), + * absolute = TheTVDB (Absolute)). + * + */ + public Builder showOrdering(Optional showOrdering) { + Utils.checkNotNull(showOrdering, "showOrdering"); + this.showOrdering = showOrdering; + return this; + } + + public Builder thumb(String thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = Optional.ofNullable(thumb); + return this; + } + + public Builder thumb(Optional thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = thumb; + return this; + } + + public Builder art(String art) { + Utils.checkNotNull(art, "art"); + this.art = Optional.ofNullable(art); + return this; + } + + public Builder art(Optional art) { + Utils.checkNotNull(art, "art"); + this.art = art; + return this; + } + + public Builder banner(String banner) { + Utils.checkNotNull(banner, "banner"); + this.banner = Optional.ofNullable(banner); + return this; + } + + public Builder banner(Optional banner) { + Utils.checkNotNull(banner, "banner"); + this.banner = banner; + return this; + } + + public Builder duration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public Builder duration(Optional duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = duration; + return this; + } + + public Builder originallyAvailableAt(LocalDate originallyAvailableAt) { + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt); + return this; + } + + public Builder originallyAvailableAt(Optional originallyAvailableAt) { + Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); + this.originallyAvailableAt = originallyAvailableAt; + return this; + } + + /** + * Unix epoch datetime in seconds + */ + public Builder addedAt(long addedAt) { + Utils.checkNotNull(addedAt, "addedAt"); + this.addedAt = addedAt; + return this; + } + + /** + * Unix epoch datetime in seconds + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + * Unix epoch datetime in seconds + */ + public Builder updatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public Builder audienceRatingImage(String audienceRatingImage) { + Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); + this.audienceRatingImage = Optional.ofNullable(audienceRatingImage); + return this; + } + + public Builder audienceRatingImage(Optional audienceRatingImage) { + Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); + this.audienceRatingImage = audienceRatingImage; + return this; + } + + public Builder chapterSource(String chapterSource) { + Utils.checkNotNull(chapterSource, "chapterSource"); + this.chapterSource = Optional.ofNullable(chapterSource); + return this; + } + + public Builder chapterSource(Optional chapterSource) { + Utils.checkNotNull(chapterSource, "chapterSource"); + this.chapterSource = chapterSource; + return this; + } + + public Builder primaryExtraKey(String primaryExtraKey) { + Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); + this.primaryExtraKey = Optional.ofNullable(primaryExtraKey); + return this; + } + + public Builder primaryExtraKey(Optional primaryExtraKey) { + Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); + this.primaryExtraKey = primaryExtraKey; + return this; + } + + public Builder ratingImage(String ratingImage) { + Utils.checkNotNull(ratingImage, "ratingImage"); + this.ratingImage = Optional.ofNullable(ratingImage); + return this; + } + + public Builder ratingImage(Optional ratingImage) { + Utils.checkNotNull(ratingImage, "ratingImage"); + this.ratingImage = ratingImage; + return this; + } + + public Builder grandparentRatingKey(String grandparentRatingKey) { + Utils.checkNotNull(grandparentRatingKey, "grandparentRatingKey"); + this.grandparentRatingKey = Optional.ofNullable(grandparentRatingKey); + return this; + } + + public Builder grandparentRatingKey(Optional grandparentRatingKey) { + Utils.checkNotNull(grandparentRatingKey, "grandparentRatingKey"); + this.grandparentRatingKey = grandparentRatingKey; + return this; + } + + public Builder grandparentGuid(String grandparentGuid) { + Utils.checkNotNull(grandparentGuid, "grandparentGuid"); + this.grandparentGuid = Optional.ofNullable(grandparentGuid); + return this; + } + + public Builder grandparentGuid(Optional grandparentGuid) { + Utils.checkNotNull(grandparentGuid, "grandparentGuid"); + this.grandparentGuid = grandparentGuid; + return this; + } + + public Builder grandparentKey(String grandparentKey) { + Utils.checkNotNull(grandparentKey, "grandparentKey"); + this.grandparentKey = Optional.ofNullable(grandparentKey); + return this; + } + + public Builder grandparentKey(Optional grandparentKey) { + Utils.checkNotNull(grandparentKey, "grandparentKey"); + this.grandparentKey = grandparentKey; + return this; + } + + public Builder grandparentTitle(String grandparentTitle) { + Utils.checkNotNull(grandparentTitle, "grandparentTitle"); + this.grandparentTitle = Optional.ofNullable(grandparentTitle); + return this; + } + + public Builder grandparentTitle(Optional grandparentTitle) { + Utils.checkNotNull(grandparentTitle, "grandparentTitle"); + this.grandparentTitle = grandparentTitle; + return this; + } + + public Builder grandparentThumb(String grandparentThumb) { + Utils.checkNotNull(grandparentThumb, "grandparentThumb"); + this.grandparentThumb = Optional.ofNullable(grandparentThumb); + return this; + } + + public Builder grandparentThumb(Optional grandparentThumb) { + Utils.checkNotNull(grandparentThumb, "grandparentThumb"); + this.grandparentThumb = grandparentThumb; + return this; + } + + public Builder parentSlug(String parentSlug) { + Utils.checkNotNull(parentSlug, "parentSlug"); + this.parentSlug = Optional.ofNullable(parentSlug); + return this; + } + + public Builder parentSlug(Optional parentSlug) { + Utils.checkNotNull(parentSlug, "parentSlug"); + this.parentSlug = parentSlug; + return this; + } + + public Builder grandparentSlug(String grandparentSlug) { + Utils.checkNotNull(grandparentSlug, "grandparentSlug"); + this.grandparentSlug = Optional.ofNullable(grandparentSlug); + return this; + } + + public Builder grandparentSlug(Optional grandparentSlug) { + Utils.checkNotNull(grandparentSlug, "grandparentSlug"); + this.grandparentSlug = grandparentSlug; + return this; + } + + public Builder grandparentArt(String grandparentArt) { + Utils.checkNotNull(grandparentArt, "grandparentArt"); + this.grandparentArt = Optional.ofNullable(grandparentArt); + return this; + } + + public Builder grandparentArt(Optional grandparentArt) { + Utils.checkNotNull(grandparentArt, "grandparentArt"); + this.grandparentArt = grandparentArt; + return this; + } + + public Builder grandparentTheme(String grandparentTheme) { + Utils.checkNotNull(grandparentTheme, "grandparentTheme"); + this.grandparentTheme = Optional.ofNullable(grandparentTheme); + return this; + } + + public Builder grandparentTheme(Optional grandparentTheme) { + Utils.checkNotNull(grandparentTheme, "grandparentTheme"); + this.grandparentTheme = grandparentTheme; + return this; + } + + /** + * The Media object is only included when type query is `4` or higher. + * + */ + public Builder media(List media) { + Utils.checkNotNull(media, "media"); + this.media = Optional.ofNullable(media); + return this; + } + + /** + * The Media object is only included when type query is `4` or higher. + * + */ + public Builder media(Optional> media) { + Utils.checkNotNull(media, "media"); + this.media = media; + return this; + } + + public Builder genre(List genre) { + Utils.checkNotNull(genre, "genre"); + this.genre = Optional.ofNullable(genre); + return this; + } + + public Builder genre(Optional> genre) { + Utils.checkNotNull(genre, "genre"); + this.genre = genre; + return this; + } + + public Builder country(List country) { + Utils.checkNotNull(country, "country"); + this.country = Optional.ofNullable(country); + return this; + } + + public Builder country(Optional> country) { + Utils.checkNotNull(country, "country"); + this.country = country; + return this; + } + + public Builder director(List director) { + Utils.checkNotNull(director, "director"); + this.director = Optional.ofNullable(director); + return this; + } + + public Builder director(Optional> director) { + Utils.checkNotNull(director, "director"); + this.director = director; + return this; + } + + public Builder writer(List writer) { + Utils.checkNotNull(writer, "writer"); + this.writer = Optional.ofNullable(writer); + return this; + } + + public Builder writer(Optional> writer) { + Utils.checkNotNull(writer, "writer"); + this.writer = writer; + return this; + } + + public Builder collection(List collection) { + Utils.checkNotNull(collection, "collection"); + this.collection = Optional.ofNullable(collection); + return this; + } + + public Builder collection(Optional> collection) { + Utils.checkNotNull(collection, "collection"); + this.collection = collection; + return this; + } + + public Builder role(List role) { + Utils.checkNotNull(role, "role"); + this.role = Optional.ofNullable(role); + return this; + } + + public Builder role(Optional> role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + public Builder location(List location) { + Utils.checkNotNull(location, "location"); + this.location = Optional.ofNullable(location); + return this; + } + + public Builder location(Optional> location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + + /** + * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + * + */ + public Builder mediaGuid(List mediaGuid) { + Utils.checkNotNull(mediaGuid, "mediaGuid"); + this.mediaGuid = Optional.ofNullable(mediaGuid); + return this; + } + + /** + * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + * + */ + public Builder mediaGuid(Optional> mediaGuid) { + Utils.checkNotNull(mediaGuid, "mediaGuid"); + this.mediaGuid = mediaGuid; + return this; + } + + public Builder ultraBlurColors(GetSearchAllLibrariesUltraBlurColors ultraBlurColors) { + Utils.checkNotNull(ultraBlurColors, "ultraBlurColors"); + this.ultraBlurColors = Optional.ofNullable(ultraBlurColors); + return this; + } + + public Builder ultraBlurColors(Optional ultraBlurColors) { + Utils.checkNotNull(ultraBlurColors, "ultraBlurColors"); + this.ultraBlurColors = ultraBlurColors; + return this; + } + + public Builder metaDataRating(List metaDataRating) { + Utils.checkNotNull(metaDataRating, "metaDataRating"); + this.metaDataRating = Optional.ofNullable(metaDataRating); + return this; + } + + public Builder metaDataRating(Optional> metaDataRating) { + Utils.checkNotNull(metaDataRating, "metaDataRating"); + this.metaDataRating = metaDataRating; + return this; + } + + public Builder image(List image) { + Utils.checkNotNull(image, "image"); + this.image = Optional.ofNullable(image); + return this; + } + + public Builder image(Optional> image) { + Utils.checkNotNull(image, "image"); + this.image = image; + return this; + } + + public Builder titleSort(String titleSort) { + Utils.checkNotNull(titleSort, "titleSort"); + this.titleSort = Optional.ofNullable(titleSort); + return this; + } + + public Builder titleSort(Optional titleSort) { + Utils.checkNotNull(titleSort, "titleSort"); + this.titleSort = titleSort; + return this; + } + + public Builder viewCount(int viewCount) { + Utils.checkNotNull(viewCount, "viewCount"); + this.viewCount = Optional.ofNullable(viewCount); + return this; + } + + public Builder viewCount(Optional viewCount) { + Utils.checkNotNull(viewCount, "viewCount"); + this.viewCount = viewCount; + return this; + } + + public Builder lastViewedAt(int lastViewedAt) { + Utils.checkNotNull(lastViewedAt, "lastViewedAt"); + this.lastViewedAt = Optional.ofNullable(lastViewedAt); + return this; + } + + public Builder lastViewedAt(Optional lastViewedAt) { + Utils.checkNotNull(lastViewedAt, "lastViewedAt"); + this.lastViewedAt = lastViewedAt; + return this; + } + + public Builder originalTitle(String originalTitle) { + Utils.checkNotNull(originalTitle, "originalTitle"); + this.originalTitle = Optional.ofNullable(originalTitle); + return this; + } + + public Builder originalTitle(Optional originalTitle) { + Utils.checkNotNull(originalTitle, "originalTitle"); + this.originalTitle = originalTitle; + return this; + } + + public Builder viewOffset(int viewOffset) { + Utils.checkNotNull(viewOffset, "viewOffset"); + this.viewOffset = Optional.ofNullable(viewOffset); + return this; + } + + public Builder viewOffset(Optional viewOffset) { + Utils.checkNotNull(viewOffset, "viewOffset"); + this.viewOffset = viewOffset; + return this; + } + + public Builder skipCount(int skipCount) { + Utils.checkNotNull(skipCount, "skipCount"); + this.skipCount = Optional.ofNullable(skipCount); + return this; + } + + public Builder skipCount(Optional skipCount) { + Utils.checkNotNull(skipCount, "skipCount"); + this.skipCount = skipCount; + return this; + } + + public Builder index(int index) { + Utils.checkNotNull(index, "index"); + this.index = Optional.ofNullable(index); + return this; + } + + public Builder index(Optional index) { + Utils.checkNotNull(index, "index"); + this.index = index; + return this; + } + + public Builder theme(String theme) { + Utils.checkNotNull(theme, "theme"); + this.theme = Optional.ofNullable(theme); + return this; + } + + public Builder theme(Optional theme) { + Utils.checkNotNull(theme, "theme"); + this.theme = theme; + return this; + } + + public Builder leafCount(int leafCount) { + Utils.checkNotNull(leafCount, "leafCount"); + this.leafCount = Optional.ofNullable(leafCount); + return this; + } + + public Builder leafCount(Optional leafCount) { + Utils.checkNotNull(leafCount, "leafCount"); + this.leafCount = leafCount; + return this; + } + + public Builder viewedLeafCount(int viewedLeafCount) { + Utils.checkNotNull(viewedLeafCount, "viewedLeafCount"); + this.viewedLeafCount = Optional.ofNullable(viewedLeafCount); + return this; + } + + public Builder viewedLeafCount(Optional viewedLeafCount) { + Utils.checkNotNull(viewedLeafCount, "viewedLeafCount"); + this.viewedLeafCount = viewedLeafCount; + return this; + } + + public Builder childCount(int childCount) { + Utils.checkNotNull(childCount, "childCount"); + this.childCount = Optional.ofNullable(childCount); + return this; + } + + public Builder childCount(Optional childCount) { + Utils.checkNotNull(childCount, "childCount"); + this.childCount = childCount; + return this; + } + + public Builder hasPremiumExtras(String hasPremiumExtras) { + Utils.checkNotNull(hasPremiumExtras, "hasPremiumExtras"); + this.hasPremiumExtras = Optional.ofNullable(hasPremiumExtras); + return this; + } + + public Builder hasPremiumExtras(Optional hasPremiumExtras) { + Utils.checkNotNull(hasPremiumExtras, "hasPremiumExtras"); + this.hasPremiumExtras = hasPremiumExtras; + return this; + } + + public Builder hasPremiumPrimaryExtra(String hasPremiumPrimaryExtra) { + Utils.checkNotNull(hasPremiumPrimaryExtra, "hasPremiumPrimaryExtra"); + this.hasPremiumPrimaryExtra = Optional.ofNullable(hasPremiumPrimaryExtra); + return this; + } + + public Builder hasPremiumPrimaryExtra(Optional hasPremiumPrimaryExtra) { + Utils.checkNotNull(hasPremiumPrimaryExtra, "hasPremiumPrimaryExtra"); + this.hasPremiumPrimaryExtra = hasPremiumPrimaryExtra; + return this; + } + + /** + * The rating key of the parent item. + * + */ + public Builder parentRatingKey(String parentRatingKey) { + Utils.checkNotNull(parentRatingKey, "parentRatingKey"); + this.parentRatingKey = Optional.ofNullable(parentRatingKey); + return this; + } + + /** + * The rating key of the parent item. + * + */ + public Builder parentRatingKey(Optional parentRatingKey) { + Utils.checkNotNull(parentRatingKey, "parentRatingKey"); + this.parentRatingKey = parentRatingKey; + return this; + } + + public Builder parentGuid(String parentGuid) { + Utils.checkNotNull(parentGuid, "parentGuid"); + this.parentGuid = Optional.ofNullable(parentGuid); + return this; + } + + public Builder parentGuid(Optional parentGuid) { + Utils.checkNotNull(parentGuid, "parentGuid"); + this.parentGuid = parentGuid; + return this; + } + + public Builder parentStudio(String parentStudio) { + Utils.checkNotNull(parentStudio, "parentStudio"); + this.parentStudio = Optional.ofNullable(parentStudio); + return this; + } + + public Builder parentStudio(Optional parentStudio) { + Utils.checkNotNull(parentStudio, "parentStudio"); + this.parentStudio = parentStudio; + return this; + } + + public Builder parentKey(String parentKey) { + Utils.checkNotNull(parentKey, "parentKey"); + this.parentKey = Optional.ofNullable(parentKey); + return this; + } + + public Builder parentKey(Optional parentKey) { + Utils.checkNotNull(parentKey, "parentKey"); + this.parentKey = parentKey; + return this; + } + + public Builder parentTitle(String parentTitle) { + Utils.checkNotNull(parentTitle, "parentTitle"); + this.parentTitle = Optional.ofNullable(parentTitle); + return this; + } + + public Builder parentTitle(Optional parentTitle) { + Utils.checkNotNull(parentTitle, "parentTitle"); + this.parentTitle = parentTitle; + return this; + } + + public Builder parentIndex(int parentIndex) { + Utils.checkNotNull(parentIndex, "parentIndex"); + this.parentIndex = Optional.ofNullable(parentIndex); + return this; + } + + public Builder parentIndex(Optional parentIndex) { + Utils.checkNotNull(parentIndex, "parentIndex"); + this.parentIndex = parentIndex; + return this; + } + + public Builder parentYear(int parentYear) { + Utils.checkNotNull(parentYear, "parentYear"); + this.parentYear = Optional.ofNullable(parentYear); + return this; + } + + public Builder parentYear(Optional parentYear) { + Utils.checkNotNull(parentYear, "parentYear"); + this.parentYear = parentYear; + return this; + } + + public Builder parentThumb(String parentThumb) { + Utils.checkNotNull(parentThumb, "parentThumb"); + this.parentThumb = Optional.ofNullable(parentThumb); + return this; + } + + public Builder parentThumb(Optional parentThumb) { + Utils.checkNotNull(parentThumb, "parentThumb"); + this.parentThumb = parentThumb; + return this; + } + + public Builder parentTheme(String parentTheme) { + Utils.checkNotNull(parentTheme, "parentTheme"); + this.parentTheme = Optional.ofNullable(parentTheme); + return this; + } + + public Builder parentTheme(Optional parentTheme) { + Utils.checkNotNull(parentTheme, "parentTheme"); + this.parentTheme = parentTheme; + return this; + } + + public GetSearchAllLibrariesMetadata build() { + if (flattenSeasons == null) { + flattenSeasons = _SINGLETON_VALUE_FlattenSeasons.value(); + } return new GetSearchAllLibrariesMetadata( + ratingKey, + key, + guid, + studio, + skipChildren, + librarySectionID, + librarySectionTitle, + librarySectionKey, + type, + title, + slug, + contentRating, + summary, + rating, + audienceRating, + year, + seasonCount, + tagline, + flattenSeasons, + showOrdering, + thumb, + art, + banner, + duration, + originallyAvailableAt, + addedAt, + updatedAt, + audienceRatingImage, + chapterSource, + primaryExtraKey, + ratingImage, + grandparentRatingKey, + grandparentGuid, + grandparentKey, + grandparentTitle, + grandparentThumb, + parentSlug, + grandparentSlug, + grandparentArt, + grandparentTheme, + media, + genre, + country, + director, + writer, + collection, + role, + location, + mediaGuid, + ultraBlurColors, + metaDataRating, + image, + titleSort, + viewCount, + lastViewedAt, + originalTitle, + viewOffset, + skipCount, + index, + theme, + leafCount, + viewedLeafCount, + childCount, + hasPremiumExtras, + hasPremiumPrimaryExtra, + parentRatingKey, + parentGuid, + parentStudio, + parentKey, + parentTitle, + parentIndex, + parentYear, + parentThumb, + parentTheme); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_FlattenSeasons = + new LazySingletonValue<>( + "flattenSeasons", + "\"0\"", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreaming.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreaming.java new file mode 100644 index 00000000..6ee0724e --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreaming.java @@ -0,0 +1,23 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum GetSearchAllLibrariesOptimizedForStreaming { + Disable(0), + Enable(1); + + @JsonValue + private final int value; + + private GetSearchAllLibrariesOptimizedForStreaming(int value) { + this.value = value; + } + + public int value() { + return value; + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesPart.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesPart.java new file mode 100644 index 00000000..b1e8b3e6 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesPart.java @@ -0,0 +1,586 @@ +/* + * 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 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 GetSearchAllLibrariesPart { + + @JsonProperty("id") + private int id; + + @JsonProperty("key") + private String key; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("duration") + private Optional duration; + + @JsonProperty("file") + private String file; + + @JsonProperty("size") + private long size; + + /** + * The container format of the media file. + * + */ + @JsonProperty("container") + private String container; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("audioProfile") + private Optional audioProfile; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("has64bitOffsets") + private Optional has64bitOffsets; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("optimizedForStreaming") + private Optional optimizedForStreaming; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("videoProfile") + private Optional videoProfile; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("indexes") + private Optional indexes; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("hasThumbnail") + private Optional hasThumbnail; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Stream") + private Optional> stream; + + @JsonCreator + public GetSearchAllLibrariesPart( + @JsonProperty("id") int id, + @JsonProperty("key") String key, + @JsonProperty("duration") Optional duration, + @JsonProperty("file") String file, + @JsonProperty("size") long size, + @JsonProperty("container") String container, + @JsonProperty("audioProfile") Optional audioProfile, + @JsonProperty("has64bitOffsets") Optional has64bitOffsets, + @JsonProperty("optimizedForStreaming") Optional optimizedForStreaming, + @JsonProperty("videoProfile") Optional videoProfile, + @JsonProperty("indexes") Optional indexes, + @JsonProperty("hasThumbnail") Optional hasThumbnail, + @JsonProperty("Stream") Optional> stream) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(key, "key"); + Utils.checkNotNull(duration, "duration"); + Utils.checkNotNull(file, "file"); + Utils.checkNotNull(size, "size"); + Utils.checkNotNull(container, "container"); + Utils.checkNotNull(audioProfile, "audioProfile"); + Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); + Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); + Utils.checkNotNull(videoProfile, "videoProfile"); + Utils.checkNotNull(indexes, "indexes"); + Utils.checkNotNull(hasThumbnail, "hasThumbnail"); + Utils.checkNotNull(stream, "stream"); + this.id = id; + this.key = key; + this.duration = duration; + this.file = file; + this.size = size; + this.container = container; + this.audioProfile = audioProfile; + this.has64bitOffsets = has64bitOffsets; + this.optimizedForStreaming = optimizedForStreaming; + this.videoProfile = videoProfile; + this.indexes = indexes; + this.hasThumbnail = hasThumbnail; + this.stream = stream; + } + + public GetSearchAllLibrariesPart( + int id, + String key, + String file, + long size, + String container) { + this(id, key, Optional.empty(), file, size, container, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @JsonIgnore + public int id() { + return id; + } + + @JsonIgnore + public String key() { + return key; + } + + @JsonIgnore + public Optional duration() { + return duration; + } + + @JsonIgnore + public String file() { + return file; + } + + @JsonIgnore + public long size() { + return size; + } + + /** + * The container format of the media file. + * + */ + @JsonIgnore + public String container() { + return container; + } + + @JsonIgnore + public Optional audioProfile() { + return audioProfile; + } + + @JsonIgnore + public Optional has64bitOffsets() { + return has64bitOffsets; + } + + @JsonIgnore + public Optional optimizedForStreaming() { + return optimizedForStreaming; + } + + @JsonIgnore + public Optional videoProfile() { + return videoProfile; + } + + @JsonIgnore + public Optional indexes() { + return indexes; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hasThumbnail() { + return (Optional) hasThumbnail; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> stream() { + return (Optional>) stream; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchAllLibrariesPart withId(int id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public GetSearchAllLibrariesPart withKey(String key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public GetSearchAllLibrariesPart withDuration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public GetSearchAllLibrariesPart withDuration(Optional duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = duration; + return this; + } + + public GetSearchAllLibrariesPart withFile(String file) { + Utils.checkNotNull(file, "file"); + this.file = file; + return this; + } + + public GetSearchAllLibrariesPart withSize(long size) { + Utils.checkNotNull(size, "size"); + this.size = size; + return this; + } + + /** + * The container format of the media file. + * + */ + public GetSearchAllLibrariesPart withContainer(String container) { + Utils.checkNotNull(container, "container"); + this.container = container; + return this; + } + + public GetSearchAllLibrariesPart withAudioProfile(String audioProfile) { + Utils.checkNotNull(audioProfile, "audioProfile"); + this.audioProfile = Optional.ofNullable(audioProfile); + return this; + } + + public GetSearchAllLibrariesPart withAudioProfile(Optional audioProfile) { + Utils.checkNotNull(audioProfile, "audioProfile"); + this.audioProfile = audioProfile; + return this; + } + + public GetSearchAllLibrariesPart withHas64bitOffsets(boolean has64bitOffsets) { + Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); + this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); + return this; + } + + public GetSearchAllLibrariesPart withHas64bitOffsets(Optional has64bitOffsets) { + Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); + this.has64bitOffsets = has64bitOffsets; + return this; + } + + public GetSearchAllLibrariesPart withOptimizedForStreaming(boolean optimizedForStreaming) { + Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); + this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming); + return this; + } + + public GetSearchAllLibrariesPart withOptimizedForStreaming(Optional optimizedForStreaming) { + Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); + this.optimizedForStreaming = optimizedForStreaming; + return this; + } + + public GetSearchAllLibrariesPart withVideoProfile(String videoProfile) { + Utils.checkNotNull(videoProfile, "videoProfile"); + this.videoProfile = Optional.ofNullable(videoProfile); + return this; + } + + public GetSearchAllLibrariesPart withVideoProfile(Optional videoProfile) { + Utils.checkNotNull(videoProfile, "videoProfile"); + this.videoProfile = videoProfile; + return this; + } + + public GetSearchAllLibrariesPart withIndexes(String indexes) { + Utils.checkNotNull(indexes, "indexes"); + this.indexes = Optional.ofNullable(indexes); + return this; + } + + public GetSearchAllLibrariesPart withIndexes(Optional indexes) { + Utils.checkNotNull(indexes, "indexes"); + this.indexes = indexes; + return this; + } + + public GetSearchAllLibrariesPart withHasThumbnail(GetSearchAllLibrariesHasThumbnail hasThumbnail) { + Utils.checkNotNull(hasThumbnail, "hasThumbnail"); + this.hasThumbnail = Optional.ofNullable(hasThumbnail); + return this; + } + + public GetSearchAllLibrariesPart withHasThumbnail(Optional hasThumbnail) { + Utils.checkNotNull(hasThumbnail, "hasThumbnail"); + this.hasThumbnail = hasThumbnail; + return this; + } + + public GetSearchAllLibrariesPart withStream(List stream) { + Utils.checkNotNull(stream, "stream"); + this.stream = Optional.ofNullable(stream); + return this; + } + + public GetSearchAllLibrariesPart withStream(Optional> stream) { + Utils.checkNotNull(stream, "stream"); + this.stream = stream; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesPart other = (GetSearchAllLibrariesPart) o; + return + Objects.deepEquals(this.id, other.id) && + Objects.deepEquals(this.key, other.key) && + Objects.deepEquals(this.duration, other.duration) && + Objects.deepEquals(this.file, other.file) && + Objects.deepEquals(this.size, other.size) && + Objects.deepEquals(this.container, other.container) && + Objects.deepEquals(this.audioProfile, other.audioProfile) && + Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Objects.deepEquals(this.videoProfile, other.videoProfile) && + Objects.deepEquals(this.indexes, other.indexes) && + Objects.deepEquals(this.hasThumbnail, other.hasThumbnail) && + Objects.deepEquals(this.stream, other.stream); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + key, + duration, + file, + size, + container, + audioProfile, + has64bitOffsets, + optimizedForStreaming, + videoProfile, + indexes, + hasThumbnail, + stream); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesPart.class, + "id", id, + "key", key, + "duration", duration, + "file", file, + "size", size, + "container", container, + "audioProfile", audioProfile, + "has64bitOffsets", has64bitOffsets, + "optimizedForStreaming", optimizedForStreaming, + "videoProfile", videoProfile, + "indexes", indexes, + "hasThumbnail", hasThumbnail, + "stream", stream); + } + + public final static class Builder { + + private Integer id; + + private String key; + + private Optional duration = Optional.empty(); + + private String file; + + private Long size; + + private String container; + + private Optional audioProfile = Optional.empty(); + + private Optional has64bitOffsets = Optional.empty(); + + private Optional optimizedForStreaming = Optional.empty(); + + private Optional videoProfile = Optional.empty(); + + private Optional indexes = Optional.empty(); + + private Optional hasThumbnail; + + private Optional> stream = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder id(int id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder key(String key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public Builder duration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public Builder duration(Optional duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = duration; + return this; + } + + public Builder file(String file) { + Utils.checkNotNull(file, "file"); + this.file = file; + return this; + } + + public Builder size(long size) { + Utils.checkNotNull(size, "size"); + this.size = size; + return this; + } + + /** + * The container format of the media file. + * + */ + public Builder container(String container) { + Utils.checkNotNull(container, "container"); + this.container = container; + return this; + } + + public Builder audioProfile(String audioProfile) { + Utils.checkNotNull(audioProfile, "audioProfile"); + this.audioProfile = Optional.ofNullable(audioProfile); + return this; + } + + public Builder audioProfile(Optional audioProfile) { + Utils.checkNotNull(audioProfile, "audioProfile"); + this.audioProfile = audioProfile; + return this; + } + + public Builder has64bitOffsets(boolean has64bitOffsets) { + Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); + this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); + return this; + } + + public Builder has64bitOffsets(Optional has64bitOffsets) { + Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); + this.has64bitOffsets = has64bitOffsets; + return this; + } + + public Builder optimizedForStreaming(boolean optimizedForStreaming) { + Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); + this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming); + return this; + } + + public Builder optimizedForStreaming(Optional optimizedForStreaming) { + Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); + this.optimizedForStreaming = optimizedForStreaming; + return this; + } + + public Builder videoProfile(String videoProfile) { + Utils.checkNotNull(videoProfile, "videoProfile"); + this.videoProfile = Optional.ofNullable(videoProfile); + return this; + } + + public Builder videoProfile(Optional videoProfile) { + Utils.checkNotNull(videoProfile, "videoProfile"); + this.videoProfile = videoProfile; + return this; + } + + public Builder indexes(String indexes) { + Utils.checkNotNull(indexes, "indexes"); + this.indexes = Optional.ofNullable(indexes); + return this; + } + + public Builder indexes(Optional indexes) { + Utils.checkNotNull(indexes, "indexes"); + this.indexes = indexes; + return this; + } + + public Builder hasThumbnail(GetSearchAllLibrariesHasThumbnail hasThumbnail) { + Utils.checkNotNull(hasThumbnail, "hasThumbnail"); + this.hasThumbnail = Optional.ofNullable(hasThumbnail); + return this; + } + + public Builder hasThumbnail(Optional hasThumbnail) { + Utils.checkNotNull(hasThumbnail, "hasThumbnail"); + this.hasThumbnail = hasThumbnail; + return this; + } + + public Builder stream(List stream) { + Utils.checkNotNull(stream, "stream"); + this.stream = Optional.ofNullable(stream); + return this; + } + + public Builder stream(Optional> stream) { + Utils.checkNotNull(stream, "stream"); + this.stream = stream; + return this; + } + + public GetSearchAllLibrariesPart build() { + if (hasThumbnail == null) { + hasThumbnail = _SINGLETON_VALUE_HasThumbnail.value(); + } return new GetSearchAllLibrariesPart( + id, + key, + duration, + file, + size, + container, + audioProfile, + has64bitOffsets, + optimizedForStreaming, + videoProfile, + indexes, + hasThumbnail, + stream); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_HasThumbnail = + new LazySingletonValue<>( + "hasThumbnail", + "\"0\"", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequest.java new file mode 100644 index 00000000..da012cf4 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequest.java @@ -0,0 +1,433 @@ +/* + * 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.core.type.TypeReference; +import dev.plexapi.sdk.utils.LazySingletonValue; +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.lang.SuppressWarnings; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + + +public class GetSearchAllLibrariesRequest { + + /** + * The search query term. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private String query; + + /** + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier") + private Optional clientID; + + /** + * Limit the number of results returned. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") + private Optional limit; + + /** + * A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=false,name=searchTypes") + private Optional> searchTypes; + + /** + * Whether to include collections in the search results. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeCollections") + private Optional includeCollections; + + /** + * Whether to include external media in the search results. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeExternalMedia") + private Optional includeExternalMedia; + + @JsonCreator + public GetSearchAllLibrariesRequest( + String query, + Optional clientID, + Optional limit, + Optional> searchTypes, + Optional includeCollections, + Optional includeExternalMedia) { + Utils.checkNotNull(query, "query"); + Utils.checkNotNull(clientID, "clientID"); + Utils.checkNotNull(limit, "limit"); + Utils.checkNotNull(searchTypes, "searchTypes"); + Utils.checkNotNull(includeCollections, "includeCollections"); + Utils.checkNotNull(includeExternalMedia, "includeExternalMedia"); + this.query = query; + this.clientID = clientID; + this.limit = limit; + this.searchTypes = searchTypes; + this.includeCollections = includeCollections; + this.includeExternalMedia = includeExternalMedia; + } + + public GetSearchAllLibrariesRequest( + String query) { + this(query, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * The search query term. + */ + @JsonIgnore + public String query() { + return query; + } + + /** + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) + */ + @JsonIgnore + public Optional clientID() { + return clientID; + } + + /** + * Limit the number of results returned. + */ + @JsonIgnore + public Optional limit() { + return limit; + } + + /** + * A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> searchTypes() { + return (Optional>) searchTypes; + } + + /** + * Whether to include collections in the search results. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional includeCollections() { + return (Optional) includeCollections; + } + + /** + * Whether to include external media in the search results. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional includeExternalMedia() { + return (Optional) includeExternalMedia; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The search query term. + */ + public GetSearchAllLibrariesRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + /** + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) + */ + public GetSearchAllLibrariesRequest withClientID(String clientID) { + Utils.checkNotNull(clientID, "clientID"); + this.clientID = Optional.ofNullable(clientID); + return this; + } + + /** + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) + */ + public GetSearchAllLibrariesRequest withClientID(Optional clientID) { + Utils.checkNotNull(clientID, "clientID"); + this.clientID = clientID; + return this; + } + + /** + * Limit the number of results returned. + */ + public GetSearchAllLibrariesRequest withLimit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Limit the number of results returned. + */ + public GetSearchAllLibrariesRequest withLimit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. + * + */ + public GetSearchAllLibrariesRequest withSearchTypes(List searchTypes) { + Utils.checkNotNull(searchTypes, "searchTypes"); + this.searchTypes = Optional.ofNullable(searchTypes); + return this; + } + + /** + * A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. + * + */ + public GetSearchAllLibrariesRequest withSearchTypes(Optional> searchTypes) { + Utils.checkNotNull(searchTypes, "searchTypes"); + this.searchTypes = searchTypes; + return this; + } + + /** + * Whether to include collections in the search results. + */ + public GetSearchAllLibrariesRequest withIncludeCollections(QueryParamIncludeCollections includeCollections) { + Utils.checkNotNull(includeCollections, "includeCollections"); + this.includeCollections = Optional.ofNullable(includeCollections); + return this; + } + + /** + * Whether to include collections in the search results. + */ + public GetSearchAllLibrariesRequest withIncludeCollections(Optional includeCollections) { + Utils.checkNotNull(includeCollections, "includeCollections"); + this.includeCollections = includeCollections; + return this; + } + + /** + * Whether to include external media in the search results. + */ + public GetSearchAllLibrariesRequest withIncludeExternalMedia(QueryParamIncludeExternalMedia includeExternalMedia) { + Utils.checkNotNull(includeExternalMedia, "includeExternalMedia"); + this.includeExternalMedia = Optional.ofNullable(includeExternalMedia); + return this; + } + + /** + * Whether to include external media in the search results. + */ + public GetSearchAllLibrariesRequest withIncludeExternalMedia(Optional includeExternalMedia) { + Utils.checkNotNull(includeExternalMedia, "includeExternalMedia"); + this.includeExternalMedia = includeExternalMedia; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesRequest other = (GetSearchAllLibrariesRequest) o; + return + Objects.deepEquals(this.query, other.query) && + Objects.deepEquals(this.clientID, other.clientID) && + Objects.deepEquals(this.limit, other.limit) && + Objects.deepEquals(this.searchTypes, other.searchTypes) && + Objects.deepEquals(this.includeCollections, other.includeCollections) && + Objects.deepEquals(this.includeExternalMedia, other.includeExternalMedia); + } + + @Override + public int hashCode() { + return Objects.hash( + query, + clientID, + limit, + searchTypes, + includeCollections, + includeExternalMedia); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesRequest.class, + "query", query, + "clientID", clientID, + "limit", limit, + "searchTypes", searchTypes, + "includeCollections", includeCollections, + "includeExternalMedia", includeExternalMedia); + } + + public final static class Builder { + + private String query; + + private Optional clientID = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional> searchTypes = Optional.empty(); + + private Optional includeCollections; + + private Optional includeExternalMedia; + + private Builder() { + // force use of static builder() method + } + + /** + * The search query term. + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + /** + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) + */ + public Builder clientID(String clientID) { + Utils.checkNotNull(clientID, "clientID"); + this.clientID = Optional.ofNullable(clientID); + return this; + } + + /** + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) + */ + public Builder clientID(Optional clientID) { + Utils.checkNotNull(clientID, "clientID"); + this.clientID = clientID; + return this; + } + + /** + * Limit the number of results returned. + */ + public Builder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Limit the number of results returned. + */ + public Builder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. + * + */ + public Builder searchTypes(List searchTypes) { + Utils.checkNotNull(searchTypes, "searchTypes"); + this.searchTypes = Optional.ofNullable(searchTypes); + return this; + } + + /** + * A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. + * + */ + public Builder searchTypes(Optional> searchTypes) { + Utils.checkNotNull(searchTypes, "searchTypes"); + this.searchTypes = searchTypes; + return this; + } + + /** + * Whether to include collections in the search results. + */ + public Builder includeCollections(QueryParamIncludeCollections includeCollections) { + Utils.checkNotNull(includeCollections, "includeCollections"); + this.includeCollections = Optional.ofNullable(includeCollections); + return this; + } + + /** + * Whether to include collections in the search results. + */ + public Builder includeCollections(Optional includeCollections) { + Utils.checkNotNull(includeCollections, "includeCollections"); + this.includeCollections = includeCollections; + return this; + } + + /** + * Whether to include external media in the search results. + */ + public Builder includeExternalMedia(QueryParamIncludeExternalMedia includeExternalMedia) { + Utils.checkNotNull(includeExternalMedia, "includeExternalMedia"); + this.includeExternalMedia = Optional.ofNullable(includeExternalMedia); + return this; + } + + /** + * Whether to include external media in the search results. + */ + public Builder includeExternalMedia(Optional includeExternalMedia) { + Utils.checkNotNull(includeExternalMedia, "includeExternalMedia"); + this.includeExternalMedia = includeExternalMedia; + return this; + } + + public GetSearchAllLibrariesRequest build() { + if (includeCollections == null) { + includeCollections = _SINGLETON_VALUE_IncludeCollections.value(); + } + if (includeExternalMedia == null) { + includeExternalMedia = _SINGLETON_VALUE_IncludeExternalMedia.value(); + } return new GetSearchAllLibrariesRequest( + query, + clientID, + limit, + searchTypes, + includeCollections, + includeExternalMedia); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_IncludeCollections = + new LazySingletonValue<>( + "includeCollections", + "0", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_IncludeExternalMedia = + new LazySingletonValue<>( + "includeExternalMedia", + "0", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequestBuilder.java new file mode 100644 index 00000000..4f0f935f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.operations; + +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; + +public class GetSearchAllLibrariesRequestBuilder { + + private GetSearchAllLibrariesRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKMethodInterfaces.MethodCallGetSearchAllLibraries sdk; + + public GetSearchAllLibrariesRequestBuilder(SDKMethodInterfaces.MethodCallGetSearchAllLibraries sdk) { + this.sdk = sdk; + } + + public GetSearchAllLibrariesRequestBuilder request(GetSearchAllLibrariesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetSearchAllLibrariesRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetSearchAllLibrariesRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public GetSearchAllLibrariesResponse call() throws Exception { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getSearchAllLibraries( + request, + options); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesResponse.java new file mode 100644 index 00000000..1843bd1a --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesResponse.java @@ -0,0 +1,251 @@ +/* + * 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 GetSearchAllLibrariesResponse 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 rawResponse; + + /** + * The libraries available on the Server + */ + private Optional object; + + @JsonCreator + public GetSearchAllLibrariesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional 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 GetSearchAllLibrariesResponse( + String contentType, + int statusCode, + HttpResponse 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 rawResponse() { + return rawResponse; + } + + /** + * The libraries available on the Server + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetSearchAllLibrariesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetSearchAllLibrariesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchAllLibrariesResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The libraries available on the Server + */ + public GetSearchAllLibrariesResponse withObject(GetSearchAllLibrariesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The libraries available on the Server + */ + public GetSearchAllLibrariesResponse withObject(Optional 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; + } + GetSearchAllLibrariesResponse other = (GetSearchAllLibrariesResponse) 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(GetSearchAllLibrariesResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional 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 rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The libraries available on the Server + */ + public Builder object(GetSearchAllLibrariesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The libraries available on the Server + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetSearchAllLibrariesResponse build() { + return new GetSearchAllLibrariesResponse( + contentType, + statusCode, + rawResponse, + object); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesResponseBody.java new file mode 100644 index 00000000..648aed71 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesResponseBody.java @@ -0,0 +1,92 @@ +/* + * 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.Override; +import java.lang.String; +import java.util.Objects; + +/** + * GetSearchAllLibrariesResponseBody - The libraries available on the Server + */ + +public class GetSearchAllLibrariesResponseBody { + + @JsonProperty("MediaContainer") + private GetSearchAllLibrariesMediaContainer mediaContainer; + + @JsonCreator + public GetSearchAllLibrariesResponseBody( + @JsonProperty("MediaContainer") GetSearchAllLibrariesMediaContainer mediaContainer) { + Utils.checkNotNull(mediaContainer, "mediaContainer"); + this.mediaContainer = mediaContainer; + } + + @JsonIgnore + public GetSearchAllLibrariesMediaContainer mediaContainer() { + return mediaContainer; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchAllLibrariesResponseBody withMediaContainer(GetSearchAllLibrariesMediaContainer 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; + } + GetSearchAllLibrariesResponseBody other = (GetSearchAllLibrariesResponseBody) o; + return + Objects.deepEquals(this.mediaContainer, other.mediaContainer); + } + + @Override + public int hashCode() { + return Objects.hash( + mediaContainer); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesResponseBody.class, + "mediaContainer", mediaContainer); + } + + public final static class Builder { + + private GetSearchAllLibrariesMediaContainer mediaContainer; + + private Builder() { + // force use of static builder() method + } + + public Builder mediaContainer(GetSearchAllLibrariesMediaContainer mediaContainer) { + Utils.checkNotNull(mediaContainer, "mediaContainer"); + this.mediaContainer = mediaContainer; + return this; + } + + public GetSearchAllLibrariesResponseBody build() { + return new GetSearchAllLibrariesResponseBody( + mediaContainer); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRole.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRole.java new file mode 100644 index 00000000..8874473f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRole.java @@ -0,0 +1,428 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Long; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; + + +public class GetSearchAllLibrariesRole { + + /** + * The ID of the tag or actor. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * The filter used to find the actor or tag. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("filter") + private Optional filter; + + /** + * The thumbnail of the actor + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("thumb") + private Optional thumb; + + /** + * The name of the tag or actor. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tag") + private Optional tag; + + /** + * Unique identifier for the tag. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tagKey") + private Optional tagKey; + + /** + * The role of the actor or tag in the media. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("role") + private Optional role; + + @JsonCreator + public GetSearchAllLibrariesRole( + @JsonProperty("id") Optional id, + @JsonProperty("filter") Optional filter, + @JsonProperty("thumb") Optional thumb, + @JsonProperty("tag") Optional tag, + @JsonProperty("tagKey") Optional tagKey, + @JsonProperty("role") Optional role) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(filter, "filter"); + Utils.checkNotNull(thumb, "thumb"); + Utils.checkNotNull(tag, "tag"); + Utils.checkNotNull(tagKey, "tagKey"); + Utils.checkNotNull(role, "role"); + this.id = id; + this.filter = filter; + this.thumb = thumb; + this.tag = tag; + this.tagKey = tagKey; + this.role = role; + } + + public GetSearchAllLibrariesRole() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * The ID of the tag or actor. + */ + @JsonIgnore + public Optional id() { + return id; + } + + /** + * The filter used to find the actor or tag. + */ + @JsonIgnore + public Optional filter() { + return filter; + } + + /** + * The thumbnail of the actor + */ + @JsonIgnore + public Optional thumb() { + return thumb; + } + + /** + * The name of the tag or actor. + */ + @JsonIgnore + public Optional tag() { + return tag; + } + + /** + * Unique identifier for the tag. + */ + @JsonIgnore + public Optional tagKey() { + return tagKey; + } + + /** + * The role of the actor or tag in the media. + */ + @JsonIgnore + public Optional role() { + return role; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the tag or actor. + */ + public GetSearchAllLibrariesRole withId(long id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * The ID of the tag or actor. + */ + public GetSearchAllLibrariesRole withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The filter used to find the actor or tag. + */ + public GetSearchAllLibrariesRole withFilter(String filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + /** + * The filter used to find the actor or tag. + */ + public GetSearchAllLibrariesRole withFilter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + /** + * The thumbnail of the actor + */ + public GetSearchAllLibrariesRole withThumb(String thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = Optional.ofNullable(thumb); + return this; + } + + /** + * The thumbnail of the actor + */ + public GetSearchAllLibrariesRole withThumb(Optional thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = thumb; + return this; + } + + /** + * The name of the tag or actor. + */ + public GetSearchAllLibrariesRole withTag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + return this; + } + + /** + * The name of the tag or actor. + */ + public GetSearchAllLibrariesRole withTag(Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + return this; + } + + /** + * Unique identifier for the tag. + */ + public GetSearchAllLibrariesRole withTagKey(String tagKey) { + Utils.checkNotNull(tagKey, "tagKey"); + this.tagKey = Optional.ofNullable(tagKey); + return this; + } + + /** + * Unique identifier for the tag. + */ + public GetSearchAllLibrariesRole withTagKey(Optional tagKey) { + Utils.checkNotNull(tagKey, "tagKey"); + this.tagKey = tagKey; + return this; + } + + /** + * The role of the actor or tag in the media. + */ + public GetSearchAllLibrariesRole withRole(String role) { + Utils.checkNotNull(role, "role"); + this.role = Optional.ofNullable(role); + return this; + } + + /** + * The role of the actor or tag in the media. + */ + public GetSearchAllLibrariesRole withRole(Optional role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesRole other = (GetSearchAllLibrariesRole) o; + return + Objects.deepEquals(this.id, other.id) && + Objects.deepEquals(this.filter, other.filter) && + Objects.deepEquals(this.thumb, other.thumb) && + Objects.deepEquals(this.tag, other.tag) && + Objects.deepEquals(this.tagKey, other.tagKey) && + Objects.deepEquals(this.role, other.role); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + filter, + thumb, + tag, + tagKey, + role); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesRole.class, + "id", id, + "filter", filter, + "thumb", thumb, + "tag", tag, + "tagKey", tagKey, + "role", role); + } + + public final static class Builder { + + private Optional id = Optional.empty(); + + private Optional filter = Optional.empty(); + + private Optional thumb = Optional.empty(); + + private Optional tag = Optional.empty(); + + private Optional tagKey = Optional.empty(); + + private Optional role = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the tag or actor. + */ + public Builder id(long id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * The ID of the tag or actor. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The filter used to find the actor or tag. + */ + public Builder filter(String filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + /** + * The filter used to find the actor or tag. + */ + public Builder filter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + /** + * The thumbnail of the actor + */ + public Builder thumb(String thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = Optional.ofNullable(thumb); + return this; + } + + /** + * The thumbnail of the actor + */ + public Builder thumb(Optional thumb) { + Utils.checkNotNull(thumb, "thumb"); + this.thumb = thumb; + return this; + } + + /** + * The name of the tag or actor. + */ + public Builder tag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + return this; + } + + /** + * The name of the tag or actor. + */ + public Builder tag(Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + return this; + } + + /** + * Unique identifier for the tag. + */ + public Builder tagKey(String tagKey) { + Utils.checkNotNull(tagKey, "tagKey"); + this.tagKey = Optional.ofNullable(tagKey); + return this; + } + + /** + * Unique identifier for the tag. + */ + public Builder tagKey(Optional tagKey) { + Utils.checkNotNull(tagKey, "tagKey"); + this.tagKey = tagKey; + return this; + } + + /** + * The role of the actor or tag in the media. + */ + public Builder role(String role) { + Utils.checkNotNull(role, "role"); + this.role = Optional.ofNullable(role); + return this; + } + + /** + * The role of the actor or tag in the media. + */ + public Builder role(Optional role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + public GetSearchAllLibrariesRole build() { + return new GetSearchAllLibrariesRole( + id, + filter, + thumb, + tag, + tagKey, + role); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesShowOrdering.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesShowOrdering.java new file mode 100644 index 00000000..6e76fa0a --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesShowOrdering.java @@ -0,0 +1,36 @@ +/* + * 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; + +/** + * GetSearchAllLibrariesShowOrdering - Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * aired = TheTVDB (Aired), + * dvd = TheTVDB (DVD), + * absolute = TheTVDB (Absolute)). + * + */ +public enum GetSearchAllLibrariesShowOrdering { + None("None"), + TmdbAiring("tmdbAiring"), + Aired("aired"), + Dvd("dvd"), + Absolute("absolute"); + + @JsonValue + private final String value; + + private GetSearchAllLibrariesShowOrdering(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesStream.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesStream.java new file mode 100644 index 00000000..12c68a3d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesStream.java @@ -0,0 +1,2212 @@ +/* + * 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.Double; +import java.lang.Long; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; + + +public class GetSearchAllLibrariesStream { + + @JsonProperty("id") + private long id; + + /** + * Type of stream (1 = video, 2 = audio, 3 = subtitle) + */ + @JsonProperty("streamType") + private long streamType; + + /** + * Indicates if this is the default stream + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("default") + private Optional default_; + + /** + * Indicates if the stream is selected + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("selected") + private Optional selected; + + /** + * Codec used by the stream + */ + @JsonProperty("codec") + private String codec; + + /** + * The index of the stream + */ + @JsonProperty("index") + private long index; + + /** + * The bitrate of the stream in kbps + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("bitrate") + private Optional bitrate; + + /** + * The color primaries of the video stream + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("colorPrimaries") + private Optional colorPrimaries; + + /** + * The color range of the video stream + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("colorRange") + private Optional colorRange; + + /** + * The color space of the video stream + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("colorSpace") + private Optional colorSpace; + + /** + * The transfer characteristics (TRC) of the video stream + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("colorTrc") + private Optional colorTrc; + + /** + * The bit depth of the video stream + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("bitDepth") + private Optional bitDepth; + + /** + * The chroma location of the video stream + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("chromaLocation") + private Optional chromaLocation; + + /** + * The identifier of the video stream + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("streamIdentifier") + private Optional streamIdentifier; + + /** + * The chroma subsampling format + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("chromaSubsampling") + private Optional chromaSubsampling; + + /** + * The coded height of the video stream + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("codedHeight") + private Optional codedHeight; + + /** + * The coded width of the video stream + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("codedWidth") + private Optional codedWidth; + + /** + * The frame rate of the video stream + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("frameRate") + private Optional frameRate; + + /** + * Indicates if the stream has a scaling matrix + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("hasScalingMatrix") + private Optional hasScalingMatrix; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("hearingImpaired") + private Optional hearingImpaired; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("closedCaptions") + private Optional closedCaptions; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("embeddedInVideo") + private Optional embeddedInVideo; + + /** + * The height of the video stream + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("height") + private Optional height; + + /** + * The level of the video codec + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("level") + private Optional level; + + /** + * The profile of the video codec + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("profile") + private Optional profile; + + /** + * Number of reference frames + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("refFrames") + private Optional refFrames; + + /** + * The scan type (progressive or interlaced) + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("scanType") + private Optional scanType; + + /** + * The width of the video stream + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("width") + private Optional width; + + /** + * Display title of the stream + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("displayTitle") + private Optional displayTitle; + + /** + * Extended display title of the stream + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("extendedDisplayTitle") + private Optional extendedDisplayTitle; + + /** + * Number of audio channels (for audio streams) + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("channels") + private Optional channels; + + /** + * The language of the stream (for audio/subtitle streams) + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("language") + private Optional language; + + /** + * Language tag of the stream + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("languageTag") + private Optional languageTag; + + /** + * Language code of the stream + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("languageCode") + private Optional languageCode; + + /** + * The audio channel layout + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("audioChannelLayout") + private Optional audioChannelLayout; + + /** + * Sampling rate of the audio stream in Hz + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("samplingRate") + private Optional samplingRate; + + /** + * Title of the subtitle track (for subtitle streams) + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("title") + private Optional title; + + /** + * Indicates if the subtitle stream can auto-sync + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("canAutoSync") + private Optional canAutoSync; + + @JsonCreator + public GetSearchAllLibrariesStream( + @JsonProperty("id") long id, + @JsonProperty("streamType") long streamType, + @JsonProperty("default") Optional default_, + @JsonProperty("selected") Optional selected, + @JsonProperty("codec") String codec, + @JsonProperty("index") long index, + @JsonProperty("bitrate") Optional bitrate, + @JsonProperty("colorPrimaries") Optional colorPrimaries, + @JsonProperty("colorRange") Optional colorRange, + @JsonProperty("colorSpace") Optional colorSpace, + @JsonProperty("colorTrc") Optional colorTrc, + @JsonProperty("bitDepth") Optional bitDepth, + @JsonProperty("chromaLocation") Optional chromaLocation, + @JsonProperty("streamIdentifier") Optional streamIdentifier, + @JsonProperty("chromaSubsampling") Optional chromaSubsampling, + @JsonProperty("codedHeight") Optional codedHeight, + @JsonProperty("codedWidth") Optional codedWidth, + @JsonProperty("frameRate") Optional frameRate, + @JsonProperty("hasScalingMatrix") Optional hasScalingMatrix, + @JsonProperty("hearingImpaired") Optional hearingImpaired, + @JsonProperty("closedCaptions") Optional closedCaptions, + @JsonProperty("embeddedInVideo") Optional embeddedInVideo, + @JsonProperty("height") Optional height, + @JsonProperty("level") Optional level, + @JsonProperty("profile") Optional profile, + @JsonProperty("refFrames") Optional refFrames, + @JsonProperty("scanType") Optional scanType, + @JsonProperty("width") Optional width, + @JsonProperty("displayTitle") Optional displayTitle, + @JsonProperty("extendedDisplayTitle") Optional extendedDisplayTitle, + @JsonProperty("channels") Optional channels, + @JsonProperty("language") Optional language, + @JsonProperty("languageTag") Optional languageTag, + @JsonProperty("languageCode") Optional languageCode, + @JsonProperty("audioChannelLayout") Optional audioChannelLayout, + @JsonProperty("samplingRate") Optional samplingRate, + @JsonProperty("title") Optional title, + @JsonProperty("canAutoSync") Optional canAutoSync) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(streamType, "streamType"); + Utils.checkNotNull(default_, "default_"); + Utils.checkNotNull(selected, "selected"); + Utils.checkNotNull(codec, "codec"); + Utils.checkNotNull(index, "index"); + Utils.checkNotNull(bitrate, "bitrate"); + Utils.checkNotNull(colorPrimaries, "colorPrimaries"); + Utils.checkNotNull(colorRange, "colorRange"); + Utils.checkNotNull(colorSpace, "colorSpace"); + Utils.checkNotNull(colorTrc, "colorTrc"); + Utils.checkNotNull(bitDepth, "bitDepth"); + Utils.checkNotNull(chromaLocation, "chromaLocation"); + Utils.checkNotNull(streamIdentifier, "streamIdentifier"); + Utils.checkNotNull(chromaSubsampling, "chromaSubsampling"); + Utils.checkNotNull(codedHeight, "codedHeight"); + Utils.checkNotNull(codedWidth, "codedWidth"); + Utils.checkNotNull(frameRate, "frameRate"); + Utils.checkNotNull(hasScalingMatrix, "hasScalingMatrix"); + Utils.checkNotNull(hearingImpaired, "hearingImpaired"); + Utils.checkNotNull(closedCaptions, "closedCaptions"); + Utils.checkNotNull(embeddedInVideo, "embeddedInVideo"); + Utils.checkNotNull(height, "height"); + Utils.checkNotNull(level, "level"); + Utils.checkNotNull(profile, "profile"); + Utils.checkNotNull(refFrames, "refFrames"); + Utils.checkNotNull(scanType, "scanType"); + Utils.checkNotNull(width, "width"); + Utils.checkNotNull(displayTitle, "displayTitle"); + Utils.checkNotNull(extendedDisplayTitle, "extendedDisplayTitle"); + Utils.checkNotNull(channels, "channels"); + Utils.checkNotNull(language, "language"); + Utils.checkNotNull(languageTag, "languageTag"); + Utils.checkNotNull(languageCode, "languageCode"); + Utils.checkNotNull(audioChannelLayout, "audioChannelLayout"); + Utils.checkNotNull(samplingRate, "samplingRate"); + Utils.checkNotNull(title, "title"); + Utils.checkNotNull(canAutoSync, "canAutoSync"); + this.id = id; + this.streamType = streamType; + this.default_ = default_; + this.selected = selected; + this.codec = codec; + this.index = index; + this.bitrate = bitrate; + this.colorPrimaries = colorPrimaries; + this.colorRange = colorRange; + this.colorSpace = colorSpace; + this.colorTrc = colorTrc; + this.bitDepth = bitDepth; + this.chromaLocation = chromaLocation; + this.streamIdentifier = streamIdentifier; + this.chromaSubsampling = chromaSubsampling; + this.codedHeight = codedHeight; + this.codedWidth = codedWidth; + this.frameRate = frameRate; + this.hasScalingMatrix = hasScalingMatrix; + this.hearingImpaired = hearingImpaired; + this.closedCaptions = closedCaptions; + this.embeddedInVideo = embeddedInVideo; + this.height = height; + this.level = level; + this.profile = profile; + this.refFrames = refFrames; + this.scanType = scanType; + this.width = width; + this.displayTitle = displayTitle; + this.extendedDisplayTitle = extendedDisplayTitle; + this.channels = channels; + this.language = language; + this.languageTag = languageTag; + this.languageCode = languageCode; + this.audioChannelLayout = audioChannelLayout; + this.samplingRate = samplingRate; + this.title = title; + this.canAutoSync = canAutoSync; + } + + public GetSearchAllLibrariesStream( + long id, + long streamType, + String codec, + long index) { + this(id, streamType, Optional.empty(), Optional.empty(), codec, index, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @JsonIgnore + public long id() { + return id; + } + + /** + * Type of stream (1 = video, 2 = audio, 3 = subtitle) + */ + @JsonIgnore + public long streamType() { + return streamType; + } + + /** + * Indicates if this is the default stream + */ + @JsonIgnore + public Optional default_() { + return default_; + } + + /** + * Indicates if the stream is selected + */ + @JsonIgnore + public Optional selected() { + return selected; + } + + /** + * Codec used by the stream + */ + @JsonIgnore + public String codec() { + return codec; + } + + /** + * The index of the stream + */ + @JsonIgnore + public long index() { + return index; + } + + /** + * The bitrate of the stream in kbps + */ + @JsonIgnore + public Optional bitrate() { + return bitrate; + } + + /** + * The color primaries of the video stream + */ + @JsonIgnore + public Optional colorPrimaries() { + return colorPrimaries; + } + + /** + * The color range of the video stream + */ + @JsonIgnore + public Optional colorRange() { + return colorRange; + } + + /** + * The color space of the video stream + */ + @JsonIgnore + public Optional colorSpace() { + return colorSpace; + } + + /** + * The transfer characteristics (TRC) of the video stream + */ + @JsonIgnore + public Optional colorTrc() { + return colorTrc; + } + + /** + * The bit depth of the video stream + */ + @JsonIgnore + public Optional bitDepth() { + return bitDepth; + } + + /** + * The chroma location of the video stream + */ + @JsonIgnore + public Optional chromaLocation() { + return chromaLocation; + } + + /** + * The identifier of the video stream + */ + @JsonIgnore + public Optional streamIdentifier() { + return streamIdentifier; + } + + /** + * The chroma subsampling format + */ + @JsonIgnore + public Optional chromaSubsampling() { + return chromaSubsampling; + } + + /** + * The coded height of the video stream + */ + @JsonIgnore + public Optional codedHeight() { + return codedHeight; + } + + /** + * The coded width of the video stream + */ + @JsonIgnore + public Optional codedWidth() { + return codedWidth; + } + + /** + * The frame rate of the video stream + */ + @JsonIgnore + public Optional frameRate() { + return frameRate; + } + + /** + * Indicates if the stream has a scaling matrix + */ + @JsonIgnore + public Optional hasScalingMatrix() { + return hasScalingMatrix; + } + + @JsonIgnore + public Optional hearingImpaired() { + return hearingImpaired; + } + + @JsonIgnore + public Optional closedCaptions() { + return closedCaptions; + } + + @JsonIgnore + public Optional embeddedInVideo() { + return embeddedInVideo; + } + + /** + * The height of the video stream + */ + @JsonIgnore + public Optional height() { + return height; + } + + /** + * The level of the video codec + */ + @JsonIgnore + public Optional level() { + return level; + } + + /** + * The profile of the video codec + */ + @JsonIgnore + public Optional profile() { + return profile; + } + + /** + * Number of reference frames + */ + @JsonIgnore + public Optional refFrames() { + return refFrames; + } + + /** + * The scan type (progressive or interlaced) + */ + @JsonIgnore + public Optional scanType() { + return scanType; + } + + /** + * The width of the video stream + */ + @JsonIgnore + public Optional width() { + return width; + } + + /** + * Display title of the stream + */ + @JsonIgnore + public Optional displayTitle() { + return displayTitle; + } + + /** + * Extended display title of the stream + */ + @JsonIgnore + public Optional extendedDisplayTitle() { + return extendedDisplayTitle; + } + + /** + * Number of audio channels (for audio streams) + */ + @JsonIgnore + public Optional channels() { + return channels; + } + + /** + * The language of the stream (for audio/subtitle streams) + */ + @JsonIgnore + public Optional language() { + return language; + } + + /** + * Language tag of the stream + */ + @JsonIgnore + public Optional languageTag() { + return languageTag; + } + + /** + * Language code of the stream + */ + @JsonIgnore + public Optional languageCode() { + return languageCode; + } + + /** + * The audio channel layout + */ + @JsonIgnore + public Optional audioChannelLayout() { + return audioChannelLayout; + } + + /** + * Sampling rate of the audio stream in Hz + */ + @JsonIgnore + public Optional samplingRate() { + return samplingRate; + } + + /** + * Title of the subtitle track (for subtitle streams) + */ + @JsonIgnore + public Optional title() { + return title; + } + + /** + * Indicates if the subtitle stream can auto-sync + */ + @JsonIgnore + public Optional canAutoSync() { + return canAutoSync; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchAllLibrariesStream withId(long id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Type of stream (1 = video, 2 = audio, 3 = subtitle) + */ + public GetSearchAllLibrariesStream withStreamType(long streamType) { + Utils.checkNotNull(streamType, "streamType"); + this.streamType = streamType; + return this; + } + + /** + * Indicates if this is the default stream + */ + public GetSearchAllLibrariesStream withDefault(boolean default_) { + Utils.checkNotNull(default_, "default_"); + this.default_ = Optional.ofNullable(default_); + return this; + } + + /** + * Indicates if this is the default stream + */ + public GetSearchAllLibrariesStream withDefault(Optional default_) { + Utils.checkNotNull(default_, "default_"); + this.default_ = default_; + return this; + } + + /** + * Indicates if the stream is selected + */ + public GetSearchAllLibrariesStream withSelected(boolean selected) { + Utils.checkNotNull(selected, "selected"); + this.selected = Optional.ofNullable(selected); + return this; + } + + /** + * Indicates if the stream is selected + */ + public GetSearchAllLibrariesStream withSelected(Optional selected) { + Utils.checkNotNull(selected, "selected"); + this.selected = selected; + return this; + } + + /** + * Codec used by the stream + */ + public GetSearchAllLibrariesStream withCodec(String codec) { + Utils.checkNotNull(codec, "codec"); + this.codec = codec; + return this; + } + + /** + * The index of the stream + */ + public GetSearchAllLibrariesStream withIndex(long index) { + Utils.checkNotNull(index, "index"); + this.index = index; + return this; + } + + /** + * The bitrate of the stream in kbps + */ + public GetSearchAllLibrariesStream withBitrate(long bitrate) { + Utils.checkNotNull(bitrate, "bitrate"); + this.bitrate = Optional.ofNullable(bitrate); + return this; + } + + /** + * The bitrate of the stream in kbps + */ + public GetSearchAllLibrariesStream withBitrate(Optional bitrate) { + Utils.checkNotNull(bitrate, "bitrate"); + this.bitrate = bitrate; + return this; + } + + /** + * The color primaries of the video stream + */ + public GetSearchAllLibrariesStream withColorPrimaries(String colorPrimaries) { + Utils.checkNotNull(colorPrimaries, "colorPrimaries"); + this.colorPrimaries = Optional.ofNullable(colorPrimaries); + return this; + } + + /** + * The color primaries of the video stream + */ + public GetSearchAllLibrariesStream withColorPrimaries(Optional colorPrimaries) { + Utils.checkNotNull(colorPrimaries, "colorPrimaries"); + this.colorPrimaries = colorPrimaries; + return this; + } + + /** + * The color range of the video stream + */ + public GetSearchAllLibrariesStream withColorRange(String colorRange) { + Utils.checkNotNull(colorRange, "colorRange"); + this.colorRange = Optional.ofNullable(colorRange); + return this; + } + + /** + * The color range of the video stream + */ + public GetSearchAllLibrariesStream withColorRange(Optional colorRange) { + Utils.checkNotNull(colorRange, "colorRange"); + this.colorRange = colorRange; + return this; + } + + /** + * The color space of the video stream + */ + public GetSearchAllLibrariesStream withColorSpace(String colorSpace) { + Utils.checkNotNull(colorSpace, "colorSpace"); + this.colorSpace = Optional.ofNullable(colorSpace); + return this; + } + + /** + * The color space of the video stream + */ + public GetSearchAllLibrariesStream withColorSpace(Optional colorSpace) { + Utils.checkNotNull(colorSpace, "colorSpace"); + this.colorSpace = colorSpace; + return this; + } + + /** + * The transfer characteristics (TRC) of the video stream + */ + public GetSearchAllLibrariesStream withColorTrc(String colorTrc) { + Utils.checkNotNull(colorTrc, "colorTrc"); + this.colorTrc = Optional.ofNullable(colorTrc); + return this; + } + + /** + * The transfer characteristics (TRC) of the video stream + */ + public GetSearchAllLibrariesStream withColorTrc(Optional colorTrc) { + Utils.checkNotNull(colorTrc, "colorTrc"); + this.colorTrc = colorTrc; + return this; + } + + /** + * The bit depth of the video stream + */ + public GetSearchAllLibrariesStream withBitDepth(long bitDepth) { + Utils.checkNotNull(bitDepth, "bitDepth"); + this.bitDepth = Optional.ofNullable(bitDepth); + return this; + } + + /** + * The bit depth of the video stream + */ + public GetSearchAllLibrariesStream withBitDepth(Optional bitDepth) { + Utils.checkNotNull(bitDepth, "bitDepth"); + this.bitDepth = bitDepth; + return this; + } + + /** + * The chroma location of the video stream + */ + public GetSearchAllLibrariesStream withChromaLocation(String chromaLocation) { + Utils.checkNotNull(chromaLocation, "chromaLocation"); + this.chromaLocation = Optional.ofNullable(chromaLocation); + return this; + } + + /** + * The chroma location of the video stream + */ + public GetSearchAllLibrariesStream withChromaLocation(Optional chromaLocation) { + Utils.checkNotNull(chromaLocation, "chromaLocation"); + this.chromaLocation = chromaLocation; + return this; + } + + /** + * The identifier of the video stream + */ + public GetSearchAllLibrariesStream withStreamIdentifier(String streamIdentifier) { + Utils.checkNotNull(streamIdentifier, "streamIdentifier"); + this.streamIdentifier = Optional.ofNullable(streamIdentifier); + return this; + } + + /** + * The identifier of the video stream + */ + public GetSearchAllLibrariesStream withStreamIdentifier(Optional streamIdentifier) { + Utils.checkNotNull(streamIdentifier, "streamIdentifier"); + this.streamIdentifier = streamIdentifier; + return this; + } + + /** + * The chroma subsampling format + */ + public GetSearchAllLibrariesStream withChromaSubsampling(String chromaSubsampling) { + Utils.checkNotNull(chromaSubsampling, "chromaSubsampling"); + this.chromaSubsampling = Optional.ofNullable(chromaSubsampling); + return this; + } + + /** + * The chroma subsampling format + */ + public GetSearchAllLibrariesStream withChromaSubsampling(Optional chromaSubsampling) { + Utils.checkNotNull(chromaSubsampling, "chromaSubsampling"); + this.chromaSubsampling = chromaSubsampling; + return this; + } + + /** + * The coded height of the video stream + */ + public GetSearchAllLibrariesStream withCodedHeight(long codedHeight) { + Utils.checkNotNull(codedHeight, "codedHeight"); + this.codedHeight = Optional.ofNullable(codedHeight); + return this; + } + + /** + * The coded height of the video stream + */ + public GetSearchAllLibrariesStream withCodedHeight(Optional codedHeight) { + Utils.checkNotNull(codedHeight, "codedHeight"); + this.codedHeight = codedHeight; + return this; + } + + /** + * The coded width of the video stream + */ + public GetSearchAllLibrariesStream withCodedWidth(long codedWidth) { + Utils.checkNotNull(codedWidth, "codedWidth"); + this.codedWidth = Optional.ofNullable(codedWidth); + return this; + } + + /** + * The coded width of the video stream + */ + public GetSearchAllLibrariesStream withCodedWidth(Optional codedWidth) { + Utils.checkNotNull(codedWidth, "codedWidth"); + this.codedWidth = codedWidth; + return this; + } + + /** + * The frame rate of the video stream + */ + public GetSearchAllLibrariesStream withFrameRate(double frameRate) { + Utils.checkNotNull(frameRate, "frameRate"); + this.frameRate = Optional.ofNullable(frameRate); + return this; + } + + /** + * The frame rate of the video stream + */ + public GetSearchAllLibrariesStream withFrameRate(Optional frameRate) { + Utils.checkNotNull(frameRate, "frameRate"); + this.frameRate = frameRate; + return this; + } + + /** + * Indicates if the stream has a scaling matrix + */ + public GetSearchAllLibrariesStream withHasScalingMatrix(boolean hasScalingMatrix) { + Utils.checkNotNull(hasScalingMatrix, "hasScalingMatrix"); + this.hasScalingMatrix = Optional.ofNullable(hasScalingMatrix); + return this; + } + + /** + * Indicates if the stream has a scaling matrix + */ + public GetSearchAllLibrariesStream withHasScalingMatrix(Optional hasScalingMatrix) { + Utils.checkNotNull(hasScalingMatrix, "hasScalingMatrix"); + this.hasScalingMatrix = hasScalingMatrix; + return this; + } + + public GetSearchAllLibrariesStream withHearingImpaired(boolean hearingImpaired) { + Utils.checkNotNull(hearingImpaired, "hearingImpaired"); + this.hearingImpaired = Optional.ofNullable(hearingImpaired); + return this; + } + + public GetSearchAllLibrariesStream withHearingImpaired(Optional hearingImpaired) { + Utils.checkNotNull(hearingImpaired, "hearingImpaired"); + this.hearingImpaired = hearingImpaired; + return this; + } + + public GetSearchAllLibrariesStream withClosedCaptions(boolean closedCaptions) { + Utils.checkNotNull(closedCaptions, "closedCaptions"); + this.closedCaptions = Optional.ofNullable(closedCaptions); + return this; + } + + public GetSearchAllLibrariesStream withClosedCaptions(Optional closedCaptions) { + Utils.checkNotNull(closedCaptions, "closedCaptions"); + this.closedCaptions = closedCaptions; + return this; + } + + public GetSearchAllLibrariesStream withEmbeddedInVideo(String embeddedInVideo) { + Utils.checkNotNull(embeddedInVideo, "embeddedInVideo"); + this.embeddedInVideo = Optional.ofNullable(embeddedInVideo); + return this; + } + + public GetSearchAllLibrariesStream withEmbeddedInVideo(Optional embeddedInVideo) { + Utils.checkNotNull(embeddedInVideo, "embeddedInVideo"); + this.embeddedInVideo = embeddedInVideo; + return this; + } + + /** + * The height of the video stream + */ + public GetSearchAllLibrariesStream withHeight(long height) { + Utils.checkNotNull(height, "height"); + this.height = Optional.ofNullable(height); + return this; + } + + /** + * The height of the video stream + */ + public GetSearchAllLibrariesStream withHeight(Optional height) { + Utils.checkNotNull(height, "height"); + this.height = height; + return this; + } + + /** + * The level of the video codec + */ + public GetSearchAllLibrariesStream withLevel(long level) { + Utils.checkNotNull(level, "level"); + this.level = Optional.ofNullable(level); + return this; + } + + /** + * The level of the video codec + */ + public GetSearchAllLibrariesStream withLevel(Optional level) { + Utils.checkNotNull(level, "level"); + this.level = level; + return this; + } + + /** + * The profile of the video codec + */ + public GetSearchAllLibrariesStream withProfile(String profile) { + Utils.checkNotNull(profile, "profile"); + this.profile = Optional.ofNullable(profile); + return this; + } + + /** + * The profile of the video codec + */ + public GetSearchAllLibrariesStream withProfile(Optional profile) { + Utils.checkNotNull(profile, "profile"); + this.profile = profile; + return this; + } + + /** + * Number of reference frames + */ + public GetSearchAllLibrariesStream withRefFrames(long refFrames) { + Utils.checkNotNull(refFrames, "refFrames"); + this.refFrames = Optional.ofNullable(refFrames); + return this; + } + + /** + * Number of reference frames + */ + public GetSearchAllLibrariesStream withRefFrames(Optional refFrames) { + Utils.checkNotNull(refFrames, "refFrames"); + this.refFrames = refFrames; + return this; + } + + /** + * The scan type (progressive or interlaced) + */ + public GetSearchAllLibrariesStream withScanType(String scanType) { + Utils.checkNotNull(scanType, "scanType"); + this.scanType = Optional.ofNullable(scanType); + return this; + } + + /** + * The scan type (progressive or interlaced) + */ + public GetSearchAllLibrariesStream withScanType(Optional scanType) { + Utils.checkNotNull(scanType, "scanType"); + this.scanType = scanType; + return this; + } + + /** + * The width of the video stream + */ + public GetSearchAllLibrariesStream withWidth(long width) { + Utils.checkNotNull(width, "width"); + this.width = Optional.ofNullable(width); + return this; + } + + /** + * The width of the video stream + */ + public GetSearchAllLibrariesStream withWidth(Optional width) { + Utils.checkNotNull(width, "width"); + this.width = width; + return this; + } + + /** + * Display title of the stream + */ + public GetSearchAllLibrariesStream withDisplayTitle(String displayTitle) { + Utils.checkNotNull(displayTitle, "displayTitle"); + this.displayTitle = Optional.ofNullable(displayTitle); + return this; + } + + /** + * Display title of the stream + */ + public GetSearchAllLibrariesStream withDisplayTitle(Optional displayTitle) { + Utils.checkNotNull(displayTitle, "displayTitle"); + this.displayTitle = displayTitle; + return this; + } + + /** + * Extended display title of the stream + */ + public GetSearchAllLibrariesStream withExtendedDisplayTitle(String extendedDisplayTitle) { + Utils.checkNotNull(extendedDisplayTitle, "extendedDisplayTitle"); + this.extendedDisplayTitle = Optional.ofNullable(extendedDisplayTitle); + return this; + } + + /** + * Extended display title of the stream + */ + public GetSearchAllLibrariesStream withExtendedDisplayTitle(Optional extendedDisplayTitle) { + Utils.checkNotNull(extendedDisplayTitle, "extendedDisplayTitle"); + this.extendedDisplayTitle = extendedDisplayTitle; + return this; + } + + /** + * Number of audio channels (for audio streams) + */ + public GetSearchAllLibrariesStream withChannels(long channels) { + Utils.checkNotNull(channels, "channels"); + this.channels = Optional.ofNullable(channels); + return this; + } + + /** + * Number of audio channels (for audio streams) + */ + public GetSearchAllLibrariesStream withChannels(Optional channels) { + Utils.checkNotNull(channels, "channels"); + this.channels = channels; + return this; + } + + /** + * The language of the stream (for audio/subtitle streams) + */ + public GetSearchAllLibrariesStream withLanguage(String language) { + Utils.checkNotNull(language, "language"); + this.language = Optional.ofNullable(language); + return this; + } + + /** + * The language of the stream (for audio/subtitle streams) + */ + public GetSearchAllLibrariesStream withLanguage(Optional language) { + Utils.checkNotNull(language, "language"); + this.language = language; + return this; + } + + /** + * Language tag of the stream + */ + public GetSearchAllLibrariesStream withLanguageTag(String languageTag) { + Utils.checkNotNull(languageTag, "languageTag"); + this.languageTag = Optional.ofNullable(languageTag); + return this; + } + + /** + * Language tag of the stream + */ + public GetSearchAllLibrariesStream withLanguageTag(Optional languageTag) { + Utils.checkNotNull(languageTag, "languageTag"); + this.languageTag = languageTag; + return this; + } + + /** + * Language code of the stream + */ + public GetSearchAllLibrariesStream withLanguageCode(String languageCode) { + Utils.checkNotNull(languageCode, "languageCode"); + this.languageCode = Optional.ofNullable(languageCode); + return this; + } + + /** + * Language code of the stream + */ + public GetSearchAllLibrariesStream withLanguageCode(Optional languageCode) { + Utils.checkNotNull(languageCode, "languageCode"); + this.languageCode = languageCode; + return this; + } + + /** + * The audio channel layout + */ + public GetSearchAllLibrariesStream withAudioChannelLayout(String audioChannelLayout) { + Utils.checkNotNull(audioChannelLayout, "audioChannelLayout"); + this.audioChannelLayout = Optional.ofNullable(audioChannelLayout); + return this; + } + + /** + * The audio channel layout + */ + public GetSearchAllLibrariesStream withAudioChannelLayout(Optional audioChannelLayout) { + Utils.checkNotNull(audioChannelLayout, "audioChannelLayout"); + this.audioChannelLayout = audioChannelLayout; + return this; + } + + /** + * Sampling rate of the audio stream in Hz + */ + public GetSearchAllLibrariesStream withSamplingRate(long samplingRate) { + Utils.checkNotNull(samplingRate, "samplingRate"); + this.samplingRate = Optional.ofNullable(samplingRate); + return this; + } + + /** + * Sampling rate of the audio stream in Hz + */ + public GetSearchAllLibrariesStream withSamplingRate(Optional samplingRate) { + Utils.checkNotNull(samplingRate, "samplingRate"); + this.samplingRate = samplingRate; + return this; + } + + /** + * Title of the subtitle track (for subtitle streams) + */ + public GetSearchAllLibrariesStream withTitle(String title) { + Utils.checkNotNull(title, "title"); + this.title = Optional.ofNullable(title); + return this; + } + + /** + * Title of the subtitle track (for subtitle streams) + */ + public GetSearchAllLibrariesStream withTitle(Optional title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + /** + * Indicates if the subtitle stream can auto-sync + */ + public GetSearchAllLibrariesStream withCanAutoSync(boolean canAutoSync) { + Utils.checkNotNull(canAutoSync, "canAutoSync"); + this.canAutoSync = Optional.ofNullable(canAutoSync); + return this; + } + + /** + * Indicates if the subtitle stream can auto-sync + */ + public GetSearchAllLibrariesStream withCanAutoSync(Optional canAutoSync) { + Utils.checkNotNull(canAutoSync, "canAutoSync"); + this.canAutoSync = canAutoSync; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesStream other = (GetSearchAllLibrariesStream) o; + return + Objects.deepEquals(this.id, other.id) && + Objects.deepEquals(this.streamType, other.streamType) && + Objects.deepEquals(this.default_, other.default_) && + Objects.deepEquals(this.selected, other.selected) && + Objects.deepEquals(this.codec, other.codec) && + Objects.deepEquals(this.index, other.index) && + Objects.deepEquals(this.bitrate, other.bitrate) && + Objects.deepEquals(this.colorPrimaries, other.colorPrimaries) && + Objects.deepEquals(this.colorRange, other.colorRange) && + Objects.deepEquals(this.colorSpace, other.colorSpace) && + Objects.deepEquals(this.colorTrc, other.colorTrc) && + Objects.deepEquals(this.bitDepth, other.bitDepth) && + Objects.deepEquals(this.chromaLocation, other.chromaLocation) && + Objects.deepEquals(this.streamIdentifier, other.streamIdentifier) && + Objects.deepEquals(this.chromaSubsampling, other.chromaSubsampling) && + Objects.deepEquals(this.codedHeight, other.codedHeight) && + Objects.deepEquals(this.codedWidth, other.codedWidth) && + Objects.deepEquals(this.frameRate, other.frameRate) && + Objects.deepEquals(this.hasScalingMatrix, other.hasScalingMatrix) && + Objects.deepEquals(this.hearingImpaired, other.hearingImpaired) && + Objects.deepEquals(this.closedCaptions, other.closedCaptions) && + Objects.deepEquals(this.embeddedInVideo, other.embeddedInVideo) && + Objects.deepEquals(this.height, other.height) && + Objects.deepEquals(this.level, other.level) && + Objects.deepEquals(this.profile, other.profile) && + Objects.deepEquals(this.refFrames, other.refFrames) && + Objects.deepEquals(this.scanType, other.scanType) && + Objects.deepEquals(this.width, other.width) && + Objects.deepEquals(this.displayTitle, other.displayTitle) && + Objects.deepEquals(this.extendedDisplayTitle, other.extendedDisplayTitle) && + Objects.deepEquals(this.channels, other.channels) && + Objects.deepEquals(this.language, other.language) && + Objects.deepEquals(this.languageTag, other.languageTag) && + Objects.deepEquals(this.languageCode, other.languageCode) && + Objects.deepEquals(this.audioChannelLayout, other.audioChannelLayout) && + Objects.deepEquals(this.samplingRate, other.samplingRate) && + Objects.deepEquals(this.title, other.title) && + Objects.deepEquals(this.canAutoSync, other.canAutoSync); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + streamType, + default_, + selected, + codec, + index, + bitrate, + colorPrimaries, + colorRange, + colorSpace, + colorTrc, + bitDepth, + chromaLocation, + streamIdentifier, + chromaSubsampling, + codedHeight, + codedWidth, + frameRate, + hasScalingMatrix, + hearingImpaired, + closedCaptions, + embeddedInVideo, + height, + level, + profile, + refFrames, + scanType, + width, + displayTitle, + extendedDisplayTitle, + channels, + language, + languageTag, + languageCode, + audioChannelLayout, + samplingRate, + title, + canAutoSync); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesStream.class, + "id", id, + "streamType", streamType, + "default_", default_, + "selected", selected, + "codec", codec, + "index", index, + "bitrate", bitrate, + "colorPrimaries", colorPrimaries, + "colorRange", colorRange, + "colorSpace", colorSpace, + "colorTrc", colorTrc, + "bitDepth", bitDepth, + "chromaLocation", chromaLocation, + "streamIdentifier", streamIdentifier, + "chromaSubsampling", chromaSubsampling, + "codedHeight", codedHeight, + "codedWidth", codedWidth, + "frameRate", frameRate, + "hasScalingMatrix", hasScalingMatrix, + "hearingImpaired", hearingImpaired, + "closedCaptions", closedCaptions, + "embeddedInVideo", embeddedInVideo, + "height", height, + "level", level, + "profile", profile, + "refFrames", refFrames, + "scanType", scanType, + "width", width, + "displayTitle", displayTitle, + "extendedDisplayTitle", extendedDisplayTitle, + "channels", channels, + "language", language, + "languageTag", languageTag, + "languageCode", languageCode, + "audioChannelLayout", audioChannelLayout, + "samplingRate", samplingRate, + "title", title, + "canAutoSync", canAutoSync); + } + + public final static class Builder { + + private Long id; + + private Long streamType; + + private Optional default_ = Optional.empty(); + + private Optional selected = Optional.empty(); + + private String codec; + + private Long index; + + private Optional bitrate = Optional.empty(); + + private Optional colorPrimaries = Optional.empty(); + + private Optional colorRange = Optional.empty(); + + private Optional colorSpace = Optional.empty(); + + private Optional colorTrc = Optional.empty(); + + private Optional bitDepth = Optional.empty(); + + private Optional chromaLocation = Optional.empty(); + + private Optional streamIdentifier = Optional.empty(); + + private Optional chromaSubsampling = Optional.empty(); + + private Optional codedHeight = Optional.empty(); + + private Optional codedWidth = Optional.empty(); + + private Optional frameRate = Optional.empty(); + + private Optional hasScalingMatrix = Optional.empty(); + + private Optional hearingImpaired = Optional.empty(); + + private Optional closedCaptions = Optional.empty(); + + private Optional embeddedInVideo = Optional.empty(); + + private Optional height = Optional.empty(); + + private Optional level = Optional.empty(); + + private Optional profile = Optional.empty(); + + private Optional refFrames = Optional.empty(); + + private Optional scanType = Optional.empty(); + + private Optional width = Optional.empty(); + + private Optional displayTitle = Optional.empty(); + + private Optional extendedDisplayTitle = Optional.empty(); + + private Optional channels = Optional.empty(); + + private Optional language = Optional.empty(); + + private Optional languageTag = Optional.empty(); + + private Optional languageCode = Optional.empty(); + + private Optional audioChannelLayout = Optional.empty(); + + private Optional samplingRate = Optional.empty(); + + private Optional title = Optional.empty(); + + private Optional canAutoSync = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder id(long id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Type of stream (1 = video, 2 = audio, 3 = subtitle) + */ + public Builder streamType(long streamType) { + Utils.checkNotNull(streamType, "streamType"); + this.streamType = streamType; + return this; + } + + /** + * Indicates if this is the default stream + */ + public Builder default_(boolean default_) { + Utils.checkNotNull(default_, "default_"); + this.default_ = Optional.ofNullable(default_); + return this; + } + + /** + * Indicates if this is the default stream + */ + public Builder default_(Optional default_) { + Utils.checkNotNull(default_, "default_"); + this.default_ = default_; + return this; + } + + /** + * Indicates if the stream is selected + */ + public Builder selected(boolean selected) { + Utils.checkNotNull(selected, "selected"); + this.selected = Optional.ofNullable(selected); + return this; + } + + /** + * Indicates if the stream is selected + */ + public Builder selected(Optional selected) { + Utils.checkNotNull(selected, "selected"); + this.selected = selected; + return this; + } + + /** + * Codec used by the stream + */ + public Builder codec(String codec) { + Utils.checkNotNull(codec, "codec"); + this.codec = codec; + return this; + } + + /** + * The index of the stream + */ + public Builder index(long index) { + Utils.checkNotNull(index, "index"); + this.index = index; + return this; + } + + /** + * The bitrate of the stream in kbps + */ + public Builder bitrate(long bitrate) { + Utils.checkNotNull(bitrate, "bitrate"); + this.bitrate = Optional.ofNullable(bitrate); + return this; + } + + /** + * The bitrate of the stream in kbps + */ + public Builder bitrate(Optional bitrate) { + Utils.checkNotNull(bitrate, "bitrate"); + this.bitrate = bitrate; + return this; + } + + /** + * The color primaries of the video stream + */ + public Builder colorPrimaries(String colorPrimaries) { + Utils.checkNotNull(colorPrimaries, "colorPrimaries"); + this.colorPrimaries = Optional.ofNullable(colorPrimaries); + return this; + } + + /** + * The color primaries of the video stream + */ + public Builder colorPrimaries(Optional colorPrimaries) { + Utils.checkNotNull(colorPrimaries, "colorPrimaries"); + this.colorPrimaries = colorPrimaries; + return this; + } + + /** + * The color range of the video stream + */ + public Builder colorRange(String colorRange) { + Utils.checkNotNull(colorRange, "colorRange"); + this.colorRange = Optional.ofNullable(colorRange); + return this; + } + + /** + * The color range of the video stream + */ + public Builder colorRange(Optional colorRange) { + Utils.checkNotNull(colorRange, "colorRange"); + this.colorRange = colorRange; + return this; + } + + /** + * The color space of the video stream + */ + public Builder colorSpace(String colorSpace) { + Utils.checkNotNull(colorSpace, "colorSpace"); + this.colorSpace = Optional.ofNullable(colorSpace); + return this; + } + + /** + * The color space of the video stream + */ + public Builder colorSpace(Optional colorSpace) { + Utils.checkNotNull(colorSpace, "colorSpace"); + this.colorSpace = colorSpace; + return this; + } + + /** + * The transfer characteristics (TRC) of the video stream + */ + public Builder colorTrc(String colorTrc) { + Utils.checkNotNull(colorTrc, "colorTrc"); + this.colorTrc = Optional.ofNullable(colorTrc); + return this; + } + + /** + * The transfer characteristics (TRC) of the video stream + */ + public Builder colorTrc(Optional colorTrc) { + Utils.checkNotNull(colorTrc, "colorTrc"); + this.colorTrc = colorTrc; + return this; + } + + /** + * The bit depth of the video stream + */ + public Builder bitDepth(long bitDepth) { + Utils.checkNotNull(bitDepth, "bitDepth"); + this.bitDepth = Optional.ofNullable(bitDepth); + return this; + } + + /** + * The bit depth of the video stream + */ + public Builder bitDepth(Optional bitDepth) { + Utils.checkNotNull(bitDepth, "bitDepth"); + this.bitDepth = bitDepth; + return this; + } + + /** + * The chroma location of the video stream + */ + public Builder chromaLocation(String chromaLocation) { + Utils.checkNotNull(chromaLocation, "chromaLocation"); + this.chromaLocation = Optional.ofNullable(chromaLocation); + return this; + } + + /** + * The chroma location of the video stream + */ + public Builder chromaLocation(Optional chromaLocation) { + Utils.checkNotNull(chromaLocation, "chromaLocation"); + this.chromaLocation = chromaLocation; + return this; + } + + /** + * The identifier of the video stream + */ + public Builder streamIdentifier(String streamIdentifier) { + Utils.checkNotNull(streamIdentifier, "streamIdentifier"); + this.streamIdentifier = Optional.ofNullable(streamIdentifier); + return this; + } + + /** + * The identifier of the video stream + */ + public Builder streamIdentifier(Optional streamIdentifier) { + Utils.checkNotNull(streamIdentifier, "streamIdentifier"); + this.streamIdentifier = streamIdentifier; + return this; + } + + /** + * The chroma subsampling format + */ + public Builder chromaSubsampling(String chromaSubsampling) { + Utils.checkNotNull(chromaSubsampling, "chromaSubsampling"); + this.chromaSubsampling = Optional.ofNullable(chromaSubsampling); + return this; + } + + /** + * The chroma subsampling format + */ + public Builder chromaSubsampling(Optional chromaSubsampling) { + Utils.checkNotNull(chromaSubsampling, "chromaSubsampling"); + this.chromaSubsampling = chromaSubsampling; + return this; + } + + /** + * The coded height of the video stream + */ + public Builder codedHeight(long codedHeight) { + Utils.checkNotNull(codedHeight, "codedHeight"); + this.codedHeight = Optional.ofNullable(codedHeight); + return this; + } + + /** + * The coded height of the video stream + */ + public Builder codedHeight(Optional codedHeight) { + Utils.checkNotNull(codedHeight, "codedHeight"); + this.codedHeight = codedHeight; + return this; + } + + /** + * The coded width of the video stream + */ + public Builder codedWidth(long codedWidth) { + Utils.checkNotNull(codedWidth, "codedWidth"); + this.codedWidth = Optional.ofNullable(codedWidth); + return this; + } + + /** + * The coded width of the video stream + */ + public Builder codedWidth(Optional codedWidth) { + Utils.checkNotNull(codedWidth, "codedWidth"); + this.codedWidth = codedWidth; + return this; + } + + /** + * The frame rate of the video stream + */ + public Builder frameRate(double frameRate) { + Utils.checkNotNull(frameRate, "frameRate"); + this.frameRate = Optional.ofNullable(frameRate); + return this; + } + + /** + * The frame rate of the video stream + */ + public Builder frameRate(Optional frameRate) { + Utils.checkNotNull(frameRate, "frameRate"); + this.frameRate = frameRate; + return this; + } + + /** + * Indicates if the stream has a scaling matrix + */ + public Builder hasScalingMatrix(boolean hasScalingMatrix) { + Utils.checkNotNull(hasScalingMatrix, "hasScalingMatrix"); + this.hasScalingMatrix = Optional.ofNullable(hasScalingMatrix); + return this; + } + + /** + * Indicates if the stream has a scaling matrix + */ + public Builder hasScalingMatrix(Optional hasScalingMatrix) { + Utils.checkNotNull(hasScalingMatrix, "hasScalingMatrix"); + this.hasScalingMatrix = hasScalingMatrix; + return this; + } + + public Builder hearingImpaired(boolean hearingImpaired) { + Utils.checkNotNull(hearingImpaired, "hearingImpaired"); + this.hearingImpaired = Optional.ofNullable(hearingImpaired); + return this; + } + + public Builder hearingImpaired(Optional hearingImpaired) { + Utils.checkNotNull(hearingImpaired, "hearingImpaired"); + this.hearingImpaired = hearingImpaired; + return this; + } + + public Builder closedCaptions(boolean closedCaptions) { + Utils.checkNotNull(closedCaptions, "closedCaptions"); + this.closedCaptions = Optional.ofNullable(closedCaptions); + return this; + } + + public Builder closedCaptions(Optional closedCaptions) { + Utils.checkNotNull(closedCaptions, "closedCaptions"); + this.closedCaptions = closedCaptions; + return this; + } + + public Builder embeddedInVideo(String embeddedInVideo) { + Utils.checkNotNull(embeddedInVideo, "embeddedInVideo"); + this.embeddedInVideo = Optional.ofNullable(embeddedInVideo); + return this; + } + + public Builder embeddedInVideo(Optional embeddedInVideo) { + Utils.checkNotNull(embeddedInVideo, "embeddedInVideo"); + this.embeddedInVideo = embeddedInVideo; + return this; + } + + /** + * The height of the video stream + */ + public Builder height(long height) { + Utils.checkNotNull(height, "height"); + this.height = Optional.ofNullable(height); + return this; + } + + /** + * The height of the video stream + */ + public Builder height(Optional height) { + Utils.checkNotNull(height, "height"); + this.height = height; + return this; + } + + /** + * The level of the video codec + */ + public Builder level(long level) { + Utils.checkNotNull(level, "level"); + this.level = Optional.ofNullable(level); + return this; + } + + /** + * The level of the video codec + */ + public Builder level(Optional level) { + Utils.checkNotNull(level, "level"); + this.level = level; + return this; + } + + /** + * The profile of the video codec + */ + public Builder profile(String profile) { + Utils.checkNotNull(profile, "profile"); + this.profile = Optional.ofNullable(profile); + return this; + } + + /** + * The profile of the video codec + */ + public Builder profile(Optional profile) { + Utils.checkNotNull(profile, "profile"); + this.profile = profile; + return this; + } + + /** + * Number of reference frames + */ + public Builder refFrames(long refFrames) { + Utils.checkNotNull(refFrames, "refFrames"); + this.refFrames = Optional.ofNullable(refFrames); + return this; + } + + /** + * Number of reference frames + */ + public Builder refFrames(Optional refFrames) { + Utils.checkNotNull(refFrames, "refFrames"); + this.refFrames = refFrames; + return this; + } + + /** + * The scan type (progressive or interlaced) + */ + public Builder scanType(String scanType) { + Utils.checkNotNull(scanType, "scanType"); + this.scanType = Optional.ofNullable(scanType); + return this; + } + + /** + * The scan type (progressive or interlaced) + */ + public Builder scanType(Optional scanType) { + Utils.checkNotNull(scanType, "scanType"); + this.scanType = scanType; + return this; + } + + /** + * The width of the video stream + */ + public Builder width(long width) { + Utils.checkNotNull(width, "width"); + this.width = Optional.ofNullable(width); + return this; + } + + /** + * The width of the video stream + */ + public Builder width(Optional width) { + Utils.checkNotNull(width, "width"); + this.width = width; + return this; + } + + /** + * Display title of the stream + */ + public Builder displayTitle(String displayTitle) { + Utils.checkNotNull(displayTitle, "displayTitle"); + this.displayTitle = Optional.ofNullable(displayTitle); + return this; + } + + /** + * Display title of the stream + */ + public Builder displayTitle(Optional displayTitle) { + Utils.checkNotNull(displayTitle, "displayTitle"); + this.displayTitle = displayTitle; + return this; + } + + /** + * Extended display title of the stream + */ + public Builder extendedDisplayTitle(String extendedDisplayTitle) { + Utils.checkNotNull(extendedDisplayTitle, "extendedDisplayTitle"); + this.extendedDisplayTitle = Optional.ofNullable(extendedDisplayTitle); + return this; + } + + /** + * Extended display title of the stream + */ + public Builder extendedDisplayTitle(Optional extendedDisplayTitle) { + Utils.checkNotNull(extendedDisplayTitle, "extendedDisplayTitle"); + this.extendedDisplayTitle = extendedDisplayTitle; + return this; + } + + /** + * Number of audio channels (for audio streams) + */ + public Builder channels(long channels) { + Utils.checkNotNull(channels, "channels"); + this.channels = Optional.ofNullable(channels); + return this; + } + + /** + * Number of audio channels (for audio streams) + */ + public Builder channels(Optional channels) { + Utils.checkNotNull(channels, "channels"); + this.channels = channels; + return this; + } + + /** + * The language of the stream (for audio/subtitle streams) + */ + public Builder language(String language) { + Utils.checkNotNull(language, "language"); + this.language = Optional.ofNullable(language); + return this; + } + + /** + * The language of the stream (for audio/subtitle streams) + */ + public Builder language(Optional language) { + Utils.checkNotNull(language, "language"); + this.language = language; + return this; + } + + /** + * Language tag of the stream + */ + public Builder languageTag(String languageTag) { + Utils.checkNotNull(languageTag, "languageTag"); + this.languageTag = Optional.ofNullable(languageTag); + return this; + } + + /** + * Language tag of the stream + */ + public Builder languageTag(Optional languageTag) { + Utils.checkNotNull(languageTag, "languageTag"); + this.languageTag = languageTag; + return this; + } + + /** + * Language code of the stream + */ + public Builder languageCode(String languageCode) { + Utils.checkNotNull(languageCode, "languageCode"); + this.languageCode = Optional.ofNullable(languageCode); + return this; + } + + /** + * Language code of the stream + */ + public Builder languageCode(Optional languageCode) { + Utils.checkNotNull(languageCode, "languageCode"); + this.languageCode = languageCode; + return this; + } + + /** + * The audio channel layout + */ + public Builder audioChannelLayout(String audioChannelLayout) { + Utils.checkNotNull(audioChannelLayout, "audioChannelLayout"); + this.audioChannelLayout = Optional.ofNullable(audioChannelLayout); + return this; + } + + /** + * The audio channel layout + */ + public Builder audioChannelLayout(Optional audioChannelLayout) { + Utils.checkNotNull(audioChannelLayout, "audioChannelLayout"); + this.audioChannelLayout = audioChannelLayout; + return this; + } + + /** + * Sampling rate of the audio stream in Hz + */ + public Builder samplingRate(long samplingRate) { + Utils.checkNotNull(samplingRate, "samplingRate"); + this.samplingRate = Optional.ofNullable(samplingRate); + return this; + } + + /** + * Sampling rate of the audio stream in Hz + */ + public Builder samplingRate(Optional samplingRate) { + Utils.checkNotNull(samplingRate, "samplingRate"); + this.samplingRate = samplingRate; + return this; + } + + /** + * Title of the subtitle track (for subtitle streams) + */ + public Builder title(String title) { + Utils.checkNotNull(title, "title"); + this.title = Optional.ofNullable(title); + return this; + } + + /** + * Title of the subtitle track (for subtitle streams) + */ + public Builder title(Optional title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + /** + * Indicates if the subtitle stream can auto-sync + */ + public Builder canAutoSync(boolean canAutoSync) { + Utils.checkNotNull(canAutoSync, "canAutoSync"); + this.canAutoSync = Optional.ofNullable(canAutoSync); + return this; + } + + /** + * Indicates if the subtitle stream can auto-sync + */ + public Builder canAutoSync(Optional canAutoSync) { + Utils.checkNotNull(canAutoSync, "canAutoSync"); + this.canAutoSync = canAutoSync; + return this; + } + + public GetSearchAllLibrariesStream build() { + return new GetSearchAllLibrariesStream( + id, + streamType, + default_, + selected, + codec, + index, + bitrate, + colorPrimaries, + colorRange, + colorSpace, + colorTrc, + bitDepth, + chromaLocation, + streamIdentifier, + chromaSubsampling, + codedHeight, + codedWidth, + frameRate, + hasScalingMatrix, + hearingImpaired, + closedCaptions, + embeddedInVideo, + height, + level, + profile, + refFrames, + scanType, + width, + displayTitle, + extendedDisplayTitle, + channels, + language, + languageTag, + languageCode, + audioChannelLayout, + samplingRate, + title, + canAutoSync); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesType.java new file mode 100644 index 00000000..5c6516b2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesType.java @@ -0,0 +1,30 @@ +/* + * 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; + +/** + * GetSearchAllLibrariesType - The type of media content + * + */ +public enum GetSearchAllLibrariesType { + Movie("movie"), + TvShow("show"), + Season("season"), + Episode("episode"); + + @JsonValue + private final String value; + + private GetSearchAllLibrariesType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesUltraBlurColors.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesUltraBlurColors.java new file mode 100644 index 00000000..ba3a47e2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesUltraBlurColors.java @@ -0,0 +1,176 @@ +/* + * 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.Override; +import java.lang.String; +import java.util.Objects; + + +public class GetSearchAllLibrariesUltraBlurColors { + + @JsonProperty("topLeft") + private String topLeft; + + @JsonProperty("topRight") + private String topRight; + + @JsonProperty("bottomRight") + private String bottomRight; + + @JsonProperty("bottomLeft") + private String bottomLeft; + + @JsonCreator + public GetSearchAllLibrariesUltraBlurColors( + @JsonProperty("topLeft") String topLeft, + @JsonProperty("topRight") String topRight, + @JsonProperty("bottomRight") String bottomRight, + @JsonProperty("bottomLeft") String bottomLeft) { + Utils.checkNotNull(topLeft, "topLeft"); + Utils.checkNotNull(topRight, "topRight"); + Utils.checkNotNull(bottomRight, "bottomRight"); + Utils.checkNotNull(bottomLeft, "bottomLeft"); + this.topLeft = topLeft; + this.topRight = topRight; + this.bottomRight = bottomRight; + this.bottomLeft = bottomLeft; + } + + @JsonIgnore + public String topLeft() { + return topLeft; + } + + @JsonIgnore + public String topRight() { + return topRight; + } + + @JsonIgnore + public String bottomRight() { + return bottomRight; + } + + @JsonIgnore + public String bottomLeft() { + return bottomLeft; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchAllLibrariesUltraBlurColors withTopLeft(String topLeft) { + Utils.checkNotNull(topLeft, "topLeft"); + this.topLeft = topLeft; + return this; + } + + public GetSearchAllLibrariesUltraBlurColors withTopRight(String topRight) { + Utils.checkNotNull(topRight, "topRight"); + this.topRight = topRight; + return this; + } + + public GetSearchAllLibrariesUltraBlurColors withBottomRight(String bottomRight) { + Utils.checkNotNull(bottomRight, "bottomRight"); + this.bottomRight = bottomRight; + return this; + } + + public GetSearchAllLibrariesUltraBlurColors withBottomLeft(String bottomLeft) { + Utils.checkNotNull(bottomLeft, "bottomLeft"); + this.bottomLeft = bottomLeft; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesUltraBlurColors other = (GetSearchAllLibrariesUltraBlurColors) o; + return + Objects.deepEquals(this.topLeft, other.topLeft) && + Objects.deepEquals(this.topRight, other.topRight) && + Objects.deepEquals(this.bottomRight, other.bottomRight) && + Objects.deepEquals(this.bottomLeft, other.bottomLeft); + } + + @Override + public int hashCode() { + return Objects.hash( + topLeft, + topRight, + bottomRight, + bottomLeft); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesUltraBlurColors.class, + "topLeft", topLeft, + "topRight", topRight, + "bottomRight", bottomRight, + "bottomLeft", bottomLeft); + } + + public final static class Builder { + + private String topLeft; + + private String topRight; + + private String bottomRight; + + private String bottomLeft; + + private Builder() { + // force use of static builder() method + } + + public Builder topLeft(String topLeft) { + Utils.checkNotNull(topLeft, "topLeft"); + this.topLeft = topLeft; + return this; + } + + public Builder topRight(String topRight) { + Utils.checkNotNull(topRight, "topRight"); + this.topRight = topRight; + return this; + } + + public Builder bottomRight(String bottomRight) { + Utils.checkNotNull(bottomRight, "bottomRight"); + this.bottomRight = bottomRight; + return this; + } + + public Builder bottomLeft(String bottomLeft) { + Utils.checkNotNull(bottomLeft, "bottomLeft"); + this.bottomLeft = bottomLeft; + return this; + } + + public GetSearchAllLibrariesUltraBlurColors build() { + return new GetSearchAllLibrariesUltraBlurColors( + topLeft, + topRight, + bottomRight, + bottomLeft); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesWriter.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesWriter.java new file mode 100644 index 00000000..7b1f1436 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesWriter.java @@ -0,0 +1,109 @@ +/* + * 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.util.Objects; +import java.util.Optional; + + +public class GetSearchAllLibrariesWriter { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tag") + private Optional tag; + + @JsonCreator + public GetSearchAllLibrariesWriter( + @JsonProperty("tag") Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + } + + public GetSearchAllLibrariesWriter() { + this(Optional.empty()); + } + + @JsonIgnore + public Optional tag() { + return tag; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetSearchAllLibrariesWriter withTag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + return this; + } + + public GetSearchAllLibrariesWriter withTag(Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesWriter other = (GetSearchAllLibrariesWriter) o; + return + Objects.deepEquals(this.tag, other.tag); + } + + @Override + public int hashCode() { + return Objects.hash( + tag); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesWriter.class, + "tag", tag); + } + + public final static class Builder { + + private Optional tag = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder tag(String tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = Optional.ofNullable(tag); + return this; + } + + public Builder tag(Optional tag) { + Utils.checkNotNull(tag, "tag"); + this.tag = tag; + return this; + } + + public GetSearchAllLibrariesWriter build() { + return new GetSearchAllLibrariesWriter( + tag); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryRequestBuilder.java index ed52545f..33fc26a0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryRequestBuilder.java @@ -4,13 +4,17 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; +import java.util.Optional; public class GetSearchLibraryRequestBuilder { private Integer sectionKey; private GetSearchLibraryQueryParamType type; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetSearchLibrary sdk; public GetSearchLibraryRequestBuilder(SDKMethodInterfaces.MethodCallGetSearchLibrary sdk) { @@ -28,11 +32,26 @@ public class GetSearchLibraryRequestBuilder { this.type = type; return this; } + + public GetSearchLibraryRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetSearchLibraryRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetSearchLibraryResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getSearchLibrary( sectionKey, - type); + type, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRequestBuilder.java index 873bddf6..e794c91a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRequestBuilder.java @@ -4,12 +4,16 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.String; +import java.util.Optional; public class GetSearchResultsRequestBuilder { private String query; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetSearchResults sdk; public GetSearchResultsRequestBuilder(SDKMethodInterfaces.MethodCallGetSearchResults sdk) { @@ -21,10 +25,25 @@ public class GetSearchResultsRequestBuilder { this.query = query; return this; } + + public GetSearchResultsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetSearchResultsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetSearchResultsResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getSearchResults( - query); + query, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesRequestBuilder.java index b8d6bd4d..f191d7b3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetServerActivitiesRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetServerActivities sdk; public GetServerActivitiesRequestBuilder(SDKMethodInterfaces.MethodCallGetServerActivities sdk) { this.sdk = sdk; } + + public GetServerActivitiesRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetServerActivitiesRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetServerActivitiesResponse call() throws Exception { - - return sdk.getServerActivitiesDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getServerActivities( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerCapabilitiesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerCapabilitiesRequestBuilder.java index 05ef6d64..2de05727 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerCapabilitiesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerCapabilitiesRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetServerCapabilitiesRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetServerCapabilities sdk; public GetServerCapabilitiesRequestBuilder(SDKMethodInterfaces.MethodCallGetServerCapabilities sdk) { this.sdk = sdk; } + + public GetServerCapabilitiesRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetServerCapabilitiesRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetServerCapabilitiesResponse call() throws Exception { - - return sdk.getServerCapabilitiesDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getServerCapabilities( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityRequestBuilder.java index cdc402de..db10a8a5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetServerIdentityRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetServerIdentity sdk; public GetServerIdentityRequestBuilder(SDKMethodInterfaces.MethodCallGetServerIdentity sdk) { this.sdk = sdk; } + + public GetServerIdentityRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetServerIdentityRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetServerIdentityResponse call() throws Exception { - - return sdk.getServerIdentityDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getServerIdentity( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerListRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerListRequestBuilder.java index 9f6f4f6f..d68319ee 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerListRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerListRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetServerListRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetServerList sdk; public GetServerListRequestBuilder(SDKMethodInterfaces.MethodCallGetServerList sdk) { this.sdk = sdk; } + + public GetServerListRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetServerListRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetServerListResponse call() throws Exception { - - return sdk.getServerListDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getServerList( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesRequestBuilder.java index 0671e581..bbe0487e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetServerPreferencesRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetServerPreferences sdk; public GetServerPreferencesRequestBuilder(SDKMethodInterfaces.MethodCallGetServerPreferences sdk) { this.sdk = sdk; } + + public GetServerPreferencesRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetServerPreferencesRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetServerPreferencesResponse call() throws Exception { - - return sdk.getServerPreferencesDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getServerPreferences( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequest.java index a5404469..1b8f363f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequest.java @@ -41,9 +41,9 @@ public class GetServerResourcesRequest { private Optional includeIPv6; /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Client-Identifier") + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier") private Optional clientID; @JsonCreator @@ -96,7 +96,7 @@ public class GetServerResourcesRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @JsonIgnore public Optional clientID() { @@ -166,7 +166,7 @@ public class GetServerResourcesRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public GetServerResourcesRequest withClientID(String clientID) { Utils.checkNotNull(clientID, "clientID"); @@ -175,7 +175,7 @@ public class GetServerResourcesRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public GetServerResourcesRequest withClientID(Optional clientID) { Utils.checkNotNull(clientID, "clientID"); @@ -290,7 +290,7 @@ public class GetServerResourcesRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public Builder clientID(String clientID) { Utils.checkNotNull(clientID, "clientID"); @@ -299,7 +299,7 @@ public class GetServerResourcesRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public Builder clientID(Optional clientID) { Utils.checkNotNull(clientID, "clientID"); diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequestBuilder.java index ed46ea32..0e4df6fe 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequestBuilder.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.core.type.TypeReference; import dev.plexapi.sdk.utils.LazySingletonValue; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.String; import java.util.Optional; @@ -26,6 +28,7 @@ public class GetServerResourcesRequestBuilder { new TypeReference>() {}); private Optional clientID = Optional.empty(); private Optional serverURL = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetServerResources sdk; public GetServerResourcesRequestBuilder(SDKMethodInterfaces.MethodCallGetServerResources sdk) { @@ -91,6 +94,18 @@ public class GetServerResourcesRequestBuilder { this.serverURL = serverURL; return this; } + + public GetServerResourcesRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetServerResourcesRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetServerResourcesResponse call() throws Exception { if (includeHttps == null) { @@ -101,13 +116,16 @@ public class GetServerResourcesRequestBuilder { } if (includeIPv6 == null) { includeIPv6 = _SINGLETON_VALUE_IncludeIPv6.value(); - } + } Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getServerResources( includeHttps, includeRelay, includeIPv6, clientID, - serverURL); + serverURL, + options); } private static final LazySingletonValue> _SINGLETON_VALUE_IncludeHttps = diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryRequestBuilder.java index e21a82ba..c5dd7e6b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.String; @@ -15,6 +17,7 @@ public class GetSessionHistoryRequestBuilder { private Optional accountId = Optional.empty(); private Optional filter = Optional.empty(); private Optional librarySectionID = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetSessionHistory sdk; public GetSessionHistoryRequestBuilder(SDKMethodInterfaces.MethodCallGetSessionHistory sdk) { @@ -68,13 +71,28 @@ public class GetSessionHistoryRequestBuilder { this.librarySectionID = librarySectionID; return this; } + + public GetSessionHistoryRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetSessionHistoryRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetSessionHistoryResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getSessionHistory( sort, accountId, filter, - librarySectionID); + librarySectionID, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsRequestBuilder.java index 92090850..d52467cb 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetSessionsRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetSessions sdk; public GetSessionsRequestBuilder(SDKMethodInterfaces.MethodCallGetSessions sdk) { this.sdk = sdk; } + + public GetSessionsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetSessionsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetSessionsResponse call() throws Exception { - - return sdk.getSessionsDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getSessions( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationRequestBuilder.java index 048c52ea..445fd35c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationRequestBuilder.java @@ -4,12 +4,16 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.String; +import java.util.Optional; public class GetSourceConnectionInformationRequestBuilder { private String source; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetSourceConnectionInformation sdk; public GetSourceConnectionInformationRequestBuilder(SDKMethodInterfaces.MethodCallGetSourceConnectionInformation sdk) { @@ -21,10 +25,25 @@ public class GetSourceConnectionInformationRequestBuilder { this.source = source; return this; } + + public GetSourceConnectionInformationRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetSourceConnectionInformationRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetSourceConnectionInformationResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getSourceConnectionInformation( - source); + source, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsRequestBuilder.java index febdc0d9..d8c3746f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.util.Optional; @@ -11,6 +13,7 @@ import java.util.Optional; public class GetStatisticsRequestBuilder { private Optional timespan = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetStatistics sdk; public GetStatisticsRequestBuilder(SDKMethodInterfaces.MethodCallGetStatistics sdk) { @@ -28,10 +31,25 @@ public class GetStatisticsRequestBuilder { this.timespan = timespan; return this; } + + public GetStatisticsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetStatisticsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetStatisticsResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getStatistics( - timespan); + timespan, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequest.java index f63f8bb6..e8f95e7e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequest.java @@ -36,9 +36,9 @@ public class GetThumbImageRequest { private long upscale; /** - * Plex Authentication Token + * An authentication token, obtained from plex.tv */ - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Token") + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Token") private String xPlexToken; @JsonCreator @@ -92,7 +92,7 @@ public class GetThumbImageRequest { } /** - * Plex Authentication Token + * An authentication token, obtained from plex.tv */ @JsonIgnore public String xPlexToken() { @@ -137,7 +137,7 @@ public class GetThumbImageRequest { } /** - * Plex Authentication Token + * An authentication token, obtained from plex.tv */ public GetThumbImageRequest withXPlexToken(String xPlexToken) { Utils.checkNotNull(xPlexToken, "xPlexToken"); @@ -237,7 +237,7 @@ public class GetThumbImageRequest { } /** - * Plex Authentication Token + * An authentication token, obtained from plex.tv */ public Builder xPlexToken(String xPlexToken) { Utils.checkNotNull(xPlexToken, "xPlexToken"); diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequestBuilder.java index a6144eb5..bf7b468e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequestBuilder.java @@ -4,11 +4,15 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetThumbImageRequestBuilder { private GetThumbImageRequest request; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetThumbImage sdk; public GetThumbImageRequestBuilder(SDKMethodInterfaces.MethodCallGetThumbImage sdk) { @@ -20,10 +24,25 @@ public class GetThumbImageRequestBuilder { this.request = request; return this; } + + public GetThumbImageRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetThumbImageRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetThumbImageResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getThumbImage( - request); + request, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineRequestBuilder.java index 64339916..357f093c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineRequestBuilder.java @@ -4,11 +4,15 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetTimelineRequestBuilder { private GetTimelineRequest request; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetTimeline sdk; public GetTimelineRequestBuilder(SDKMethodInterfaces.MethodCallGetTimeline sdk) { @@ -20,10 +24,25 @@ public class GetTimelineRequestBuilder { this.request = request; return this; } + + public GetTimelineRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetTimelineRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetTimelineResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getTimeline( - request); + request, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequest.java index b471a5cd..85c870eb 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequest.java @@ -25,43 +25,55 @@ public class GetTokenByPinIdRequest { private long pinID; /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Client-Identifier") + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier") private Optional clientID; - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Product") + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Product") private Optional clientName; - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Device") - private Optional deviceName; + /** + * A relatively friendly name for the client device + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Device") + private Optional deviceNickname; - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Version") + /** + * The version of the client application. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Version") private Optional clientVersion; - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Platform") - private Optional clientPlatform; + /** + * The platform of the client application. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Platform") + private Optional platform; @JsonCreator public GetTokenByPinIdRequest( long pinID, Optional clientID, Optional clientName, - Optional deviceName, + Optional deviceNickname, Optional clientVersion, - Optional clientPlatform) { + Optional platform) { Utils.checkNotNull(pinID, "pinID"); Utils.checkNotNull(clientID, "clientID"); Utils.checkNotNull(clientName, "clientName"); - Utils.checkNotNull(deviceName, "deviceName"); + Utils.checkNotNull(deviceNickname, "deviceNickname"); Utils.checkNotNull(clientVersion, "clientVersion"); - Utils.checkNotNull(clientPlatform, "clientPlatform"); + Utils.checkNotNull(platform, "platform"); this.pinID = pinID; this.clientID = clientID; this.clientName = clientName; - this.deviceName = deviceName; + this.deviceNickname = deviceNickname; this.clientVersion = clientVersion; - this.clientPlatform = clientPlatform; + this.platform = platform; } public GetTokenByPinIdRequest( @@ -78,31 +90,43 @@ public class GetTokenByPinIdRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @JsonIgnore public Optional clientID() { return clientID; } + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ @JsonIgnore public Optional clientName() { return clientName; } + /** + * A relatively friendly name for the client device + */ @JsonIgnore - public Optional deviceName() { - return deviceName; + public Optional deviceNickname() { + return deviceNickname; } + /** + * The version of the client application. + */ @JsonIgnore public Optional clientVersion() { return clientVersion; } + /** + * The platform of the client application. + */ @JsonIgnore - public Optional clientPlatform() { - return clientPlatform; + public Optional platform() { + return platform; } public final static Builder builder() { @@ -119,7 +143,7 @@ public class GetTokenByPinIdRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public GetTokenByPinIdRequest withClientID(String clientID) { Utils.checkNotNull(clientID, "clientID"); @@ -128,7 +152,7 @@ public class GetTokenByPinIdRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public GetTokenByPinIdRequest withClientID(Optional clientID) { Utils.checkNotNull(clientID, "clientID"); @@ -136,51 +160,75 @@ public class GetTokenByPinIdRequest { return this; } + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ public GetTokenByPinIdRequest withClientName(String clientName) { Utils.checkNotNull(clientName, "clientName"); this.clientName = Optional.ofNullable(clientName); return this; } + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ public GetTokenByPinIdRequest withClientName(Optional clientName) { Utils.checkNotNull(clientName, "clientName"); this.clientName = clientName; return this; } - public GetTokenByPinIdRequest withDeviceName(String deviceName) { - Utils.checkNotNull(deviceName, "deviceName"); - this.deviceName = Optional.ofNullable(deviceName); + /** + * A relatively friendly name for the client device + */ + public GetTokenByPinIdRequest withDeviceNickname(String deviceNickname) { + Utils.checkNotNull(deviceNickname, "deviceNickname"); + this.deviceNickname = Optional.ofNullable(deviceNickname); return this; } - public GetTokenByPinIdRequest withDeviceName(Optional deviceName) { - Utils.checkNotNull(deviceName, "deviceName"); - this.deviceName = deviceName; + /** + * A relatively friendly name for the client device + */ + public GetTokenByPinIdRequest withDeviceNickname(Optional deviceNickname) { + Utils.checkNotNull(deviceNickname, "deviceNickname"); + this.deviceNickname = deviceNickname; return this; } + /** + * The version of the client application. + */ public GetTokenByPinIdRequest withClientVersion(String clientVersion) { Utils.checkNotNull(clientVersion, "clientVersion"); this.clientVersion = Optional.ofNullable(clientVersion); return this; } + /** + * The version of the client application. + */ public GetTokenByPinIdRequest withClientVersion(Optional clientVersion) { Utils.checkNotNull(clientVersion, "clientVersion"); this.clientVersion = clientVersion; return this; } - public GetTokenByPinIdRequest withClientPlatform(String clientPlatform) { - Utils.checkNotNull(clientPlatform, "clientPlatform"); - this.clientPlatform = Optional.ofNullable(clientPlatform); + /** + * The platform of the client application. + */ + public GetTokenByPinIdRequest withPlatform(String platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = Optional.ofNullable(platform); return this; } - public GetTokenByPinIdRequest withClientPlatform(Optional clientPlatform) { - Utils.checkNotNull(clientPlatform, "clientPlatform"); - this.clientPlatform = clientPlatform; + /** + * The platform of the client application. + */ + public GetTokenByPinIdRequest withPlatform(Optional platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = platform; return this; } @@ -197,9 +245,9 @@ public class GetTokenByPinIdRequest { Objects.deepEquals(this.pinID, other.pinID) && Objects.deepEquals(this.clientID, other.clientID) && Objects.deepEquals(this.clientName, other.clientName) && - Objects.deepEquals(this.deviceName, other.deviceName) && + Objects.deepEquals(this.deviceNickname, other.deviceNickname) && Objects.deepEquals(this.clientVersion, other.clientVersion) && - Objects.deepEquals(this.clientPlatform, other.clientPlatform); + Objects.deepEquals(this.platform, other.platform); } @Override @@ -208,9 +256,9 @@ public class GetTokenByPinIdRequest { pinID, clientID, clientName, - deviceName, + deviceNickname, clientVersion, - clientPlatform); + platform); } @Override @@ -219,9 +267,9 @@ public class GetTokenByPinIdRequest { "pinID", pinID, "clientID", clientID, "clientName", clientName, - "deviceName", deviceName, + "deviceNickname", deviceNickname, "clientVersion", clientVersion, - "clientPlatform", clientPlatform); + "platform", platform); } public final static class Builder { @@ -232,11 +280,11 @@ public class GetTokenByPinIdRequest { private Optional clientName = Optional.empty(); - private Optional deviceName = Optional.empty(); + private Optional deviceNickname = Optional.empty(); private Optional clientVersion = Optional.empty(); - private Optional clientPlatform = Optional.empty(); + private Optional platform = Optional.empty(); private Builder() { // force use of static builder() method @@ -252,7 +300,7 @@ public class GetTokenByPinIdRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public Builder clientID(String clientID) { Utils.checkNotNull(clientID, "clientID"); @@ -261,7 +309,7 @@ public class GetTokenByPinIdRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public Builder clientID(Optional clientID) { Utils.checkNotNull(clientID, "clientID"); @@ -269,51 +317,75 @@ public class GetTokenByPinIdRequest { return this; } + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ public Builder clientName(String clientName) { Utils.checkNotNull(clientName, "clientName"); this.clientName = Optional.ofNullable(clientName); return this; } + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ public Builder clientName(Optional clientName) { Utils.checkNotNull(clientName, "clientName"); this.clientName = clientName; return this; } - public Builder deviceName(String deviceName) { - Utils.checkNotNull(deviceName, "deviceName"); - this.deviceName = Optional.ofNullable(deviceName); + /** + * A relatively friendly name for the client device + */ + public Builder deviceNickname(String deviceNickname) { + Utils.checkNotNull(deviceNickname, "deviceNickname"); + this.deviceNickname = Optional.ofNullable(deviceNickname); return this; } - public Builder deviceName(Optional deviceName) { - Utils.checkNotNull(deviceName, "deviceName"); - this.deviceName = deviceName; + /** + * A relatively friendly name for the client device + */ + public Builder deviceNickname(Optional deviceNickname) { + Utils.checkNotNull(deviceNickname, "deviceNickname"); + this.deviceNickname = deviceNickname; return this; } + /** + * The version of the client application. + */ public Builder clientVersion(String clientVersion) { Utils.checkNotNull(clientVersion, "clientVersion"); this.clientVersion = Optional.ofNullable(clientVersion); return this; } + /** + * The version of the client application. + */ public Builder clientVersion(Optional clientVersion) { Utils.checkNotNull(clientVersion, "clientVersion"); this.clientVersion = clientVersion; return this; } - public Builder clientPlatform(String clientPlatform) { - Utils.checkNotNull(clientPlatform, "clientPlatform"); - this.clientPlatform = Optional.ofNullable(clientPlatform); + /** + * The platform of the client application. + */ + public Builder platform(String platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = Optional.ofNullable(platform); return this; } - public Builder clientPlatform(Optional clientPlatform) { - Utils.checkNotNull(clientPlatform, "clientPlatform"); - this.clientPlatform = clientPlatform; + /** + * The platform of the client application. + */ + public Builder platform(Optional platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = platform; return this; } @@ -322,9 +394,9 @@ public class GetTokenByPinIdRequest { pinID, clientID, clientName, - deviceName, + deviceNickname, clientVersion, - clientPlatform); + platform); } } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequestBuilder.java index d0d0b1d8..96985879 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.String; import java.util.Optional; @@ -12,6 +14,7 @@ public class GetTokenByPinIdRequestBuilder { private GetTokenByPinIdRequest request; private Optional serverURL = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetTokenByPinId sdk; public GetTokenByPinIdRequestBuilder(SDKMethodInterfaces.MethodCallGetTokenByPinId sdk) { @@ -35,11 +38,26 @@ public class GetTokenByPinIdRequestBuilder { this.serverURL = serverURL; return this; } + + public GetTokenByPinIdRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetTokenByPinIdRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetTokenByPinIdResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getTokenByPinId( request, - serverURL); + serverURL, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsFeatures.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsFeatures.java deleted file mode 100644 index 35e7e250..00000000 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsFeatures.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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; - -public enum GetTokenDetailsFeatures { - ANDROID_DOLBY_VISION("Android - Dolby Vision"), - ANDROID_PI_P("Android - PiP"), - CU_SUNSET("CU Sunset"), - HRK_ENABLE_EUR("HRK_enable_EUR"), - TREBLE_SHOW_FEATURES("TREBLE-show-features"), - AD_COUNTDOWN_TIMER("ad-countdown-timer"), - ADAPTIVE_BITRATE("adaptive_bitrate"), - ALBUM_TYPES("album-types"), - ALLOW_DVR("allow_dvr"), - AMAZON_LOOP_DEBUG("amazon-loop-debug"), - AVOD_AD_ANALYSIS("avod-ad-analysis"), - AVOD_NEW_MEDIA("avod-new-media"), - BLACKLIST_GET_SIGNIN("blacklist_get_signin"), - BOOST_VOICES("boost-voices"), - CAMERA_UPLOAD("camera_upload"), - CLIENT_RADIO_STATIONS("client-radio-stations"), - CLOUDFLARE_TURNSTILE_REQUIRED("cloudflare-turnstile-required"), - CLOUDSYNC("cloudsync"), - COLLECTIONS("collections"), - COMMENTS_AND_REPLIES_PUSH_NOTIFICATIONS("comments_and_replies_push_notifications"), - COMMUNITY_ACCESS_PLEX_TV("community_access_plex_tv"), - COMPANIONS_SONOS("companions_sonos"), - CONTENT_FILTER("content_filter"), - CUSTOM_HOME_REMOVAL("custom-home-removal"), - DISABLE_HOME_USER_FRIENDSHIPS("disable_home_user_friendships"), - DISABLE_SHARING_FRIENDSHIPS("disable_sharing_friendships"), - DOWNLOADS_GATING("downloads-gating"), - DRM_SUPPORT("drm_support"), - DVR("dvr"), - DVR_BLOCK_UNSUPPORTED_COUNTRIES("dvr-block-unsupported-countries"), - EPG_RECENT_CHANNELS("epg-recent-channels"), - EXCLUDE_RESTRICTIONS("exclude restrictions"), - FEDERATED_AUTH("federated-auth"), - FRIEND_REQUEST_PUSH_NOTIFICATIONS("friend_request_push_notifications"), - GRANDFATHER_SYNC("grandfather-sync"), - GUIDED_UPGRADE("guided-upgrade"), - HARDWARE_TRANSCODING("hardware_transcoding"), - HOME("home"), - HWTRANSCODE("hwtranscode"), - IMAGGA_V2("imagga-v2"), - INCREASE_PASSWORD_COMPLEXITY("increase-password-complexity"), - IOS14_PRIVACY_BANNER("ios14-privacy-banner"), - ITERABLE_NOTIFICATION_TOKENS("iterable-notification-tokens"), - ITEM_CLUSTERS("item_clusters"), - KEEP_PAYMENT_METHOD("keep-payment-method"), - KEVIN_BACON("kevin-bacon"), - KOREA_CONSENT("korea-consent"), - LE_ISRG_ROOT_X1("le_isrg_root_x1"), - LETS_ENCRYPT("lets_encrypt"), - LIGHTNING_DVR_PIVOT("lightning-dvr-pivot"), - LIVE_TV_SUPPORT_INCOMPLETE_SEGMENTS("live-tv-support-incomplete-segments"), - LIVETV("livetv"), - LYRICS("lyrics"), - METADATA_SEARCH("metadata_search"), - MUSIC_ANALYSIS("music-analysis"), - MUSIC_VIDEOS("music_videos"), - NEW_PLEX_PASS_PRICES("new_plex_pass_prices"), - NEWS_PROVIDER_SUNSET_MODAL("news-provider-sunset-modal"), - NOMINATIM("nominatim"), - PASS("pass"), - PHOTOS_FAVORITES("photos-favorites"), - PHOTOS_METADATA_EDITION("photos-metadata-edition"), - PHOTOS_V6_EDIT("photosV6-edit"), - PHOTOS_V6_TV_ALBUMS("photosV6-tv-albums"), - PMS_HEALTH("pms_health"), - PREMIUM_DASHBOARD("premium-dashboard"), - PREMIUM_MUSIC_METADATA("premium_music_metadata"), - RADIO("radio"), - RATE_LIMIT_CLIENT_TOKEN("rate-limit-client-token"), - SCROBBLING_SERVICE_PLEX_TV("scrobbling-service-plex-tv"), - SESSION_BANDWIDTH_RESTRICTIONS("session_bandwidth_restrictions"), - SESSION_KICK("session_kick"), - SHARED_SERVER_NOTIFICATION("shared_server_notification"), - SHARED_SOURCE_NOTIFICATION("shared_source_notification"), - SIGNIN_NOTIFICATION("signin_notification"), - SIGNIN_WITH_APPLE("signin_with_apple"), - SILENCE_REMOVAL("silence-removal"), - SLEEP_TIMER("sleep-timer"), - SPRING_SERVE_AD_PROVIDER("spring_serve_ad_provider"), - SYNC("sync"), - SWEET_FADES("sweet-fades"), - TRANSCODER_CACHE("transcoder_cache"), - TRAILERS("trailers"), - TUNER_SHARING("tuner-sharing"), - TWO_FACTOR_AUTHENTICATION("two-factor-authentication"), - UNSUPPORTEDTUNERS("unsupportedtuners"), - UPGRADE3DS2("upgrade-3ds2"), - VISUALIZERS("visualizers"), - VOD_SCHEMA("vod-schema"), - VOD_CLOUDFLARE("vod_cloudflare"), - VOLUME_LEVELING("volume-leveling"), - WATCH_TOGETHER_INVITE("watch-together-invite"), - WATCHLIST_RSS("watchlist-rss"), - WEB_SERVER_DASHBOARD("web_server_dashboard"), - WEBHOOKS("webhooks"); - - @JsonValue - private final String value; - - private GetTokenDetailsFeatures(String value) { - this.value = value; - } - - public String value() { - return value; - } -} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsRequestBuilder.java index 61fa32fb..b6686165 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.String; import java.util.Optional; @@ -11,6 +13,7 @@ import java.util.Optional; public class GetTokenDetailsRequestBuilder { private Optional serverURL = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetTokenDetails sdk; public GetTokenDetailsRequestBuilder(SDKMethodInterfaces.MethodCallGetTokenDetails sdk) { @@ -28,10 +31,25 @@ public class GetTokenDetailsRequestBuilder { this.serverURL = serverURL; return this; } + + public GetTokenDetailsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetTokenDetailsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetTokenDetailsResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getTokenDetails( - serverURL); + serverURL, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsSubscription.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsSubscription.java index a1ac8083..10e4d02c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsSubscription.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsSubscription.java @@ -28,7 +28,7 @@ public class GetTokenDetailsSubscription { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("features") - private Optional> features; + private Optional> features; /** * If the account's Plex Pass subscription is active @@ -67,7 +67,7 @@ public class GetTokenDetailsSubscription { @JsonCreator public GetTokenDetailsSubscription( - @JsonProperty("features") Optional> features, + @JsonProperty("features") Optional> features, @JsonProperty("active") Optional active, @JsonProperty("subscribedAt") JsonNullable subscribedAt, @JsonProperty("status") Optional status, @@ -96,8 +96,8 @@ public class GetTokenDetailsSubscription { */ @SuppressWarnings("unchecked") @JsonIgnore - public Optional> features() { - return (Optional>) features; + public Optional> features() { + return (Optional>) features; } /** @@ -148,7 +148,7 @@ public class GetTokenDetailsSubscription { /** * List of features allowed on your Plex Pass subscription */ - public GetTokenDetailsSubscription withFeatures(List features) { + public GetTokenDetailsSubscription withFeatures(List features) { Utils.checkNotNull(features, "features"); this.features = Optional.ofNullable(features); return this; @@ -157,7 +157,7 @@ public class GetTokenDetailsSubscription { /** * List of features allowed on your Plex Pass subscription */ - public GetTokenDetailsSubscription withFeatures(Optional> features) { + public GetTokenDetailsSubscription withFeatures(Optional> features) { Utils.checkNotNull(features, "features"); this.features = features; return this; @@ -295,7 +295,7 @@ public class GetTokenDetailsSubscription { public final static class Builder { - private Optional> features = Optional.empty(); + private Optional> features = Optional.empty(); private Optional active = Optional.empty(); @@ -314,7 +314,7 @@ public class GetTokenDetailsSubscription { /** * List of features allowed on your Plex Pass subscription */ - public Builder features(List features) { + public Builder features(List features) { Utils.checkNotNull(features, "features"); this.features = Optional.ofNullable(features); return this; @@ -323,7 +323,7 @@ public class GetTokenDetailsSubscription { /** * List of features allowed on your Plex Pass subscription */ - public Builder features(Optional> features) { + public Builder features(Optional> features) { Utils.checkNotNull(features, "features"); this.features = features; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequest.java index 1c818abf..85ae9446 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequest.java @@ -18,6 +18,13 @@ import java.util.Optional; public class GetTopWatchedContentRequest { + /** + * Adds the Guids object to the response + * + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeGuids") + private Optional includeGuids; + /** * The type of media to retrieve. * 1 = movie @@ -30,26 +37,28 @@ public class GetTopWatchedContentRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=type") private GetTopWatchedContentQueryParamType type; - /** - * Adds the Guids object to the response - * - */ - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeGuids") - private Optional includeGuids; - @JsonCreator public GetTopWatchedContentRequest( - GetTopWatchedContentQueryParamType type, - Optional includeGuids) { - Utils.checkNotNull(type, "type"); + Optional includeGuids, + GetTopWatchedContentQueryParamType type) { Utils.checkNotNull(includeGuids, "includeGuids"); - this.type = type; + Utils.checkNotNull(type, "type"); this.includeGuids = includeGuids; + this.type = type; } public GetTopWatchedContentRequest( GetTopWatchedContentQueryParamType type) { - this(type, Optional.empty()); + this(Optional.empty(), type); + } + + /** + * Adds the Guids object to the response + * + */ + @JsonIgnore + public Optional includeGuids() { + return includeGuids; } /** @@ -66,34 +75,10 @@ public class GetTopWatchedContentRequest { return type; } - /** - * Adds the Guids object to the response - * - */ - @JsonIgnore - public Optional includeGuids() { - return includeGuids; - } - public final static Builder builder() { return new Builder(); } - /** - * The type of media to retrieve. - * 1 = movie - * 2 = show - * 3 = season - * 4 = episode - * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - * - */ - public GetTopWatchedContentRequest withType(GetTopWatchedContentQueryParamType type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - /** * Adds the Guids object to the response * @@ -113,6 +98,21 @@ public class GetTopWatchedContentRequest { this.includeGuids = includeGuids; return this; } + + /** + * The type of media to retrieve. + * 1 = movie + * 2 = show + * 3 = season + * 4 = episode + * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + * + */ + public GetTopWatchedContentRequest withType(GetTopWatchedContentQueryParamType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } @Override public boolean equals(java.lang.Object o) { @@ -124,49 +124,34 @@ public class GetTopWatchedContentRequest { } GetTopWatchedContentRequest other = (GetTopWatchedContentRequest) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.includeGuids, other.includeGuids); + Objects.deepEquals(this.includeGuids, other.includeGuids) && + Objects.deepEquals(this.type, other.type); } @Override public int hashCode() { return Objects.hash( - type, - includeGuids); + includeGuids, + type); } @Override public String toString() { return Utils.toString(GetTopWatchedContentRequest.class, - "type", type, - "includeGuids", includeGuids); + "includeGuids", includeGuids, + "type", type); } public final static class Builder { - private GetTopWatchedContentQueryParamType type; + private Optional includeGuids = Optional.empty(); - private Optional includeGuids = Optional.empty(); + private GetTopWatchedContentQueryParamType type; private Builder() { // force use of static builder() method } - /** - * The type of media to retrieve. - * 1 = movie - * 2 = show - * 3 = season - * 4 = episode - * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries - * - */ - public Builder type(GetTopWatchedContentQueryParamType type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - /** * Adds the Guids object to the response * @@ -186,11 +171,26 @@ public class GetTopWatchedContentRequest { this.includeGuids = includeGuids; return this; } + + /** + * The type of media to retrieve. + * 1 = movie + * 2 = show + * 3 = season + * 4 = episode + * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + * + */ + public Builder type(GetTopWatchedContentQueryParamType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } public GetTopWatchedContentRequest build() { return new GetTopWatchedContentRequest( - type, - includeGuids); + includeGuids, + type); } } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequestBuilder.java index d910dfac..44ffe0cb 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequestBuilder.java @@ -4,25 +4,22 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.util.Optional; public class GetTopWatchedContentRequestBuilder { - private GetTopWatchedContentQueryParamType type; private Optional includeGuids = Optional.empty(); + private GetTopWatchedContentQueryParamType type; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetTopWatchedContent sdk; public GetTopWatchedContentRequestBuilder(SDKMethodInterfaces.MethodCallGetTopWatchedContent sdk) { this.sdk = sdk; } - - public GetTopWatchedContentRequestBuilder type(GetTopWatchedContentQueryParamType type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } public GetTopWatchedContentRequestBuilder includeGuids(long includeGuids) { Utils.checkNotNull(includeGuids, "includeGuids"); @@ -36,10 +33,31 @@ public class GetTopWatchedContentRequestBuilder { return this; } - public GetTopWatchedContentResponse call() throws Exception { + public GetTopWatchedContentRequestBuilder type(GetTopWatchedContentQueryParamType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public GetTopWatchedContentRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + public GetTopWatchedContentRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public GetTopWatchedContentResponse call() throws Exception { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getTopWatchedContent( + includeGuids, type, - includeGuids); + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsRequestBuilder.java index 46531ad8..105c709a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetTranscodeSessionsRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetTranscodeSessions sdk; public GetTranscodeSessionsRequestBuilder(SDKMethodInterfaces.MethodCallGetTranscodeSessions sdk) { this.sdk = sdk; } + + public GetTranscodeSessionsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetTranscodeSessionsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetTranscodeSessionsResponse call() throws Exception { - - return sdk.getTranscodeSessionsDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getTranscodeSessions( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenRequestBuilder.java index ad320b7d..8f2dc03d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenRequestBuilder.java @@ -4,12 +4,16 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetTransientTokenRequestBuilder { private GetTransientTokenQueryParamType type; private Scope scope; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetTransientToken sdk; public GetTransientTokenRequestBuilder(SDKMethodInterfaces.MethodCallGetTransientToken sdk) { @@ -27,11 +31,26 @@ public class GetTransientTokenRequestBuilder { this.scope = scope; return this; } + + public GetTransientTokenRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetTransientTokenRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetTransientTokenResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getTransientToken( type, - scope); + scope, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusRequestBuilder.java index 9ec2fffa..59a1a583 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class GetUpdateStatusRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetUpdateStatus sdk; public GetUpdateStatusRequestBuilder(SDKMethodInterfaces.MethodCallGetUpdateStatus sdk) { this.sdk = sdk; } + + public GetUpdateStatusRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetUpdateStatusRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetUpdateStatusResponse call() throws Exception { - - return sdk.getUpdateStatusDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getUpdateStatus( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetUserFriendsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetUserFriendsRequestBuilder.java index 5a6c3c26..353162fe 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetUserFriendsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetUserFriendsRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.String; import java.util.Optional; @@ -11,6 +13,7 @@ import java.util.Optional; public class GetUserFriendsRequestBuilder { private Optional serverURL = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetUserFriends sdk; public GetUserFriendsRequestBuilder(SDKMethodInterfaces.MethodCallGetUserFriends sdk) { @@ -28,10 +31,25 @@ public class GetUserFriendsRequestBuilder { this.serverURL = serverURL; return this; } + + public GetUserFriendsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetUserFriendsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetUserFriendsResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getUserFriends( - serverURL); + serverURL, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequest.java index 7ac3950c..bc746970 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequest.java @@ -84,9 +84,9 @@ public class GetWatchListRequest { private Optional xPlexContainerSize; /** - * Plex Authentication Token + * An authentication token, obtained from plex.tv */ - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Token") + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Token") private String xPlexToken; @JsonCreator @@ -208,7 +208,7 @@ public class GetWatchListRequest { } /** - * Plex Authentication Token + * An authentication token, obtained from plex.tv */ @JsonIgnore public String xPlexToken() { @@ -383,7 +383,7 @@ public class GetWatchListRequest { } /** - * Plex Authentication Token + * An authentication token, obtained from plex.tv */ public GetWatchListRequest withXPlexToken(String xPlexToken) { Utils.checkNotNull(xPlexToken, "xPlexToken"); @@ -628,7 +628,7 @@ public class GetWatchListRequest { } /** - * Plex Authentication Token + * An authentication token, obtained from plex.tv */ public Builder xPlexToken(String xPlexToken) { Utils.checkNotNull(xPlexToken, "xPlexToken"); diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequestBuilder.java index 96dc4189..4c7cef5e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.String; import java.util.Optional; @@ -12,6 +14,7 @@ public class GetWatchListRequestBuilder { private GetWatchListRequest request; private Optional serverURL = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetWatchList sdk; public GetWatchListRequestBuilder(SDKMethodInterfaces.MethodCallGetWatchList sdk) { @@ -35,11 +38,26 @@ public class GetWatchListRequestBuilder { this.serverURL = serverURL; return this; } + + public GetWatchListRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetWatchListRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public GetWatchListResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.getWatchList( request, - serverURL); + serverURL, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Location.java b/src/main/java/dev/plexapi/sdk/models/operations/Location.java index fc4499d2..effb96de 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Location.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Location.java @@ -7,39 +7,35 @@ 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.Integer; import java.lang.Override; import java.lang.String; import java.util.Objects; +import java.util.Optional; public class Location { - @JsonProperty("id") - private int id; - + @JsonInclude(Include.NON_ABSENT) @JsonProperty("path") - private String path; + private Optional path; @JsonCreator public Location( - @JsonProperty("id") int id, - @JsonProperty("path") String path) { - Utils.checkNotNull(id, "id"); + @JsonProperty("path") Optional path) { Utils.checkNotNull(path, "path"); - this.id = id; this.path = path; } - - @JsonIgnore - public int id() { - return id; + + public Location() { + this(Optional.empty()); } @JsonIgnore - public String path() { + public Optional path() { return path; } @@ -47,13 +43,13 @@ public class Location { return new Builder(); } - public Location withId(int id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Location withPath(String path) { + Utils.checkNotNull(path, "path"); + this.path = Optional.ofNullable(path); return this; } - public Location withPath(String path) { + public Location withPath(Optional path) { Utils.checkNotNull(path, "path"); this.path = path; return this; @@ -69,41 +65,36 @@ public class Location { } Location other = (Location) o; return - Objects.deepEquals(this.id, other.id) && Objects.deepEquals(this.path, other.path); } @Override public int hashCode() { return Objects.hash( - id, path); } @Override public String toString() { return Utils.toString(Location.class, - "id", id, "path", path); } public final static class Builder { - private Integer id; - - private String path; + private Optional path = Optional.empty(); private Builder() { // force use of static builder() method } - public Builder id(int id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder path(String path) { + Utils.checkNotNull(path, "path"); + this.path = Optional.ofNullable(path); return this; } - public Builder path(String path) { + public Builder path(Optional path) { Utils.checkNotNull(path, "path"); this.path = path; return this; @@ -111,7 +102,6 @@ public class Location { public Location build() { return new Location( - id, path); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/LogLineRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/LogLineRequestBuilder.java index 01fa9fc3..de4b8116 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/LogLineRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/LogLineRequestBuilder.java @@ -4,14 +4,18 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.String; +import java.util.Optional; public class LogLineRequestBuilder { private Level level; private String message; private String source; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallLogLine sdk; public LogLineRequestBuilder(SDKMethodInterfaces.MethodCallLogLine sdk) { @@ -35,12 +39,27 @@ public class LogLineRequestBuilder { this.source = source; return this; } + + public LogLineRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public LogLineRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public LogLineResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.logLine( level, message, - source); + source, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/LogMultiLineRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/LogMultiLineRequestBuilder.java index 222c736b..09c017dc 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/LogMultiLineRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/LogMultiLineRequestBuilder.java @@ -4,12 +4,16 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.String; +import java.util.Optional; public class LogMultiLineRequestBuilder { private String request; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallLogMultiLine sdk; public LogMultiLineRequestBuilder(SDKMethodInterfaces.MethodCallLogMultiLine sdk) { @@ -21,10 +25,25 @@ public class LogMultiLineRequestBuilder { this.request = request; return this; } + + public LogMultiLineRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public LogMultiLineRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public LogMultiLineResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.logMultiLine( - request); + request, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/MarkPlayedRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/MarkPlayedRequestBuilder.java index b8930877..12162ee6 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/MarkPlayedRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/MarkPlayedRequestBuilder.java @@ -4,12 +4,16 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; +import java.util.Optional; public class MarkPlayedRequestBuilder { private Double key; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallMarkPlayed sdk; public MarkPlayedRequestBuilder(SDKMethodInterfaces.MethodCallMarkPlayed sdk) { @@ -21,10 +25,25 @@ public class MarkPlayedRequestBuilder { this.key = key; return this; } + + public MarkPlayedRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public MarkPlayedRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public MarkPlayedResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.markPlayed( - key); + key, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/MarkUnplayedRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/MarkUnplayedRequestBuilder.java index 588bcb9b..a4736f82 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/MarkUnplayedRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/MarkUnplayedRequestBuilder.java @@ -4,12 +4,16 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; +import java.util.Optional; public class MarkUnplayedRequestBuilder { private Double key; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallMarkUnplayed sdk; public MarkUnplayedRequestBuilder(SDKMethodInterfaces.MethodCallMarkUnplayed sdk) { @@ -21,10 +25,25 @@ public class MarkUnplayedRequestBuilder { this.key = key; return this; } + + public MarkUnplayedRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public MarkUnplayedRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public MarkUnplayedResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.markUnplayed( - key); + key, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Media.java b/src/main/java/dev/plexapi/sdk/models/operations/Media.java index f2f6b427..c1b21a6c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Media.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Media.java @@ -29,45 +29,56 @@ public class Media { @JsonProperty("id") private int id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") - private int duration; + private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("bitrate") - private int bitrate; + private Optional bitrate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("width") - private int width; + private Optional width; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("height") - private int height; + private Optional height; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("aspectRatio") - private double aspectRatio; + private Optional aspectRatio; @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioProfile") private Optional audioProfile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioChannels") - private int audioChannels; + private Optional audioChannels; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioCodec") - private String audioCodec; + private Optional audioCodec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoCodec") - private String videoCodec; + private Optional videoCodec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoResolution") - private String videoResolution; + private Optional videoResolution; @JsonProperty("container") private String container; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoFrameRate") - private String videoFrameRate; + private Optional videoFrameRate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoProfile") - private String videoProfile; + private Optional videoProfile; @JsonInclude(Include.NON_ABSENT) @JsonProperty("hasVoiceActivity") @@ -87,19 +98,19 @@ public class Media { @JsonCreator public Media( @JsonProperty("id") int id, - @JsonProperty("duration") int duration, - @JsonProperty("bitrate") int bitrate, - @JsonProperty("width") int width, - @JsonProperty("height") int height, - @JsonProperty("aspectRatio") double aspectRatio, + @JsonProperty("duration") Optional duration, + @JsonProperty("bitrate") Optional bitrate, + @JsonProperty("width") Optional width, + @JsonProperty("height") Optional height, + @JsonProperty("aspectRatio") Optional aspectRatio, @JsonProperty("audioProfile") Optional audioProfile, - @JsonProperty("audioChannels") int audioChannels, - @JsonProperty("audioCodec") String audioCodec, - @JsonProperty("videoCodec") String videoCodec, - @JsonProperty("videoResolution") String videoResolution, + @JsonProperty("audioChannels") Optional audioChannels, + @JsonProperty("audioCodec") Optional audioCodec, + @JsonProperty("videoCodec") Optional videoCodec, + @JsonProperty("videoResolution") Optional videoResolution, @JsonProperty("container") String container, - @JsonProperty("videoFrameRate") String videoFrameRate, - @JsonProperty("videoProfile") String videoProfile, + @JsonProperty("videoFrameRate") Optional videoFrameRate, + @JsonProperty("videoProfile") Optional videoProfile, @JsonProperty("hasVoiceActivity") Optional hasVoiceActivity, @JsonProperty("optimizedForStreaming") Optional optimizedForStreaming, @JsonProperty("has64bitOffsets") Optional has64bitOffsets, @@ -144,20 +155,9 @@ public class Media { public Media( int id, - int duration, - int bitrate, - int width, - int height, - double aspectRatio, - int audioChannels, - String audioCodec, - String videoCodec, - String videoResolution, String container, - String videoFrameRate, - String videoProfile, List part) { - this(id, duration, bitrate, width, height, aspectRatio, Optional.empty(), audioChannels, audioCodec, videoCodec, videoResolution, container, videoFrameRate, videoProfile, Optional.empty(), Optional.empty(), Optional.empty(), part); + this(id, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), container, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), part); } @JsonIgnore @@ -166,27 +166,27 @@ public class Media { } @JsonIgnore - public int duration() { + public Optional duration() { return duration; } @JsonIgnore - public int bitrate() { + public Optional bitrate() { return bitrate; } @JsonIgnore - public int width() { + public Optional width() { return width; } @JsonIgnore - public int height() { + public Optional height() { return height; } @JsonIgnore - public double aspectRatio() { + public Optional aspectRatio() { return aspectRatio; } @@ -196,22 +196,22 @@ public class Media { } @JsonIgnore - public int audioChannels() { + public Optional audioChannels() { return audioChannels; } @JsonIgnore - public String audioCodec() { + public Optional audioCodec() { return audioCodec; } @JsonIgnore - public String videoCodec() { + public Optional videoCodec() { return videoCodec; } @JsonIgnore - public String videoResolution() { + public Optional videoResolution() { return videoResolution; } @@ -221,12 +221,12 @@ public class Media { } @JsonIgnore - public String videoFrameRate() { + public Optional videoFrameRate() { return videoFrameRate; } @JsonIgnore - public String videoProfile() { + public Optional videoProfile() { return videoProfile; } @@ -262,30 +262,60 @@ public class Media { } public Media withDuration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public Media withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; return this; } public Media withBitrate(int bitrate) { + Utils.checkNotNull(bitrate, "bitrate"); + this.bitrate = Optional.ofNullable(bitrate); + return this; + } + + public Media withBitrate(Optional bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = bitrate; return this; } public Media withWidth(int width) { + Utils.checkNotNull(width, "width"); + this.width = Optional.ofNullable(width); + return this; + } + + public Media withWidth(Optional width) { Utils.checkNotNull(width, "width"); this.width = width; return this; } public Media withHeight(int height) { + Utils.checkNotNull(height, "height"); + this.height = Optional.ofNullable(height); + return this; + } + + public Media withHeight(Optional height) { Utils.checkNotNull(height, "height"); this.height = height; return this; } public Media withAspectRatio(double aspectRatio) { + Utils.checkNotNull(aspectRatio, "aspectRatio"); + this.aspectRatio = Optional.ofNullable(aspectRatio); + return this; + } + + public Media withAspectRatio(Optional aspectRatio) { Utils.checkNotNull(aspectRatio, "aspectRatio"); this.aspectRatio = aspectRatio; return this; @@ -304,24 +334,48 @@ public class Media { } public Media withAudioChannels(int audioChannels) { + Utils.checkNotNull(audioChannels, "audioChannels"); + this.audioChannels = Optional.ofNullable(audioChannels); + return this; + } + + public Media withAudioChannels(Optional audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = audioChannels; return this; } public Media withAudioCodec(String audioCodec) { + Utils.checkNotNull(audioCodec, "audioCodec"); + this.audioCodec = Optional.ofNullable(audioCodec); + return this; + } + + public Media withAudioCodec(Optional audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = audioCodec; return this; } public Media withVideoCodec(String videoCodec) { + Utils.checkNotNull(videoCodec, "videoCodec"); + this.videoCodec = Optional.ofNullable(videoCodec); + return this; + } + + public Media withVideoCodec(Optional videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = videoCodec; return this; } public Media withVideoResolution(String videoResolution) { + Utils.checkNotNull(videoResolution, "videoResolution"); + this.videoResolution = Optional.ofNullable(videoResolution); + return this; + } + + public Media withVideoResolution(Optional videoResolution) { Utils.checkNotNull(videoResolution, "videoResolution"); this.videoResolution = videoResolution; return this; @@ -334,12 +388,24 @@ public class Media { } public Media withVideoFrameRate(String videoFrameRate) { + Utils.checkNotNull(videoFrameRate, "videoFrameRate"); + this.videoFrameRate = Optional.ofNullable(videoFrameRate); + return this; + } + + public Media withVideoFrameRate(Optional videoFrameRate) { Utils.checkNotNull(videoFrameRate, "videoFrameRate"); this.videoFrameRate = videoFrameRate; return this; } public Media withVideoProfile(String videoProfile) { + Utils.checkNotNull(videoProfile, "videoProfile"); + this.videoProfile = Optional.ofNullable(videoProfile); + return this; + } + + public Media withVideoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; return this; @@ -467,31 +533,31 @@ public class Media { private Integer id; - private Integer duration; + private Optional duration = Optional.empty(); - private Integer bitrate; + private Optional bitrate = Optional.empty(); - private Integer width; + private Optional width = Optional.empty(); - private Integer height; + private Optional height = Optional.empty(); - private Double aspectRatio; + private Optional aspectRatio = Optional.empty(); private Optional audioProfile = Optional.empty(); - private Integer audioChannels; + private Optional audioChannels = Optional.empty(); - private String audioCodec; + private Optional audioCodec = Optional.empty(); - private String videoCodec; + private Optional videoCodec = Optional.empty(); - private String videoResolution; + private Optional videoResolution = Optional.empty(); private String container; - private String videoFrameRate; + private Optional videoFrameRate = Optional.empty(); - private String videoProfile; + private Optional videoProfile = Optional.empty(); private Optional hasVoiceActivity = Optional.empty(); @@ -512,30 +578,60 @@ public class Media { } public Builder duration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public Builder duration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; return this; } public Builder bitrate(int bitrate) { + Utils.checkNotNull(bitrate, "bitrate"); + this.bitrate = Optional.ofNullable(bitrate); + return this; + } + + public Builder bitrate(Optional bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = bitrate; return this; } public Builder width(int width) { + Utils.checkNotNull(width, "width"); + this.width = Optional.ofNullable(width); + return this; + } + + public Builder width(Optional width) { Utils.checkNotNull(width, "width"); this.width = width; return this; } public Builder height(int height) { + Utils.checkNotNull(height, "height"); + this.height = Optional.ofNullable(height); + return this; + } + + public Builder height(Optional height) { Utils.checkNotNull(height, "height"); this.height = height; return this; } public Builder aspectRatio(double aspectRatio) { + Utils.checkNotNull(aspectRatio, "aspectRatio"); + this.aspectRatio = Optional.ofNullable(aspectRatio); + return this; + } + + public Builder aspectRatio(Optional aspectRatio) { Utils.checkNotNull(aspectRatio, "aspectRatio"); this.aspectRatio = aspectRatio; return this; @@ -554,24 +650,48 @@ public class Media { } public Builder audioChannels(int audioChannels) { + Utils.checkNotNull(audioChannels, "audioChannels"); + this.audioChannels = Optional.ofNullable(audioChannels); + return this; + } + + public Builder audioChannels(Optional audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = audioChannels; return this; } public Builder audioCodec(String audioCodec) { + Utils.checkNotNull(audioCodec, "audioCodec"); + this.audioCodec = Optional.ofNullable(audioCodec); + return this; + } + + public Builder audioCodec(Optional audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = audioCodec; return this; } public Builder videoCodec(String videoCodec) { + Utils.checkNotNull(videoCodec, "videoCodec"); + this.videoCodec = Optional.ofNullable(videoCodec); + return this; + } + + public Builder videoCodec(Optional videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = videoCodec; return this; } public Builder videoResolution(String videoResolution) { + Utils.checkNotNull(videoResolution, "videoResolution"); + this.videoResolution = Optional.ofNullable(videoResolution); + return this; + } + + public Builder videoResolution(Optional videoResolution) { Utils.checkNotNull(videoResolution, "videoResolution"); this.videoResolution = videoResolution; return this; @@ -584,12 +704,24 @@ public class Media { } public Builder videoFrameRate(String videoFrameRate) { + Utils.checkNotNull(videoFrameRate, "videoFrameRate"); + this.videoFrameRate = Optional.ofNullable(videoFrameRate); + return this; + } + + public Builder videoFrameRate(Optional videoFrameRate) { Utils.checkNotNull(videoFrameRate, "videoFrameRate"); this.videoFrameRate = videoFrameRate; return this; } public Builder videoProfile(String videoProfile) { + Utils.checkNotNull(videoProfile, "videoProfile"); + this.videoProfile = Optional.ofNullable(videoProfile); + return this; + } + + public Builder videoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Part.java b/src/main/java/dev/plexapi/sdk/models/operations/Part.java index 648fce8f..3a6d5cfe 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Part.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Part.java @@ -32,8 +32,9 @@ public class Part { @JsonProperty("key") private String key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") - private int duration; + private Optional duration; @JsonProperty("file") private String file; @@ -60,8 +61,9 @@ public class Part { @JsonProperty("optimizedForStreaming") private Optional optimizedForStreaming; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoProfile") - private String videoProfile; + private Optional videoProfile; @JsonInclude(Include.NON_ABSENT) @JsonProperty("indexes") @@ -79,14 +81,14 @@ public class Part { public Part( @JsonProperty("id") int id, @JsonProperty("key") String key, - @JsonProperty("duration") int duration, + @JsonProperty("duration") Optional duration, @JsonProperty("file") String file, @JsonProperty("size") long size, @JsonProperty("container") String container, @JsonProperty("audioProfile") Optional audioProfile, @JsonProperty("has64bitOffsets") Optional has64bitOffsets, @JsonProperty("optimizedForStreaming") Optional optimizedForStreaming, - @JsonProperty("videoProfile") String videoProfile, + @JsonProperty("videoProfile") Optional videoProfile, @JsonProperty("indexes") Optional indexes, @JsonProperty("hasThumbnail") Optional hasThumbnail, @JsonProperty("Stream") Optional> stream) { @@ -121,12 +123,10 @@ public class Part { public Part( int id, String key, - int duration, String file, long size, - String container, - String videoProfile) { - this(id, key, duration, file, size, container, Optional.empty(), Optional.empty(), Optional.empty(), videoProfile, Optional.empty(), Optional.empty(), Optional.empty()); + String container) { + this(id, key, Optional.empty(), file, size, container, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore @@ -140,7 +140,7 @@ public class Part { } @JsonIgnore - public int duration() { + public Optional duration() { return duration; } @@ -179,7 +179,7 @@ public class Part { } @JsonIgnore - public String videoProfile() { + public Optional videoProfile() { return videoProfile; } @@ -217,6 +217,12 @@ public class Part { } public Part withDuration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public Part withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; return this; @@ -281,6 +287,12 @@ public class Part { } public Part withVideoProfile(String videoProfile) { + Utils.checkNotNull(videoProfile, "videoProfile"); + this.videoProfile = Optional.ofNullable(videoProfile); + return this; + } + + public Part withVideoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; return this; @@ -389,7 +401,7 @@ public class Part { private String key; - private Integer duration; + private Optional duration = Optional.empty(); private String file; @@ -403,7 +415,7 @@ public class Part { private Optional optimizedForStreaming = Optional.empty(); - private String videoProfile; + private Optional videoProfile = Optional.empty(); private Optional indexes = Optional.empty(); @@ -428,6 +440,12 @@ public class Part { } public Builder duration(int duration) { + Utils.checkNotNull(duration, "duration"); + this.duration = Optional.ofNullable(duration); + return this; + } + + public Builder duration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; return this; @@ -492,6 +510,12 @@ public class Part { } public Builder videoProfile(String videoProfile) { + Utils.checkNotNull(videoProfile, "videoProfile"); + this.videoProfile = Optional.ofNullable(videoProfile); + return this; + } + + public Builder videoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchRequestBuilder.java index 942bc359..a684cf5a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchRequestBuilder.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.core.type.TypeReference; import dev.plexapi.sdk.utils.LazySingletonValue; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.String; @@ -19,6 +21,7 @@ public class PerformSearchRequestBuilder { "limit", "3", new TypeReference>() {}); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallPerformSearch sdk; public PerformSearchRequestBuilder(SDKMethodInterfaces.MethodCallPerformSearch sdk) { @@ -54,15 +57,30 @@ public class PerformSearchRequestBuilder { this.limit = limit; return this; } + + public PerformSearchRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public PerformSearchRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public PerformSearchResponse call() throws Exception { if (limit == null) { limit = _SINGLETON_VALUE_Limit.value(); - } + } Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.performSearch( query, sectionId, - limit); + limit, + options); } private static final LazySingletonValue> _SINGLETON_VALUE_Limit = diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchRequestBuilder.java index 05dd0cdc..e6c11ae4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchRequestBuilder.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.core.type.TypeReference; import dev.plexapi.sdk.utils.LazySingletonValue; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.String; @@ -19,6 +21,7 @@ public class PerformVoiceSearchRequestBuilder { "limit", "3", new TypeReference>() {}); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallPerformVoiceSearch sdk; public PerformVoiceSearchRequestBuilder(SDKMethodInterfaces.MethodCallPerformVoiceSearch sdk) { @@ -54,15 +57,30 @@ public class PerformVoiceSearchRequestBuilder { this.limit = limit; return this; } + + public PerformVoiceSearchRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public PerformVoiceSearchRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public PerformVoiceSearchResponse call() throws Exception { if (limit == null) { limit = _SINGLETON_VALUE_Limit.value(); - } + } Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.performVoiceSearch( query, sectionId, - limit); + limit, + options); } private static final LazySingletonValue> _SINGLETON_VALUE_Limit = diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationFeatures.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationFeatures.java deleted file mode 100644 index df0f04d7..00000000 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationFeatures.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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; - -public enum PostUsersSignInDataAuthenticationFeatures { - ANDROID_DOLBY_VISION("Android - Dolby Vision"), - ANDROID_PI_P("Android - PiP"), - CU_SUNSET("CU Sunset"), - HRK_ENABLE_EUR("HRK_enable_EUR"), - TREBLE_SHOW_FEATURES("TREBLE-show-features"), - AD_COUNTDOWN_TIMER("ad-countdown-timer"), - ADAPTIVE_BITRATE("adaptive_bitrate"), - ALBUM_TYPES("album-types"), - ALLOW_DVR("allow_dvr"), - AMAZON_LOOP_DEBUG("amazon-loop-debug"), - AVOD_AD_ANALYSIS("avod-ad-analysis"), - AVOD_NEW_MEDIA("avod-new-media"), - BLACKLIST_GET_SIGNIN("blacklist_get_signin"), - BOOST_VOICES("boost-voices"), - CAMERA_UPLOAD("camera_upload"), - CLIENT_RADIO_STATIONS("client-radio-stations"), - CLOUDFLARE_TURNSTILE_REQUIRED("cloudflare-turnstile-required"), - CLOUDSYNC("cloudsync"), - COLLECTIONS("collections"), - COMMENTS_AND_REPLIES_PUSH_NOTIFICATIONS("comments_and_replies_push_notifications"), - COMMUNITY_ACCESS_PLEX_TV("community_access_plex_tv"), - COMPANIONS_SONOS("companions_sonos"), - CONTENT_FILTER("content_filter"), - CUSTOM_HOME_REMOVAL("custom-home-removal"), - DISABLE_HOME_USER_FRIENDSHIPS("disable_home_user_friendships"), - DISABLE_SHARING_FRIENDSHIPS("disable_sharing_friendships"), - DOWNLOADS_GATING("downloads-gating"), - DRM_SUPPORT("drm_support"), - DVR("dvr"), - DVR_BLOCK_UNSUPPORTED_COUNTRIES("dvr-block-unsupported-countries"), - EPG_RECENT_CHANNELS("epg-recent-channels"), - EXCLUDE_RESTRICTIONS("exclude restrictions"), - FEDERATED_AUTH("federated-auth"), - FRIEND_REQUEST_PUSH_NOTIFICATIONS("friend_request_push_notifications"), - GRANDFATHER_SYNC("grandfather-sync"), - GUIDED_UPGRADE("guided-upgrade"), - HARDWARE_TRANSCODING("hardware_transcoding"), - HOME("home"), - HWTRANSCODE("hwtranscode"), - IMAGGA_V2("imagga-v2"), - INCREASE_PASSWORD_COMPLEXITY("increase-password-complexity"), - IOS14_PRIVACY_BANNER("ios14-privacy-banner"), - ITERABLE_NOTIFICATION_TOKENS("iterable-notification-tokens"), - ITEM_CLUSTERS("item_clusters"), - KEEP_PAYMENT_METHOD("keep-payment-method"), - KEVIN_BACON("kevin-bacon"), - KOREA_CONSENT("korea-consent"), - LE_ISRG_ROOT_X1("le_isrg_root_x1"), - LETS_ENCRYPT("lets_encrypt"), - LIGHTNING_DVR_PIVOT("lightning-dvr-pivot"), - LIVE_TV_SUPPORT_INCOMPLETE_SEGMENTS("live-tv-support-incomplete-segments"), - LIVETV("livetv"), - LYRICS("lyrics"), - METADATA_SEARCH("metadata_search"), - MUSIC_ANALYSIS("music-analysis"), - MUSIC_VIDEOS("music_videos"), - NEW_PLEX_PASS_PRICES("new_plex_pass_prices"), - NEWS_PROVIDER_SUNSET_MODAL("news-provider-sunset-modal"), - NOMINATIM("nominatim"), - PASS("pass"), - PHOTOS_FAVORITES("photos-favorites"), - PHOTOS_METADATA_EDITION("photos-metadata-edition"), - PHOTOS_V6_EDIT("photosV6-edit"), - PHOTOS_V6_TV_ALBUMS("photosV6-tv-albums"), - PMS_HEALTH("pms_health"), - PREMIUM_DASHBOARD("premium-dashboard"), - PREMIUM_MUSIC_METADATA("premium_music_metadata"), - RADIO("radio"), - RATE_LIMIT_CLIENT_TOKEN("rate-limit-client-token"), - SCROBBLING_SERVICE_PLEX_TV("scrobbling-service-plex-tv"), - SESSION_BANDWIDTH_RESTRICTIONS("session_bandwidth_restrictions"), - SESSION_KICK("session_kick"), - SHARED_SERVER_NOTIFICATION("shared_server_notification"), - SHARED_SOURCE_NOTIFICATION("shared_source_notification"), - SIGNIN_NOTIFICATION("signin_notification"), - SIGNIN_WITH_APPLE("signin_with_apple"), - SILENCE_REMOVAL("silence-removal"), - SLEEP_TIMER("sleep-timer"), - SPRING_SERVE_AD_PROVIDER("spring_serve_ad_provider"), - SYNC("sync"), - SWEET_FADES("sweet-fades"), - TRANSCODER_CACHE("transcoder_cache"), - TRAILERS("trailers"), - TUNER_SHARING("tuner-sharing"), - TWO_FACTOR_AUTHENTICATION("two-factor-authentication"), - UNSUPPORTEDTUNERS("unsupportedtuners"), - UPGRADE3DS2("upgrade-3ds2"), - VISUALIZERS("visualizers"), - VOD_SCHEMA("vod-schema"), - VOD_CLOUDFLARE("vod_cloudflare"), - VOLUME_LEVELING("volume-leveling"), - WATCH_TOGETHER_INVITE("watch-together-invite"), - WATCHLIST_RSS("watchlist-rss"), - WEB_SERVER_DASHBOARD("web_server_dashboard"), - WEBHOOKS("webhooks"); - - @JsonValue - private final String value; - - private PostUsersSignInDataAuthenticationFeatures(String value) { - this.value = value; - } - - public String value() { - return value; - } -} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationSubscription.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationSubscription.java index 92e47d2a..babecd3f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationSubscription.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationSubscription.java @@ -28,7 +28,7 @@ public class PostUsersSignInDataAuthenticationSubscription { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("features") - private Optional> features; + private Optional> features; /** * If the account's Plex Pass subscription is active @@ -67,7 +67,7 @@ public class PostUsersSignInDataAuthenticationSubscription { @JsonCreator public PostUsersSignInDataAuthenticationSubscription( - @JsonProperty("features") Optional> features, + @JsonProperty("features") Optional> features, @JsonProperty("active") Optional active, @JsonProperty("subscribedAt") JsonNullable subscribedAt, @JsonProperty("status") Optional status, @@ -96,8 +96,8 @@ public class PostUsersSignInDataAuthenticationSubscription { */ @SuppressWarnings("unchecked") @JsonIgnore - public Optional> features() { - return (Optional>) features; + public Optional> features() { + return (Optional>) features; } /** @@ -148,7 +148,7 @@ public class PostUsersSignInDataAuthenticationSubscription { /** * List of features allowed on your Plex Pass subscription */ - public PostUsersSignInDataAuthenticationSubscription withFeatures(List features) { + public PostUsersSignInDataAuthenticationSubscription withFeatures(List features) { Utils.checkNotNull(features, "features"); this.features = Optional.ofNullable(features); return this; @@ -157,7 +157,7 @@ public class PostUsersSignInDataAuthenticationSubscription { /** * List of features allowed on your Plex Pass subscription */ - public PostUsersSignInDataAuthenticationSubscription withFeatures(Optional> features) { + public PostUsersSignInDataAuthenticationSubscription withFeatures(Optional> features) { Utils.checkNotNull(features, "features"); this.features = features; return this; @@ -295,7 +295,7 @@ public class PostUsersSignInDataAuthenticationSubscription { public final static class Builder { - private Optional> features = Optional.empty(); + private Optional> features = Optional.empty(); private Optional active = Optional.empty(); @@ -314,7 +314,7 @@ public class PostUsersSignInDataAuthenticationSubscription { /** * List of features allowed on your Plex Pass subscription */ - public Builder features(List features) { + public Builder features(List features) { Utils.checkNotNull(features, "features"); this.features = Optional.ofNullable(features); return this; @@ -323,7 +323,7 @@ public class PostUsersSignInDataAuthenticationSubscription { /** * List of features allowed on your Plex Pass subscription */ - public Builder features(Optional> features) { + public Builder features(Optional> features) { Utils.checkNotNull(features, "features"); this.features = features; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataFeatures.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataFeatures.java deleted file mode 100644 index 33c19c01..00000000 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataFeatures.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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; - -public enum PostUsersSignInDataFeatures { - ANDROID_DOLBY_VISION("Android - Dolby Vision"), - ANDROID_PI_P("Android - PiP"), - CU_SUNSET("CU Sunset"), - HRK_ENABLE_EUR("HRK_enable_EUR"), - TREBLE_SHOW_FEATURES("TREBLE-show-features"), - AD_COUNTDOWN_TIMER("ad-countdown-timer"), - ADAPTIVE_BITRATE("adaptive_bitrate"), - ALBUM_TYPES("album-types"), - ALLOW_DVR("allow_dvr"), - AMAZON_LOOP_DEBUG("amazon-loop-debug"), - AVOD_AD_ANALYSIS("avod-ad-analysis"), - AVOD_NEW_MEDIA("avod-new-media"), - BLACKLIST_GET_SIGNIN("blacklist_get_signin"), - BOOST_VOICES("boost-voices"), - CAMERA_UPLOAD("camera_upload"), - CLIENT_RADIO_STATIONS("client-radio-stations"), - CLOUDFLARE_TURNSTILE_REQUIRED("cloudflare-turnstile-required"), - CLOUDSYNC("cloudsync"), - COLLECTIONS("collections"), - COMMENTS_AND_REPLIES_PUSH_NOTIFICATIONS("comments_and_replies_push_notifications"), - COMMUNITY_ACCESS_PLEX_TV("community_access_plex_tv"), - COMPANIONS_SONOS("companions_sonos"), - CONTENT_FILTER("content_filter"), - CUSTOM_HOME_REMOVAL("custom-home-removal"), - DISABLE_HOME_USER_FRIENDSHIPS("disable_home_user_friendships"), - DISABLE_SHARING_FRIENDSHIPS("disable_sharing_friendships"), - DOWNLOADS_GATING("downloads-gating"), - DRM_SUPPORT("drm_support"), - DVR("dvr"), - DVR_BLOCK_UNSUPPORTED_COUNTRIES("dvr-block-unsupported-countries"), - EPG_RECENT_CHANNELS("epg-recent-channels"), - EXCLUDE_RESTRICTIONS("exclude restrictions"), - FEDERATED_AUTH("federated-auth"), - FRIEND_REQUEST_PUSH_NOTIFICATIONS("friend_request_push_notifications"), - GRANDFATHER_SYNC("grandfather-sync"), - GUIDED_UPGRADE("guided-upgrade"), - HARDWARE_TRANSCODING("hardware_transcoding"), - HOME("home"), - HWTRANSCODE("hwtranscode"), - IMAGGA_V2("imagga-v2"), - INCREASE_PASSWORD_COMPLEXITY("increase-password-complexity"), - IOS14_PRIVACY_BANNER("ios14-privacy-banner"), - ITERABLE_NOTIFICATION_TOKENS("iterable-notification-tokens"), - ITEM_CLUSTERS("item_clusters"), - KEEP_PAYMENT_METHOD("keep-payment-method"), - KEVIN_BACON("kevin-bacon"), - KOREA_CONSENT("korea-consent"), - LE_ISRG_ROOT_X1("le_isrg_root_x1"), - LETS_ENCRYPT("lets_encrypt"), - LIGHTNING_DVR_PIVOT("lightning-dvr-pivot"), - LIVE_TV_SUPPORT_INCOMPLETE_SEGMENTS("live-tv-support-incomplete-segments"), - LIVETV("livetv"), - LYRICS("lyrics"), - METADATA_SEARCH("metadata_search"), - MUSIC_ANALYSIS("music-analysis"), - MUSIC_VIDEOS("music_videos"), - NEW_PLEX_PASS_PRICES("new_plex_pass_prices"), - NEWS_PROVIDER_SUNSET_MODAL("news-provider-sunset-modal"), - NOMINATIM("nominatim"), - PASS("pass"), - PHOTOS_FAVORITES("photos-favorites"), - PHOTOS_METADATA_EDITION("photos-metadata-edition"), - PHOTOS_V6_EDIT("photosV6-edit"), - PHOTOS_V6_TV_ALBUMS("photosV6-tv-albums"), - PMS_HEALTH("pms_health"), - PREMIUM_DASHBOARD("premium-dashboard"), - PREMIUM_MUSIC_METADATA("premium_music_metadata"), - RADIO("radio"), - RATE_LIMIT_CLIENT_TOKEN("rate-limit-client-token"), - SCROBBLING_SERVICE_PLEX_TV("scrobbling-service-plex-tv"), - SESSION_BANDWIDTH_RESTRICTIONS("session_bandwidth_restrictions"), - SESSION_KICK("session_kick"), - SHARED_SERVER_NOTIFICATION("shared_server_notification"), - SHARED_SOURCE_NOTIFICATION("shared_source_notification"), - SIGNIN_NOTIFICATION("signin_notification"), - SIGNIN_WITH_APPLE("signin_with_apple"), - SILENCE_REMOVAL("silence-removal"), - SLEEP_TIMER("sleep-timer"), - SPRING_SERVE_AD_PROVIDER("spring_serve_ad_provider"), - SYNC("sync"), - SWEET_FADES("sweet-fades"), - TRANSCODER_CACHE("transcoder_cache"), - TRAILERS("trailers"), - TUNER_SHARING("tuner-sharing"), - TWO_FACTOR_AUTHENTICATION("two-factor-authentication"), - UNSUPPORTEDTUNERS("unsupportedtuners"), - UPGRADE3DS2("upgrade-3ds2"), - VISUALIZERS("visualizers"), - VOD_SCHEMA("vod-schema"), - VOD_CLOUDFLARE("vod_cloudflare"), - VOLUME_LEVELING("volume-leveling"), - WATCH_TOGETHER_INVITE("watch-together-invite"), - WATCHLIST_RSS("watchlist-rss"), - WEB_SERVER_DASHBOARD("web_server_dashboard"), - WEBHOOKS("webhooks"); - - @JsonValue - private final String value; - - private PostUsersSignInDataFeatures(String value) { - this.value = value; - } - - public String value() { - return value; - } -} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequest.java index a76b059e..919af2a7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequest.java @@ -19,22 +19,34 @@ import java.util.Optional; public class PostUsersSignInDataRequest { /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Client-Identifier") + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier") private Optional clientID; - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Product") + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Product") private Optional clientName; - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Device") - private Optional deviceName; + /** + * A relatively friendly name for the client device + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Device") + private Optional deviceNickname; - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Version") + /** + * The version of the client application. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Version") private Optional clientVersion; - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Platform") - private Optional clientPlatform; + /** + * The platform of the client application. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Platform") + private Optional platform; /** * Login credentials @@ -46,21 +58,21 @@ public class PostUsersSignInDataRequest { public PostUsersSignInDataRequest( Optional clientID, Optional clientName, - Optional deviceName, + Optional deviceNickname, Optional clientVersion, - Optional clientPlatform, + Optional platform, Optional requestBody) { Utils.checkNotNull(clientID, "clientID"); Utils.checkNotNull(clientName, "clientName"); - Utils.checkNotNull(deviceName, "deviceName"); + Utils.checkNotNull(deviceNickname, "deviceNickname"); Utils.checkNotNull(clientVersion, "clientVersion"); - Utils.checkNotNull(clientPlatform, "clientPlatform"); + Utils.checkNotNull(platform, "platform"); Utils.checkNotNull(requestBody, "requestBody"); this.clientID = clientID; this.clientName = clientName; - this.deviceName = deviceName; + this.deviceNickname = deviceNickname; this.clientVersion = clientVersion; - this.clientPlatform = clientPlatform; + this.platform = platform; this.requestBody = requestBody; } @@ -69,31 +81,43 @@ public class PostUsersSignInDataRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @JsonIgnore public Optional clientID() { return clientID; } + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ @JsonIgnore public Optional clientName() { return clientName; } + /** + * A relatively friendly name for the client device + */ @JsonIgnore - public Optional deviceName() { - return deviceName; + public Optional deviceNickname() { + return deviceNickname; } + /** + * The version of the client application. + */ @JsonIgnore public Optional clientVersion() { return clientVersion; } + /** + * The platform of the client application. + */ @JsonIgnore - public Optional clientPlatform() { - return clientPlatform; + public Optional platform() { + return platform; } /** @@ -110,7 +134,7 @@ public class PostUsersSignInDataRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public PostUsersSignInDataRequest withClientID(String clientID) { Utils.checkNotNull(clientID, "clientID"); @@ -119,7 +143,7 @@ public class PostUsersSignInDataRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public PostUsersSignInDataRequest withClientID(Optional clientID) { Utils.checkNotNull(clientID, "clientID"); @@ -127,51 +151,75 @@ public class PostUsersSignInDataRequest { return this; } + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ public PostUsersSignInDataRequest withClientName(String clientName) { Utils.checkNotNull(clientName, "clientName"); this.clientName = Optional.ofNullable(clientName); return this; } + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ public PostUsersSignInDataRequest withClientName(Optional clientName) { Utils.checkNotNull(clientName, "clientName"); this.clientName = clientName; return this; } - public PostUsersSignInDataRequest withDeviceName(String deviceName) { - Utils.checkNotNull(deviceName, "deviceName"); - this.deviceName = Optional.ofNullable(deviceName); + /** + * A relatively friendly name for the client device + */ + public PostUsersSignInDataRequest withDeviceNickname(String deviceNickname) { + Utils.checkNotNull(deviceNickname, "deviceNickname"); + this.deviceNickname = Optional.ofNullable(deviceNickname); return this; } - public PostUsersSignInDataRequest withDeviceName(Optional deviceName) { - Utils.checkNotNull(deviceName, "deviceName"); - this.deviceName = deviceName; + /** + * A relatively friendly name for the client device + */ + public PostUsersSignInDataRequest withDeviceNickname(Optional deviceNickname) { + Utils.checkNotNull(deviceNickname, "deviceNickname"); + this.deviceNickname = deviceNickname; return this; } + /** + * The version of the client application. + */ public PostUsersSignInDataRequest withClientVersion(String clientVersion) { Utils.checkNotNull(clientVersion, "clientVersion"); this.clientVersion = Optional.ofNullable(clientVersion); return this; } + /** + * The version of the client application. + */ public PostUsersSignInDataRequest withClientVersion(Optional clientVersion) { Utils.checkNotNull(clientVersion, "clientVersion"); this.clientVersion = clientVersion; return this; } - public PostUsersSignInDataRequest withClientPlatform(String clientPlatform) { - Utils.checkNotNull(clientPlatform, "clientPlatform"); - this.clientPlatform = Optional.ofNullable(clientPlatform); + /** + * The platform of the client application. + */ + public PostUsersSignInDataRequest withPlatform(String platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = Optional.ofNullable(platform); return this; } - public PostUsersSignInDataRequest withClientPlatform(Optional clientPlatform) { - Utils.checkNotNull(clientPlatform, "clientPlatform"); - this.clientPlatform = clientPlatform; + /** + * The platform of the client application. + */ + public PostUsersSignInDataRequest withPlatform(Optional platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = platform; return this; } @@ -205,9 +253,9 @@ public class PostUsersSignInDataRequest { return Objects.deepEquals(this.clientID, other.clientID) && Objects.deepEquals(this.clientName, other.clientName) && - Objects.deepEquals(this.deviceName, other.deviceName) && + Objects.deepEquals(this.deviceNickname, other.deviceNickname) && Objects.deepEquals(this.clientVersion, other.clientVersion) && - Objects.deepEquals(this.clientPlatform, other.clientPlatform) && + Objects.deepEquals(this.platform, other.platform) && Objects.deepEquals(this.requestBody, other.requestBody); } @@ -216,9 +264,9 @@ public class PostUsersSignInDataRequest { return Objects.hash( clientID, clientName, - deviceName, + deviceNickname, clientVersion, - clientPlatform, + platform, requestBody); } @@ -227,9 +275,9 @@ public class PostUsersSignInDataRequest { return Utils.toString(PostUsersSignInDataRequest.class, "clientID", clientID, "clientName", clientName, - "deviceName", deviceName, + "deviceNickname", deviceNickname, "clientVersion", clientVersion, - "clientPlatform", clientPlatform, + "platform", platform, "requestBody", requestBody); } @@ -239,11 +287,11 @@ public class PostUsersSignInDataRequest { private Optional clientName = Optional.empty(); - private Optional deviceName = Optional.empty(); + private Optional deviceNickname = Optional.empty(); private Optional clientVersion = Optional.empty(); - private Optional clientPlatform = Optional.empty(); + private Optional platform = Optional.empty(); private Optional requestBody = Optional.empty(); @@ -252,7 +300,7 @@ public class PostUsersSignInDataRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public Builder clientID(String clientID) { Utils.checkNotNull(clientID, "clientID"); @@ -261,7 +309,7 @@ public class PostUsersSignInDataRequest { } /** - * The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public Builder clientID(Optional clientID) { Utils.checkNotNull(clientID, "clientID"); @@ -269,51 +317,75 @@ public class PostUsersSignInDataRequest { return this; } + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ public Builder clientName(String clientName) { Utils.checkNotNull(clientName, "clientName"); this.clientName = Optional.ofNullable(clientName); return this; } + /** + * The name of the client application. (Plex Web, Plex Media Server, etc.) + */ public Builder clientName(Optional clientName) { Utils.checkNotNull(clientName, "clientName"); this.clientName = clientName; return this; } - public Builder deviceName(String deviceName) { - Utils.checkNotNull(deviceName, "deviceName"); - this.deviceName = Optional.ofNullable(deviceName); + /** + * A relatively friendly name for the client device + */ + public Builder deviceNickname(String deviceNickname) { + Utils.checkNotNull(deviceNickname, "deviceNickname"); + this.deviceNickname = Optional.ofNullable(deviceNickname); return this; } - public Builder deviceName(Optional deviceName) { - Utils.checkNotNull(deviceName, "deviceName"); - this.deviceName = deviceName; + /** + * A relatively friendly name for the client device + */ + public Builder deviceNickname(Optional deviceNickname) { + Utils.checkNotNull(deviceNickname, "deviceNickname"); + this.deviceNickname = deviceNickname; return this; } + /** + * The version of the client application. + */ public Builder clientVersion(String clientVersion) { Utils.checkNotNull(clientVersion, "clientVersion"); this.clientVersion = Optional.ofNullable(clientVersion); return this; } + /** + * The version of the client application. + */ public Builder clientVersion(Optional clientVersion) { Utils.checkNotNull(clientVersion, "clientVersion"); this.clientVersion = clientVersion; return this; } - public Builder clientPlatform(String clientPlatform) { - Utils.checkNotNull(clientPlatform, "clientPlatform"); - this.clientPlatform = Optional.ofNullable(clientPlatform); + /** + * The platform of the client application. + */ + public Builder platform(String platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = Optional.ofNullable(platform); return this; } - public Builder clientPlatform(Optional clientPlatform) { - Utils.checkNotNull(clientPlatform, "clientPlatform"); - this.clientPlatform = clientPlatform; + /** + * The platform of the client application. + */ + public Builder platform(Optional platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = platform; return this; } @@ -339,9 +411,9 @@ public class PostUsersSignInDataRequest { return new PostUsersSignInDataRequest( clientID, clientName, - deviceName, + deviceNickname, clientVersion, - clientPlatform, + platform, requestBody); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequestBuilder.java index 3021fda5..e9a37c50 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.String; import java.util.Optional; @@ -12,6 +14,7 @@ public class PostUsersSignInDataRequestBuilder { private PostUsersSignInDataRequest request; private Optional serverURL = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallPostUsersSignInData sdk; public PostUsersSignInDataRequestBuilder(SDKMethodInterfaces.MethodCallPostUsersSignInData sdk) { @@ -35,11 +38,26 @@ public class PostUsersSignInDataRequestBuilder { this.serverURL = serverURL; return this; } + + public PostUsersSignInDataRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public PostUsersSignInDataRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public PostUsersSignInDataResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.postUsersSignInData( request, - serverURL); + serverURL, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataSubscription.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataSubscription.java index a2b8acf9..d6c34b63 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataSubscription.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataSubscription.java @@ -31,7 +31,7 @@ public class PostUsersSignInDataSubscription { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("features") - private Optional> features; + private Optional> features; /** * If the account's Plex Pass subscription is active @@ -70,7 +70,7 @@ public class PostUsersSignInDataSubscription { @JsonCreator public PostUsersSignInDataSubscription( - @JsonProperty("features") Optional> features, + @JsonProperty("features") Optional> features, @JsonProperty("active") Optional active, @JsonProperty("subscribedAt") JsonNullable subscribedAt, @JsonProperty("status") Optional status, @@ -99,8 +99,8 @@ public class PostUsersSignInDataSubscription { */ @SuppressWarnings("unchecked") @JsonIgnore - public Optional> features() { - return (Optional>) features; + public Optional> features() { + return (Optional>) features; } /** @@ -151,7 +151,7 @@ public class PostUsersSignInDataSubscription { /** * List of features allowed on your Plex Pass subscription */ - public PostUsersSignInDataSubscription withFeatures(List features) { + public PostUsersSignInDataSubscription withFeatures(List features) { Utils.checkNotNull(features, "features"); this.features = Optional.ofNullable(features); return this; @@ -160,7 +160,7 @@ public class PostUsersSignInDataSubscription { /** * List of features allowed on your Plex Pass subscription */ - public PostUsersSignInDataSubscription withFeatures(Optional> features) { + public PostUsersSignInDataSubscription withFeatures(Optional> features) { Utils.checkNotNull(features, "features"); this.features = features; return this; @@ -298,7 +298,7 @@ public class PostUsersSignInDataSubscription { public final static class Builder { - private Optional> features = Optional.empty(); + private Optional> features = Optional.empty(); private Optional active = Optional.empty(); @@ -317,7 +317,7 @@ public class PostUsersSignInDataSubscription { /** * List of features allowed on your Plex Pass subscription */ - public Builder features(List features) { + public Builder features(List features) { Utils.checkNotNull(features, "features"); this.features = Optional.ofNullable(features); return this; @@ -326,7 +326,7 @@ public class PostUsersSignInDataSubscription { /** * List of features allowed on your Plex Pass subscription */ - public Builder features(Optional> features) { + public Builder features(Optional> features) { Utils.checkNotNull(features, "features"); this.features = features; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeCollections.java b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeCollections.java new file mode 100644 index 00000000..de75e75d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeCollections.java @@ -0,0 +1,26 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * QueryParamIncludeCollections - Whether to include collections in the search results. + */ +public enum QueryParamIncludeCollections { + Disable(0), + Enable(1); + + @JsonValue + private final int value; + + private QueryParamIncludeCollections(int value) { + this.value = value; + } + + public int value() { + return value; + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeExternalMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeExternalMedia.java new file mode 100644 index 00000000..09bceeb9 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeExternalMedia.java @@ -0,0 +1,26 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * QueryParamIncludeExternalMedia - Whether to include external media in the search results. + */ +public enum QueryParamIncludeExternalMedia { + Disable(0), + Enable(1); + + @JsonValue + private final int value; + + private QueryParamIncludeExternalMedia(int value) { + this.value = value; + } + + public int value() { + return value; + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java b/src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java index 24d968e6..1833cfe3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java @@ -4,6 +4,7 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; import java.lang.Double; import java.lang.Exception; import java.lang.Long; @@ -14,61 +15,72 @@ public class SDKMethodInterfaces { public interface MethodCallGetServerCapabilities { - GetServerCapabilitiesResponse getServerCapabilitiesDirect() throws Exception; + GetServerCapabilitiesResponse getServerCapabilities( + Optional options) throws Exception; } public interface MethodCallGetServerPreferences { - GetServerPreferencesResponse getServerPreferencesDirect() throws Exception; + GetServerPreferencesResponse getServerPreferences( + Optional options) throws Exception; } public interface MethodCallGetAvailableClients { - GetAvailableClientsResponse getAvailableClientsDirect() throws Exception; + GetAvailableClientsResponse getAvailableClients( + Optional options) throws Exception; } public interface MethodCallGetDevices { - GetDevicesResponse getDevicesDirect() throws Exception; + GetDevicesResponse getDevices( + Optional options) throws Exception; } public interface MethodCallGetServerIdentity { - GetServerIdentityResponse getServerIdentityDirect() throws Exception; + GetServerIdentityResponse getServerIdentity( + Optional options) throws Exception; } public interface MethodCallGetMyPlexAccount { - GetMyPlexAccountResponse getMyPlexAccountDirect() throws Exception; + GetMyPlexAccountResponse getMyPlexAccount( + Optional options) throws Exception; } public interface MethodCallGetResizedPhoto { GetResizedPhotoResponse getResizedPhoto( - GetResizedPhotoRequest request) throws Exception; + GetResizedPhotoRequest request, + Optional options) throws Exception; } public interface MethodCallGetMediaProviders { GetMediaProvidersResponse getMediaProviders( - String xPlexToken) throws Exception; + String xPlexToken, + Optional options) throws Exception; } public interface MethodCallGetServerList { - GetServerListResponse getServerListDirect() throws Exception; + GetServerListResponse getServerList( + Optional options) throws Exception; } public interface MethodCallMarkPlayed { MarkPlayedResponse markPlayed( - double key) throws Exception; + double key, + Optional options) throws Exception; } public interface MethodCallMarkUnplayed { MarkUnplayedResponse markUnplayed( - double key) throws Exception; + double key, + Optional options) throws Exception; } @@ -76,92 +88,108 @@ public class SDKMethodInterfaces { UpdatePlayProgressResponse updatePlayProgress( String key, double time, - String state) throws Exception; + String state, + Optional options) throws Exception; } public interface MethodCallGetBannerImage { GetBannerImageResponse getBannerImage( - GetBannerImageRequest request) throws Exception; + GetBannerImageRequest request, + Optional options) throws Exception; } public interface MethodCallGetThumbImage { GetThumbImageResponse getThumbImage( - GetThumbImageRequest request) throws Exception; + GetThumbImageRequest request, + Optional options) throws Exception; } public interface MethodCallGetTimeline { GetTimelineResponse getTimeline( - GetTimelineRequest request) throws Exception; + GetTimelineRequest request, + Optional options) throws Exception; } public interface MethodCallStartUniversalTranscode { StartUniversalTranscodeResponse startUniversalTranscode( - StartUniversalTranscodeRequest request) throws Exception; + StartUniversalTranscodeRequest request, + Optional options) throws Exception; } public interface MethodCallGetServerActivities { - GetServerActivitiesResponse getServerActivitiesDirect() throws Exception; + GetServerActivitiesResponse getServerActivities( + Optional options) throws Exception; } public interface MethodCallCancelServerActivities { CancelServerActivitiesResponse cancelServerActivities( - String activityUUID) throws Exception; + String activityUUID, + Optional options) throws Exception; } public interface MethodCallGetButlerTasks { - GetButlerTasksResponse getButlerTasksDirect() throws Exception; + GetButlerTasksResponse getButlerTasks( + Optional options) throws Exception; } public interface MethodCallStartAllTasks { - StartAllTasksResponse startAllTasksDirect() throws Exception; + StartAllTasksResponse startAllTasks( + Optional options) throws Exception; } public interface MethodCallStopAllTasks { - StopAllTasksResponse stopAllTasksDirect() throws Exception; + StopAllTasksResponse stopAllTasks( + Optional options) throws Exception; } public interface MethodCallStartTask { StartTaskResponse startTask( - TaskName taskName) throws Exception; + TaskName taskName, + Optional options) throws Exception; } public interface MethodCallStopTask { StopTaskResponse stopTask( - PathParamTaskName taskName) throws Exception; + PathParamTaskName taskName, + Optional options) throws Exception; } public interface MethodCallGetCompanionsData { GetCompanionsDataResponse getCompanionsData( - Optional serverURL) throws Exception; + Optional serverURL, + Optional options) throws Exception; } public interface MethodCallGetUserFriends { GetUserFriendsResponse getUserFriends( - Optional serverURL) throws Exception; + Optional serverURL, + Optional options) throws Exception; } public interface MethodCallGetGeoData { GetGeoDataResponse getGeoData( - Optional serverURL) throws Exception; + Optional serverURL, + Optional options) throws Exception; } public interface MethodCallGetHomeData { - GetHomeDataResponse getHomeDataDirect() throws Exception; + GetHomeDataResponse getHomeData( + Optional options) throws Exception; } @@ -171,34 +199,39 @@ public class SDKMethodInterfaces { Optional includeRelay, Optional includeIPv6, Optional clientID, - Optional serverURL) throws Exception; + Optional serverURL, + Optional options) throws Exception; } public interface MethodCallGetPin { GetPinResponse getPin( GetPinRequest request, - Optional serverURL) throws Exception; + Optional serverURL, + Optional options) throws Exception; } public interface MethodCallGetTokenByPinId { GetTokenByPinIdResponse getTokenByPinId( GetTokenByPinIdRequest request, - Optional serverURL) throws Exception; + Optional serverURL, + Optional options) throws Exception; } public interface MethodCallGetGlobalHubs { GetGlobalHubsResponse getGlobalHubs( Optional count, - Optional onlyTransient) throws Exception; + Optional onlyTransient, + Optional options) throws Exception; } public interface MethodCallGetRecentlyAdded { GetRecentlyAddedResponse getRecentlyAdded( - GetRecentlyAddedRequest request) throws Exception; + GetRecentlyAddedRequest request, + Optional options) throws Exception; } @@ -206,7 +239,8 @@ public class SDKMethodInterfaces { GetLibraryHubsResponse getLibraryHubs( double sectionId, Optional count, - Optional onlyTransient) throws Exception; + Optional onlyTransient, + Optional options) throws Exception; } @@ -214,7 +248,8 @@ public class SDKMethodInterfaces { PerformSearchResponse performSearch( String query, Optional sectionId, - Optional limit) throws Exception; + Optional limit, + Optional options) throws Exception; } @@ -222,96 +257,118 @@ public class SDKMethodInterfaces { PerformVoiceSearchResponse performVoiceSearch( String query, Optional sectionId, - Optional limit) throws Exception; + Optional limit, + Optional options) throws Exception; } public interface MethodCallGetSearchResults { GetSearchResultsResponse getSearchResults( - String query) throws Exception; + String query, + Optional options) throws Exception; } public interface MethodCallGetFileHash { GetFileHashResponse getFileHash( String url, - Optional type) throws Exception; + Optional type, + Optional options) throws Exception; } public interface MethodCallGetRecentlyAddedLibrary { GetRecentlyAddedLibraryResponse getRecentlyAddedLibrary( - GetRecentlyAddedLibraryRequest request) throws Exception; + GetRecentlyAddedLibraryRequest request, + Optional options) throws Exception; } public interface MethodCallGetAllLibraries { - GetAllLibrariesResponse getAllLibrariesDirect() throws Exception; + GetAllLibrariesResponse getAllLibraries( + Optional options) throws Exception; } public interface MethodCallGetLibraryDetails { GetLibraryDetailsResponse getLibraryDetails( + Optional includeDetails, int sectionKey, - Optional includeDetails) throws Exception; + Optional options) throws Exception; } public interface MethodCallDeleteLibrary { DeleteLibraryResponse deleteLibrary( - int sectionKey) throws Exception; + int sectionKey, + Optional options) throws Exception; } public interface MethodCallGetLibraryItems { GetLibraryItemsResponse getLibraryItems( - GetLibraryItemsRequest request) throws Exception; + GetLibraryItemsRequest request, + Optional options) throws Exception; } public interface MethodCallGetRefreshLibraryMetadata { GetRefreshLibraryMetadataResponse getRefreshLibraryMetadata( + Optional force, int sectionKey, - Optional force) throws Exception; + Optional options) throws Exception; } public interface MethodCallGetSearchLibrary { GetSearchLibraryResponse getSearchLibrary( int sectionKey, - GetSearchLibraryQueryParamType type) throws Exception; + GetSearchLibraryQueryParamType type, + Optional options) throws Exception; + } + + + public interface MethodCallGetSearchAllLibraries { + GetSearchAllLibrariesResponse getSearchAllLibraries( + GetSearchAllLibrariesRequest request, + Optional options) throws Exception; } public interface MethodCallGetMetaDataByRatingKey { GetMetaDataByRatingKeyResponse getMetaDataByRatingKey( - long ratingKey) throws Exception; + long ratingKey, + Optional options) throws Exception; } public interface MethodCallGetMetadataChildren { GetMetadataChildrenResponse getMetadataChildren( double ratingKey, - Optional includeElements) throws Exception; + Optional includeElements, + Optional options) throws Exception; } public interface MethodCallGetTopWatchedContent { GetTopWatchedContentResponse getTopWatchedContent( + Optional includeGuids, GetTopWatchedContentQueryParamType type, - Optional includeGuids) throws Exception; + Optional options) throws Exception; } public interface MethodCallGetOnDeck { - GetOnDeckResponse getOnDeckDirect() throws Exception; + GetOnDeckResponse getOnDeck( + Optional options) throws Exception; } public interface MethodCallGetWatchList { GetWatchListResponse getWatchList( GetWatchListRequest request, - Optional serverURL) throws Exception; + Optional serverURL, + Optional options) throws Exception; } @@ -319,43 +376,50 @@ public class SDKMethodInterfaces { LogLineResponse logLine( Level level, String message, - String source) throws Exception; + String source, + Optional options) throws Exception; } public interface MethodCallLogMultiLine { LogMultiLineResponse logMultiLine( - String request) throws Exception; + String request, + Optional options) throws Exception; } public interface MethodCallEnablePaperTrail { - EnablePaperTrailResponse enablePaperTrailDirect() throws Exception; + EnablePaperTrailResponse enablePaperTrail( + Optional options) throws Exception; } public interface MethodCallCreatePlaylist { CreatePlaylistResponse createPlaylist( - CreatePlaylistRequest request) throws Exception; + CreatePlaylistRequest request, + Optional options) throws Exception; } public interface MethodCallGetPlaylists { GetPlaylistsResponse getPlaylists( Optional playlistType, - Optional smart) throws Exception; + Optional smart, + Optional options) throws Exception; } public interface MethodCallGetPlaylist { GetPlaylistResponse getPlaylist( - double playlistID) throws Exception; + double playlistID, + Optional options) throws Exception; } public interface MethodCallDeletePlaylist { DeletePlaylistResponse deletePlaylist( - double playlistID) throws Exception; + double playlistID, + Optional options) throws Exception; } @@ -363,20 +427,23 @@ public class SDKMethodInterfaces { UpdatePlaylistResponse updatePlaylist( double playlistID, Optional title, - Optional summary) throws Exception; + Optional summary, + Optional options) throws Exception; } public interface MethodCallGetPlaylistContents { GetPlaylistContentsResponse getPlaylistContents( double playlistID, - GetPlaylistContentsQueryParamType type) throws Exception; + GetPlaylistContentsQueryParamType type, + Optional options) throws Exception; } public interface MethodCallClearPlaylistContents { ClearPlaylistContentsResponse clearPlaylistContents( - double playlistID) throws Exception; + double playlistID, + Optional options) throws Exception; } @@ -384,7 +451,8 @@ public class SDKMethodInterfaces { AddPlaylistContentsResponse addPlaylistContents( double playlistID, String uri, - Optional playQueueID) throws Exception; + Optional playQueueID, + Optional options) throws Exception; } @@ -392,56 +460,65 @@ public class SDKMethodInterfaces { UploadPlaylistResponse uploadPlaylist( String path, QueryParamForce force, - long sectionID) throws Exception; + long sectionID, + Optional options) throws Exception; } public interface MethodCallGetTransientToken { GetTransientTokenResponse getTransientToken( GetTransientTokenQueryParamType type, - Scope scope) throws Exception; + Scope scope, + Optional options) throws Exception; } public interface MethodCallGetSourceConnectionInformation { GetSourceConnectionInformationResponse getSourceConnectionInformation( - String source) throws Exception; + String source, + Optional options) throws Exception; } public interface MethodCallGetTokenDetails { GetTokenDetailsResponse getTokenDetails( - Optional serverURL) throws Exception; + Optional serverURL, + Optional options) throws Exception; } public interface MethodCallPostUsersSignInData { PostUsersSignInDataResponse postUsersSignInData( PostUsersSignInDataRequest request, - Optional serverURL) throws Exception; + Optional serverURL, + Optional options) throws Exception; } public interface MethodCallGetStatistics { GetStatisticsResponse getStatistics( - Optional timespan) throws Exception; + Optional timespan, + Optional options) throws Exception; } public interface MethodCallGetResourcesStatistics { GetResourcesStatisticsResponse getResourcesStatistics( - Optional timespan) throws Exception; + Optional timespan, + Optional options) throws Exception; } public interface MethodCallGetBandwidthStatistics { GetBandwidthStatisticsResponse getBandwidthStatistics( - Optional timespan) throws Exception; + Optional timespan, + Optional options) throws Exception; } public interface MethodCallGetSessions { - GetSessionsResponse getSessionsDirect() throws Exception; + GetSessionsResponse getSessions( + Optional options) throws Exception; } @@ -450,36 +527,42 @@ public class SDKMethodInterfaces { Optional sort, Optional accountId, Optional filter, - Optional librarySectionID) throws Exception; + Optional librarySectionID, + Optional options) throws Exception; } public interface MethodCallGetTranscodeSessions { - GetTranscodeSessionsResponse getTranscodeSessionsDirect() throws Exception; + GetTranscodeSessionsResponse getTranscodeSessions( + Optional options) throws Exception; } public interface MethodCallStopTranscodeSession { StopTranscodeSessionResponse stopTranscodeSession( - String sessionKey) throws Exception; + String sessionKey, + Optional options) throws Exception; } public interface MethodCallGetUpdateStatus { - GetUpdateStatusResponse getUpdateStatusDirect() throws Exception; + GetUpdateStatusResponse getUpdateStatus( + Optional options) throws Exception; } public interface MethodCallCheckForUpdates { CheckForUpdatesResponse checkForUpdates( - Optional download) throws Exception; + Optional download, + Optional options) throws Exception; } public interface MethodCallApplyUpdates { ApplyUpdatesResponse applyUpdates( Optional tonight, - Optional skip) throws Exception; + Optional skip, + Optional options) throws Exception; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/SearchResult.java b/src/main/java/dev/plexapi/sdk/models/operations/SearchResult.java new file mode 100644 index 00000000..4871dd16 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/SearchResult.java @@ -0,0 +1,119 @@ +/* + * 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.Float; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; + + +public class SearchResult { + + @JsonProperty("score") + private float score; + + @JsonProperty("Metadata") + private GetSearchAllLibrariesMetadata metadata; + + @JsonCreator + public SearchResult( + @JsonProperty("score") float score, + @JsonProperty("Metadata") GetSearchAllLibrariesMetadata metadata) { + Utils.checkNotNull(score, "score"); + Utils.checkNotNull(metadata, "metadata"); + this.score = score; + this.metadata = metadata; + } + + @JsonIgnore + public float score() { + return score; + } + + @JsonIgnore + public GetSearchAllLibrariesMetadata metadata() { + return metadata; + } + + public final static Builder builder() { + return new Builder(); + } + + public SearchResult withScore(float score) { + Utils.checkNotNull(score, "score"); + this.score = score; + return this; + } + + public SearchResult withMetadata(GetSearchAllLibrariesMetadata 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; + } + SearchResult other = (SearchResult) o; + return + Objects.deepEquals(this.score, other.score) && + Objects.deepEquals(this.metadata, other.metadata); + } + + @Override + public int hashCode() { + return Objects.hash( + score, + metadata); + } + + @Override + public String toString() { + return Utils.toString(SearchResult.class, + "score", score, + "metadata", metadata); + } + + public final static class Builder { + + private Float score; + + private GetSearchAllLibrariesMetadata metadata; + + private Builder() { + // force use of static builder() method + } + + public Builder score(float score) { + Utils.checkNotNull(score, "score"); + this.score = score; + return this; + } + + public Builder metadata(GetSearchAllLibrariesMetadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public SearchResult build() { + return new SearchResult( + score, + metadata); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/SearchTypes.java b/src/main/java/dev/plexapi/sdk/models/operations/SearchTypes.java new file mode 100644 index 00000000..0a8765b2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/SearchTypes.java @@ -0,0 +1,27 @@ +/* + * 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; + +public enum SearchTypes { + MOVIES("movies"), + MUSIC("music"), + OTHER_VIDEOS("otherVideos"), + PEOPLE("people"), + TV("tv"); + + @JsonValue + private final String value; + + private SearchTypes(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StartAllTasksRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/StartAllTasksRequestBuilder.java index 966a0423..3cd24123 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StartAllTasksRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StartAllTasksRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class StartAllTasksRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallStartAllTasks sdk; public StartAllTasksRequestBuilder(SDKMethodInterfaces.MethodCallStartAllTasks sdk) { this.sdk = sdk; } + + public StartAllTasksRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public StartAllTasksRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public StartAllTasksResponse call() throws Exception { - - return sdk.startAllTasksDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.startAllTasks( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StartTaskRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/StartTaskRequestBuilder.java index 5d4c7e01..8a7fc72b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StartTaskRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StartTaskRequestBuilder.java @@ -4,11 +4,15 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class StartTaskRequestBuilder { private TaskName taskName; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallStartTask sdk; public StartTaskRequestBuilder(SDKMethodInterfaces.MethodCallStartTask sdk) { @@ -20,10 +24,25 @@ public class StartTaskRequestBuilder { this.taskName = taskName; return this; } + + public StartTaskRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public StartTaskRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public StartTaskResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.startTask( - taskName); + taskName, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeRequestBuilder.java index dadcbc18..cd3ab7dc 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeRequestBuilder.java @@ -4,11 +4,15 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class StartUniversalTranscodeRequestBuilder { private StartUniversalTranscodeRequest request; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallStartUniversalTranscode sdk; public StartUniversalTranscodeRequestBuilder(SDKMethodInterfaces.MethodCallStartUniversalTranscode sdk) { @@ -20,10 +24,25 @@ public class StartUniversalTranscodeRequestBuilder { this.request = request; return this; } + + public StartUniversalTranscodeRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public StartUniversalTranscodeRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public StartUniversalTranscodeResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.startUniversalTranscode( - request); + request, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StopAllTasksRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/StopAllTasksRequestBuilder.java index f31e3f2d..d88cae08 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StopAllTasksRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StopAllTasksRequestBuilder.java @@ -4,17 +4,37 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; +import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class StopAllTasksRequestBuilder { + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallStopAllTasks sdk; public StopAllTasksRequestBuilder(SDKMethodInterfaces.MethodCallStopAllTasks sdk) { this.sdk = sdk; } + + public StopAllTasksRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public StopAllTasksRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public StopAllTasksResponse call() throws Exception { - - return sdk.stopAllTasksDirect(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.stopAllTasks( + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StopTaskRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/StopTaskRequestBuilder.java index dd143045..4b2c3d25 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StopTaskRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StopTaskRequestBuilder.java @@ -4,11 +4,15 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; +import java.util.Optional; public class StopTaskRequestBuilder { private PathParamTaskName taskName; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallStopTask sdk; public StopTaskRequestBuilder(SDKMethodInterfaces.MethodCallStopTask sdk) { @@ -20,10 +24,25 @@ public class StopTaskRequestBuilder { this.taskName = taskName; return this; } + + public StopTaskRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public StopTaskRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public StopTaskResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.stopTask( - taskName); + taskName, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionRequestBuilder.java index cf76f9c7..89ce5639 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionRequestBuilder.java @@ -4,12 +4,16 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.String; +import java.util.Optional; public class StopTranscodeSessionRequestBuilder { private String sessionKey; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallStopTranscodeSession sdk; public StopTranscodeSessionRequestBuilder(SDKMethodInterfaces.MethodCallStopTranscodeSession sdk) { @@ -21,10 +25,25 @@ public class StopTranscodeSessionRequestBuilder { this.sessionKey = sessionKey; return this; } + + public StopTranscodeSessionRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public StopTranscodeSessionRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public StopTranscodeSessionResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.stopTranscodeSession( - sessionKey); + sessionKey, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Subscription.java b/src/main/java/dev/plexapi/sdk/models/operations/Subscription.java index 4616497e..4311285b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Subscription.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Subscription.java @@ -31,7 +31,7 @@ public class Subscription { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("features") - private Optional> features; + private Optional> features; /** * If the account's Plex Pass subscription is active @@ -70,7 +70,7 @@ public class Subscription { @JsonCreator public Subscription( - @JsonProperty("features") Optional> features, + @JsonProperty("features") Optional> features, @JsonProperty("active") Optional active, @JsonProperty("subscribedAt") JsonNullable subscribedAt, @JsonProperty("status") Optional status, @@ -99,8 +99,8 @@ public class Subscription { */ @SuppressWarnings("unchecked") @JsonIgnore - public Optional> features() { - return (Optional>) features; + public Optional> features() { + return (Optional>) features; } /** @@ -151,7 +151,7 @@ public class Subscription { /** * List of features allowed on your Plex Pass subscription */ - public Subscription withFeatures(List features) { + public Subscription withFeatures(List features) { Utils.checkNotNull(features, "features"); this.features = Optional.ofNullable(features); return this; @@ -160,7 +160,7 @@ public class Subscription { /** * List of features allowed on your Plex Pass subscription */ - public Subscription withFeatures(Optional> features) { + public Subscription withFeatures(Optional> features) { Utils.checkNotNull(features, "features"); this.features = features; return this; @@ -298,7 +298,7 @@ public class Subscription { public final static class Builder { - private Optional> features = Optional.empty(); + private Optional> features = Optional.empty(); private Optional active = Optional.empty(); @@ -317,7 +317,7 @@ public class Subscription { /** * List of features allowed on your Plex Pass subscription */ - public Builder features(List features) { + public Builder features(List features) { Utils.checkNotNull(features, "features"); this.features = Optional.ofNullable(features); return this; @@ -326,7 +326,7 @@ public class Subscription { /** * List of features allowed on your Plex Pass subscription */ - public Builder features(Optional> features) { + public Builder features(Optional> features) { Utils.checkNotNull(features, "features"); this.features = features; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressRequestBuilder.java index 2eb6fb03..33bfd7cd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressRequestBuilder.java @@ -4,15 +4,19 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.String; +import java.util.Optional; public class UpdatePlayProgressRequestBuilder { private String key; private Double time; private String state; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallUpdatePlayProgress sdk; public UpdatePlayProgressRequestBuilder(SDKMethodInterfaces.MethodCallUpdatePlayProgress sdk) { @@ -36,12 +40,27 @@ public class UpdatePlayProgressRequestBuilder { this.state = state; return this; } + + public UpdatePlayProgressRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public UpdatePlayProgressRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public UpdatePlayProgressResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.updatePlayProgress( key, time, - state); + state, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistRequestBuilder.java index 7d2b3cdd..933bddff 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistRequestBuilder.java @@ -4,6 +4,8 @@ package dev.plexapi.sdk.models.operations; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.String; @@ -14,6 +16,7 @@ public class UpdatePlaylistRequestBuilder { private Double playlistID; private Optional title = Optional.empty(); private Optional summary = Optional.empty(); + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallUpdatePlaylist sdk; public UpdatePlaylistRequestBuilder(SDKMethodInterfaces.MethodCallUpdatePlaylist sdk) { @@ -49,12 +52,27 @@ public class UpdatePlaylistRequestBuilder { this.summary = summary; return this; } + + public UpdatePlaylistRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public UpdatePlaylistRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public UpdatePlaylistResponse call() throws Exception { - + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.updatePlaylist( playlistID, title, - summary); + summary, + options); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistRequestBuilder.java index 2739c987..695c243e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistRequestBuilder.java @@ -6,15 +6,19 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.core.type.TypeReference; import dev.plexapi.sdk.utils.LazySingletonValue; +import dev.plexapi.sdk.utils.Options; +import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.String; +import java.util.Optional; public class UploadPlaylistRequestBuilder { private String path; private QueryParamForce force; private Long sectionID; + private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallUploadPlaylist sdk; public UploadPlaylistRequestBuilder(SDKMethodInterfaces.MethodCallUploadPlaylist sdk) { @@ -38,15 +42,30 @@ public class UploadPlaylistRequestBuilder { this.sectionID = sectionID; return this; } + + public UploadPlaylistRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public UploadPlaylistRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } public UploadPlaylistResponse call() throws Exception { if (sectionID == null) { sectionID = _SINGLETON_VALUE_SectionID.value(); - } + } Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); return sdk.uploadPlaylist( path, force, - sectionID); + sectionID, + options); } private static final LazySingletonValue _SINGLETON_VALUE_SectionID =