From 9c8fe4c95eb75650581cc145ad22dee73fee5da7 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Sat, 21 Dec 2024 00:27:05 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.459.2 --- .speakeasy/gen.lock | 33 +- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 14 +- README.md | 49 +-- RELEASES.md | 12 +- USAGE.md | 5 - build.gradle | 18 +- codeSamples.yaml | 415 ++---------------- .../operations/GetLibraryItemsMetadata.md | 2 +- .../GetLibraryItemsQueryParamType.md | 4 +- .../operations/GetLibraryItemsShowOrdering.md | 26 +- .../GetMetaDataByRatingKeyMetadata.md | 5 + docs/models/operations/GetPinRequest.md | 2 +- .../GetPlaylistContentsQueryParamType.md | 4 +- .../operations/GetRecentlyAddedMetadata.md | 2 +- .../GetSearchAllLibrariesMetadata.md | 2 +- .../GetSearchAllLibrariesRequest.md | 2 +- .../GetSearchAllLibrariesShowOrdering.md | 26 +- .../GetSearchLibraryQueryParamType.md | 4 +- .../operations/GetServerResourcesRequest.md | 2 +- .../operations/GetTokenByPinIdRequest.md | 2 +- .../GetTopWatchedContentQueryParamType.md | 4 +- .../operations/PostUsersSignInDataRequest.md | 2 +- docs/models/operations/QueryParamType.md | 4 +- docs/models/operations/ShowOrdering.md | 26 +- docs/models/operations/Tag.md | 3 +- docs/models/operations/Type.md | 4 +- docs/sdks/activities/README.md | 10 - docs/sdks/authentication/README.md | 27 +- docs/sdks/butler/README.md | 25 -- docs/sdks/hubs/README.md | 19 +- docs/sdks/library/README.md | 71 +-- docs/sdks/log/README.md | 18 +- docs/sdks/media/README.md | 25 -- docs/sdks/playlists/README.md | 51 +-- docs/sdks/plex/README.md | 47 +- docs/sdks/plexapi/README.md | 3 + docs/sdks/search/README.md | 17 +- docs/sdks/server/README.md | 49 +-- docs/sdks/sessions/README.md | 22 +- docs/sdks/statistics/README.md | 15 - docs/sdks/updater/README.md | 15 - docs/sdks/video/README.md | 10 - docs/sdks/watchlist/README.md | 5 - src/main/java/dev/plexapi/sdk/Activities.java | 26 +- .../java/dev/plexapi/sdk/Authentication.java | 52 +-- src/main/java/dev/plexapi/sdk/Butler.java | 64 +-- src/main/java/dev/plexapi/sdk/Hubs.java | 44 +- src/main/java/dev/plexapi/sdk/Library.java | 192 ++++---- src/main/java/dev/plexapi/sdk/Log.java | 38 +- src/main/java/dev/plexapi/sdk/Media.java | 78 ++-- src/main/java/dev/plexapi/sdk/Playlists.java | 132 +++--- src/main/java/dev/plexapi/sdk/Plex.java | 98 +++-- src/main/java/dev/plexapi/sdk/PlexAPI.java | 91 +--- .../dev/plexapi/sdk/SDKConfiguration.java | 26 +- src/main/java/dev/plexapi/sdk/Search.java | 42 +- src/main/java/dev/plexapi/sdk/Server.java | 110 ++--- src/main/java/dev/plexapi/sdk/Sessions.java | 52 +-- src/main/java/dev/plexapi/sdk/Statistics.java | 42 +- src/main/java/dev/plexapi/sdk/Updater.java | 40 +- src/main/java/dev/plexapi/sdk/Video.java | 28 +- src/main/java/dev/plexapi/sdk/Watchlist.java | 18 +- .../models/operations/ActiveDirection.java | 11 + .../models/operations/AutoSelectSubtitle.java | 11 + .../CreatePlaylistQueryParamType.java | 11 + .../models/operations/DefaultDirection.java | 11 + .../DefaultSubtitleAccessibility.java | 11 + .../operations/DefaultSubtitleForced.java | 11 + .../sdk/models/operations/Download.java | 11 + .../plexapi/sdk/models/operations/Filter.java | 11 + .../sdk/models/operations/FlattenSeasons.java | 11 + .../plexapi/sdk/models/operations/Force.java | 11 + .../GetLibraryItemsActiveDirection.java | 11 + .../GetLibraryItemsDefaultDirection.java | 11 + .../GetLibraryItemsFlattenSeasons.java | 11 + .../GetLibraryItemsHasThumbnail.java | 11 + ...GetLibraryItemsLibraryActiveDirection.java | 11 + ...etLibraryItemsLibraryDefaultDirection.java | 11 + ...GetLibraryItemsLibraryResponse200Type.java | 11 + .../GetLibraryItemsLibraryType.java | 11 + .../operations/GetLibraryItemsMetadata.java | 72 +-- .../GetLibraryItemsOptimizedForStreaming.java | 11 + .../GetLibraryItemsQueryParamIncludeMeta.java | 11 + .../GetLibraryItemsQueryParamType.java | 15 +- .../GetLibraryItemsShowOrdering.java | 29 +- .../GetMetaDataByRatingKeyMetadata.java | 303 ++++++++++++- .../sdk/models/operations/GetPinRequest.java | 31 +- .../GetPlaylistContentsQueryParamType.java | 15 +- .../GetRecentlyAddedActiveDirection.java | 11 + .../GetRecentlyAddedDefaultDirection.java | 11 + .../GetRecentlyAddedHubsResponseType.java | 11 + .../operations/GetRecentlyAddedHubsType.java | 11 + .../operations/GetRecentlyAddedMetadata.java | 72 +-- .../GetSearchAllLibrariesFlattenSeasons.java | 11 + .../GetSearchAllLibrariesHasThumbnail.java | 11 + .../GetSearchAllLibrariesLibraryType.java | 11 + .../GetSearchAllLibrariesMetadata.java | 72 +-- ...archAllLibrariesOptimizedForStreaming.java | 11 + .../GetSearchAllLibrariesRequest.java | 31 +- .../GetSearchAllLibrariesShowOrdering.java | 29 +- .../operations/GetSearchAllLibrariesType.java | 11 + .../GetSearchLibraryQueryParamType.java | 15 +- .../operations/GetServerResourcesRequest.java | 31 +- .../GetServerResourcesRequestBuilder.java | 10 +- .../operations/GetTokenByPinIdRequest.java | 31 +- ...enDetailsAuthenticationResponseStatus.java | 11 + .../GetTokenDetailsAuthenticationStatus.java | 11 + .../operations/GetTokenDetailsStatus.java | 11 + .../GetTopWatchedContentQueryParamType.java | 15 +- .../GetTransientTokenQueryParamType.java | 11 + .../sdk/models/operations/HasThumbnail.java | 11 + .../models/operations/IncludeCollections.java | 11 + .../sdk/models/operations/IncludeDetails.java | 11 + .../operations/IncludeExternalMedia.java | 11 + .../sdk/models/operations/IncludeGuids.java | 11 + .../sdk/models/operations/IncludeHttps.java | 11 + .../sdk/models/operations/IncludeIPv6.java | 11 + .../sdk/models/operations/IncludeMeta.java | 11 + .../sdk/models/operations/IncludeRelay.java | 11 + .../plexapi/sdk/models/operations/Level.java | 11 + .../sdk/models/operations/Libtype.java | 11 + .../models/operations/MailingListStatus.java | 11 + .../operations/MediaReviewsVisibility.java | 11 + .../sdk/models/operations/MinSize.java | 11 + .../sdk/models/operations/OnlyTransient.java | 11 + .../operations/OptimizedForStreaming.java | 11 + .../models/operations/PathParamTaskName.java | 11 + .../sdk/models/operations/PlaylistType.java | 11 + ...ignInDataAuthenticationResponseStatus.java | 11 + ...stUsersSignInDataAuthenticationStatus.java | 11 + ...PostUsersSignInDataAutoSelectSubtitle.java | 11 + ...ignInDataDefaultSubtitleAccessibility.java | 11 + ...tUsersSignInDataDefaultSubtitleForced.java | 11 + .../PostUsersSignInDataMailingListStatus.java | 11 + ...UsersSignInDataMediaReviewsVisibility.java | 11 + .../PostUsersSignInDataRequest.java | 31 +- .../operations/PostUsersSignInDataState.java | 11 + .../operations/PostUsersSignInDataStatus.java | 11 + .../PostUsersSignInDataWatchedIndicator.java | 11 + .../sdk/models/operations/Protocol.java | 11 + .../models/operations/QueryParamForce.java | 11 + .../QueryParamIncludeCollections.java | 11 + .../QueryParamIncludeExternalMedia.java | 11 + .../operations/QueryParamIncludeMeta.java | 11 + .../operations/QueryParamOnlyTransient.java | 11 + .../models/operations/QueryParamSmart.java | 11 + .../sdk/models/operations/QueryParamType.java | 15 +- .../operations/SDKMethodInterfaces.java | 2 +- .../plexapi/sdk/models/operations/Scope.java | 11 + .../sdk/models/operations/SearchTypes.java | 11 + .../sdk/models/operations/ShowOrdering.java | 29 +- .../plexapi/sdk/models/operations/Skip.java | 11 + .../plexapi/sdk/models/operations/Smart.java | 11 + .../plexapi/sdk/models/operations/State.java | 11 + .../plexapi/sdk/models/operations/Status.java | 11 + .../plexapi/sdk/models/operations/Tag.java | 14 +- .../sdk/models/operations/TaskName.java | 11 + .../sdk/models/operations/Tonight.java | 11 + .../plexapi/sdk/models/operations/Type.java | 15 +- .../sdk/models/operations/Upscale.java | 11 + .../models/operations/WatchedIndicator.java | 11 + .../plexapi/sdk/utils/BigDecimalString.java | 30 +- .../plexapi/sdk/utils/BigIntegerString.java | 30 +- .../dev/plexapi/sdk/utils/HTTPRequest.java | 70 ++- .../plexapi/sdk/utils/PathParamsMetadata.java | 4 +- .../dev/plexapi/sdk/utils/QueryParameter.java | 62 +++ .../plexapi/sdk/utils/QueryParameters.java | 59 ++- .../sdk/utils/QueryParamsMetadata.java | 4 +- .../dev/plexapi/sdk/utils/RequestBody.java | 32 +- .../java/dev/plexapi/sdk/utils/Security.java | 64 ++- .../dev/plexapi/sdk/utils/SessionManager.java | 178 ++++++++ .../dev/plexapi/sdk/utils/Utf8UrlEncoder.java | 117 +++++ .../java/dev/plexapi/sdk/utils/Utils.java | 83 ++-- 173 files changed, 2804 insertions(+), 1940 deletions(-) create mode 100644 src/main/java/dev/plexapi/sdk/utils/QueryParameter.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/SessionManager.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/Utf8UrlEncoder.java diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index a8541056..c29cc78e 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 1732900d-e173-47c1-a90d-d45182eb35d9 management: - docChecksum: 2554ade61ed4d42b8e095168765d7dc0 + docChecksum: 48a69156b6fa2af10cd43e971790441b docVersion: 0.0.3 - speakeasyVersion: 1.439.0 - generationVersion: 2.457.9 - releaseVersion: 0.10.1 - configChecksum: e121da064a554c10c4efe58d148f8926 + speakeasyVersion: 1.459.2 + generationVersion: 2.483.1 + releaseVersion: 0.11.0 + configChecksum: 6cd83c39bb832c6f9b6161688569339f repoURL: https://github.com/LukeHagar/plexjava.git published: true features: java: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.1 - core: 3.31.1 + core: 3.33.4 deprecations: 2.81.1 downloadStreams: 0.1.1 enums: 2.81.2 @@ -23,12 +23,10 @@ features: globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 globalServerURLs: 2.82.1 - globals: 2.82.1 methodServerURLs: 2.82.1 nameOverrides: 2.81.3 nullables: 0.1.0 sdkHooks: 0.1.0 - tests: 0.1.0 generatedFiles: - .gitattributes - CONTRIBUTING.md @@ -1762,6 +1760,7 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/utils/OneOfDeserializer.java - src/main/java/dev/plexapi/sdk/utils/Options.java - src/main/java/dev/plexapi/sdk/utils/PathParamsMetadata.java + - src/main/java/dev/plexapi/sdk/utils/QueryParameter.java - src/main/java/dev/plexapi/sdk/utils/QueryParameters.java - src/main/java/dev/plexapi/sdk/utils/QueryParamsMetadata.java - src/main/java/dev/plexapi/sdk/utils/RequestBody.java @@ -1772,10 +1771,12 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/utils/Security.java - src/main/java/dev/plexapi/sdk/utils/SecurityMetadata.java - src/main/java/dev/plexapi/sdk/utils/SerializedBody.java + - src/main/java/dev/plexapi/sdk/utils/SessionManager.java - src/main/java/dev/plexapi/sdk/utils/SpeakeasyHTTPClient.java - src/main/java/dev/plexapi/sdk/utils/SpeakeasyMetadata.java - src/main/java/dev/plexapi/sdk/utils/TypedObject.java - src/main/java/dev/plexapi/sdk/utils/Types.java + - src/main/java/dev/plexapi/sdk/utils/Utf8UrlEncoder.java - src/main/java/dev/plexapi/sdk/utils/Utils.java examples: getServerCapabilities: @@ -1783,7 +1784,8 @@ examples: responses: "401": application/json: {"errors": []} - "200": {} + "200": + application/json: {} "400": application/json: {"errors": []} getServerPreferences: @@ -1987,7 +1989,8 @@ examples: responses: "401": application/json: {"errors": []} - "200": {} + "200": + application/json: {} "400": application/json: {"errors": []} cancelServerActivities: @@ -2299,7 +2302,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"}], "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"}]}]}}} + 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": "tvdbDvd", "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": "tvdbDvd", "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": @@ -2418,7 +2421,8 @@ examples: responses: "401": application/json: {"errors": []} - "200": {} + "200": + application/json: {} "400": application/json: {"errors": []} logLine: @@ -2818,7 +2822,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"}], "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"}]}} + 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": "tvdbDvd", "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: @@ -2849,8 +2853,9 @@ examples: 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"}}]}} + 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": "tvdbAbsolute", "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": "tvdbAbsolute", "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": "tmdbAiring", "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}]} +generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 7ffa8aaf..c5aba344 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false java: - version: 0.10.1 + version: 0.11.0 additionalDependencies: [] additionalPlugins: [] artifactID: plexapi diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 677d28a7..28a58799 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.439.0 +speakeasyVersion: 1.459.2 sources: my-source: sourceNamespace: my-source @@ -8,19 +8,19 @@ sources: - latest plexapi: sourceNamespace: plexapi - sourceRevisionDigest: sha256:37c6bfb15f4154eb89b112465107f20757411f22bd1cc7d0a04335df7127fcb4 - sourceBlobDigest: sha256:290473ebc909cada80ff428c685b897f4621cf121397e1417355e06d334e7206 + sourceRevisionDigest: sha256:ccba0c42f1644923e2209e28da7a78195a843e48da1aeaaedbf8759f1a8a0fe0 + sourceBlobDigest: sha256:b362c110ef633288220a55ab50627374b996c64f2d9b8e020944e84ea2840332 tags: - latest - - main + - speakeasy-sdk-regen-1734740746 targets: plexjava: source: plexapi sourceNamespace: plexapi - sourceRevisionDigest: sha256:37c6bfb15f4154eb89b112465107f20757411f22bd1cc7d0a04335df7127fcb4 - sourceBlobDigest: sha256:290473ebc909cada80ff428c685b897f4621cf121397e1417355e06d334e7206 + sourceRevisionDigest: sha256:ccba0c42f1644923e2209e28da7a78195a843e48da1aeaaedbf8759f1a8a0fe0 + sourceBlobDigest: sha256:b362c110ef633288220a55ab50627374b996c64f2d9b8e020944e84ea2840332 codeSamplesNamespace: code-samples-java-plexjava - codeSamplesRevisionDigest: sha256:218724cff48118b26161c9ff5a0eb0f5aed771cea0d6bcef400db821dd019aea + codeSamplesRevisionDigest: sha256:0612fff80a5399294636de519c9d3e8c24207624718af53454fe4d57a0a714e0 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 8d08aa25..de64648a 100644 --- a/README.md +++ b/README.md @@ -41,13 +41,21 @@ The following SDKs are generated from the OpenAPI Specification. They are automa ## Table of Contents + +* [plexapi](#plexapi) +* [Plex Media Server OpenAPI Specification](#plex-media-server-openapi-specification) + * [Documentation](#documentation) + * [SDKs](#sdks) + * [SDK Installation](#sdk-installation) + * [SDK Example Usage](#sdk-example-usage) + * [Available Resources and Operations](#available-resources-and-operations) + * [Error Handling](#error-handling) + * [Server Selection](#server-selection) + * [Authentication](#authentication) +* [Development](#development) + * [Maturity](#maturity) + * [Contributions](#contributions) -* [SDK Installation](#sdk-installation) -* [SDK Example Usage](#sdk-example-usage) -* [Available Resources and Operations](#available-resources-and-operations) -* [Error Handling](#error-handling) -* [Server Selection](#server-selection) -* [Authentication](#authentication) @@ -61,7 +69,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'dev.plexapi:plexapi:0.10.1' +implementation 'dev.plexapi:plexapi:0.11.0' ``` Maven: @@ -69,7 +77,7 @@ Maven: dev.plexapi plexapi - 0.10.1 + 0.11.0 ``` @@ -108,11 +116,6 @@ public class Application { 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(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() @@ -290,11 +293,6 @@ public class Application { 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(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() @@ -337,11 +335,6 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .serverURL("https://10.10.10.47:32400") .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() @@ -372,11 +365,6 @@ public class Application { 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(); GetCompanionsDataResponse res = sdk.plex().getCompanionsData() @@ -418,11 +406,6 @@ public class Application { 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(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() diff --git a/RELEASES.md b/RELEASES.md index 8bca2a59..2baaa40e 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -178,4 +178,14 @@ Based on: ### Generated - [java v0.10.1] . ### Releases -- [Maven Central v0.10.1] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.10.1 - . \ No newline at end of file +- [Maven Central v0.10.1] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.10.1 - . + +## 2024-12-21 00:25:42 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.459.2 (2.483.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v0.11.0] . +### Releases +- [Maven Central v0.11.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.11.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 66425063..53a171a9 100644 --- a/USAGE.md +++ b/USAGE.md @@ -14,11 +14,6 @@ public class Application { 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(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() diff --git a/build.gradle b/build.gradle index 2b4ce5bf..429aac5b 100644 --- a/build.gradle +++ b/build.gradle @@ -63,7 +63,7 @@ tasks.withType(Javadoc) { } group = "dev.plexapi" -version = "0.10.1" +version = "0.11.0" sourcesJar { archiveBaseName = "plexapi" @@ -101,7 +101,7 @@ publishing { maven(MavenPublication) { groupId = 'dev.plexapi' artifactId = 'plexapi' - version = '0.10.1' + version = '0.11.0' from components.java @@ -145,13 +145,13 @@ if (!project.hasProperty('skip.signing')) { } dependencies { - implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2' - implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2' - implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.17.2' - implementation 'org.openapitools:jackson-databind-nullable:0.2.6' - implementation 'org.apache.httpcomponents:httpclient:4.5.14' - implementation 'org.apache.httpcomponents:httpmime:4.5.14' - implementation 'commons-io:commons-io:2.15.1' + api 'com.fasterxml.jackson.core:jackson-annotations:2.18.2' + implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.2' + implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2' + implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2' + api('org.openapitools:jackson-databind-nullable:0.2.6') {exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'} + implementation 'org.apache.httpcomponents.client5:httpclient5:5.4.1' + implementation 'commons-io:commons-io:2.18.0' } diff --git a/codeSamples.yaml b/codeSamples.yaml index 406f1ac5..9ba3aff9 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -23,11 +23,6 @@ actions: 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(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() @@ -58,11 +53,6 @@ actions: 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(); GetServerPreferencesResponse res = sdk.server().getServerPreferences() @@ -93,11 +83,6 @@ actions: 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(); UpdatePlayProgressResponse res = sdk.media().updatePlayProgress() @@ -129,11 +114,6 @@ actions: 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(); MarkPlayedResponse res = sdk.media().markPlayed() @@ -165,11 +145,6 @@ actions: 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(); GetTimelineRequest req = GetTimelineRequest.builder() @@ -212,11 +187,6 @@ actions: 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(); MarkUnplayedResponse res = sdk.media().markUnplayed() @@ -246,11 +216,6 @@ actions: 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(); GetServerActivitiesResponse res = sdk.activities().getServerActivities() @@ -281,11 +246,6 @@ actions: 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(); CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities() @@ -315,11 +275,6 @@ actions: 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(); StopAllTasksResponse res = sdk.butler().stopAllTasks() @@ -348,11 +303,6 @@ actions: 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(); GetButlerTasksResponse res = sdk.butler().getButlerTasks() @@ -383,11 +333,6 @@ actions: 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(); StartAllTasksResponse res = sdk.butler().startAllTasks() @@ -417,11 +362,6 @@ actions: 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(); StopTaskResponse res = sdk.butler().stopTask() @@ -452,11 +392,6 @@ actions: 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(); StartTaskResponse res = sdk.butler().startTask() @@ -486,11 +421,6 @@ actions: 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(); GetAvailableClientsResponse res = sdk.server().getAvailableClients() @@ -521,11 +451,6 @@ actions: 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(); GetCompanionsDataResponse res = sdk.plex().getCompanionsData() @@ -556,11 +481,6 @@ actions: 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(); GetDevicesResponse res = sdk.server().getDevices() @@ -591,11 +511,6 @@ actions: 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(); GetUserFriendsResponse res = sdk.plex().getUserFriends() @@ -625,11 +540,6 @@ actions: public static void main(String[] args) throws GetGeoDataBadRequest, GetGeoDataUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .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 +570,6 @@ actions: 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(); GetHomeDataResponse res = sdk.plex().getHomeData() @@ -696,11 +601,6 @@ actions: 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(); GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs() @@ -734,11 +634,6 @@ actions: 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(); GetRecentlyAddedRequest req = GetRecentlyAddedRequest.builder() @@ -779,16 +674,11 @@ actions: 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(); PerformSearchResponse res = sdk.search().performSearch() .query("dylan") - .sectionId(9372.69d) + .sectionId(9487.87d) .limit(5d) .call(); @@ -815,11 +705,6 @@ actions: 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(); PerformVoiceSearchResponse res = sdk.search().performVoiceSearch() @@ -852,17 +737,12 @@ actions: 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(); GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs() .sectionId(6728.76d) - .count(639.24d) - .onlyTransient(QueryParamOnlyTransient.ONE) + .count(6728.76d) + .onlyTransient(QueryParamOnlyTransient.ZERO) .call(); if (res.object().isPresent()) { @@ -888,11 +768,6 @@ actions: public static void main(String[] args) throws GetServerIdentityRequestTimeout, Exception { PlexAPI sdk = PlexAPI.builder() - .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,11 +799,6 @@ actions: 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(); GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent() @@ -961,11 +831,6 @@ actions: 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(); GetFileHashResponse res = sdk.library().getFileHash() @@ -996,11 +861,6 @@ actions: 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(); GetMetaDataByRatingKeyResponse res = sdk.library().getMetaDataByRatingKey() @@ -1033,11 +893,6 @@ actions: 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(); GetBannerImageRequest req = GetBannerImageRequest.builder() @@ -1078,16 +933,11 @@ actions: 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(); GetMetadataChildrenResponse res = sdk.library().getMetadataChildren() .ratingKey(1539.15d) - .includeElements("") + .includeElements("Stream") .call(); if (res.object().isPresent()) { @@ -1116,11 +966,6 @@ actions: 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(); GetThumbImageRequest req = GetThumbImageRequest.builder() @@ -1161,11 +1006,6 @@ actions: 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(); GetOnDeckResponse res = sdk.library().getOnDeck() @@ -1200,11 +1040,6 @@ actions: 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(); GetRecentlyAddedLibraryRequest req = GetRecentlyAddedLibraryRequest.builder() @@ -1263,15 +1098,11 @@ actions: 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("") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") .searchTypes(List.of( SearchTypes.PEOPLE)) .includeCollections(QueryParamIncludeCollections.Enable) @@ -1307,11 +1138,6 @@ actions: 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(); GetAllLibrariesResponse res = sdk.library().getAllLibraries() @@ -1344,11 +1170,6 @@ actions: 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(); GetWatchListRequest req = GetWatchListRequest.builder() @@ -1387,11 +1208,6 @@ actions: 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(); DeleteLibraryResponse res = sdk.library().deleteLibrary() @@ -1422,11 +1238,6 @@ actions: 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(); GetLibraryDetailsResponse res = sdk.library().getLibraryDetails() @@ -1460,11 +1271,6 @@ actions: 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(); GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata() @@ -1496,11 +1302,6 @@ actions: 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(); GetSearchLibraryResponse res = sdk.library().getSearchLibrary() @@ -1538,11 +1339,6 @@ actions: 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(); GetLibraryItemsRequest req = GetLibraryItemsRequest.builder() @@ -1585,11 +1381,6 @@ actions: 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(); LogLineResponse res = sdk.log().logLine() @@ -1622,15 +1413,9 @@ actions: 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(); - String req = "level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman - level=1&message=Test%20message%203&source=postman"; + String req = "level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman\nlevel=1&message=Test%20message%203&source=postman"; LogMultiLineResponse res = sdk.log().logMultiLine() .request(req) @@ -1659,11 +1444,6 @@ actions: 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(); EnablePaperTrailResponse res = sdk.log().enablePaperTrail() @@ -1692,11 +1472,6 @@ actions: 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(); GetMediaProvidersResponse res = sdk.server().getMediaProviders() @@ -1728,11 +1503,6 @@ actions: 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(); GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount() @@ -1766,19 +1536,14 @@ actions: 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(); GetResizedPhotoRequest req = GetResizedPhotoRequest.builder() .width(110d) .height(165d) .opacity(100L) - .blur(20d) - .minSize(MinSize.ZERO) + .blur(0d) + .minSize(MinSize.ONE) .upscale(Upscale.ONE) .url("/library/metadata/49564/thumb/1654258204") .build(); @@ -1809,14 +1574,14 @@ actions: public static void main(String[] args) throws GetPinBadRequest, Exception { PlexAPI sdk = PlexAPI.builder() - .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") - .clientName("Plex for Roku") - .clientVersion("2.4.1") - .platform("Roku") - .deviceNickname("Roku 3") .build(); GetPinRequest req = GetPinRequest.builder() + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .deviceNickname("Roku 3") + .clientVersion("2.4.1") + .platform("Roku") .build(); GetPinResponse res = sdk.plex().getPin() @@ -1848,15 +1613,15 @@ actions: public static void main(String[] args) throws GetTokenByPinIdBadRequest, GetTokenByPinIdResponseBody, Exception { PlexAPI sdk = PlexAPI.builder() - .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") - .clientName("Plex for Roku") - .clientVersion("2.4.1") - .platform("Roku") - .deviceNickname("Roku 3") .build(); GetTokenByPinIdRequest req = GetTokenByPinIdRequest.builder() .pinID(408895L) + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .deviceNickname("Roku 3") + .clientVersion("2.4.1") + .platform("Roku") .build(); GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId() @@ -1890,11 +1655,6 @@ actions: 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(); GetPlaylistsResponse res = sdk.playlists().getPlaylists() @@ -1930,11 +1690,6 @@ actions: 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(); CreatePlaylistRequest req = CreatePlaylistRequest.builder() @@ -1974,11 +1729,6 @@ actions: 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(); UploadPlaylistResponse res = sdk.playlists().uploadPlaylist() @@ -2010,11 +1760,6 @@ actions: 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(); DeletePlaylistResponse res = sdk.playlists().deletePlaylist() @@ -2044,11 +1789,6 @@ actions: 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(); GetPlaylistResponse res = sdk.playlists().getPlaylist() @@ -2080,11 +1820,6 @@ actions: 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(); UpdatePlaylistResponse res = sdk.playlists().updatePlaylist() @@ -2116,11 +1851,6 @@ actions: 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(); ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents() @@ -2151,11 +1881,6 @@ actions: 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(); GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents() @@ -2188,11 +1913,6 @@ actions: 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(); AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents() @@ -2229,11 +1949,6 @@ actions: 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(); GetServerResourcesResponse res = sdk.plex().getServerResources() @@ -2268,11 +1983,6 @@ actions: 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(); GetSearchResultsResponse res = sdk.search().getSearchResults() @@ -2304,15 +2014,10 @@ actions: 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(); GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation() - .source("server://client-identifier") + .source("provider://provider-identifier") .call(); // handle response @@ -2340,11 +2045,6 @@ actions: 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(); GetTransientTokenResponse res = sdk.authentication().getTransientToken() @@ -2375,11 +2075,6 @@ actions: 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(); GetServerListResponse res = sdk.server().getServerList() @@ -2410,11 +2105,6 @@ actions: 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(); GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics() @@ -2446,11 +2136,6 @@ actions: 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(); GetStatisticsResponse res = sdk.statistics().getStatistics() @@ -2482,11 +2167,6 @@ actions: 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(); GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics() @@ -2518,11 +2198,6 @@ actions: 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(); GetSessionsResponse res = sdk.sessions().getSessions() @@ -2554,15 +2229,10 @@ actions: 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(); GetSessionHistoryResponse res = sdk.sessions().getSessionHistory() - .sort("") + .sort("viewedAt:desc") .accountId(1L) .filter(QueryParamFilter.builder() .build()) @@ -2594,11 +2264,6 @@ actions: 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(); GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions() @@ -2629,11 +2294,6 @@ actions: 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(); StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession() @@ -2665,11 +2325,6 @@ actions: 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(); ApplyUpdatesResponse res = sdk.updater().applyUpdates() @@ -2701,11 +2356,6 @@ actions: 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(); CheckForUpdatesResponse res = sdk.updater().checkForUpdates() @@ -2735,11 +2385,6 @@ actions: 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(); GetUpdateStatusResponse res = sdk.updater().getUpdateStatus() @@ -2770,11 +2415,6 @@ actions: 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(); GetTokenDetailsResponse res = sdk.authentication().getTokenDetails() @@ -2806,14 +2446,14 @@ actions: public static void main(String[] args) throws PostUsersSignInDataBadRequest, PostUsersSignInDataUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") - .clientName("Plex for Roku") - .clientVersion("2.4.1") - .platform("Roku") - .deviceNickname("Roku 3") .build(); PostUsersSignInDataRequest req = PostUsersSignInDataRequest.builder() + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .deviceNickname("Roku 3") + .clientVersion("2.4.1") + .platform("Roku") .requestBody(PostUsersSignInDataRequestBody.builder() .login("username@email.com") .password("password123") @@ -2851,11 +2491,6 @@ actions: 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(); StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder() diff --git a/docs/models/operations/GetLibraryItemsMetadata.md b/docs/models/operations/GetLibraryItemsMetadata.md index 012b80a3..bc76e672 100644 --- a/docs/models/operations/GetLibraryItemsMetadata.md +++ b/docs/models/operations/GetLibraryItemsMetadata.md @@ -24,7 +24,7 @@ | `seasonCount` | *Optional\* | :heavy_minus_sign: | N/A | 2022 | | `tagline` | *Optional\* | :heavy_minus_sign: | N/A | Return to Pandora. | | `flattenSeasons` | [Optional\](../../models/operations/GetLibraryItemsFlattenSeasons.md) | :heavy_minus_sign: | N/A | 1 | -| `showOrdering` | [Optional\](../../models/operations/GetLibraryItemsShowOrdering.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 | +| `showOrdering` | [Optional\](../../models/operations/GetLibraryItemsShowOrdering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show
None = Library default,
tmdbAiring = The Movie Database (Aired),
tvdbAiring = TheTVDB (Aired),
tvdbDvd = TheTVDB (DVD),
tvdbAbsolute = TheTVDB (Absolute)).
| tvdbDvd | | `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 | diff --git a/docs/models/operations/GetLibraryItemsQueryParamType.md b/docs/models/operations/GetLibraryItemsQueryParamType.md index 3add83f6..c0b13045 100644 --- a/docs/models/operations/GetLibraryItemsQueryParamType.md +++ b/docs/models/operations/GetLibraryItemsQueryParamType.md @@ -17,4 +17,6 @@ E.g. A movie library will not return anything with type 3 as there are no season | `TvShow` | 2 | | `Season` | 3 | | `Episode` | 4 | -| `Audio` | 8 | \ No newline at end of file +| `Audio` | 8 | +| `Album` | 9 | +| `Track` | 10 | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryItemsShowOrdering.md b/docs/models/operations/GetLibraryItemsShowOrdering.md index 1d7aa8ce..a82729cd 100644 --- a/docs/models/operations/GetLibraryItemsShowOrdering.md +++ b/docs/models/operations/GetLibraryItemsShowOrdering.md @@ -1,20 +1,20 @@ # GetLibraryItemsShowOrdering -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)). +Setting that indicates the episode ordering for the show +None = Library default, +tmdbAiring = The Movie Database (Aired), +tvdbAiring = TheTVDB (Aired), +tvdbDvd = TheTVDB (DVD), +tvdbAbsolute = TheTVDB (Absolute)). ## Values -| Name | Value | -| ------------ | ------------ | -| `None` | None | -| `TmdbAiring` | tmdbAiring | -| `Aired` | aired | -| `Dvd` | dvd | -| `Absolute` | absolute | \ No newline at end of file +| Name | Value | +| -------------- | -------------- | +| `None` | None | +| `TmdbAiring` | tmdbAiring | +| `TvdbAiring` | tvdbAiring | +| `TvdbDvd` | tvdbDvd | +| `TvdbAbsolute` | tvdbAbsolute | \ No newline at end of file diff --git a/docs/models/operations/GetMetaDataByRatingKeyMetadata.md b/docs/models/operations/GetMetaDataByRatingKeyMetadata.md index ad340b0b..3e1ba58e 100644 --- a/docs/models/operations/GetMetaDataByRatingKeyMetadata.md +++ b/docs/models/operations/GetMetaDataByRatingKeyMetadata.md @@ -14,6 +14,11 @@ | `librarySectionTitle` | *Optional\* | :heavy_minus_sign: | N/A | Movies | | `librarySectionID` | *Optional\* | :heavy_minus_sign: | N/A | 1 | | `librarySectionKey` | *Optional\* | :heavy_minus_sign: | N/A | /library/sections/1 | +| `grandparentTitle` | *Optional\* | :heavy_minus_sign: | The name of the album artist for the track when audio, and the name of the TV show for the episode when video. | | +| `parentTitle` | *Optional\* | :heavy_minus_sign: | The name of the album for the track when audio, and the name of the season for the episode when TV show. | | +| `originalTitle` | *Optional\* | :heavy_minus_sign: | The orginal untranslated name of the media item when non-english. | | +| `index` | *Optional\* | :heavy_minus_sign: | The index starting from 0 of this media item in the MetaData array. | | +| `parentIndex` | *Optional\* | :heavy_minus_sign: | The parent index starting from 0 of this media item in the parent MetaData array. | | | `contentRating` | *Optional\* | :heavy_minus_sign: | N/A | PG-13 | | `summary` | *Optional\* | :heavy_minus_sign: | N/A | Serenity continues the story of the TV series it was based upon ("Firefly"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job. | | `rating` | *Optional\* | :heavy_minus_sign: | N/A | 8.2 | diff --git a/docs/models/operations/GetPinRequest.md b/docs/models/operations/GetPinRequest.md index 5a058e52..7dcd179f 100644 --- a/docs/models/operations/GetPinRequest.md +++ b/docs/models/operations/GetPinRequest.md @@ -6,7 +6,7 @@ | 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 | +| `clientID` | *String* | :heavy_check_mark: | 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 | diff --git a/docs/models/operations/GetPlaylistContentsQueryParamType.md b/docs/models/operations/GetPlaylistContentsQueryParamType.md index 7defe609..b5b34abc 100644 --- a/docs/models/operations/GetPlaylistContentsQueryParamType.md +++ b/docs/models/operations/GetPlaylistContentsQueryParamType.md @@ -17,4 +17,6 @@ E.g. A movie library will not return anything with type 3 as there are no season | `TvShow` | 2 | | `Season` | 3 | | `Episode` | 4 | -| `Audio` | 8 | \ No newline at end of file +| `Audio` | 8 | +| `Album` | 9 | +| `Track` | 10 | \ No newline at end of file diff --git a/docs/models/operations/GetRecentlyAddedMetadata.md b/docs/models/operations/GetRecentlyAddedMetadata.md index dfa7b0ea..b5eb98e2 100644 --- a/docs/models/operations/GetRecentlyAddedMetadata.md +++ b/docs/models/operations/GetRecentlyAddedMetadata.md @@ -24,7 +24,7 @@ | `seasonCount` | *Optional\* | :heavy_minus_sign: | N/A | 2022 | | `tagline` | *Optional\* | :heavy_minus_sign: | N/A | Return to Pandora. | | `flattenSeasons` | [Optional\](../../models/operations/FlattenSeasons.md) | :heavy_minus_sign: | N/A | 1 | -| `showOrdering` | [Optional\](../../models/operations/ShowOrdering.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 | +| `showOrdering` | [Optional\](../../models/operations/ShowOrdering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show
None = Library default,
tmdbAiring = The Movie Database (Aired),
tvdbAiring = TheTVDB (Aired),
tvdbDvd = TheTVDB (DVD),
tvdbAbsolute = TheTVDB (Absolute)).
| tvdbDvd | | `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 | diff --git a/docs/models/operations/GetSearchAllLibrariesMetadata.md b/docs/models/operations/GetSearchAllLibrariesMetadata.md index f7e4d9ee..357b2d1a 100644 --- a/docs/models/operations/GetSearchAllLibrariesMetadata.md +++ b/docs/models/operations/GetSearchAllLibrariesMetadata.md @@ -24,7 +24,7 @@ | `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 | +| `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),
tvdbAiring = TheTVDB (Aired),
tvdbDvd = TheTVDB (DVD),
tvdbAbsolute = TheTVDB (Absolute)).
| tvdbDvd | | `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 | diff --git a/docs/models/operations/GetSearchAllLibrariesRequest.md b/docs/models/operations/GetSearchAllLibrariesRequest.md index 3bcdc678..e559108e 100644 --- a/docs/models/operations/GetSearchAllLibrariesRequest.md +++ b/docs/models/operations/GetSearchAllLibrariesRequest.md @@ -6,7 +6,7 @@ | 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 | +| `clientID` | *String* | :heavy_check_mark: | 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 | diff --git a/docs/models/operations/GetSearchAllLibrariesShowOrdering.md b/docs/models/operations/GetSearchAllLibrariesShowOrdering.md index 5876c454..fc54022a 100644 --- a/docs/models/operations/GetSearchAllLibrariesShowOrdering.md +++ b/docs/models/operations/GetSearchAllLibrariesShowOrdering.md @@ -1,20 +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)). +Setting that indicates the episode ordering for the show +None = Library default, +tmdbAiring = The Movie Database (Aired), +tvdbAiring = TheTVDB (Aired), +tvdbDvd = TheTVDB (DVD), +tvdbAbsolute = TheTVDB (Absolute)). ## Values -| Name | Value | -| ------------ | ------------ | -| `None` | None | -| `TmdbAiring` | tmdbAiring | -| `Aired` | aired | -| `Dvd` | dvd | -| `Absolute` | absolute | \ No newline at end of file +| Name | Value | +| -------------- | -------------- | +| `None` | None | +| `TmdbAiring` | tmdbAiring | +| `TvdbAiring` | tvdbAiring | +| `TvdbDvd` | tvdbDvd | +| `TvdbAbsolute` | tvdbAbsolute | \ No newline at end of file diff --git a/docs/models/operations/GetSearchLibraryQueryParamType.md b/docs/models/operations/GetSearchLibraryQueryParamType.md index 7242bfdf..9e3a4826 100644 --- a/docs/models/operations/GetSearchLibraryQueryParamType.md +++ b/docs/models/operations/GetSearchLibraryQueryParamType.md @@ -17,4 +17,6 @@ E.g. A movie library will not return anything with type 3 as there are no season | `TvShow` | 2 | | `Season` | 3 | | `Episode` | 4 | -| `Audio` | 8 | \ No newline at end of file +| `Audio` | 8 | +| `Album` | 9 | +| `Track` | 10 | \ No newline at end of file diff --git a/docs/models/operations/GetServerResourcesRequest.md b/docs/models/operations/GetServerResourcesRequest.md index 23057241..e6469c47 100644 --- a/docs/models/operations/GetServerResourcesRequest.md +++ b/docs/models/operations/GetServerResourcesRequest.md @@ -8,4 +8,4 @@ | `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 +| `clientID` | *String* | :heavy_check_mark: | 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/GetTokenByPinIdRequest.md b/docs/models/operations/GetTokenByPinIdRequest.md index 23a7c79e..784d2619 100644 --- a/docs/models/operations/GetTokenByPinIdRequest.md +++ b/docs/models/operations/GetTokenByPinIdRequest.md @@ -6,7 +6,7 @@ | 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 | +| `clientID` | *String* | :heavy_check_mark: | 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 | diff --git a/docs/models/operations/GetTopWatchedContentQueryParamType.md b/docs/models/operations/GetTopWatchedContentQueryParamType.md index c178f9e3..6736d2a0 100644 --- a/docs/models/operations/GetTopWatchedContentQueryParamType.md +++ b/docs/models/operations/GetTopWatchedContentQueryParamType.md @@ -17,4 +17,6 @@ E.g. A movie library will not return anything with type 3 as there are no season | `TvShow` | 2 | | `Season` | 3 | | `Episode` | 4 | -| `Audio` | 8 | \ No newline at end of file +| `Audio` | 8 | +| `Album` | 9 | +| `Track` | 10 | \ No newline at end of file diff --git a/docs/models/operations/PostUsersSignInDataRequest.md b/docs/models/operations/PostUsersSignInDataRequest.md index 2eafbe44..f7863eb3 100644 --- a/docs/models/operations/PostUsersSignInDataRequest.md +++ b/docs/models/operations/PostUsersSignInDataRequest.md @@ -5,7 +5,7 @@ | 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 | +| `clientID` | *String* | :heavy_check_mark: | 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 | diff --git a/docs/models/operations/QueryParamType.md b/docs/models/operations/QueryParamType.md index 326696d5..13fedecc 100644 --- a/docs/models/operations/QueryParamType.md +++ b/docs/models/operations/QueryParamType.md @@ -17,4 +17,6 @@ E.g. A movie library will not return anything with type 3 as there are no season | `TvShow` | 2 | | `Season` | 3 | | `Episode` | 4 | -| `Audio` | 8 | \ No newline at end of file +| `Audio` | 8 | +| `Album` | 9 | +| `Track` | 10 | \ No newline at end of file diff --git a/docs/models/operations/ShowOrdering.md b/docs/models/operations/ShowOrdering.md index b8a243b2..f969631a 100644 --- a/docs/models/operations/ShowOrdering.md +++ b/docs/models/operations/ShowOrdering.md @@ -1,20 +1,20 @@ # ShowOrdering -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)). +Setting that indicates the episode ordering for the show +None = Library default, +tmdbAiring = The Movie Database (Aired), +tvdbAiring = TheTVDB (Aired), +tvdbDvd = TheTVDB (DVD), +tvdbAbsolute = TheTVDB (Absolute)). ## Values -| Name | Value | -| ------------ | ------------ | -| `None` | None | -| `TmdbAiring` | tmdbAiring | -| `Aired` | aired | -| `Dvd` | dvd | -| `Absolute` | absolute | \ No newline at end of file +| Name | Value | +| -------------- | -------------- | +| `None` | None | +| `TmdbAiring` | tmdbAiring | +| `TvdbAiring` | tvdbAiring | +| `TvdbDvd` | tvdbDvd | +| `TvdbAbsolute` | tvdbAbsolute | \ No newline at end of file diff --git a/docs/models/operations/Tag.md b/docs/models/operations/Tag.md index 19a3a0df..66930656 100644 --- a/docs/models/operations/Tag.md +++ b/docs/models/operations/Tag.md @@ -25,4 +25,5 @@ A key representing a specific tag within the section. | `RATING` | rating | | `RESOLUTION` | resolution | | `FIRST_CHARACTER` | firstCharacter | -| `FOLDER` | folder | \ No newline at end of file +| `FOLDER` | folder | +| `ALBUMS` | albums | \ No newline at end of file diff --git a/docs/models/operations/Type.md b/docs/models/operations/Type.md index 1ef815d8..e0e804eb 100644 --- a/docs/models/operations/Type.md +++ b/docs/models/operations/Type.md @@ -17,4 +17,6 @@ E.g. A movie library will not return anything with type 3 as there are no season | `TvShow` | 2 | | `Season` | 3 | | `Episode` | 4 | -| `Audio` | 8 | \ No newline at end of file +| `Audio` | 8 | +| `Album` | 9 | +| `Track` | 10 | \ No newline at end of file diff --git a/docs/sdks/activities/README.md b/docs/sdks/activities/README.md index 462b0ff8..ca99e95d 100644 --- a/docs/sdks/activities/README.md +++ b/docs/sdks/activities/README.md @@ -38,11 +38,6 @@ public class Application { 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(); GetServerActivitiesResponse res = sdk.activities().getServerActivities() @@ -88,11 +83,6 @@ public class Application { 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(); CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities() diff --git a/docs/sdks/authentication/README.md b/docs/sdks/authentication/README.md index 1b5ada8d..ad9d3c98 100644 --- a/docs/sdks/authentication/README.md +++ b/docs/sdks/authentication/README.md @@ -37,11 +37,6 @@ public class Application { 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(); GetTransientTokenResponse res = sdk.authentication().getTransientToken() @@ -96,15 +91,10 @@ public class Application { 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(); GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation() - .source("server://client-identifier") + .source("provider://provider-identifier") .call(); // handle response @@ -151,11 +141,6 @@ public class Application { 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(); GetTokenDetailsResponse res = sdk.authentication().getTokenDetails() @@ -208,14 +193,14 @@ public class Application { public static void main(String[] args) throws PostUsersSignInDataBadRequest, PostUsersSignInDataUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") - .clientName("Plex for Roku") - .clientVersion("2.4.1") - .platform("Roku") - .deviceNickname("Roku 3") .build(); PostUsersSignInDataRequest req = PostUsersSignInDataRequest.builder() + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .deviceNickname("Roku 3") + .clientVersion("2.4.1") + .platform("Roku") .requestBody(PostUsersSignInDataRequestBody.builder() .login("username@email.com") .password("password123") diff --git a/docs/sdks/butler/README.md b/docs/sdks/butler/README.md index 4dbaa946..72e172b0 100644 --- a/docs/sdks/butler/README.md +++ b/docs/sdks/butler/README.md @@ -35,11 +35,6 @@ public class Application { 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(); GetButlerTasksResponse res = sdk.butler().getButlerTasks() @@ -90,11 +85,6 @@ public class Application { 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(); StartAllTasksResponse res = sdk.butler().startAllTasks() @@ -139,11 +129,6 @@ public class Application { 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(); StopAllTasksResponse res = sdk.butler().stopAllTasks() @@ -193,11 +178,6 @@ public class Application { 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(); StartTaskResponse res = sdk.butler().startTask() @@ -250,11 +230,6 @@ public class Application { 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(); StopTaskResponse res = sdk.butler().stopTask() diff --git a/docs/sdks/hubs/README.md b/docs/sdks/hubs/README.md index 08ba6af6..298f5bd7 100644 --- a/docs/sdks/hubs/README.md +++ b/docs/sdks/hubs/README.md @@ -34,11 +34,6 @@ public class Application { 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(); GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs() @@ -95,11 +90,6 @@ public class Application { 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(); GetRecentlyAddedRequest req = GetRecentlyAddedRequest.builder() @@ -161,17 +151,12 @@ public class Application { 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(); GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs() .sectionId(6728.76d) - .count(639.24d) - .onlyTransient(QueryParamOnlyTransient.ONE) + .count(6728.76d) + .onlyTransient(QueryParamOnlyTransient.ZERO) .call(); if (res.object().isPresent()) { diff --git a/docs/sdks/library/README.md b/docs/sdks/library/README.md index e2c2cb22..5388d4ac 100644 --- a/docs/sdks/library/README.md +++ b/docs/sdks/library/README.md @@ -43,11 +43,6 @@ public class Application { 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(); GetFileHashResponse res = sdk.library().getFileHash() @@ -105,11 +100,6 @@ public class Application { 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(); GetRecentlyAddedLibraryRequest req = GetRecentlyAddedLibraryRequest.builder() @@ -190,11 +180,6 @@ public class Application { 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(); GetAllLibrariesResponse res = sdk.library().getAllLibraries() @@ -280,11 +265,6 @@ public class Application { 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(); GetLibraryDetailsResponse res = sdk.library().getLibraryDetails() @@ -339,11 +319,6 @@ public class Application { 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(); DeleteLibraryResponse res = sdk.library().deleteLibrary() @@ -395,6 +370,7 @@ Fetches details from a specific section of the library identified by a section k - `resolution`: Items categorized by resolution. - `firstCharacter`: Items categorized by the first letter. - `folder`: Items categorized by folder. +- `albums`: Items categorized by album. ### Example Usage @@ -419,11 +395,6 @@ public class Application { 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(); GetLibraryItemsRequest req = GetLibraryItemsRequest.builder() @@ -488,11 +459,6 @@ public class Application { 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(); GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata() @@ -564,11 +530,6 @@ public class Application { 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(); GetSearchLibraryResponse res = sdk.library().getSearchLibrary() @@ -629,15 +590,11 @@ public class Application { 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("") + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") .searchTypes(List.of( SearchTypes.PEOPLE)) .includeCollections(QueryParamIncludeCollections.Enable) @@ -695,11 +652,6 @@ public class Application { 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(); GetMetaDataByRatingKeyResponse res = sdk.library().getMetaDataByRatingKey() @@ -753,16 +705,11 @@ public class Application { 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(); GetMetadataChildrenResponse res = sdk.library().getMetadataChildren() - .ratingKey(1539.15d) - .includeElements("") + .ratingKey(1539.14d) + .includeElements("Stream") .call(); if (res.object().isPresent()) { @@ -814,11 +761,6 @@ public class Application { 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(); GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent() @@ -874,11 +816,6 @@ public class Application { 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(); GetOnDeckResponse res = sdk.library().getOnDeck() diff --git a/docs/sdks/log/README.md b/docs/sdks/log/README.md index 084aa5d4..cb3be6b2 100644 --- a/docs/sdks/log/README.md +++ b/docs/sdks/log/README.md @@ -35,11 +35,6 @@ public class Application { 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(); LogLineResponse res = sdk.log().logLine() @@ -116,15 +111,9 @@ public class Application { 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(); - String req = "level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman - level=1&message=Test%20message%203&source=postman"; + String req = "level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman\nlevel=1&message=Test%20message%203&source=postman"; LogMultiLineResponse res = sdk.log().logMultiLine() .request(req) @@ -175,11 +164,6 @@ public class Application { 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(); EnablePaperTrailResponse res = sdk.log().enablePaperTrail() diff --git a/docs/sdks/media/README.md b/docs/sdks/media/README.md index e1bd374c..b45d4ce1 100644 --- a/docs/sdks/media/README.md +++ b/docs/sdks/media/README.md @@ -35,11 +35,6 @@ public class Application { 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(); MarkPlayedResponse res = sdk.media().markPlayed() @@ -90,11 +85,6 @@ public class Application { 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(); MarkUnplayedResponse res = sdk.media().markUnplayed() @@ -146,11 +136,6 @@ public class Application { 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(); UpdatePlayProgressResponse res = sdk.media().updatePlayProgress() @@ -206,11 +191,6 @@ public class Application { 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(); GetBannerImageRequest req = GetBannerImageRequest.builder() @@ -273,11 +253,6 @@ public class Application { 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(); GetThumbImageRequest req = GetThumbImageRequest.builder() diff --git a/docs/sdks/playlists/README.md b/docs/sdks/playlists/README.md index 96ffd94a..be565e52 100644 --- a/docs/sdks/playlists/README.md +++ b/docs/sdks/playlists/README.md @@ -48,18 +48,13 @@ public class Application { 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(); CreatePlaylistRequest req = CreatePlaylistRequest.builder() .title("") .type(CreatePlaylistQueryParamType.PHOTO) .smart(Smart.ONE) - .uri("https://hoarse-testing.info/") + .uri("https://inborn-brochure.biz") .build(); CreatePlaylistResponse res = sdk.playlists().createPlaylist() @@ -114,11 +109,6 @@ public class Application { 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(); GetPlaylistsResponse res = sdk.playlists().getPlaylists() @@ -175,11 +165,6 @@ public class Application { 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(); GetPlaylistResponse res = sdk.playlists().getPlaylist() @@ -233,11 +218,6 @@ public class Application { 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(); DeletePlaylistResponse res = sdk.playlists().deletePlaylist() @@ -289,15 +269,10 @@ public class Application { 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(); UpdatePlaylistResponse res = sdk.playlists().updatePlaylist() - .playlistID(3915.00d) + .playlistID(3915d) .title("") .summary("") .call(); @@ -353,11 +328,6 @@ public class Application { 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(); GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents() @@ -413,11 +383,6 @@ public class Application { 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(); ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents() @@ -470,15 +435,10 @@ public class Application { 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(); AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents() - .playlistID(8502.00d) + .playlistID(8502.01d) .uri("server://12345/com.plexapp.plugins.library/library/metadata/1") .playQueueID(123d) .call(); @@ -533,11 +493,6 @@ public class Application { 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(); UploadPlaylistResponse res = sdk.playlists().uploadPlaylist() diff --git a/docs/sdks/plex/README.md b/docs/sdks/plex/README.md index bb214dda..d698c7be 100644 --- a/docs/sdks/plex/README.md +++ b/docs/sdks/plex/README.md @@ -37,11 +37,6 @@ public class Application { 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(); GetCompanionsDataResponse res = sdk.plex().getCompanionsData() @@ -93,11 +88,6 @@ public class Application { 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(); GetUserFriendsResponse res = sdk.plex().getUserFriends() @@ -148,11 +138,6 @@ public class Application { public static void main(String[] args) throws GetGeoDataBadRequest, GetGeoDataUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .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 +189,6 @@ public class Application { 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(); GetHomeDataResponse res = sdk.plex().getHomeData() @@ -257,11 +237,6 @@ public class Application { 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(); GetServerResourcesResponse res = sdk.plex().getServerResources() @@ -285,7 +260,7 @@ public class Application { | `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 | +| `clientID` | *String* | :heavy_check_mark: | 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,14 +295,14 @@ public class Application { public static void main(String[] args) throws GetPinBadRequest, Exception { PlexAPI sdk = PlexAPI.builder() - .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") - .clientName("Plex for Roku") - .clientVersion("2.4.1") - .platform("Roku") - .deviceNickname("Roku 3") .build(); GetPinRequest req = GetPinRequest.builder() + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .deviceNickname("Roku 3") + .clientVersion("2.4.1") + .platform("Roku") .build(); GetPinResponse res = sdk.plex().getPin() @@ -380,15 +355,15 @@ public class Application { public static void main(String[] args) throws GetTokenByPinIdBadRequest, GetTokenByPinIdResponseBody, Exception { PlexAPI sdk = PlexAPI.builder() - .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") - .clientName("Plex for Roku") - .clientVersion("2.4.1") - .platform("Roku") - .deviceNickname("Roku 3") .build(); GetTokenByPinIdRequest req = GetTokenByPinIdRequest.builder() .pinID(408895L) + .clientID("3381b62b-9ab7-4e37-827b-203e9809eb58") + .clientName("Plex for Roku") + .deviceNickname("Roku 3") + .clientVersion("2.4.1") + .platform("Roku") .build(); GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId() diff --git a/docs/sdks/plexapi/README.md b/docs/sdks/plexapi/README.md index e91fa370..1e395e44 100644 --- a/docs/sdks/plexapi/README.md +++ b/docs/sdks/plexapi/README.md @@ -26,3 +26,6 @@ The following SDKs are generated from the OpenAPI Specification. They are automa | 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) | - + + +### Available Operations diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index a841d6e6..4ddd2e37 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -45,16 +45,11 @@ public class Application { 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(); PerformSearchResponse res = sdk.search().performSearch() .query("dylan") - .sectionId(9372.69d) + .sectionId(9487.87d) .limit(5d) .call(); @@ -108,11 +103,6 @@ public class Application { 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(); PerformVoiceSearchResponse res = sdk.search().performVoiceSearch() @@ -167,11 +157,6 @@ public class Application { 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(); GetSearchResultsResponse res = sdk.search().getSearchResults() diff --git a/docs/sdks/server/README.md b/docs/sdks/server/README.md index 0caec297..01e3a16e 100644 --- a/docs/sdks/server/README.md +++ b/docs/sdks/server/README.md @@ -39,11 +39,6 @@ public class Application { 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(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() @@ -89,11 +84,6 @@ public class Application { 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(); GetServerPreferencesResponse res = sdk.server().getServerPreferences() @@ -139,11 +129,6 @@ public class Application { 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(); GetAvailableClientsResponse res = sdk.server().getAvailableClients() @@ -189,11 +174,6 @@ public class Application { 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(); GetDevicesResponse res = sdk.server().getDevices() @@ -237,11 +217,6 @@ public class Application { public static void main(String[] args) throws GetServerIdentityRequestTimeout, Exception { PlexAPI sdk = PlexAPI.builder() - .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 +261,6 @@ public class Application { 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(); GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount() @@ -340,19 +310,14 @@ public class Application { 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(); GetResizedPhotoRequest req = GetResizedPhotoRequest.builder() .width(110d) .height(165d) .opacity(100L) - .blur(20d) - .minSize(MinSize.ZERO) + .blur(0d) + .minSize(MinSize.ONE) .upscale(Upscale.ONE) .url("/library/metadata/49564/thumb/1654258204") .build(); @@ -405,11 +370,6 @@ public class Application { 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(); GetMediaProvidersResponse res = sdk.server().getMediaProviders() @@ -462,11 +422,6 @@ public class Application { 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(); GetServerListResponse res = sdk.server().getServerList() diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md index ed1131c1..eec92f07 100644 --- a/docs/sdks/sessions/README.md +++ b/docs/sdks/sessions/README.md @@ -34,11 +34,6 @@ public class Application { 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(); GetSessionsResponse res = sdk.sessions().getSessions() @@ -85,15 +80,10 @@ public class Application { 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(); GetSessionHistoryResponse res = sdk.sessions().getSessionHistory() - .sort("") + .sort("viewedAt:desc") .accountId(1L) .filter(QueryParamFilter.builder() .build()) @@ -149,11 +139,6 @@ public class Application { 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(); GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions() @@ -199,11 +184,6 @@ public class Application { 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(); StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession() diff --git a/docs/sdks/statistics/README.md b/docs/sdks/statistics/README.md index 324d9d3b..071d0a74 100644 --- a/docs/sdks/statistics/README.md +++ b/docs/sdks/statistics/README.md @@ -33,11 +33,6 @@ public class Application { 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(); GetStatisticsResponse res = sdk.statistics().getStatistics() @@ -90,11 +85,6 @@ public class Application { 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(); GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics() @@ -147,11 +137,6 @@ public class Application { 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(); GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics() diff --git a/docs/sdks/updater/README.md b/docs/sdks/updater/README.md index 9778e8f9..2ebccc7e 100644 --- a/docs/sdks/updater/README.md +++ b/docs/sdks/updater/README.md @@ -34,11 +34,6 @@ public class Application { 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(); GetUpdateStatusResponse res = sdk.updater().getUpdateStatus() @@ -85,11 +80,6 @@ public class Application { 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(); CheckForUpdatesResponse res = sdk.updater().checkForUpdates() @@ -143,11 +133,6 @@ public class Application { 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(); ApplyUpdatesResponse res = sdk.updater().applyUpdates() diff --git a/docs/sdks/video/README.md b/docs/sdks/video/README.md index 8d2e18d3..a9060df8 100644 --- a/docs/sdks/video/README.md +++ b/docs/sdks/video/README.md @@ -34,11 +34,6 @@ public class Application { 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(); GetTimelineRequest req = GetTimelineRequest.builder() @@ -103,11 +98,6 @@ public class Application { 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(); StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder() diff --git a/docs/sdks/watchlist/README.md b/docs/sdks/watchlist/README.md index f53a51bc..0dbafce7 100644 --- a/docs/sdks/watchlist/README.md +++ b/docs/sdks/watchlist/README.md @@ -33,11 +33,6 @@ public class Application { 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(); 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..ebab0420 100644 --- a/src/main/java/dev/plexapi/sdk/Activities.java +++ b/src/main/java/dev/plexapi/sdk/Activities.java @@ -78,10 +78,10 @@ public class Activities implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -89,7 +89,7 @@ public class Activities implements new BeforeRequestContextImpl( "getServerActivities", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -100,7 +100,7 @@ public class Activities implements new AfterErrorContextImpl( "getServerActivities", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -109,7 +109,7 @@ public class Activities implements new AfterSuccessContextImpl( "getServerActivities", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -118,7 +118,7 @@ public class Activities implements new AfterErrorContextImpl( "getServerActivities", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -229,16 +229,16 @@ public class Activities implements CancelServerActivitiesRequest.class, _baseUrl, "/activities/{activityUUID}", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "DELETE"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -246,7 +246,7 @@ public class Activities implements new BeforeRequestContextImpl( "cancelServerActivities", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -257,7 +257,7 @@ public class Activities implements new AfterErrorContextImpl( "cancelServerActivities", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -266,7 +266,7 @@ public class Activities implements new AfterSuccessContextImpl( "cancelServerActivities", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -275,7 +275,7 @@ public class Activities implements new AfterErrorContextImpl( "cancelServerActivities", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } diff --git a/src/main/java/dev/plexapi/sdk/Authentication.java b/src/main/java/dev/plexapi/sdk/Authentication.java index 64cf5d7e..a05ad121 100644 --- a/src/main/java/dev/plexapi/sdk/Authentication.java +++ b/src/main/java/dev/plexapi/sdk/Authentication.java @@ -122,11 +122,11 @@ public class Authentication implements _req.addQueryParams(Utils.getQueryParams( GetTransientTokenRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -134,7 +134,7 @@ public class Authentication implements new BeforeRequestContextImpl( "getTransientToken", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -145,7 +145,7 @@ public class Authentication implements new AfterErrorContextImpl( "getTransientToken", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -154,7 +154,7 @@ public class Authentication implements new AfterSuccessContextImpl( "getTransientToken", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -163,7 +163,7 @@ public class Authentication implements new AfterErrorContextImpl( "getTransientToken", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -275,11 +275,11 @@ public class Authentication implements _req.addQueryParams(Utils.getQueryParams( GetSourceConnectionInformationRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -287,7 +287,7 @@ public class Authentication implements new BeforeRequestContextImpl( "getSourceConnectionInformation", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -298,7 +298,7 @@ public class Authentication implements new AfterErrorContextImpl( "getSourceConnectionInformation", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -307,7 +307,7 @@ public class Authentication implements new AfterSuccessContextImpl( "getSourceConnectionInformation", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -316,7 +316,7 @@ public class Authentication implements new AfterErrorContextImpl( "getSourceConnectionInformation", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -426,10 +426,10 @@ public class Authentication implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -437,7 +437,7 @@ public class Authentication implements new BeforeRequestContextImpl( "getTokenDetails", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -448,7 +448,7 @@ public class Authentication implements new AfterErrorContextImpl( "getTokenDetails", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -457,7 +457,7 @@ public class Authentication implements new AfterSuccessContextImpl( "getTokenDetails", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -466,7 +466,7 @@ public class Authentication implements new AfterErrorContextImpl( "getTokenDetails", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -601,8 +601,8 @@ public class Authentication implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); - + _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + Optional _hookSecuritySource = Optional.empty(); HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -610,7 +610,7 @@ public class Authentication implements new BeforeRequestContextImpl( "post-users-sign-in-data", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -621,7 +621,7 @@ public class Authentication implements new AfterErrorContextImpl( "post-users-sign-in-data", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -630,7 +630,7 @@ public class Authentication implements new AfterSuccessContextImpl( "post-users-sign-in-data", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -639,7 +639,7 @@ public class Authentication implements new AfterErrorContextImpl( "post-users-sign-in-data", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } diff --git a/src/main/java/dev/plexapi/sdk/Butler.java b/src/main/java/dev/plexapi/sdk/Butler.java index 03491621..d885b7cf 100644 --- a/src/main/java/dev/plexapi/sdk/Butler.java +++ b/src/main/java/dev/plexapi/sdk/Butler.java @@ -90,10 +90,10 @@ public class Butler implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -101,7 +101,7 @@ public class Butler implements new BeforeRequestContextImpl( "getButlerTasks", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -112,7 +112,7 @@ public class Butler implements new AfterErrorContextImpl( "getButlerTasks", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -121,7 +121,7 @@ public class Butler implements new AfterSuccessContextImpl( "getButlerTasks", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -130,7 +130,7 @@ public class Butler implements new AfterErrorContextImpl( "getButlerTasks", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -247,10 +247,10 @@ public class Butler implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -258,7 +258,7 @@ public class Butler implements new BeforeRequestContextImpl( "startAllTasks", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -269,7 +269,7 @@ public class Butler implements new AfterErrorContextImpl( "startAllTasks", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -278,7 +278,7 @@ public class Butler implements new AfterSuccessContextImpl( "startAllTasks", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -287,7 +287,7 @@ public class Butler implements new AfterErrorContextImpl( "startAllTasks", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -385,10 +385,10 @@ public class Butler implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -396,7 +396,7 @@ public class Butler implements new BeforeRequestContextImpl( "stopAllTasks", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -407,7 +407,7 @@ public class Butler implements new AfterErrorContextImpl( "stopAllTasks", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -416,7 +416,7 @@ public class Butler implements new AfterSuccessContextImpl( "stopAllTasks", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -425,7 +425,7 @@ public class Butler implements new AfterErrorContextImpl( "stopAllTasks", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -535,16 +535,16 @@ public class Butler implements StartTaskRequest.class, _baseUrl, "/butler/{taskName}", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "POST"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -552,7 +552,7 @@ public class Butler implements new BeforeRequestContextImpl( "startTask", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -563,7 +563,7 @@ public class Butler implements new AfterErrorContextImpl( "startTask", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -572,7 +572,7 @@ public class Butler implements new AfterSuccessContextImpl( "startTask", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -581,7 +581,7 @@ public class Butler implements new AfterErrorContextImpl( "startTask", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -683,16 +683,16 @@ public class Butler implements StopTaskRequest.class, _baseUrl, "/butler/{taskName}", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "DELETE"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -700,7 +700,7 @@ public class Butler implements new BeforeRequestContextImpl( "stopTask", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -711,7 +711,7 @@ public class Butler implements new AfterErrorContextImpl( "stopTask", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -720,7 +720,7 @@ public class Butler implements new AfterSuccessContextImpl( "stopTask", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -729,7 +729,7 @@ public class Butler implements new AfterErrorContextImpl( "stopTask", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } diff --git a/src/main/java/dev/plexapi/sdk/Hubs.java b/src/main/java/dev/plexapi/sdk/Hubs.java index 43a2e0d7..6d82bf55 100644 --- a/src/main/java/dev/plexapi/sdk/Hubs.java +++ b/src/main/java/dev/plexapi/sdk/Hubs.java @@ -107,11 +107,11 @@ public class Hubs implements _req.addQueryParams(Utils.getQueryParams( GetGlobalHubsRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -119,7 +119,7 @@ public class Hubs implements new BeforeRequestContextImpl( "getGlobalHubs", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -130,7 +130,7 @@ public class Hubs implements new AfterErrorContextImpl( "getGlobalHubs", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -139,7 +139,7 @@ public class Hubs implements new AfterSuccessContextImpl( "getGlobalHubs", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -148,7 +148,7 @@ public class Hubs implements new AfterErrorContextImpl( "getGlobalHubs", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -263,11 +263,11 @@ public class Hubs implements _req.addQueryParams(Utils.getQueryParams( GetRecentlyAddedRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -275,7 +275,7 @@ public class Hubs implements new BeforeRequestContextImpl( "get-recently-added", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -286,7 +286,7 @@ public class Hubs implements new AfterErrorContextImpl( "get-recently-added", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -295,7 +295,7 @@ public class Hubs implements new AfterSuccessContextImpl( "get-recently-added", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -304,7 +304,7 @@ public class Hubs implements new AfterErrorContextImpl( "get-recently-added", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -404,7 +404,7 @@ public class Hubs implements GetLibraryHubsRequest.class, _baseUrl, "/hubs/sections/{sectionId}", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") @@ -414,11 +414,11 @@ public class Hubs implements _req.addQueryParams(Utils.getQueryParams( GetLibraryHubsRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -426,7 +426,7 @@ public class Hubs implements new BeforeRequestContextImpl( "getLibraryHubs", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -437,7 +437,7 @@ public class Hubs implements new AfterErrorContextImpl( "getLibraryHubs", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -446,7 +446,7 @@ public class Hubs implements new AfterSuccessContextImpl( "getLibraryHubs", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -455,7 +455,7 @@ public class Hubs implements new AfterErrorContextImpl( "getLibraryHubs", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } diff --git a/src/main/java/dev/plexapi/sdk/Library.java b/src/main/java/dev/plexapi/sdk/Library.java index 49679359..f29785a6 100644 --- a/src/main/java/dev/plexapi/sdk/Library.java +++ b/src/main/java/dev/plexapi/sdk/Library.java @@ -179,11 +179,11 @@ public class Library implements _req.addQueryParams(Utils.getQueryParams( GetFileHashRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -191,7 +191,7 @@ public class Library implements new BeforeRequestContextImpl( "getFileHash", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -202,7 +202,7 @@ public class Library implements new AfterErrorContextImpl( "getFileHash", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -211,7 +211,7 @@ public class Library implements new AfterSuccessContextImpl( "getFileHash", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -220,7 +220,7 @@ public class Library implements new AfterErrorContextImpl( "getFileHash", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -324,11 +324,11 @@ public class Library implements _req.addQueryParams(Utils.getQueryParams( GetRecentlyAddedLibraryRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -336,7 +336,7 @@ public class Library implements new BeforeRequestContextImpl( "get-recently-added-library", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -347,7 +347,7 @@ public class Library implements new AfterErrorContextImpl( "get-recently-added-library", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -356,7 +356,7 @@ public class Library implements new AfterSuccessContextImpl( "get-recently-added-library", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -365,7 +365,7 @@ public class Library implements new AfterErrorContextImpl( "get-recently-added-library", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -484,10 +484,10 @@ public class Library implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -495,7 +495,7 @@ public class Library implements new BeforeRequestContextImpl( "get-all-libraries", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -506,7 +506,7 @@ public class Library implements new AfterErrorContextImpl( "get-all-libraries", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -515,7 +515,7 @@ public class Library implements new AfterSuccessContextImpl( "get-all-libraries", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -524,7 +524,7 @@ public class Library implements new AfterErrorContextImpl( "get-all-libraries", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -773,7 +773,7 @@ public class Library implements GetLibraryDetailsRequest.class, _baseUrl, "/library/sections/{sectionKey}", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") @@ -783,11 +783,11 @@ public class Library implements _req.addQueryParams(Utils.getQueryParams( GetLibraryDetailsRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -795,7 +795,7 @@ public class Library implements new BeforeRequestContextImpl( "get-library-details", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -806,7 +806,7 @@ public class Library implements new AfterErrorContextImpl( "get-library-details", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -815,7 +815,7 @@ public class Library implements new AfterSuccessContextImpl( "get-library-details", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -824,7 +824,7 @@ public class Library implements new AfterErrorContextImpl( "get-library-details", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -937,16 +937,16 @@ public class Library implements DeleteLibraryRequest.class, _baseUrl, "/library/sections/{sectionKey}", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "DELETE"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -954,7 +954,7 @@ public class Library implements new BeforeRequestContextImpl( "deleteLibrary", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -965,7 +965,7 @@ public class Library implements new AfterErrorContextImpl( "deleteLibrary", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -974,7 +974,7 @@ public class Library implements new AfterSuccessContextImpl( "deleteLibrary", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -983,7 +983,7 @@ public class Library implements new AfterErrorContextImpl( "deleteLibrary", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -1075,6 +1075,7 @@ public class Library implements * - `resolution`: Items categorized by resolution. * - `firstCharacter`: Items categorized by the first letter. * - `folder`: Items categorized by folder. + * - `albums`: Items categorized by album. * * @return The call builder */ @@ -1104,6 +1105,7 @@ public class Library implements * - `resolution`: Items categorized by resolution. * - `firstCharacter`: Items categorized by the first letter. * - `folder`: Items categorized by folder. + * - `albums`: Items categorized by album. * * @param request The request object containing all of the parameters for the API call. * @return The response from the API call @@ -1117,7 +1119,7 @@ public class Library implements GetLibraryItemsRequest.class, _baseUrl, "/library/sections/{sectionKey}/{tag}", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") @@ -1127,11 +1129,11 @@ public class Library implements _req.addQueryParams(Utils.getQueryParams( GetLibraryItemsRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -1139,7 +1141,7 @@ public class Library implements new BeforeRequestContextImpl( "get-library-items", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -1150,7 +1152,7 @@ public class Library implements new AfterErrorContextImpl( "get-library-items", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -1159,7 +1161,7 @@ public class Library implements new AfterSuccessContextImpl( "get-library-items", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -1168,7 +1170,7 @@ public class Library implements new AfterErrorContextImpl( "get-library-items", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -1301,7 +1303,7 @@ public class Library implements GetRefreshLibraryMetadataRequest.class, _baseUrl, "/library/sections/{sectionKey}/refresh", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") @@ -1311,11 +1313,11 @@ public class Library implements _req.addQueryParams(Utils.getQueryParams( GetRefreshLibraryMetadataRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -1323,7 +1325,7 @@ public class Library implements new BeforeRequestContextImpl( "get-refresh-library-metadata", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -1334,7 +1336,7 @@ public class Library implements new AfterErrorContextImpl( "get-refresh-library-metadata", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -1343,7 +1345,7 @@ public class Library implements new AfterSuccessContextImpl( "get-refresh-library-metadata", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -1352,7 +1354,7 @@ public class Library implements new AfterErrorContextImpl( "get-refresh-library-metadata", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -1499,7 +1501,7 @@ public class Library implements GetSearchLibraryRequest.class, _baseUrl, "/library/sections/{sectionKey}/search", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") @@ -1509,11 +1511,11 @@ public class Library implements _req.addQueryParams(Utils.getQueryParams( GetSearchLibraryRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -1521,7 +1523,7 @@ public class Library implements new BeforeRequestContextImpl( "get-search-library", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -1532,7 +1534,7 @@ public class Library implements new AfterErrorContextImpl( "get-search-library", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -1541,7 +1543,7 @@ public class Library implements new AfterSuccessContextImpl( "get-search-library", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -1550,7 +1552,7 @@ public class Library implements new AfterErrorContextImpl( "get-search-library", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -1665,12 +1667,12 @@ public class Library implements _req.addQueryParams(Utils.getQueryParams( GetSearchAllLibrariesRequest.class, request, - this.sdkConfiguration.globals)); - _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); - + null)); + _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -1678,7 +1680,7 @@ public class Library implements new BeforeRequestContextImpl( "get-search-all-libraries", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -1689,7 +1691,7 @@ public class Library implements new AfterErrorContextImpl( "get-search-all-libraries", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -1698,7 +1700,7 @@ public class Library implements new AfterSuccessContextImpl( "get-search-all-libraries", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -1707,7 +1709,7 @@ public class Library implements new AfterErrorContextImpl( "get-search-all-libraries", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -1820,16 +1822,16 @@ public class Library implements GetMetaDataByRatingKeyRequest.class, _baseUrl, "/library/metadata/{ratingKey}", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -1837,7 +1839,7 @@ public class Library implements new BeforeRequestContextImpl( "get-meta-data-by-rating-key", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -1848,7 +1850,7 @@ public class Library implements new AfterErrorContextImpl( "get-meta-data-by-rating-key", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -1857,7 +1859,7 @@ public class Library implements new AfterSuccessContextImpl( "get-meta-data-by-rating-key", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -1866,7 +1868,7 @@ public class Library implements new AfterErrorContextImpl( "get-meta-data-by-rating-key", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -1996,7 +1998,7 @@ public class Library implements GetMetadataChildrenRequest.class, _baseUrl, "/library/metadata/{ratingKey}/children", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") @@ -2006,11 +2008,11 @@ public class Library implements _req.addQueryParams(Utils.getQueryParams( GetMetadataChildrenRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -2018,7 +2020,7 @@ public class Library implements new BeforeRequestContextImpl( "getMetadataChildren", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -2029,7 +2031,7 @@ public class Library implements new AfterErrorContextImpl( "getMetadataChildren", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -2038,7 +2040,7 @@ public class Library implements new AfterSuccessContextImpl( "getMetadataChildren", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -2047,7 +2049,7 @@ public class Library implements new AfterErrorContextImpl( "getMetadataChildren", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -2197,11 +2199,11 @@ public class Library implements _req.addQueryParams(Utils.getQueryParams( GetTopWatchedContentRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -2209,7 +2211,7 @@ public class Library implements new BeforeRequestContextImpl( "getTopWatchedContent", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -2220,7 +2222,7 @@ public class Library implements new AfterErrorContextImpl( "getTopWatchedContent", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -2229,7 +2231,7 @@ public class Library implements new AfterSuccessContextImpl( "getTopWatchedContent", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -2238,7 +2240,7 @@ public class Library implements new AfterErrorContextImpl( "getTopWatchedContent", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -2347,10 +2349,10 @@ public class Library implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -2358,7 +2360,7 @@ public class Library implements new BeforeRequestContextImpl( "getOnDeck", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -2369,7 +2371,7 @@ public class Library implements new AfterErrorContextImpl( "getOnDeck", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -2378,7 +2380,7 @@ public class Library implements new AfterSuccessContextImpl( "getOnDeck", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -2387,7 +2389,7 @@ public class Library implements new AfterErrorContextImpl( "getOnDeck", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } diff --git a/src/main/java/dev/plexapi/sdk/Log.java b/src/main/java/dev/plexapi/sdk/Log.java index 28ca5d90..31716fac 100644 --- a/src/main/java/dev/plexapi/sdk/Log.java +++ b/src/main/java/dev/plexapi/sdk/Log.java @@ -106,11 +106,11 @@ public class Log implements _req.addQueryParams(Utils.getQueryParams( LogLineRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -118,7 +118,7 @@ public class Log implements new BeforeRequestContextImpl( "logLine", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -129,7 +129,7 @@ public class Log implements new AfterErrorContextImpl( "logLine", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -138,7 +138,7 @@ public class Log implements new AfterSuccessContextImpl( "logLine", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -147,7 +147,7 @@ public class Log implements new AfterErrorContextImpl( "logLine", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -300,10 +300,10 @@ public class Log implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -311,7 +311,7 @@ public class Log implements new BeforeRequestContextImpl( "logMultiLine", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -322,7 +322,7 @@ public class Log implements new AfterErrorContextImpl( "logMultiLine", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -331,7 +331,7 @@ public class Log implements new AfterSuccessContextImpl( "logMultiLine", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -340,7 +340,7 @@ public class Log implements new AfterErrorContextImpl( "logMultiLine", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -438,10 +438,10 @@ public class Log implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -449,7 +449,7 @@ public class Log implements new BeforeRequestContextImpl( "enablePaperTrail", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -460,7 +460,7 @@ public class Log implements new AfterErrorContextImpl( "enablePaperTrail", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -469,7 +469,7 @@ public class Log implements new AfterSuccessContextImpl( "enablePaperTrail", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -478,7 +478,7 @@ public class Log implements new AfterErrorContextImpl( "enablePaperTrail", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } diff --git a/src/main/java/dev/plexapi/sdk/Media.java b/src/main/java/dev/plexapi/sdk/Media.java index ac12e6f4..aebeba41 100644 --- a/src/main/java/dev/plexapi/sdk/Media.java +++ b/src/main/java/dev/plexapi/sdk/Media.java @@ -102,11 +102,11 @@ public class Media implements _req.addQueryParams(Utils.getQueryParams( MarkPlayedRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -114,7 +114,7 @@ public class Media implements new BeforeRequestContextImpl( "markPlayed", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -125,7 +125,7 @@ public class Media implements new AfterErrorContextImpl( "markPlayed", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -134,7 +134,7 @@ public class Media implements new AfterSuccessContextImpl( "markPlayed", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -143,7 +143,7 @@ public class Media implements new AfterErrorContextImpl( "markPlayed", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -251,11 +251,11 @@ public class Media implements _req.addQueryParams(Utils.getQueryParams( MarkUnplayedRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -263,7 +263,7 @@ public class Media implements new BeforeRequestContextImpl( "markUnplayed", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -274,7 +274,7 @@ public class Media implements new AfterErrorContextImpl( "markUnplayed", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -283,7 +283,7 @@ public class Media implements new AfterSuccessContextImpl( "markUnplayed", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -292,7 +292,7 @@ public class Media implements new AfterErrorContextImpl( "markUnplayed", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -408,11 +408,11 @@ public class Media implements _req.addQueryParams(Utils.getQueryParams( UpdatePlayProgressRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -420,7 +420,7 @@ public class Media implements new BeforeRequestContextImpl( "updatePlayProgress", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -431,7 +431,7 @@ public class Media implements new AfterErrorContextImpl( "updatePlayProgress", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -440,7 +440,7 @@ public class Media implements new AfterSuccessContextImpl( "updatePlayProgress", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -449,7 +449,7 @@ public class Media implements new AfterErrorContextImpl( "updatePlayProgress", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -543,7 +543,7 @@ public class Media implements GetBannerImageRequest.class, _baseUrl, "/library/metadata/{ratingKey}/banner", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "image/jpeg") @@ -553,12 +553,12 @@ public class Media implements _req.addQueryParams(Utils.getQueryParams( GetBannerImageRequest.class, request, - this.sdkConfiguration.globals)); - _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); - + null)); + _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -566,7 +566,7 @@ public class Media implements new BeforeRequestContextImpl( "get-banner-image", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -577,7 +577,7 @@ public class Media implements new AfterErrorContextImpl( "get-banner-image", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -586,7 +586,7 @@ public class Media implements new AfterSuccessContextImpl( "get-banner-image", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -595,7 +595,7 @@ public class Media implements new AfterErrorContextImpl( "get-banner-image", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -700,7 +700,7 @@ public class Media implements GetThumbImageRequest.class, _baseUrl, "/library/metadata/{ratingKey}/thumb", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "image/jpeg") @@ -710,12 +710,12 @@ public class Media implements _req.addQueryParams(Utils.getQueryParams( GetThumbImageRequest.class, request, - this.sdkConfiguration.globals)); - _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); - + null)); + _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -723,7 +723,7 @@ public class Media implements new BeforeRequestContextImpl( "get-thumb-image", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -734,7 +734,7 @@ public class Media implements new AfterErrorContextImpl( "get-thumb-image", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -743,7 +743,7 @@ public class Media implements new AfterSuccessContextImpl( "get-thumb-image", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -752,7 +752,7 @@ public class Media implements new AfterErrorContextImpl( "get-thumb-image", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } diff --git a/src/main/java/dev/plexapi/sdk/Playlists.java b/src/main/java/dev/plexapi/sdk/Playlists.java index 3fd57515..6a7fbe62 100644 --- a/src/main/java/dev/plexapi/sdk/Playlists.java +++ b/src/main/java/dev/plexapi/sdk/Playlists.java @@ -139,11 +139,11 @@ public class Playlists implements _req.addQueryParams(Utils.getQueryParams( CreatePlaylistRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -151,7 +151,7 @@ public class Playlists implements new BeforeRequestContextImpl( "createPlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -162,7 +162,7 @@ public class Playlists implements new AfterErrorContextImpl( "createPlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -171,7 +171,7 @@ public class Playlists implements new AfterSuccessContextImpl( "createPlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -180,7 +180,7 @@ public class Playlists implements new AfterErrorContextImpl( "createPlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -312,11 +312,11 @@ public class Playlists implements _req.addQueryParams(Utils.getQueryParams( GetPlaylistsRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -324,7 +324,7 @@ public class Playlists implements new BeforeRequestContextImpl( "getPlaylists", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -335,7 +335,7 @@ public class Playlists implements new AfterErrorContextImpl( "getPlaylists", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -344,7 +344,7 @@ public class Playlists implements new AfterSuccessContextImpl( "getPlaylists", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -353,7 +353,7 @@ public class Playlists implements new AfterErrorContextImpl( "getPlaylists", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -468,16 +468,16 @@ public class Playlists implements GetPlaylistRequest.class, _baseUrl, "/playlists/{playlistID}", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -485,7 +485,7 @@ public class Playlists implements new BeforeRequestContextImpl( "getPlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -496,7 +496,7 @@ public class Playlists implements new AfterErrorContextImpl( "getPlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -505,7 +505,7 @@ public class Playlists implements new AfterSuccessContextImpl( "getPlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -514,7 +514,7 @@ public class Playlists implements new AfterErrorContextImpl( "getPlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -627,16 +627,16 @@ public class Playlists implements DeletePlaylistRequest.class, _baseUrl, "/playlists/{playlistID}", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "DELETE"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -644,7 +644,7 @@ public class Playlists implements new BeforeRequestContextImpl( "deletePlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -655,7 +655,7 @@ public class Playlists implements new AfterErrorContextImpl( "deletePlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -664,7 +664,7 @@ public class Playlists implements new AfterSuccessContextImpl( "deletePlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -673,7 +673,7 @@ public class Playlists implements new AfterErrorContextImpl( "deletePlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -794,7 +794,7 @@ public class Playlists implements UpdatePlaylistRequest.class, _baseUrl, "/playlists/{playlistID}", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "PUT"); _req.addHeader("Accept", "application/json") @@ -804,11 +804,11 @@ public class Playlists implements _req.addQueryParams(Utils.getQueryParams( UpdatePlaylistRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -816,7 +816,7 @@ public class Playlists implements new BeforeRequestContextImpl( "updatePlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -827,7 +827,7 @@ public class Playlists implements new AfterErrorContextImpl( "updatePlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -836,7 +836,7 @@ public class Playlists implements new AfterSuccessContextImpl( "updatePlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -845,7 +845,7 @@ public class Playlists implements new AfterErrorContextImpl( "updatePlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -962,7 +962,7 @@ public class Playlists implements GetPlaylistContentsRequest.class, _baseUrl, "/playlists/{playlistID}/items", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") @@ -972,11 +972,11 @@ public class Playlists implements _req.addQueryParams(Utils.getQueryParams( GetPlaylistContentsRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -984,7 +984,7 @@ public class Playlists implements new BeforeRequestContextImpl( "getPlaylistContents", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -995,7 +995,7 @@ public class Playlists implements new AfterErrorContextImpl( "getPlaylistContents", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -1004,7 +1004,7 @@ public class Playlists implements new AfterSuccessContextImpl( "getPlaylistContents", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -1013,7 +1013,7 @@ public class Playlists implements new AfterErrorContextImpl( "getPlaylistContents", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -1126,16 +1126,16 @@ public class Playlists implements ClearPlaylistContentsRequest.class, _baseUrl, "/playlists/{playlistID}/items", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "DELETE"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -1143,7 +1143,7 @@ public class Playlists implements new BeforeRequestContextImpl( "clearPlaylistContents", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -1154,7 +1154,7 @@ public class Playlists implements new AfterErrorContextImpl( "clearPlaylistContents", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -1163,7 +1163,7 @@ public class Playlists implements new AfterSuccessContextImpl( "clearPlaylistContents", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -1172,7 +1172,7 @@ public class Playlists implements new AfterErrorContextImpl( "clearPlaylistContents", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -1298,7 +1298,7 @@ public class Playlists implements AddPlaylistContentsRequest.class, _baseUrl, "/playlists/{playlistID}/items", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "PUT"); _req.addHeader("Accept", "application/json") @@ -1308,11 +1308,11 @@ public class Playlists implements _req.addQueryParams(Utils.getQueryParams( AddPlaylistContentsRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -1320,7 +1320,7 @@ public class Playlists implements new BeforeRequestContextImpl( "addPlaylistContents", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -1331,7 +1331,7 @@ public class Playlists implements new AfterErrorContextImpl( "addPlaylistContents", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -1340,7 +1340,7 @@ public class Playlists implements new AfterSuccessContextImpl( "addPlaylistContents", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -1349,7 +1349,7 @@ public class Playlists implements new AfterErrorContextImpl( "addPlaylistContents", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -1486,11 +1486,11 @@ public class Playlists implements _req.addQueryParams(Utils.getQueryParams( UploadPlaylistRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -1498,7 +1498,7 @@ public class Playlists implements new BeforeRequestContextImpl( "uploadPlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -1509,7 +1509,7 @@ public class Playlists implements new AfterErrorContextImpl( "uploadPlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -1518,7 +1518,7 @@ public class Playlists implements new AfterSuccessContextImpl( "uploadPlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -1527,7 +1527,7 @@ public class Playlists implements new AfterErrorContextImpl( "uploadPlaylist", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } diff --git a/src/main/java/dev/plexapi/sdk/Plex.java b/src/main/java/dev/plexapi/sdk/Plex.java index 696f0615..b980ad3f 100644 --- a/src/main/java/dev/plexapi/sdk/Plex.java +++ b/src/main/java/dev/plexapi/sdk/Plex.java @@ -164,10 +164,10 @@ public class Plex implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -175,7 +175,7 @@ public class Plex implements new BeforeRequestContextImpl( "getCompanionsData", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -186,7 +186,7 @@ public class Plex implements new AfterErrorContextImpl( "getCompanionsData", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -195,7 +195,7 @@ public class Plex implements new AfterSuccessContextImpl( "getCompanionsData", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -204,7 +204,7 @@ public class Plex implements new AfterErrorContextImpl( "getCompanionsData", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -325,10 +325,10 @@ public class Plex implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -336,7 +336,7 @@ public class Plex implements new BeforeRequestContextImpl( "getUserFriends", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -347,7 +347,7 @@ public class Plex implements new AfterErrorContextImpl( "getUserFriends", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -356,7 +356,7 @@ public class Plex implements new AfterSuccessContextImpl( "getUserFriends", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -365,7 +365,7 @@ public class Plex implements new AfterErrorContextImpl( "getUserFriends", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -486,7 +486,7 @@ public class Plex implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + Optional _hookSecuritySource = Optional.empty(); HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -494,7 +494,7 @@ public class Plex implements new BeforeRequestContextImpl( "getGeoData", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -505,7 +505,7 @@ public class Plex implements new AfterErrorContextImpl( "getGeoData", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -514,7 +514,7 @@ public class Plex implements new AfterSuccessContextImpl( "getGeoData", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -523,7 +523,7 @@ public class Plex implements new AfterErrorContextImpl( "getGeoData", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -630,10 +630,10 @@ public class Plex implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -641,7 +641,7 @@ public class Plex implements new BeforeRequestContextImpl( "getHomeData", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -652,7 +652,7 @@ public class Plex implements new AfterErrorContextImpl( "getHomeData", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -661,7 +661,7 @@ public class Plex implements new AfterSuccessContextImpl( "getHomeData", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -670,7 +670,7 @@ public class Plex implements new AfterErrorContextImpl( "getHomeData", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -763,11 +763,13 @@ public class Plex implements /** * Get Server Resources * Get Plex server access tokens and server connections + * @param clientID An opaque identifier unique to the client (UUID, serial number, or other unique device ID) * @return The response from the API call * @throws Exception if the API call fails */ - public GetServerResourcesResponse getServerResourcesDirect() throws Exception { - return getServerResources(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + public GetServerResourcesResponse getServerResources( + String clientID) throws Exception { + return getServerResources(Optional.empty(), Optional.empty(), Optional.empty(), clientID, Optional.empty()); } /** @@ -787,7 +789,7 @@ public class Plex implements Optional includeHttps, Optional includeRelay, Optional includeIPv6, - Optional clientID, + String clientID, Optional serverURL) throws Exception { GetServerResourcesRequest request = GetServerResourcesRequest @@ -814,12 +816,12 @@ public class Plex implements _req.addQueryParams(Utils.getQueryParams( GetServerResourcesRequest.class, request, - this.sdkConfiguration.globals)); - _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); - + null)); + _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -827,7 +829,7 @@ public class Plex implements new BeforeRequestContextImpl( "get-server-resources", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -838,7 +840,7 @@ public class Plex implements new AfterErrorContextImpl( "get-server-resources", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -847,7 +849,7 @@ public class Plex implements new AfterSuccessContextImpl( "get-server-resources", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -856,7 +858,7 @@ public class Plex implements new AfterErrorContextImpl( "get-server-resources", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -985,9 +987,9 @@ public class Plex implements _req.addQueryParams(Utils.getQueryParams( GetPinRequest.class, request, - this.sdkConfiguration.globals)); - _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); - + null)); + _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + Optional _hookSecuritySource = Optional.empty(); HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -995,7 +997,7 @@ public class Plex implements new BeforeRequestContextImpl( "getPin", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -1006,7 +1008,7 @@ public class Plex implements new AfterErrorContextImpl( "getPin", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -1015,7 +1017,7 @@ public class Plex implements new AfterSuccessContextImpl( "getPin", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -1024,7 +1026,7 @@ public class Plex implements new AfterErrorContextImpl( "getPin", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -1129,14 +1131,14 @@ public class Plex implements GetTokenByPinIdRequest.class, _baseUrl, "/pins/{pinID}", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); - + _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + Optional _hookSecuritySource = Optional.empty(); HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -1144,7 +1146,7 @@ public class Plex implements new BeforeRequestContextImpl( "getTokenByPinId", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -1155,7 +1157,7 @@ public class Plex implements new AfterErrorContextImpl( "getTokenByPinId", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -1164,7 +1166,7 @@ public class Plex implements new AfterSuccessContextImpl( "getTokenByPinId", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -1173,7 +1175,7 @@ public class Plex implements new AfterErrorContextImpl( "getTokenByPinId", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } diff --git a/src/main/java/dev/plexapi/sdk/PlexAPI.java b/src/main/java/dev/plexapi/sdk/PlexAPI.java index 21674739..0996d351 100644 --- a/src/main/java/dev/plexapi/sdk/PlexAPI.java +++ b/src/main/java/dev/plexapi/sdk/PlexAPI.java @@ -5,7 +5,6 @@ package dev.plexapi.sdk; import com.fasterxml.jackson.annotation.JsonValue; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; import dev.plexapi.sdk.utils.HTTPClient; import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.SpeakeasyHTTPClient; @@ -13,6 +12,7 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.String; import java.util.Map; import java.util.Optional; +import java.util.function.Consumer; /** * Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server @@ -458,89 +458,16 @@ public class PlexAPI { return this; } - /** - * Allows setting the clientID parameter for all supported operations. - * - * @param clientID The value to set. - * @return The builder instance. - */ - public Builder clientID(String clientID) { - 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("header").put("clientID", clientID); - - return this; + // Visible for testing, may be accessed via reflection in tests + Builder _hooks(dev.plexapi.sdk.utils.Hooks hooks) { + sdkConfiguration.setHooks(hooks); + return this; } - /** - * Allows setting the clientName parameter for all supported operations. - * - * @param clientName The value to set. - * @return The builder instance. - */ - public Builder clientName(String clientName) { - 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("header").put("clientName", clientName); - - return this; - } - - /** - * Allows setting the clientVersion parameter for all supported operations. - * - * @param clientVersion The value to set. - * @return The builder instance. - */ - public Builder clientVersion(String clientVersion) { - 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("header").put("clientVersion", clientVersion); - - return this; - } - - /** - * Allows setting the platform parameter for all supported operations. - * - * @param platform The value to set. - * @return The builder instance. - */ - 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("header").put("platform", platform); - - return this; - } - - /** - * Allows setting the deviceNickname parameter for all supported operations. - * - * @param deviceNickname The value to set. - * @return The builder instance. - */ - 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("header").put("deviceNickname", deviceNickname); - - return this; - } - - // Visible for testing, will be accessed via reflection - void _hooks(dev.plexapi.sdk.utils.Hooks hooks) { - sdkConfiguration.setHooks(hooks); + // Visible for testing, may be accessed via reflection in tests + Builder _hooks(Consumer consumer) { + consumer.accept(sdkConfiguration.hooks()); + return this; } /** diff --git a/src/main/java/dev/plexapi/sdk/SDKConfiguration.java b/src/main/java/dev/plexapi/sdk/SDKConfiguration.java index 2aa23152..abe197f5 100644 --- a/src/main/java/dev/plexapi/sdk/SDKConfiguration.java +++ b/src/main/java/dev/plexapi/sdk/SDKConfiguration.java @@ -9,7 +9,7 @@ import dev.plexapi.sdk.utils.HTTPClient; import dev.plexapi.sdk.utils.Hook.SdkInitData; import dev.plexapi.sdk.utils.Hooks; import dev.plexapi.sdk.utils.RetryConfig; -import java.lang.Object; +import dev.plexapi.sdk.utils.Utils; import java.lang.String; import java.lang.SuppressWarnings; import java.util.ArrayList; @@ -24,9 +24,16 @@ class SDKConfiguration { public Optional securitySource() { return Optional.ofNullable(securitySource); } + public HTTPClient defaultClient; + public String serverUrl; + + public String resolvedServerUrl() { + return Utils.templateUrl(serverUrl, getServerVariableDefaults()); + } public int serverIdx = 0; + @SuppressWarnings("serial") List> serverDefaults = new ArrayList<>(){ { add(new HashMap<>(){ { put("protocol", "https"); @@ -36,8 +43,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.10.1"; - public static final String GEN_VERSION = "2.457.9"; + public static final String SDK_VERSION = "0.11.0"; + public static final String GEN_VERSION = "2.483.1"; private static final String BASE_PACKAGE = "dev.plexapi.sdk"; public static final String USER_AGENT = String.format("speakeasy-sdk/%s %s %s %s %s", @@ -64,18 +71,15 @@ class SDKConfiguration { public void initialize() { SDKHooks.initialize(_hooks); // apply the sdk init hook immediately - SdkInitData data = _hooks.sdkInit(new SdkInitData(serverUrl, defaultClient)); + SdkInitData data = _hooks.sdkInit(new SdkInitData(resolvedServerUrl(), defaultClient)); this.serverUrl = data.baseUrl(); this.defaultClient = data.client(); } - @SuppressWarnings("serial") - public Map>> globals = new HashMap<>(){ { - put("parameters", new HashMap<>()); - } }; - public Map getServerVariableDefaults() { - return serverDefaults.get(this.serverIdx); - } + + public Map getServerVariableDefaults() { + return serverDefaults.get(this.serverIdx); + } public Optional retryConfig = Optional.empty(); } diff --git a/src/main/java/dev/plexapi/sdk/Search.java b/src/main/java/dev/plexapi/sdk/Search.java index 79fa01f5..d8b6b356 100644 --- a/src/main/java/dev/plexapi/sdk/Search.java +++ b/src/main/java/dev/plexapi/sdk/Search.java @@ -146,11 +146,11 @@ public class Search implements _req.addQueryParams(Utils.getQueryParams( PerformSearchRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -158,7 +158,7 @@ public class Search implements new BeforeRequestContextImpl( "performSearch", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -169,7 +169,7 @@ public class Search implements new AfterErrorContextImpl( "performSearch", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -178,7 +178,7 @@ public class Search implements new AfterSuccessContextImpl( "performSearch", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -187,7 +187,7 @@ public class Search implements new AfterErrorContextImpl( "performSearch", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -325,11 +325,11 @@ public class Search implements _req.addQueryParams(Utils.getQueryParams( PerformVoiceSearchRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -337,7 +337,7 @@ public class Search implements new BeforeRequestContextImpl( "performVoiceSearch", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -348,7 +348,7 @@ public class Search implements new AfterErrorContextImpl( "performVoiceSearch", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -357,7 +357,7 @@ public class Search implements new AfterSuccessContextImpl( "performVoiceSearch", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -366,7 +366,7 @@ public class Search implements new AfterErrorContextImpl( "performVoiceSearch", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -474,11 +474,11 @@ public class Search implements _req.addQueryParams(Utils.getQueryParams( GetSearchResultsRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -486,7 +486,7 @@ public class Search implements new BeforeRequestContextImpl( "getSearchResults", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -497,7 +497,7 @@ public class Search implements new AfterErrorContextImpl( "getSearchResults", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -506,7 +506,7 @@ public class Search implements new AfterSuccessContextImpl( "getSearchResults", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -515,7 +515,7 @@ public class Search implements new AfterErrorContextImpl( "getSearchResults", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } diff --git a/src/main/java/dev/plexapi/sdk/Server.java b/src/main/java/dev/plexapi/sdk/Server.java index ab1b125a..6dc38fb2 100644 --- a/src/main/java/dev/plexapi/sdk/Server.java +++ b/src/main/java/dev/plexapi/sdk/Server.java @@ -114,10 +114,10 @@ public class Server implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -125,7 +125,7 @@ public class Server implements new BeforeRequestContextImpl( "getServerCapabilities", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -136,7 +136,7 @@ public class Server implements new AfterErrorContextImpl( "getServerCapabilities", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -145,7 +145,7 @@ public class Server implements new AfterSuccessContextImpl( "getServerCapabilities", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -154,7 +154,7 @@ public class Server implements new AfterErrorContextImpl( "getServerCapabilities", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -261,10 +261,10 @@ public class Server implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -272,7 +272,7 @@ public class Server implements new BeforeRequestContextImpl( "getServerPreferences", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -283,7 +283,7 @@ public class Server implements new AfterErrorContextImpl( "getServerPreferences", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -292,7 +292,7 @@ public class Server implements new AfterSuccessContextImpl( "getServerPreferences", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -301,7 +301,7 @@ public class Server implements new AfterErrorContextImpl( "getServerPreferences", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -408,10 +408,10 @@ public class Server implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -419,7 +419,7 @@ public class Server implements new BeforeRequestContextImpl( "getAvailableClients", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -430,7 +430,7 @@ public class Server implements new AfterErrorContextImpl( "getAvailableClients", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -439,7 +439,7 @@ public class Server implements new AfterSuccessContextImpl( "getAvailableClients", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -448,7 +448,7 @@ public class Server implements new AfterErrorContextImpl( "getAvailableClients", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -555,10 +555,10 @@ public class Server implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -566,7 +566,7 @@ public class Server implements new BeforeRequestContextImpl( "getDevices", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -577,7 +577,7 @@ public class Server implements new AfterErrorContextImpl( "getDevices", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -586,7 +586,7 @@ public class Server implements new AfterSuccessContextImpl( "getDevices", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -595,7 +595,7 @@ public class Server implements new AfterErrorContextImpl( "getDevices", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -702,7 +702,7 @@ public class Server implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + Optional _hookSecuritySource = Optional.empty(); HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -710,7 +710,7 @@ public class Server implements new BeforeRequestContextImpl( "get-server-identity", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -721,7 +721,7 @@ public class Server implements new AfterErrorContextImpl( "get-server-identity", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -730,7 +730,7 @@ public class Server implements new AfterSuccessContextImpl( "get-server-identity", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -739,7 +739,7 @@ public class Server implements new AfterErrorContextImpl( "get-server-identity", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -830,10 +830,10 @@ public class Server implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -841,7 +841,7 @@ public class Server implements new BeforeRequestContextImpl( "getMyPlexAccount", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -852,7 +852,7 @@ public class Server implements new AfterErrorContextImpl( "getMyPlexAccount", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -861,7 +861,7 @@ public class Server implements new AfterSuccessContextImpl( "getMyPlexAccount", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -870,7 +870,7 @@ public class Server implements new AfterErrorContextImpl( "getMyPlexAccount", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -985,11 +985,11 @@ public class Server implements _req.addQueryParams(Utils.getQueryParams( GetResizedPhotoRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -997,7 +997,7 @@ public class Server implements new BeforeRequestContextImpl( "getResizedPhoto", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -1008,7 +1008,7 @@ public class Server implements new AfterErrorContextImpl( "getResizedPhoto", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -1017,7 +1017,7 @@ public class Server implements new AfterSuccessContextImpl( "getResizedPhoto", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -1026,7 +1026,7 @@ public class Server implements new AfterErrorContextImpl( "getResizedPhoto", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -1130,11 +1130,11 @@ public class Server implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); - + _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -1142,7 +1142,7 @@ public class Server implements new BeforeRequestContextImpl( "get-media-providers", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -1153,7 +1153,7 @@ public class Server implements new AfterErrorContextImpl( "get-media-providers", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -1162,7 +1162,7 @@ public class Server implements new AfterSuccessContextImpl( "get-media-providers", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -1171,7 +1171,7 @@ public class Server implements new AfterErrorContextImpl( "get-media-providers", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -1278,10 +1278,10 @@ public class Server implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -1289,7 +1289,7 @@ public class Server implements new BeforeRequestContextImpl( "getServerList", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -1300,7 +1300,7 @@ public class Server implements new AfterErrorContextImpl( "getServerList", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -1309,7 +1309,7 @@ public class Server implements new AfterSuccessContextImpl( "getServerList", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -1318,7 +1318,7 @@ public class Server implements new AfterErrorContextImpl( "getServerList", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } diff --git a/src/main/java/dev/plexapi/sdk/Sessions.java b/src/main/java/dev/plexapi/sdk/Sessions.java index 403ede4d..27b2f50f 100644 --- a/src/main/java/dev/plexapi/sdk/Sessions.java +++ b/src/main/java/dev/plexapi/sdk/Sessions.java @@ -87,10 +87,10 @@ public class Sessions implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -98,7 +98,7 @@ public class Sessions implements new BeforeRequestContextImpl( "getSessions", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -109,7 +109,7 @@ public class Sessions implements new AfterErrorContextImpl( "getSessions", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -118,7 +118,7 @@ public class Sessions implements new AfterSuccessContextImpl( "getSessions", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -127,7 +127,7 @@ public class Sessions implements new AfterErrorContextImpl( "getSessions", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -270,11 +270,11 @@ public class Sessions implements _req.addQueryParams(Utils.getQueryParams( GetSessionHistoryRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -282,7 +282,7 @@ public class Sessions implements new BeforeRequestContextImpl( "getSessionHistory", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -293,7 +293,7 @@ public class Sessions implements new AfterErrorContextImpl( "getSessionHistory", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -302,7 +302,7 @@ public class Sessions implements new AfterSuccessContextImpl( "getSessionHistory", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -311,7 +311,7 @@ public class Sessions implements new AfterErrorContextImpl( "getSessionHistory", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -418,10 +418,10 @@ public class Sessions implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -429,7 +429,7 @@ public class Sessions implements new BeforeRequestContextImpl( "getTranscodeSessions", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -440,7 +440,7 @@ public class Sessions implements new AfterErrorContextImpl( "getTranscodeSessions", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -449,7 +449,7 @@ public class Sessions implements new AfterSuccessContextImpl( "getTranscodeSessions", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -458,7 +458,7 @@ public class Sessions implements new AfterErrorContextImpl( "getTranscodeSessions", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -569,16 +569,16 @@ public class Sessions implements StopTranscodeSessionRequest.class, _baseUrl, "/transcode/sessions/{sessionKey}", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "DELETE"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -586,7 +586,7 @@ public class Sessions implements new BeforeRequestContextImpl( "stopTranscodeSession", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -597,7 +597,7 @@ public class Sessions implements new AfterErrorContextImpl( "stopTranscodeSession", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -606,7 +606,7 @@ public class Sessions implements new AfterSuccessContextImpl( "stopTranscodeSession", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -615,7 +615,7 @@ public class Sessions implements new AfterErrorContextImpl( "stopTranscodeSession", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } diff --git a/src/main/java/dev/plexapi/sdk/Statistics.java b/src/main/java/dev/plexapi/sdk/Statistics.java index f0873e0b..11c98300 100644 --- a/src/main/java/dev/plexapi/sdk/Statistics.java +++ b/src/main/java/dev/plexapi/sdk/Statistics.java @@ -106,11 +106,11 @@ public class Statistics implements _req.addQueryParams(Utils.getQueryParams( GetStatisticsRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -118,7 +118,7 @@ public class Statistics implements new BeforeRequestContextImpl( "getStatistics", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -129,7 +129,7 @@ public class Statistics implements new AfterErrorContextImpl( "getStatistics", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -138,7 +138,7 @@ public class Statistics implements new AfterSuccessContextImpl( "getStatistics", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -147,7 +147,7 @@ public class Statistics implements new AfterErrorContextImpl( "getStatistics", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -278,11 +278,11 @@ public class Statistics implements _req.addQueryParams(Utils.getQueryParams( GetResourcesStatisticsRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -290,7 +290,7 @@ public class Statistics implements new BeforeRequestContextImpl( "getResourcesStatistics", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -301,7 +301,7 @@ public class Statistics implements new AfterErrorContextImpl( "getResourcesStatistics", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -310,7 +310,7 @@ public class Statistics implements new AfterSuccessContextImpl( "getResourcesStatistics", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -319,7 +319,7 @@ public class Statistics implements new AfterErrorContextImpl( "getResourcesStatistics", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -450,11 +450,11 @@ public class Statistics implements _req.addQueryParams(Utils.getQueryParams( GetBandwidthStatisticsRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -462,7 +462,7 @@ public class Statistics implements new BeforeRequestContextImpl( "getBandwidthStatistics", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -473,7 +473,7 @@ public class Statistics implements new AfterErrorContextImpl( "getBandwidthStatistics", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -482,7 +482,7 @@ public class Statistics implements new AfterSuccessContextImpl( "getBandwidthStatistics", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -491,7 +491,7 @@ public class Statistics implements new AfterErrorContextImpl( "getBandwidthStatistics", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } diff --git a/src/main/java/dev/plexapi/sdk/Updater.java b/src/main/java/dev/plexapi/sdk/Updater.java index 14e60e8c..aa638923 100644 --- a/src/main/java/dev/plexapi/sdk/Updater.java +++ b/src/main/java/dev/plexapi/sdk/Updater.java @@ -82,10 +82,10 @@ public class Updater implements _req.addHeader("Accept", "application/json") .addHeader("user-agent", SDKConfiguration.USER_AGENT); - + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -93,7 +93,7 @@ public class Updater implements new BeforeRequestContextImpl( "getUpdateStatus", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -104,7 +104,7 @@ public class Updater implements new AfterErrorContextImpl( "getUpdateStatus", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -113,7 +113,7 @@ public class Updater implements new AfterSuccessContextImpl( "getUpdateStatus", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -122,7 +122,7 @@ public class Updater implements new AfterErrorContextImpl( "getUpdateStatus", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -251,11 +251,11 @@ public class Updater implements _req.addQueryParams(Utils.getQueryParams( CheckForUpdatesRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -263,7 +263,7 @@ public class Updater implements new BeforeRequestContextImpl( "checkForUpdates", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -274,7 +274,7 @@ public class Updater implements new AfterErrorContextImpl( "checkForUpdates", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -283,7 +283,7 @@ public class Updater implements new AfterSuccessContextImpl( "checkForUpdates", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -292,7 +292,7 @@ public class Updater implements new AfterErrorContextImpl( "checkForUpdates", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -416,11 +416,11 @@ public class Updater implements _req.addQueryParams(Utils.getQueryParams( ApplyUpdatesRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -428,7 +428,7 @@ public class Updater implements new BeforeRequestContextImpl( "applyUpdates", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -439,7 +439,7 @@ public class Updater implements new AfterErrorContextImpl( "applyUpdates", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -448,7 +448,7 @@ public class Updater implements new AfterSuccessContextImpl( "applyUpdates", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -457,7 +457,7 @@ public class Updater implements new AfterErrorContextImpl( "applyUpdates", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } diff --git a/src/main/java/dev/plexapi/sdk/Video.java b/src/main/java/dev/plexapi/sdk/Video.java index 19699f3d..f47ba0e9 100644 --- a/src/main/java/dev/plexapi/sdk/Video.java +++ b/src/main/java/dev/plexapi/sdk/Video.java @@ -78,11 +78,11 @@ public class Video implements _req.addQueryParams(Utils.getQueryParams( GetTimelineRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -90,7 +90,7 @@ public class Video implements new BeforeRequestContextImpl( "getTimeline", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -101,7 +101,7 @@ public class Video implements new AfterErrorContextImpl( "getTimeline", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -110,7 +110,7 @@ public class Video implements new AfterSuccessContextImpl( "getTimeline", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -119,7 +119,7 @@ public class Video implements new AfterErrorContextImpl( "getTimeline", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } @@ -221,11 +221,11 @@ public class Video implements _req.addQueryParams(Utils.getQueryParams( StartUniversalTranscodeRequest.class, request, - this.sdkConfiguration.globals)); - + null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -233,7 +233,7 @@ public class Video implements new BeforeRequestContextImpl( "startUniversalTranscode", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -244,7 +244,7 @@ public class Video implements new AfterErrorContextImpl( "startUniversalTranscode", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -253,7 +253,7 @@ public class Video implements new AfterSuccessContextImpl( "startUniversalTranscode", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -262,7 +262,7 @@ public class Video implements new AfterErrorContextImpl( "startUniversalTranscode", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } diff --git a/src/main/java/dev/plexapi/sdk/Watchlist.java b/src/main/java/dev/plexapi/sdk/Watchlist.java index 47ae0962..ad9e7790 100644 --- a/src/main/java/dev/plexapi/sdk/Watchlist.java +++ b/src/main/java/dev/plexapi/sdk/Watchlist.java @@ -92,7 +92,7 @@ public class Watchlist implements GetWatchListRequest.class, _baseUrl, "/library/sections/watchlist/{filter}", - request, this.sdkConfiguration.globals); + request, null); HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") @@ -102,12 +102,12 @@ public class Watchlist implements _req.addQueryParams(Utils.getQueryParams( GetWatchListRequest.class, request, - this.sdkConfiguration.globals)); - _req.addHeaders(Utils.getHeadersFromMetadata(request, this.sdkConfiguration.globals)); - + null)); + _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + + Optional _hookSecuritySource = this.sdkConfiguration.securitySource(); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); - HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = sdkConfiguration.hooks() @@ -115,7 +115,7 @@ public class Watchlist implements new BeforeRequestContextImpl( "get-watch-list", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _req.build()); HttpResponse _httpRes; try { @@ -126,7 +126,7 @@ public class Watchlist implements new AfterErrorContextImpl( "get-watch-list", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.of(_httpRes), Optional.empty()); } else { @@ -135,7 +135,7 @@ public class Watchlist implements new AfterSuccessContextImpl( "get-watch-list", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), _httpRes); } } catch (Exception _e) { @@ -144,7 +144,7 @@ public class Watchlist implements new AfterErrorContextImpl( "get-watch-list", Optional.of(List.of()), - sdkConfiguration.securitySource()), + _hookSecuritySource), Optional.empty(), Optional.of(_e)); } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/ActiveDirection.java b/src/main/java/dev/plexapi/sdk/models/operations/ActiveDirection.java index 369e30f9..22f8bac8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/ActiveDirection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/ActiveDirection.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * ActiveDirection - The direction of the sort. Can be either `asc` or `desc`. @@ -25,4 +27,13 @@ public enum ActiveDirection { public String value() { return value; } + + public static Optional fromValue(String value) { + for (ActiveDirection o: ActiveDirection.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/AutoSelectSubtitle.java b/src/main/java/dev/plexapi/sdk/models/operations/AutoSelectSubtitle.java index d98bc549..a3cfaa3b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/AutoSelectSubtitle.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/AutoSelectSubtitle.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * AutoSelectSubtitle - The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) @@ -23,4 +25,13 @@ public enum AutoSelectSubtitle { public int value() { return value; } + + public static Optional fromValue(int value) { + for (AutoSelectSubtitle o: AutoSelectSubtitle.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistQueryParamType.java b/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistQueryParamType.java index d5449e89..85b51eb3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistQueryParamType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistQueryParamType.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * CreatePlaylistQueryParamType - type of playlist to create @@ -25,4 +27,13 @@ public enum CreatePlaylistQueryParamType { public String value() { return value; } + + public static Optional fromValue(String value) { + for (CreatePlaylistQueryParamType o: CreatePlaylistQueryParamType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/DefaultDirection.java b/src/main/java/dev/plexapi/sdk/models/operations/DefaultDirection.java index 849f04c1..c4fcf71e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/DefaultDirection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/DefaultDirection.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * DefaultDirection - The direction of the sort. Can be either `asc` or `desc`. @@ -25,4 +27,13 @@ public enum DefaultDirection { public String value() { return value; } + + public static Optional fromValue(String value) { + for (DefaultDirection o: DefaultDirection.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/DefaultSubtitleAccessibility.java b/src/main/java/dev/plexapi/sdk/models/operations/DefaultSubtitleAccessibility.java index 3681b1d0..48c58469 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/DefaultSubtitleAccessibility.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/DefaultSubtitleAccessibility.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * DefaultSubtitleAccessibility - The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles) @@ -23,4 +25,13 @@ public enum DefaultSubtitleAccessibility { public int value() { return value; } + + public static Optional fromValue(int value) { + for (DefaultSubtitleAccessibility o: DefaultSubtitleAccessibility.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/DefaultSubtitleForced.java b/src/main/java/dev/plexapi/sdk/models/operations/DefaultSubtitleForced.java index 1b224caf..cb82fff9 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/DefaultSubtitleForced.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/DefaultSubtitleForced.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * DefaultSubtitleForced - The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles) @@ -23,4 +25,13 @@ public enum DefaultSubtitleForced { public int value() { return value; } + + public static Optional fromValue(int value) { + for (DefaultSubtitleForced o: DefaultSubtitleForced.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Download.java b/src/main/java/dev/plexapi/sdk/models/operations/Download.java index c74b6382..792c4cd2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Download.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Download.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * Download - Indicate that you want to start download any updates found. @@ -23,4 +25,13 @@ public enum Download { public long value() { return value; } + + public static Optional fromValue(long value) { + for (Download o: Download.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Filter.java b/src/main/java/dev/plexapi/sdk/models/operations/Filter.java index 42a20309..fb6e4ebf 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Filter.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Filter.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * Filter - Filter @@ -25,4 +27,13 @@ public enum Filter { public String value() { return value; } + + public static Optional fromValue(String value) { + for (Filter o: Filter.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/FlattenSeasons.java b/src/main/java/dev/plexapi/sdk/models/operations/FlattenSeasons.java index 7ee89460..2bbe67a5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/FlattenSeasons.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/FlattenSeasons.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; public enum FlattenSeasons { False("0"), @@ -21,4 +23,13 @@ public enum FlattenSeasons { public String value() { return value; } + + public static Optional fromValue(String value) { + for (FlattenSeasons o: FlattenSeasons.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Force.java b/src/main/java/dev/plexapi/sdk/models/operations/Force.java index f491dda0..7ad90c20 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Force.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Force.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * Force - Force the refresh even if the library is already being refreshed. @@ -23,4 +25,13 @@ public enum Force { public long value() { return value; } + + public static Optional fromValue(long value) { + for (Force o: Force.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsActiveDirection.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsActiveDirection.java index 2ec497fb..03999744 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsActiveDirection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsActiveDirection.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * GetLibraryItemsActiveDirection - The direction of the sort. Can be either `asc` or `desc`. @@ -25,4 +27,13 @@ public enum GetLibraryItemsActiveDirection { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetLibraryItemsActiveDirection o: GetLibraryItemsActiveDirection.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsDefaultDirection.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsDefaultDirection.java index a431751d..7fc16628 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsDefaultDirection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsDefaultDirection.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * GetLibraryItemsDefaultDirection - The direction of the sort. Can be either `asc` or `desc`. @@ -25,4 +27,13 @@ public enum GetLibraryItemsDefaultDirection { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetLibraryItemsDefaultDirection o: GetLibraryItemsDefaultDirection.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsFlattenSeasons.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsFlattenSeasons.java index 6e1a26c5..1e7a530e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsFlattenSeasons.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsFlattenSeasons.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; public enum GetLibraryItemsFlattenSeasons { False("0"), @@ -21,4 +23,13 @@ public enum GetLibraryItemsFlattenSeasons { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetLibraryItemsFlattenSeasons o: GetLibraryItemsFlattenSeasons.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsHasThumbnail.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsHasThumbnail.java index 57b26fbe..c76454c4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsHasThumbnail.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsHasThumbnail.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; public enum GetLibraryItemsHasThumbnail { False("0"), @@ -21,4 +23,13 @@ public enum GetLibraryItemsHasThumbnail { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetLibraryItemsHasThumbnail o: GetLibraryItemsHasThumbnail.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryActiveDirection.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryActiveDirection.java index 087f35f7..2b5669d1 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryActiveDirection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryActiveDirection.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * GetLibraryItemsLibraryActiveDirection - The direction of the sort. Can be either `asc` or `desc`. @@ -25,4 +27,13 @@ public enum GetLibraryItemsLibraryActiveDirection { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetLibraryItemsLibraryActiveDirection o: GetLibraryItemsLibraryActiveDirection.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryDefaultDirection.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryDefaultDirection.java index 62a6a762..cc9b6c69 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryDefaultDirection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryDefaultDirection.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * GetLibraryItemsLibraryDefaultDirection - The direction of the sort. Can be either `asc` or `desc`. @@ -25,4 +27,13 @@ public enum GetLibraryItemsLibraryDefaultDirection { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetLibraryItemsLibraryDefaultDirection o: GetLibraryItemsLibraryDefaultDirection.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryResponse200Type.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryResponse200Type.java index b64cf68b..8c2c5bf3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryResponse200Type.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryResponse200Type.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; public enum GetLibraryItemsLibraryResponse200Type { COVER_POSTER("coverPoster"), @@ -23,4 +25,13 @@ public enum GetLibraryItemsLibraryResponse200Type { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetLibraryItemsLibraryResponse200Type o: GetLibraryItemsLibraryResponse200Type.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryType.java index 5ad1810a..904b6789 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryType.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * GetLibraryItemsLibraryType - The type of media content @@ -27,4 +29,13 @@ public enum GetLibraryItemsLibraryType { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetLibraryItemsLibraryType o: GetLibraryItemsLibraryType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } 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 b22081c1..984cfa24 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMetadata.java @@ -108,12 +108,12 @@ public class GetLibraryItemsMetadata { 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ @JsonInclude(Include.NON_ABSENT) @@ -696,12 +696,12 @@ public class GetLibraryItemsMetadata { } /** - * 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ @SuppressWarnings("unchecked") @@ -1216,12 +1216,12 @@ public class GetLibraryItemsMetadata { } /** - * 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ public GetLibraryItemsMetadata withShowOrdering(GetLibraryItemsShowOrdering showOrdering) { @@ -1231,12 +1231,12 @@ public class GetLibraryItemsMetadata { } /** - * 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ public GetLibraryItemsMetadata withShowOrdering(Optional showOrdering) { @@ -2520,12 +2520,12 @@ public class GetLibraryItemsMetadata { } /** - * 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ public Builder showOrdering(GetLibraryItemsShowOrdering showOrdering) { @@ -2535,12 +2535,12 @@ public class GetLibraryItemsMetadata { } /** - * 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ public Builder showOrdering(Optional showOrdering) { diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOptimizedForStreaming.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOptimizedForStreaming.java index 1e7590c1..1644b7a7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOptimizedForStreaming.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOptimizedForStreaming.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; public enum GetLibraryItemsOptimizedForStreaming { Disable(0), @@ -20,4 +22,13 @@ public enum GetLibraryItemsOptimizedForStreaming { public int value() { return value; } + + public static Optional fromValue(int value) { + for (GetLibraryItemsOptimizedForStreaming o: GetLibraryItemsOptimizedForStreaming.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsQueryParamIncludeMeta.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsQueryParamIncludeMeta.java index 453b9fb6..c02c330b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsQueryParamIncludeMeta.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsQueryParamIncludeMeta.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * GetLibraryItemsQueryParamIncludeMeta - Adds the Meta object to the response @@ -24,4 +26,13 @@ public enum GetLibraryItemsQueryParamIncludeMeta { public int value() { return value; } + + public static Optional fromValue(int value) { + for (GetLibraryItemsQueryParamIncludeMeta o: GetLibraryItemsQueryParamIncludeMeta.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsQueryParamType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsQueryParamType.java index 0aef5116..a65e3f8e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsQueryParamType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsQueryParamType.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * GetLibraryItemsQueryParamType - The type of media to retrieve. @@ -20,7 +22,9 @@ public enum GetLibraryItemsQueryParamType { TvShow(2L), Season(3L), Episode(4L), - Audio(8L); + Audio(8L), + Album(9L), + Track(10L); @JsonValue private final long value; @@ -32,4 +36,13 @@ public enum GetLibraryItemsQueryParamType { public long value() { return value; } + + public static Optional fromValue(long value) { + for (GetLibraryItemsQueryParamType o: GetLibraryItemsQueryParamType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsShowOrdering.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsShowOrdering.java index e9c1e5e7..7a398ef2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsShowOrdering.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsShowOrdering.java @@ -6,22 +6,24 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** - * GetLibraryItemsShowOrdering - 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)). + * GetLibraryItemsShowOrdering - Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ public enum GetLibraryItemsShowOrdering { None("None"), TmdbAiring("tmdbAiring"), - Aired("aired"), - Dvd("dvd"), - Absolute("absolute"); + TvdbAiring("tvdbAiring"), + TvdbDvd("tvdbDvd"), + TvdbAbsolute("tvdbAbsolute"); @JsonValue private final String value; @@ -33,4 +35,13 @@ public enum GetLibraryItemsShowOrdering { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetLibraryItemsShowOrdering o: GetLibraryItemsShowOrdering.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMetaDataByRatingKeyMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMetaDataByRatingKeyMetadata.java index d202f111..ec8d16d2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMetaDataByRatingKeyMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMetaDataByRatingKeyMetadata.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Integer; +import java.lang.Long; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; @@ -60,6 +61,41 @@ public class GetMetaDataByRatingKeyMetadata { @JsonProperty("librarySectionKey") private Optional librarySectionKey; + /** + * The name of the album artist for the track when audio, and the name of the TV show for the episode when video. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("grandparentTitle") + private Optional grandparentTitle; + + /** + * The name of the album for the track when audio, and the name of the season for the episode when TV show. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("parentTitle") + private Optional parentTitle; + + /** + * The orginal untranslated name of the media item when non-english. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("originalTitle") + private Optional originalTitle; + + /** + * The index starting from 0 of this media item in the MetaData array. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("index") + private Optional index; + + /** + * The parent index starting from 0 of this media item in the parent MetaData array. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("parentIndex") + private Optional parentIndex; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("contentRating") private Optional contentRating; @@ -167,6 +203,11 @@ public class GetMetaDataByRatingKeyMetadata { @JsonProperty("librarySectionTitle") Optional librarySectionTitle, @JsonProperty("librarySectionID") Optional librarySectionID, @JsonProperty("librarySectionKey") Optional librarySectionKey, + @JsonProperty("grandparentTitle") Optional grandparentTitle, + @JsonProperty("parentTitle") Optional parentTitle, + @JsonProperty("originalTitle") Optional originalTitle, + @JsonProperty("index") Optional index, + @JsonProperty("parentIndex") Optional parentIndex, @JsonProperty("contentRating") Optional contentRating, @JsonProperty("summary") Optional summary, @JsonProperty("rating") Optional rating, @@ -200,6 +241,11 @@ public class GetMetaDataByRatingKeyMetadata { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); Utils.checkNotNull(librarySectionID, "librarySectionID"); Utils.checkNotNull(librarySectionKey, "librarySectionKey"); + Utils.checkNotNull(grandparentTitle, "grandparentTitle"); + Utils.checkNotNull(parentTitle, "parentTitle"); + Utils.checkNotNull(originalTitle, "originalTitle"); + Utils.checkNotNull(index, "index"); + Utils.checkNotNull(parentIndex, "parentIndex"); Utils.checkNotNull(contentRating, "contentRating"); Utils.checkNotNull(summary, "summary"); Utils.checkNotNull(rating, "rating"); @@ -233,6 +279,11 @@ public class GetMetaDataByRatingKeyMetadata { this.librarySectionTitle = librarySectionTitle; this.librarySectionID = librarySectionID; this.librarySectionKey = librarySectionKey; + this.grandparentTitle = grandparentTitle; + this.parentTitle = parentTitle; + this.originalTitle = originalTitle; + this.index = index; + this.parentIndex = parentIndex; this.contentRating = contentRating; this.summary = summary; this.rating = rating; @@ -260,7 +311,7 @@ public class GetMetaDataByRatingKeyMetadata { } public GetMetaDataByRatingKeyMetadata() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), 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(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), 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 @@ -308,6 +359,46 @@ public class GetMetaDataByRatingKeyMetadata { return librarySectionKey; } + /** + * The name of the album artist for the track when audio, and the name of the TV show for the episode when video. + */ + @JsonIgnore + public Optional grandparentTitle() { + return grandparentTitle; + } + + /** + * The name of the album for the track when audio, and the name of the season for the episode when TV show. + */ + @JsonIgnore + public Optional parentTitle() { + return parentTitle; + } + + /** + * The orginal untranslated name of the media item when non-english. + */ + @JsonIgnore + public Optional originalTitle() { + return originalTitle; + } + + /** + * The index starting from 0 of this media item in the MetaData array. + */ + @JsonIgnore + public Optional index() { + return index; + } + + /** + * The parent index starting from 0 of this media item in the parent MetaData array. + */ + @JsonIgnore + public Optional parentIndex() { + return parentIndex; + } + @JsonIgnore public Optional contentRating() { return contentRating; @@ -549,6 +640,96 @@ public class GetMetaDataByRatingKeyMetadata { return this; } + /** + * The name of the album artist for the track when audio, and the name of the TV show for the episode when video. + */ + public GetMetaDataByRatingKeyMetadata withGrandparentTitle(String grandparentTitle) { + Utils.checkNotNull(grandparentTitle, "grandparentTitle"); + this.grandparentTitle = Optional.ofNullable(grandparentTitle); + return this; + } + + /** + * The name of the album artist for the track when audio, and the name of the TV show for the episode when video. + */ + public GetMetaDataByRatingKeyMetadata withGrandparentTitle(Optional grandparentTitle) { + Utils.checkNotNull(grandparentTitle, "grandparentTitle"); + this.grandparentTitle = grandparentTitle; + return this; + } + + /** + * The name of the album for the track when audio, and the name of the season for the episode when TV show. + */ + public GetMetaDataByRatingKeyMetadata withParentTitle(String parentTitle) { + Utils.checkNotNull(parentTitle, "parentTitle"); + this.parentTitle = Optional.ofNullable(parentTitle); + return this; + } + + /** + * The name of the album for the track when audio, and the name of the season for the episode when TV show. + */ + public GetMetaDataByRatingKeyMetadata withParentTitle(Optional parentTitle) { + Utils.checkNotNull(parentTitle, "parentTitle"); + this.parentTitle = parentTitle; + return this; + } + + /** + * The orginal untranslated name of the media item when non-english. + */ + public GetMetaDataByRatingKeyMetadata withOriginalTitle(String originalTitle) { + Utils.checkNotNull(originalTitle, "originalTitle"); + this.originalTitle = Optional.ofNullable(originalTitle); + return this; + } + + /** + * The orginal untranslated name of the media item when non-english. + */ + public GetMetaDataByRatingKeyMetadata withOriginalTitle(Optional originalTitle) { + Utils.checkNotNull(originalTitle, "originalTitle"); + this.originalTitle = originalTitle; + return this; + } + + /** + * The index starting from 0 of this media item in the MetaData array. + */ + public GetMetaDataByRatingKeyMetadata withIndex(long index) { + Utils.checkNotNull(index, "index"); + this.index = Optional.ofNullable(index); + return this; + } + + /** + * The index starting from 0 of this media item in the MetaData array. + */ + public GetMetaDataByRatingKeyMetadata withIndex(Optional index) { + Utils.checkNotNull(index, "index"); + this.index = index; + return this; + } + + /** + * The parent index starting from 0 of this media item in the parent MetaData array. + */ + public GetMetaDataByRatingKeyMetadata withParentIndex(long parentIndex) { + Utils.checkNotNull(parentIndex, "parentIndex"); + this.parentIndex = Optional.ofNullable(parentIndex); + return this; + } + + /** + * The parent index starting from 0 of this media item in the parent MetaData array. + */ + public GetMetaDataByRatingKeyMetadata withParentIndex(Optional parentIndex) { + Utils.checkNotNull(parentIndex, "parentIndex"); + this.parentIndex = parentIndex; + return this; + } + public GetMetaDataByRatingKeyMetadata withContentRating(String contentRating) { Utils.checkNotNull(contentRating, "contentRating"); this.contentRating = Optional.ofNullable(contentRating); @@ -856,6 +1037,11 @@ public class GetMetaDataByRatingKeyMetadata { Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && Objects.deepEquals(this.librarySectionID, other.librarySectionID) && Objects.deepEquals(this.librarySectionKey, other.librarySectionKey) && + Objects.deepEquals(this.grandparentTitle, other.grandparentTitle) && + Objects.deepEquals(this.parentTitle, other.parentTitle) && + Objects.deepEquals(this.originalTitle, other.originalTitle) && + Objects.deepEquals(this.index, other.index) && + Objects.deepEquals(this.parentIndex, other.parentIndex) && Objects.deepEquals(this.contentRating, other.contentRating) && Objects.deepEquals(this.summary, other.summary) && Objects.deepEquals(this.rating, other.rating) && @@ -894,6 +1080,11 @@ public class GetMetaDataByRatingKeyMetadata { librarySectionTitle, librarySectionID, librarySectionKey, + grandparentTitle, + parentTitle, + originalTitle, + index, + parentIndex, contentRating, summary, rating, @@ -932,6 +1123,11 @@ public class GetMetaDataByRatingKeyMetadata { "librarySectionTitle", librarySectionTitle, "librarySectionID", librarySectionID, "librarySectionKey", librarySectionKey, + "grandparentTitle", grandparentTitle, + "parentTitle", parentTitle, + "originalTitle", originalTitle, + "index", index, + "parentIndex", parentIndex, "contentRating", contentRating, "summary", summary, "rating", rating, @@ -978,6 +1174,16 @@ public class GetMetaDataByRatingKeyMetadata { private Optional librarySectionKey = Optional.empty(); + private Optional grandparentTitle = Optional.empty(); + + private Optional parentTitle = Optional.empty(); + + private Optional originalTitle = Optional.empty(); + + private Optional index = Optional.empty(); + + private Optional parentIndex = Optional.empty(); + private Optional contentRating = Optional.empty(); private Optional summary = Optional.empty(); @@ -1138,6 +1344,96 @@ public class GetMetaDataByRatingKeyMetadata { return this; } + /** + * The name of the album artist for the track when audio, and the name of the TV show for the episode when video. + */ + public Builder grandparentTitle(String grandparentTitle) { + Utils.checkNotNull(grandparentTitle, "grandparentTitle"); + this.grandparentTitle = Optional.ofNullable(grandparentTitle); + return this; + } + + /** + * The name of the album artist for the track when audio, and the name of the TV show for the episode when video. + */ + public Builder grandparentTitle(Optional grandparentTitle) { + Utils.checkNotNull(grandparentTitle, "grandparentTitle"); + this.grandparentTitle = grandparentTitle; + return this; + } + + /** + * The name of the album for the track when audio, and the name of the season for the episode when TV show. + */ + public Builder parentTitle(String parentTitle) { + Utils.checkNotNull(parentTitle, "parentTitle"); + this.parentTitle = Optional.ofNullable(parentTitle); + return this; + } + + /** + * The name of the album for the track when audio, and the name of the season for the episode when TV show. + */ + public Builder parentTitle(Optional parentTitle) { + Utils.checkNotNull(parentTitle, "parentTitle"); + this.parentTitle = parentTitle; + return this; + } + + /** + * The orginal untranslated name of the media item when non-english. + */ + public Builder originalTitle(String originalTitle) { + Utils.checkNotNull(originalTitle, "originalTitle"); + this.originalTitle = Optional.ofNullable(originalTitle); + return this; + } + + /** + * The orginal untranslated name of the media item when non-english. + */ + public Builder originalTitle(Optional originalTitle) { + Utils.checkNotNull(originalTitle, "originalTitle"); + this.originalTitle = originalTitle; + return this; + } + + /** + * The index starting from 0 of this media item in the MetaData array. + */ + public Builder index(long index) { + Utils.checkNotNull(index, "index"); + this.index = Optional.ofNullable(index); + return this; + } + + /** + * The index starting from 0 of this media item in the MetaData array. + */ + public Builder index(Optional index) { + Utils.checkNotNull(index, "index"); + this.index = index; + return this; + } + + /** + * The parent index starting from 0 of this media item in the parent MetaData array. + */ + public Builder parentIndex(long parentIndex) { + Utils.checkNotNull(parentIndex, "parentIndex"); + this.parentIndex = Optional.ofNullable(parentIndex); + return this; + } + + /** + * The parent index starting from 0 of this media item in the parent MetaData array. + */ + public Builder parentIndex(Optional parentIndex) { + Utils.checkNotNull(parentIndex, "parentIndex"); + this.parentIndex = parentIndex; + return this; + } + public Builder contentRating(String contentRating) { Utils.checkNotNull(contentRating, "contentRating"); this.contentRating = Optional.ofNullable(contentRating); @@ -1437,6 +1733,11 @@ public class GetMetaDataByRatingKeyMetadata { librarySectionTitle, librarySectionID, librarySectionKey, + grandparentTitle, + parentTitle, + originalTitle, + index, + parentIndex, contentRating, summary, rating, 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 636dc96f..b2669426 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequest.java @@ -33,7 +33,7 @@ public class GetPinRequest { * 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; + private String clientID; /** * The name of the client application. (Plex Web, Plex Media Server, etc.) @@ -62,7 +62,7 @@ public class GetPinRequest { @JsonCreator public GetPinRequest( Optional strong, - Optional clientID, + String clientID, Optional clientName, Optional deviceNickname, Optional clientVersion, @@ -81,8 +81,9 @@ public class GetPinRequest { this.platform = platform; } - public GetPinRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + public GetPinRequest( + String clientID) { + this(Optional.empty(), clientID, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -100,7 +101,7 @@ public class GetPinRequest { * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @JsonIgnore - public Optional clientID() { + public String clientID() { return clientID; } @@ -168,15 +169,6 @@ public class GetPinRequest { * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public GetPinRequest 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 GetPinRequest withClientID(Optional clientID) { Utils.checkNotNull(clientID, "clientID"); this.clientID = clientID; return this; @@ -298,7 +290,7 @@ public class GetPinRequest { private Optional strong; - private Optional clientID = Optional.empty(); + private String clientID; private Optional clientName = Optional.empty(); @@ -340,15 +332,6 @@ public class GetPinRequest { * 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; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsQueryParamType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsQueryParamType.java index c4e66d31..1c94a8b3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsQueryParamType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsQueryParamType.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * GetPlaylistContentsQueryParamType - The type of media to retrieve. @@ -20,7 +22,9 @@ public enum GetPlaylistContentsQueryParamType { TvShow(2L), Season(3L), Episode(4L), - Audio(8L); + Audio(8L), + Album(9L), + Track(10L); @JsonValue private final long value; @@ -32,4 +36,13 @@ public enum GetPlaylistContentsQueryParamType { public long value() { return value; } + + public static Optional fromValue(long value) { + for (GetPlaylistContentsQueryParamType o: GetPlaylistContentsQueryParamType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedActiveDirection.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedActiveDirection.java index 25848131..a40968e5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedActiveDirection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedActiveDirection.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * GetRecentlyAddedActiveDirection - The direction of the sort. Can be either `asc` or `desc`. @@ -25,4 +27,13 @@ public enum GetRecentlyAddedActiveDirection { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetRecentlyAddedActiveDirection o: GetRecentlyAddedActiveDirection.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedDefaultDirection.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedDefaultDirection.java index 9d1fb1b3..80f4fca5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedDefaultDirection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedDefaultDirection.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * GetRecentlyAddedDefaultDirection - The direction of the sort. Can be either `asc` or `desc`. @@ -25,4 +27,13 @@ public enum GetRecentlyAddedDefaultDirection { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetRecentlyAddedDefaultDirection o: GetRecentlyAddedDefaultDirection.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedHubsResponseType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedHubsResponseType.java index 4f250a5c..3f415e4b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedHubsResponseType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedHubsResponseType.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; public enum GetRecentlyAddedHubsResponseType { COVER_POSTER("coverPoster"), @@ -23,4 +25,13 @@ public enum GetRecentlyAddedHubsResponseType { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetRecentlyAddedHubsResponseType o: GetRecentlyAddedHubsResponseType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedHubsType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedHubsType.java index 3f58a3ff..63510e53 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedHubsType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedHubsType.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * GetRecentlyAddedHubsType - The type of media content @@ -27,4 +29,13 @@ public enum GetRecentlyAddedHubsType { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetRecentlyAddedHubsType o: GetRecentlyAddedHubsType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } 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 2eb1c694..4d509441 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedMetadata.java @@ -108,12 +108,12 @@ public class GetRecentlyAddedMetadata { 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ @JsonInclude(Include.NON_ABSENT) @@ -696,12 +696,12 @@ public class GetRecentlyAddedMetadata { } /** - * 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ @SuppressWarnings("unchecked") @@ -1216,12 +1216,12 @@ public class GetRecentlyAddedMetadata { } /** - * 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ public GetRecentlyAddedMetadata withShowOrdering(ShowOrdering showOrdering) { @@ -1231,12 +1231,12 @@ public class GetRecentlyAddedMetadata { } /** - * 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ public GetRecentlyAddedMetadata withShowOrdering(Optional showOrdering) { @@ -2520,12 +2520,12 @@ public class GetRecentlyAddedMetadata { } /** - * 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ public Builder showOrdering(ShowOrdering showOrdering) { @@ -2535,12 +2535,12 @@ public class GetRecentlyAddedMetadata { } /** - * 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ public Builder showOrdering(Optional showOrdering) { diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesFlattenSeasons.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesFlattenSeasons.java index d1b4d015..93f4246d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesFlattenSeasons.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesFlattenSeasons.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; public enum GetSearchAllLibrariesFlattenSeasons { False("0"), @@ -21,4 +23,13 @@ public enum GetSearchAllLibrariesFlattenSeasons { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetSearchAllLibrariesFlattenSeasons o: GetSearchAllLibrariesFlattenSeasons.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesHasThumbnail.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesHasThumbnail.java index 9a202dea..7a870386 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesHasThumbnail.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesHasThumbnail.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; public enum GetSearchAllLibrariesHasThumbnail { False("0"), @@ -21,4 +23,13 @@ public enum GetSearchAllLibrariesHasThumbnail { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetSearchAllLibrariesHasThumbnail o: GetSearchAllLibrariesHasThumbnail.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLibraryType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLibraryType.java index 324fe763..d1c6c022 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLibraryType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLibraryType.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; public enum GetSearchAllLibrariesLibraryType { COVER_POSTER("coverPoster"), @@ -23,4 +25,13 @@ public enum GetSearchAllLibrariesLibraryType { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetSearchAllLibrariesLibraryType o: GetSearchAllLibrariesLibraryType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMetadata.java index f6cbf612..6afd07a8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMetadata.java @@ -108,12 +108,12 @@ public class GetSearchAllLibrariesMetadata { 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ @JsonInclude(Include.NON_ABSENT) @@ -696,12 +696,12 @@ public class GetSearchAllLibrariesMetadata { } /** - * 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ @SuppressWarnings("unchecked") @@ -1216,12 +1216,12 @@ public class GetSearchAllLibrariesMetadata { } /** - * 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ public GetSearchAllLibrariesMetadata withShowOrdering(GetSearchAllLibrariesShowOrdering showOrdering) { @@ -1231,12 +1231,12 @@ public class GetSearchAllLibrariesMetadata { } /** - * 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ public GetSearchAllLibrariesMetadata withShowOrdering(Optional showOrdering) { @@ -2520,12 +2520,12 @@ public class GetSearchAllLibrariesMetadata { } /** - * 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ public Builder showOrdering(GetSearchAllLibrariesShowOrdering showOrdering) { @@ -2535,12 +2535,12 @@ public class GetSearchAllLibrariesMetadata { } /** - * 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)). + * Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ public Builder showOrdering(Optional showOrdering) { diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreaming.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreaming.java index 6ee0724e..37eca6b8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreaming.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreaming.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; public enum GetSearchAllLibrariesOptimizedForStreaming { Disable(0), @@ -20,4 +22,13 @@ public enum GetSearchAllLibrariesOptimizedForStreaming { public int value() { return value; } + + public static Optional fromValue(int value) { + for (GetSearchAllLibrariesOptimizedForStreaming o: GetSearchAllLibrariesOptimizedForStreaming.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequest.java index da012cf4..1dd959fc 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequest.java @@ -32,7 +32,7 @@ public class GetSearchAllLibrariesRequest { * 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; + private String clientID; /** * Limit the number of results returned. @@ -62,7 +62,7 @@ public class GetSearchAllLibrariesRequest { @JsonCreator public GetSearchAllLibrariesRequest( String query, - Optional clientID, + String clientID, Optional limit, Optional> searchTypes, Optional includeCollections, @@ -82,8 +82,9 @@ public class GetSearchAllLibrariesRequest { } public GetSearchAllLibrariesRequest( - String query) { - this(query, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + String query, + String clientID) { + this(query, clientID, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -98,7 +99,7 @@ public class GetSearchAllLibrariesRequest { * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @JsonIgnore - public Optional clientID() { + public String clientID() { return clientID; } @@ -155,15 +156,6 @@ public class GetSearchAllLibrariesRequest { * 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; @@ -287,7 +279,7 @@ public class GetSearchAllLibrariesRequest { private String query; - private Optional clientID = Optional.empty(); + private String clientID; private Optional limit = Optional.empty(); @@ -314,15 +306,6 @@ public class GetSearchAllLibrariesRequest { * 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; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesShowOrdering.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesShowOrdering.java index 6e76fa0a..cc654807 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesShowOrdering.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesShowOrdering.java @@ -6,22 +6,24 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** - * 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)). + * GetSearchAllLibrariesShowOrdering - Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ public enum GetSearchAllLibrariesShowOrdering { None("None"), TmdbAiring("tmdbAiring"), - Aired("aired"), - Dvd("dvd"), - Absolute("absolute"); + TvdbAiring("tvdbAiring"), + TvdbDvd("tvdbDvd"), + TvdbAbsolute("tvdbAbsolute"); @JsonValue private final String value; @@ -33,4 +35,13 @@ public enum GetSearchAllLibrariesShowOrdering { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetSearchAllLibrariesShowOrdering o: GetSearchAllLibrariesShowOrdering.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesType.java index 5c6516b2..d04e847e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesType.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * GetSearchAllLibrariesType - The type of media content @@ -27,4 +29,13 @@ public enum GetSearchAllLibrariesType { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetSearchAllLibrariesType o: GetSearchAllLibrariesType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryQueryParamType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryQueryParamType.java index 0f881b6f..bc7cb051 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryQueryParamType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryQueryParamType.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * GetSearchLibraryQueryParamType - The type of media to retrieve. @@ -20,7 +22,9 @@ public enum GetSearchLibraryQueryParamType { TvShow(2L), Season(3L), Episode(4L), - Audio(8L); + Audio(8L), + Album(9L), + Track(10L); @JsonValue private final long value; @@ -32,4 +36,13 @@ public enum GetSearchLibraryQueryParamType { public long value() { return value; } + + public static Optional fromValue(long value) { + for (GetSearchLibraryQueryParamType o: GetSearchLibraryQueryParamType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } 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 1b8f363f..39aa0725 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequest.java @@ -44,14 +44,14 @@ public class GetServerResourcesRequest { * 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; + private String clientID; @JsonCreator public GetServerResourcesRequest( Optional includeHttps, Optional includeRelay, Optional includeIPv6, - Optional clientID) { + String clientID) { Utils.checkNotNull(includeHttps, "includeHttps"); Utils.checkNotNull(includeRelay, "includeRelay"); Utils.checkNotNull(includeIPv6, "includeIPv6"); @@ -62,8 +62,9 @@ public class GetServerResourcesRequest { this.clientID = clientID; } - public GetServerResourcesRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + public GetServerResourcesRequest( + String clientID) { + this(Optional.empty(), Optional.empty(), Optional.empty(), clientID); } /** @@ -99,7 +100,7 @@ public class GetServerResourcesRequest { * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @JsonIgnore - public Optional clientID() { + public String clientID() { return clientID; } @@ -169,15 +170,6 @@ public class GetServerResourcesRequest { * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public GetServerResourcesRequest 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 GetServerResourcesRequest withClientID(Optional clientID) { Utils.checkNotNull(clientID, "clientID"); this.clientID = clientID; return this; @@ -225,7 +217,7 @@ public class GetServerResourcesRequest { private Optional includeIPv6; - private Optional clientID = Optional.empty(); + private String clientID; private Builder() { // force use of static builder() method @@ -293,15 +285,6 @@ public class GetServerResourcesRequest { * 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; 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..7f133696 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequestBuilder.java @@ -24,7 +24,7 @@ public class GetServerResourcesRequestBuilder { "includeIPv6", "0", new TypeReference>() {}); - private Optional clientID = Optional.empty(); + private String clientID; private Optional serverURL = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetServerResources sdk; @@ -67,14 +67,8 @@ public class GetServerResourcesRequestBuilder { this.includeIPv6 = includeIPv6; return this; } - - public GetServerResourcesRequestBuilder clientID(String clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = Optional.of(clientID); - return this; - } - public GetServerResourcesRequestBuilder clientID(Optional clientID) { + public GetServerResourcesRequestBuilder clientID(String clientID) { Utils.checkNotNull(clientID, "clientID"); this.clientID = clientID; return this; 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 85c870eb..32e3b925 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequest.java @@ -28,7 +28,7 @@ public class GetTokenByPinIdRequest { * 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; + private String clientID; /** * The name of the client application. (Plex Web, Plex Media Server, etc.) @@ -57,7 +57,7 @@ public class GetTokenByPinIdRequest { @JsonCreator public GetTokenByPinIdRequest( long pinID, - Optional clientID, + String clientID, Optional clientName, Optional deviceNickname, Optional clientVersion, @@ -77,8 +77,9 @@ public class GetTokenByPinIdRequest { } public GetTokenByPinIdRequest( - long pinID) { - this(pinID, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + long pinID, + String clientID) { + this(pinID, clientID, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -93,7 +94,7 @@ public class GetTokenByPinIdRequest { * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @JsonIgnore - public Optional clientID() { + public String clientID() { return clientID; } @@ -146,15 +147,6 @@ public class GetTokenByPinIdRequest { * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public GetTokenByPinIdRequest 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 GetTokenByPinIdRequest withClientID(Optional clientID) { Utils.checkNotNull(clientID, "clientID"); this.clientID = clientID; return this; @@ -276,7 +268,7 @@ public class GetTokenByPinIdRequest { private Long pinID; - private Optional clientID = Optional.empty(); + private String clientID; private Optional clientName = Optional.empty(); @@ -303,15 +295,6 @@ public class GetTokenByPinIdRequest { * 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; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsAuthenticationResponseStatus.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsAuthenticationResponseStatus.java index 60ade7d8..6018dc4c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsAuthenticationResponseStatus.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsAuthenticationResponseStatus.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * GetTokenDetailsAuthenticationResponseStatus - String representation of subscriptionActive @@ -24,4 +26,13 @@ public enum GetTokenDetailsAuthenticationResponseStatus { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetTokenDetailsAuthenticationResponseStatus o: GetTokenDetailsAuthenticationResponseStatus.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsAuthenticationStatus.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsAuthenticationStatus.java index 3a04d91b..51b4425d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsAuthenticationStatus.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsAuthenticationStatus.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * GetTokenDetailsAuthenticationStatus - String representation of subscriptionActive @@ -24,4 +26,13 @@ public enum GetTokenDetailsAuthenticationStatus { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetTokenDetailsAuthenticationStatus o: GetTokenDetailsAuthenticationStatus.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsStatus.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsStatus.java index 532a50d4..b962962c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsStatus.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsStatus.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; public enum GetTokenDetailsStatus { ONLINE("online"), @@ -21,4 +23,13 @@ public enum GetTokenDetailsStatus { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetTokenDetailsStatus o: GetTokenDetailsStatus.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentQueryParamType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentQueryParamType.java index cb3dda5f..dfe8bf12 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentQueryParamType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentQueryParamType.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * GetTopWatchedContentQueryParamType - The type of media to retrieve. @@ -20,7 +22,9 @@ public enum GetTopWatchedContentQueryParamType { TvShow(2L), Season(3L), Episode(4L), - Audio(8L); + Audio(8L), + Album(9L), + Track(10L); @JsonValue private final long value; @@ -32,4 +36,13 @@ public enum GetTopWatchedContentQueryParamType { public long value() { return value; } + + public static Optional fromValue(long value) { + for (GetTopWatchedContentQueryParamType o: GetTopWatchedContentQueryParamType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenQueryParamType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenQueryParamType.java index edecb30f..101ff451 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenQueryParamType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenQueryParamType.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * GetTransientTokenQueryParamType - `delegation` - This is the only supported `type` parameter. @@ -23,4 +25,13 @@ public enum GetTransientTokenQueryParamType { public String value() { return value; } + + public static Optional fromValue(String value) { + for (GetTransientTokenQueryParamType o: GetTransientTokenQueryParamType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/HasThumbnail.java b/src/main/java/dev/plexapi/sdk/models/operations/HasThumbnail.java index 05c17e43..6384167f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/HasThumbnail.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/HasThumbnail.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; public enum HasThumbnail { False("0"), @@ -21,4 +23,13 @@ public enum HasThumbnail { public String value() { return value; } + + public static Optional fromValue(String value) { + for (HasThumbnail o: HasThumbnail.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/IncludeCollections.java b/src/main/java/dev/plexapi/sdk/models/operations/IncludeCollections.java index 77d7aa4c..5473ce7f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeCollections.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeCollections.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * IncludeCollections - include collections in the results @@ -24,4 +26,13 @@ public enum IncludeCollections { public long value() { return value; } + + public static Optional fromValue(long value) { + for (IncludeCollections o: IncludeCollections.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/IncludeDetails.java b/src/main/java/dev/plexapi/sdk/models/operations/IncludeDetails.java index 4edf7291..068e7946 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeDetails.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeDetails.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * IncludeDetails - Whether or not to include details for a section (types, filters, and sorts). @@ -25,4 +27,13 @@ public enum IncludeDetails { public long value() { return value; } + + public static Optional fromValue(long value) { + for (IncludeDetails o: IncludeDetails.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/IncludeExternalMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/IncludeExternalMedia.java index 76ed2488..69ca7e23 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeExternalMedia.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeExternalMedia.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * IncludeExternalMedia - include external media in the results @@ -24,4 +26,13 @@ public enum IncludeExternalMedia { public long value() { return value; } + + public static Optional fromValue(long value) { + for (IncludeExternalMedia o: IncludeExternalMedia.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/IncludeGuids.java b/src/main/java/dev/plexapi/sdk/models/operations/IncludeGuids.java index 35722afd..57824757 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeGuids.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeGuids.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * IncludeGuids - Adds the Guids object to the response @@ -24,4 +26,13 @@ public enum IncludeGuids { public int value() { return value; } + + public static Optional fromValue(int value) { + for (IncludeGuids o: IncludeGuids.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/IncludeHttps.java b/src/main/java/dev/plexapi/sdk/models/operations/IncludeHttps.java index c14c7211..09133bb3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeHttps.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeHttps.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * IncludeHttps - Include Https entries in the results @@ -23,4 +25,13 @@ public enum IncludeHttps { public int value() { return value; } + + public static Optional fromValue(int value) { + for (IncludeHttps o: IncludeHttps.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/IncludeIPv6.java b/src/main/java/dev/plexapi/sdk/models/operations/IncludeIPv6.java index 625b6107..b7bb7cea 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeIPv6.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeIPv6.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * IncludeIPv6 - Include IPv6 entries in the results @@ -23,4 +25,13 @@ public enum IncludeIPv6 { public int value() { return value; } + + public static Optional fromValue(int value) { + for (IncludeIPv6 o: IncludeIPv6.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/IncludeMeta.java b/src/main/java/dev/plexapi/sdk/models/operations/IncludeMeta.java index 390803ae..7626c440 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeMeta.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeMeta.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * IncludeMeta - Adds the Meta object to the response @@ -24,4 +26,13 @@ public enum IncludeMeta { public int value() { return value; } + + public static Optional fromValue(int value) { + for (IncludeMeta o: IncludeMeta.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/IncludeRelay.java b/src/main/java/dev/plexapi/sdk/models/operations/IncludeRelay.java index 38ffa732..b8269de7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeRelay.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeRelay.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * IncludeRelay - Include Relay addresses in the results @@ -25,4 +27,13 @@ public enum IncludeRelay { public int value() { return value; } + + public static Optional fromValue(int value) { + for (IncludeRelay o: IncludeRelay.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Level.java b/src/main/java/dev/plexapi/sdk/models/operations/Level.java index 6915fad6..82621437 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Level.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Level.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * Level - An integer log level to write to the PMS log with. @@ -32,4 +34,13 @@ public enum Level { public long value() { return value; } + + public static Optional fromValue(long value) { + for (Level o: Level.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Libtype.java b/src/main/java/dev/plexapi/sdk/models/operations/Libtype.java index d5303e94..8b8ac9f2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Libtype.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Libtype.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * Libtype - The type of library to filter. Can be "movie" or "show", or all if not present. @@ -25,4 +27,13 @@ public enum Libtype { public String value() { return value; } + + public static Optional fromValue(String value) { + for (Libtype o: Libtype.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/MailingListStatus.java b/src/main/java/dev/plexapi/sdk/models/operations/MailingListStatus.java index 9a216c5d..db13b102 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/MailingListStatus.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/MailingListStatus.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * MailingListStatus - Your current mailing list status (active or unsubscribed) @@ -24,4 +26,13 @@ public enum MailingListStatus { public String value() { return value; } + + public static Optional fromValue(String value) { + for (MailingListStatus o: MailingListStatus.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/MediaReviewsVisibility.java b/src/main/java/dev/plexapi/sdk/models/operations/MediaReviewsVisibility.java index 3e28b40a..88c79faa 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/MediaReviewsVisibility.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/MediaReviewsVisibility.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * MediaReviewsVisibility - Whether or not the account has media reviews visibility enabled @@ -23,4 +25,13 @@ public enum MediaReviewsVisibility { public int value() { return value; } + + public static Optional fromValue(int value) { + for (MediaReviewsVisibility o: MediaReviewsVisibility.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/MinSize.java b/src/main/java/dev/plexapi/sdk/models/operations/MinSize.java index 4d205713..fab55ef0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/MinSize.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/MinSize.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * MinSize - images are always scaled proportionally. A value of '1' in minSize will make the smaller native dimension the dimension resized against. @@ -23,4 +25,13 @@ public enum MinSize { public long value() { return value; } + + public static Optional fromValue(long value) { + for (MinSize o: MinSize.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/OnlyTransient.java b/src/main/java/dev/plexapi/sdk/models/operations/OnlyTransient.java index 2f77ba6a..af03526d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/OnlyTransient.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/OnlyTransient.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * 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). @@ -23,4 +25,13 @@ public enum OnlyTransient { public long value() { return value; } + + public static Optional fromValue(long value) { + for (OnlyTransient o: OnlyTransient.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/OptimizedForStreaming.java b/src/main/java/dev/plexapi/sdk/models/operations/OptimizedForStreaming.java index f5cd9179..be753d6f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/OptimizedForStreaming.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/OptimizedForStreaming.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; public enum OptimizedForStreaming { Disable(0), @@ -20,4 +22,13 @@ public enum OptimizedForStreaming { public int value() { return value; } + + public static Optional fromValue(int value) { + for (OptimizedForStreaming o: OptimizedForStreaming.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PathParamTaskName.java b/src/main/java/dev/plexapi/sdk/models/operations/PathParamTaskName.java index 309cb4a8..409e1a5d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PathParamTaskName.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PathParamTaskName.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * PathParamTaskName - The name of the task to be started. @@ -36,4 +38,13 @@ public enum PathParamTaskName { public String value() { return value; } + + public static Optional fromValue(String value) { + for (PathParamTaskName o: PathParamTaskName.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PlaylistType.java b/src/main/java/dev/plexapi/sdk/models/operations/PlaylistType.java index 4cf553ad..1dac221a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PlaylistType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PlaylistType.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * PlaylistType - limit to a type of playlist. @@ -25,4 +27,13 @@ public enum PlaylistType { public String value() { return value; } + + public static Optional fromValue(String value) { + for (PlaylistType o: PlaylistType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationResponseStatus.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationResponseStatus.java index b87799bc..9480c68e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationResponseStatus.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationResponseStatus.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * PostUsersSignInDataAuthenticationResponseStatus - String representation of subscriptionActive @@ -24,4 +26,13 @@ public enum PostUsersSignInDataAuthenticationResponseStatus { public String value() { return value; } + + public static Optional fromValue(String value) { + for (PostUsersSignInDataAuthenticationResponseStatus o: PostUsersSignInDataAuthenticationResponseStatus.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationStatus.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationStatus.java index 53f63ab8..d46f6230 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationStatus.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationStatus.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * PostUsersSignInDataAuthenticationStatus - String representation of subscriptionActive @@ -24,4 +26,13 @@ public enum PostUsersSignInDataAuthenticationStatus { public String value() { return value; } + + public static Optional fromValue(String value) { + for (PostUsersSignInDataAuthenticationStatus o: PostUsersSignInDataAuthenticationStatus.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAutoSelectSubtitle.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAutoSelectSubtitle.java index 9d89e346..d4303d92 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAutoSelectSubtitle.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAutoSelectSubtitle.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * PostUsersSignInDataAutoSelectSubtitle - The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) @@ -23,4 +25,13 @@ public enum PostUsersSignInDataAutoSelectSubtitle { public int value() { return value; } + + public static Optional fromValue(int value) { + for (PostUsersSignInDataAutoSelectSubtitle o: PostUsersSignInDataAutoSelectSubtitle.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleAccessibility.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleAccessibility.java index 5ed6be52..fdaa665e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleAccessibility.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleAccessibility.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * PostUsersSignInDataDefaultSubtitleAccessibility - The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles) @@ -23,4 +25,13 @@ public enum PostUsersSignInDataDefaultSubtitleAccessibility { public int value() { return value; } + + public static Optional fromValue(int value) { + for (PostUsersSignInDataDefaultSubtitleAccessibility o: PostUsersSignInDataDefaultSubtitleAccessibility.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleForced.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleForced.java index ba222abc..eb629c12 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleForced.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleForced.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * PostUsersSignInDataDefaultSubtitleForced - The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles) @@ -23,4 +25,13 @@ public enum PostUsersSignInDataDefaultSubtitleForced { public int value() { return value; } + + public static Optional fromValue(int value) { + for (PostUsersSignInDataDefaultSubtitleForced o: PostUsersSignInDataDefaultSubtitleForced.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMailingListStatus.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMailingListStatus.java index 8b71c92e..2769a3e0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMailingListStatus.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMailingListStatus.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * PostUsersSignInDataMailingListStatus - Your current mailing list status (active or unsubscribed) @@ -24,4 +26,13 @@ public enum PostUsersSignInDataMailingListStatus { public String value() { return value; } + + public static Optional fromValue(String value) { + for (PostUsersSignInDataMailingListStatus o: PostUsersSignInDataMailingListStatus.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMediaReviewsVisibility.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMediaReviewsVisibility.java index 7fc07441..7c48a559 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMediaReviewsVisibility.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMediaReviewsVisibility.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * PostUsersSignInDataMediaReviewsVisibility - Whether or not the account has media reviews visibility enabled @@ -23,4 +25,13 @@ public enum PostUsersSignInDataMediaReviewsVisibility { public int value() { return value; } + + public static Optional fromValue(int value) { + for (PostUsersSignInDataMediaReviewsVisibility o: PostUsersSignInDataMediaReviewsVisibility.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } 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 919af2a7..d3ac0796 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequest.java @@ -22,7 +22,7 @@ public class PostUsersSignInDataRequest { * 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; + private String clientID; /** * The name of the client application. (Plex Web, Plex Media Server, etc.) @@ -56,7 +56,7 @@ public class PostUsersSignInDataRequest { @JsonCreator public PostUsersSignInDataRequest( - Optional clientID, + String clientID, Optional clientName, Optional deviceNickname, Optional clientVersion, @@ -76,15 +76,16 @@ public class PostUsersSignInDataRequest { this.requestBody = requestBody; } - public PostUsersSignInDataRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + public PostUsersSignInDataRequest( + String clientID) { + this(clientID, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @JsonIgnore - public Optional clientID() { + public String clientID() { return clientID; } @@ -137,15 +138,6 @@ public class PostUsersSignInDataRequest { * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public PostUsersSignInDataRequest 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 PostUsersSignInDataRequest withClientID(Optional clientID) { Utils.checkNotNull(clientID, "clientID"); this.clientID = clientID; return this; @@ -283,7 +275,7 @@ public class PostUsersSignInDataRequest { public final static class Builder { - private Optional clientID = Optional.empty(); + private String clientID; private Optional clientName = Optional.empty(); @@ -303,15 +295,6 @@ public class PostUsersSignInDataRequest { * 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; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataState.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataState.java index aec010ac..95a40ef0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataState.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataState.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; public enum PostUsersSignInDataState { ENDED("ended"); @@ -20,4 +22,13 @@ public enum PostUsersSignInDataState { public String value() { return value; } + + public static Optional fromValue(String value) { + for (PostUsersSignInDataState o: PostUsersSignInDataState.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataStatus.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataStatus.java index d139e30b..1a162b5f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataStatus.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataStatus.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; public enum PostUsersSignInDataStatus { ONLINE("online"), @@ -21,4 +23,13 @@ public enum PostUsersSignInDataStatus { public String value() { return value; } + + public static Optional fromValue(String value) { + for (PostUsersSignInDataStatus o: PostUsersSignInDataStatus.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataWatchedIndicator.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataWatchedIndicator.java index 97c7de16..b5fa00e9 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataWatchedIndicator.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataWatchedIndicator.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * PostUsersSignInDataWatchedIndicator - Whether or not media watched indicators are enabled (little orange dot on media) @@ -23,4 +25,13 @@ public enum PostUsersSignInDataWatchedIndicator { public int value() { return value; } + + public static Optional fromValue(int value) { + for (PostUsersSignInDataWatchedIndicator o: PostUsersSignInDataWatchedIndicator.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Protocol.java b/src/main/java/dev/plexapi/sdk/models/operations/Protocol.java index ad1d4444..585db0f5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Protocol.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Protocol.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * Protocol - The protocol used for the connection (http, https, etc) @@ -24,4 +26,13 @@ public enum Protocol { public String value() { return value; } + + public static Optional fromValue(String value) { + for (Protocol o: Protocol.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamForce.java b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamForce.java index 4ec06b6c..e2f6f611 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamForce.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamForce.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * QueryParamForce - Force overwriting of duplicate playlists. @@ -27,4 +29,13 @@ public enum QueryParamForce { public long value() { return value; } + + public static Optional fromValue(long value) { + for (QueryParamForce o: QueryParamForce.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeCollections.java b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeCollections.java index de75e75d..6f9729c8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeCollections.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeCollections.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * QueryParamIncludeCollections - Whether to include collections in the search results. @@ -23,4 +25,13 @@ public enum QueryParamIncludeCollections { public int value() { return value; } + + public static Optional fromValue(int value) { + for (QueryParamIncludeCollections o: QueryParamIncludeCollections.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeExternalMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeExternalMedia.java index 09bceeb9..dc9de591 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeExternalMedia.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeExternalMedia.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * QueryParamIncludeExternalMedia - Whether to include external media in the search results. @@ -23,4 +25,13 @@ public enum QueryParamIncludeExternalMedia { public int value() { return value; } + + public static Optional fromValue(int value) { + for (QueryParamIncludeExternalMedia o: QueryParamIncludeExternalMedia.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeMeta.java b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeMeta.java index 51f62c97..5c262a80 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeMeta.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeMeta.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * QueryParamIncludeMeta - Adds the Meta object to the response @@ -24,4 +26,13 @@ public enum QueryParamIncludeMeta { public int value() { return value; } + + public static Optional fromValue(int value) { + for (QueryParamIncludeMeta o: QueryParamIncludeMeta.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamOnlyTransient.java b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamOnlyTransient.java index d40062dc..14da8acb 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamOnlyTransient.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamOnlyTransient.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * QueryParamOnlyTransient - 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). @@ -23,4 +25,13 @@ public enum QueryParamOnlyTransient { public long value() { return value; } + + public static Optional fromValue(long value) { + for (QueryParamOnlyTransient o: QueryParamOnlyTransient.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamSmart.java b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamSmart.java index 2b27faa6..9a028933 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamSmart.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamSmart.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * QueryParamSmart - type of playlists to return (default is all). @@ -23,4 +25,13 @@ public enum QueryParamSmart { public long value() { return value; } + + public static Optional fromValue(long value) { + for (QueryParamSmart o: QueryParamSmart.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamType.java b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamType.java index bcccfc45..fe4099cc 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamType.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * QueryParamType - The type of media to retrieve. @@ -20,7 +22,9 @@ public enum QueryParamType { TvShow(2L), Season(3L), Episode(4L), - Audio(8L); + Audio(8L), + Album(9L), + Track(10L); @JsonValue private final long value; @@ -32,4 +36,13 @@ public enum QueryParamType { public long value() { return value; } + + public static Optional fromValue(long value) { + for (QueryParamType o: QueryParamType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } 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 b33691c7..13a1bff2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java @@ -170,7 +170,7 @@ public class SDKMethodInterfaces { Optional includeHttps, Optional includeRelay, Optional includeIPv6, - Optional clientID, + String clientID, Optional serverURL) throws Exception; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Scope.java b/src/main/java/dev/plexapi/sdk/models/operations/Scope.java index 93c29026..eb7ee5d6 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Scope.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Scope.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * Scope - `all` - This is the only supported `scope` parameter. @@ -23,4 +25,13 @@ public enum Scope { public String value() { return value; } + + public static Optional fromValue(String value) { + for (Scope o: Scope.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/SearchTypes.java b/src/main/java/dev/plexapi/sdk/models/operations/SearchTypes.java index 0a8765b2..0a69bb00 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/SearchTypes.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/SearchTypes.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; public enum SearchTypes { MOVIES("movies"), @@ -24,4 +26,13 @@ public enum SearchTypes { public String value() { return value; } + + public static Optional fromValue(String value) { + for (SearchTypes o: SearchTypes.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/ShowOrdering.java b/src/main/java/dev/plexapi/sdk/models/operations/ShowOrdering.java index 32478d01..39fce644 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/ShowOrdering.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/ShowOrdering.java @@ -6,22 +6,24 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** - * ShowOrdering - 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)). + * ShowOrdering - Setting that indicates the episode ordering for the show + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). * */ public enum ShowOrdering { None("None"), TmdbAiring("tmdbAiring"), - Aired("aired"), - Dvd("dvd"), - Absolute("absolute"); + TvdbAiring("tvdbAiring"), + TvdbDvd("tvdbDvd"), + TvdbAbsolute("tvdbAbsolute"); @JsonValue private final String value; @@ -33,4 +35,13 @@ public enum ShowOrdering { public String value() { return value; } + + public static Optional fromValue(String value) { + for (ShowOrdering o: ShowOrdering.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Skip.java b/src/main/java/dev/plexapi/sdk/models/operations/Skip.java index 6095437a..10e6f435 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Skip.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Skip.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * Skip - Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`. @@ -23,4 +25,13 @@ public enum Skip { public long value() { return value; } + + public static Optional fromValue(long value) { + for (Skip o: Skip.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Smart.java b/src/main/java/dev/plexapi/sdk/models/operations/Smart.java index de8b34c1..5d34a692 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Smart.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Smart.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * Smart - whether the playlist is smart or not @@ -23,4 +25,13 @@ public enum Smart { public long value() { return value; } + + public static Optional fromValue(long value) { + for (Smart o: Smart.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/State.java b/src/main/java/dev/plexapi/sdk/models/operations/State.java index e988f103..6a9d84a0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/State.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/State.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * State - The state of the media item @@ -25,4 +27,13 @@ public enum State { public String value() { return value; } + + public static Optional fromValue(String value) { + for (State o: State.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Status.java b/src/main/java/dev/plexapi/sdk/models/operations/Status.java index 1fbc64b1..609deb0d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Status.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Status.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * Status - Current friend request status @@ -23,4 +25,13 @@ public enum Status { public String value() { return value; } + + public static Optional fromValue(String value) { + for (Status o: Status.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Tag.java b/src/main/java/dev/plexapi/sdk/models/operations/Tag.java index 1313f0d4..ad0daf74 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Tag.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Tag.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * Tag - A key representing a specific tag within the section. @@ -29,7 +31,8 @@ public enum Tag { RATING("rating"), RESOLUTION("resolution"), FIRST_CHARACTER("firstCharacter"), - FOLDER("folder"); + FOLDER("folder"), + ALBUMS("albums"); @JsonValue private final String value; @@ -41,4 +44,13 @@ public enum Tag { public String value() { return value; } + + public static Optional fromValue(String value) { + for (Tag o: Tag.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/TaskName.java b/src/main/java/dev/plexapi/sdk/models/operations/TaskName.java index e85a320a..b36082db 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/TaskName.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/TaskName.java @@ -6,6 +6,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.String; +import java.util.Objects; +import java.util.Optional; /** * TaskName - the name of the task to be started. @@ -36,4 +38,13 @@ public enum TaskName { public String value() { return value; } + + public static Optional fromValue(String value) { + for (TaskName o: TaskName.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Tonight.java b/src/main/java/dev/plexapi/sdk/models/operations/Tonight.java index 3cb7160f..a5c07eb4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Tonight.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Tonight.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * 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 @@ -23,4 +25,13 @@ public enum Tonight { public long value() { return value; } + + public static Optional fromValue(long value) { + for (Tonight o: Tonight.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Type.java b/src/main/java/dev/plexapi/sdk/models/operations/Type.java index 7ca65261..1d490e30 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Type.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Type.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * Type - The type of media to retrieve. @@ -20,7 +22,9 @@ public enum Type { TvShow(2L), Season(3L), Episode(4L), - Audio(8L); + Audio(8L), + Album(9L), + Track(10L); @JsonValue private final long value; @@ -32,4 +36,13 @@ public enum Type { public long value() { return value; } + + public static Optional fromValue(long value) { + for (Type o: Type.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Upscale.java b/src/main/java/dev/plexapi/sdk/models/operations/Upscale.java index 4261ece4..01442f25 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Upscale.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Upscale.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * Upscale - allow images to be resized beyond native dimensions. @@ -23,4 +25,13 @@ public enum Upscale { public long value() { return value; } + + public static Optional fromValue(long value) { + for (Upscale o: Upscale.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/WatchedIndicator.java b/src/main/java/dev/plexapi/sdk/models/operations/WatchedIndicator.java index dd8e057d..37230c2d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/WatchedIndicator.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/WatchedIndicator.java @@ -5,6 +5,8 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; /** * WatchedIndicator - Whether or not media watched indicators are enabled (little orange dot on media) @@ -23,4 +25,13 @@ public enum WatchedIndicator { public int value() { return value; } + + public static Optional fromValue(int value) { + for (WatchedIndicator o: WatchedIndicator.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } } diff --git a/src/main/java/dev/plexapi/sdk/utils/BigDecimalString.java b/src/main/java/dev/plexapi/sdk/utils/BigDecimalString.java index ce24b273..8f6174ce 100644 --- a/src/main/java/dev/plexapi/sdk/utils/BigDecimalString.java +++ b/src/main/java/dev/plexapi/sdk/utils/BigDecimalString.java @@ -24,8 +24,8 @@ import com.fasterxml.jackson.databind.ser.std.StdSerializer; // Note that Jackson 2.16.1 does not support @JsonValue and @JsonFormat combined so we must use // a custom serializer/deserializer -@JsonSerialize(using = BigDecimalString.BigDecimalStringSerializer.class) -@JsonDeserialize(using = BigDecimalString.BigDecimalStringDeserializer.class) +@JsonSerialize(using = BigDecimalString.Serializer.class) +@JsonDeserialize(using = BigDecimalString.Deserializer.class) public class BigDecimalString { private final BigDecimal value; @@ -64,16 +64,11 @@ public class BigDecimalString { return Objects.equals(value, other.value); } - public static final class BigDecimalStringSerializer extends StdSerializer { + @SuppressWarnings("serial") + public static final class Serializer extends StdSerializer { - private static final long serialVersionUID = -3828937716095008071L; - - public BigDecimalStringSerializer() { - this(null); - } - - public BigDecimalStringSerializer(Class t) { - super(t); + protected Serializer() { + super(BigDecimalString.class); } @Override @@ -83,16 +78,11 @@ public class BigDecimalString { } } - public static final class BigDecimalStringDeserializer extends StdDeserializer { + @SuppressWarnings("serial") + public static final class Deserializer extends StdDeserializer { - private static final long serialVersionUID = -2474225842945673085L; - - public BigDecimalStringDeserializer() { - this(null); - } - - public BigDecimalStringDeserializer(Class t) { - super(t); + protected Deserializer() { + super(BigDecimalString.class); } @Override diff --git a/src/main/java/dev/plexapi/sdk/utils/BigIntegerString.java b/src/main/java/dev/plexapi/sdk/utils/BigIntegerString.java index 8d151eaa..650a6599 100644 --- a/src/main/java/dev/plexapi/sdk/utils/BigIntegerString.java +++ b/src/main/java/dev/plexapi/sdk/utils/BigIntegerString.java @@ -24,8 +24,8 @@ import com.fasterxml.jackson.databind.ser.std.StdSerializer; // Note that Jackson 2.16.1 does not support @JsonValue and @JsonFormat combined so we must use // a custom serializer/deserializer -@JsonSerialize(using = BigIntegerString.BigIntegerStringSerializer.class) -@JsonDeserialize(using = BigIntegerString.BigIntegerStringDeserializer.class) +@JsonSerialize(using = BigIntegerString.Serializer.class) +@JsonDeserialize(using = BigIntegerString.Deserializer.class) public class BigIntegerString { private final BigInteger value; @@ -64,16 +64,11 @@ public class BigIntegerString { return Objects.equals(value, other.value); } - public static final class BigIntegerStringSerializer extends StdSerializer { + @SuppressWarnings("serial") + public static final class Serializer extends StdSerializer { - private static final long serialVersionUID = -2474225842945673085L; - - public BigIntegerStringSerializer() { - this(null); - } - - public BigIntegerStringSerializer(Class t) { - super(t); + protected Serializer() { + super(BigIntegerString.class); } @Override @@ -83,16 +78,11 @@ public class BigIntegerString { } } - public static final class BigIntegerStringDeserializer extends StdDeserializer { + @SuppressWarnings("serial") + public static final class Deserializer extends StdDeserializer { - private static final long serialVersionUID = -2474225842945673085L; - - public BigIntegerStringDeserializer() { - this(null); - } - - public BigIntegerStringDeserializer(Class t) { - super(t); + protected Deserializer() { + super(BigIntegerString.class); } @Override diff --git a/src/main/java/dev/plexapi/sdk/utils/HTTPRequest.java b/src/main/java/dev/plexapi/sdk/utils/HTTPRequest.java index 71e74568..d372a878 100644 --- a/src/main/java/dev/plexapi/sdk/utils/HTTPRequest.java +++ b/src/main/java/dev/plexapi/sdk/utils/HTTPRequest.java @@ -4,6 +4,7 @@ package dev.plexapi.sdk.utils; +import java.net.URI; import java.net.URISyntaxException; import java.net.http.HttpRequest; import java.net.http.HttpRequest.BodyPublisher; @@ -15,15 +16,15 @@ import java.util.List; import java.util.Map; import java.util.Optional; -import org.apache.http.NameValuePair; -import org.apache.http.client.utils.URIBuilder; -import org.apache.http.message.BasicNameValuePair; - public class HTTPRequest { + private static final String FRAGMENT_SEGMENT_START = "#"; + private static final String QUERY_NAME_VALUE_DELIMITER = "="; + private static final String QUERY_PARAMETER_DELIMITER = "&"; + private static final String QUERY_SEGMENT_START = "?"; private final String baseURL; private final String method; - private final List queryParams = new ArrayList<>(); + private final List queryParams = new ArrayList<>(); private final Map> headers = new HashMap<>(); private Optional body = Optional.empty(); // mutable @@ -54,21 +55,21 @@ public class HTTPRequest { return this; } - public HTTPRequest addQueryParam(String name, String value) { - addQueryParam(new BasicNameValuePair(name, value)); - return this; - } - - public HTTPRequest addQueryParam(NameValuePair param) { + public HTTPRequest addQueryParam(QueryParameter param) { this.queryParams.add(param); return this; } - public HTTPRequest addQueryParams(Collection params) { + public HTTPRequest addQueryParam(String key, String value, boolean allowReserved) { + this.queryParams.add(QueryParameter.of(key, value, allowReserved)); + return this; + } + + public HTTPRequest addQueryParams(Collection params) { params.forEach(p -> addQueryParam(p)); return this; } - + public HttpRequest build() { HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(); @@ -81,14 +82,49 @@ public class HTTPRequest { } requestBuilder.method(method, bodyPublisher); try { - URIBuilder b = new URIBuilder(this.baseURL); - queryParams.forEach(pair -> b.addParameter(pair.getName(), pair.getValue())); - requestBuilder.uri(b.build()); + requestBuilder.uri(new URI(buildUrl(baseURL, queryParams))); } catch (URISyntaxException e) { throw new RuntimeException(e); } headers.forEach((k, list) -> list.forEach(v -> requestBuilder.header(k, v))); return requestBuilder.build(); } - + + // VisibleForTesting + public static String buildUrl(String baseURL, Collection queryParams) { + if (queryParams.isEmpty()) { + return baseURL; + } else { + final String base; + final String fragment; + int i = baseURL.indexOf(FRAGMENT_SEGMENT_START); + if (i == -1) { + base = baseURL; + fragment = ""; + } else { + base = baseURL.substring(0, i); + fragment = baseURL.substring(i); + } + StringBuilder b = new StringBuilder(base); + if (!base.contains(QUERY_SEGMENT_START)) { + b.append(QUERY_SEGMENT_START); + } else { + b.append(QUERY_PARAMETER_DELIMITER); + } + boolean first = true; + for (QueryParameter p : queryParams) { + if (!first) { + b.append(QUERY_PARAMETER_DELIMITER); + } + first = false; + // don't allow reserved characters to be unencoded in key (??) + b.append(Utf8UrlEncoder.DEFAULT.encode(p.name())); + b.append(QUERY_NAME_VALUE_DELIMITER); + b.append(Utf8UrlEncoder.allowReserved(p.allowReserved()).encode(p.value())); + } + b.append(fragment); + return b.toString(); + } + } + } \ No newline at end of file diff --git a/src/main/java/dev/plexapi/sdk/utils/PathParamsMetadata.java b/src/main/java/dev/plexapi/sdk/utils/PathParamsMetadata.java index 2ffc1c84..ce71f38a 100644 --- a/src/main/java/dev/plexapi/sdk/utils/PathParamsMetadata.java +++ b/src/main/java/dev/plexapi/sdk/utils/PathParamsMetadata.java @@ -8,15 +8,17 @@ import java.lang.reflect.Field; class PathParamsMetadata { + // these fields set via reflection + String style = "simple"; boolean explode; String name; String serialization; + boolean allowReserved; private PathParamsMetadata() { } - // pathParam:style=simple,explode=false,name=apiID static PathParamsMetadata parse(Field field) throws IllegalArgumentException, IllegalAccessException { return Metadata.parse("pathParam", new PathParamsMetadata(), field); } diff --git a/src/main/java/dev/plexapi/sdk/utils/QueryParameter.java b/src/main/java/dev/plexapi/sdk/utils/QueryParameter.java new file mode 100644 index 00000000..8b49709f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/QueryParameter.java @@ -0,0 +1,62 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.utils; + +import java.util.Objects; + +// internal class, not for public use +// TODO move to internal package +public final class QueryParameter { + + private final String name; + private final String value; + private final boolean allowReserved; + + private QueryParameter(String name, String value, boolean allowReserved) { + this.name = name; + this.value = value; + this.allowReserved = allowReserved; + } + + public static QueryParameter of(String name, String value, boolean allowReserved) { + return new QueryParameter(name, value, allowReserved); + } + + public String name() { + return name; + } + + public String value() { + return value; + } + + public boolean allowReserved() { + return allowReserved; + } + + @Override + public String toString() { + return "QueryParameter [name=" + name + ", value=" + value + ", allowReserved=" + allowReserved + "]"; + } + + @Override + public int hashCode() { + return Objects.hash(allowReserved, name, value); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + QueryParameter other = (QueryParameter) obj; + return allowReserved == other.allowReserved && Objects.equals(name, other.name) + && Objects.equals(value, other.value); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/utils/QueryParameters.java b/src/main/java/dev/plexapi/sdk/utils/QueryParameters.java index 51ff2adf..66aa3241 100644 --- a/src/main/java/dev/plexapi/sdk/utils/QueryParameters.java +++ b/src/main/java/dev/plexapi/sdk/utils/QueryParameters.java @@ -11,16 +11,13 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import org.apache.http.NameValuePair; -import org.apache.http.message.BasicNameValuePair; - import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class QueryParameters { - public static List parseQueryParams(Class type, T queryParams, + public static List parseQueryParams(Class type, T queryParams, Map>> globals) throws Exception { - List allParams = new ArrayList<>(); + List allParams = new ArrayList<>(); Field[] fields = type.getDeclaredFields(); @@ -45,20 +42,20 @@ public class QueryParameters { } if (queryParamsMetadata.serialization != null && !queryParamsMetadata.serialization.isBlank()) { - List params = parseSerializedParams(queryParamsMetadata, value); + List params = parseSerializedParams(queryParamsMetadata, value); allParams.addAll(params); } else { switch (queryParamsMetadata.style) { case "form": - List formParams = parseDelimitedParams(queryParamsMetadata, value, ","); + List formParams = parseDelimitedParams(queryParamsMetadata, value, ","); allParams.addAll(formParams); break; case "deepObject": - List deepObjectParams = parseDeepObjectParams(queryParamsMetadata, value); + List deepObjectParams = parseDeepObjectParams(queryParamsMetadata, value); allParams.addAll(deepObjectParams); break; case "pipeDelimited": - List pipeDelimitedParams = parseDelimitedParams(queryParamsMetadata, value, "|"); + List pipeDelimitedParams = parseDelimitedParams(queryParamsMetadata, value, "|"); allParams.addAll(pipeDelimitedParams); break; default: @@ -70,14 +67,14 @@ public class QueryParameters { return allParams; } - private static List parseSerializedParams(QueryParamsMetadata queryParamsMetadata, Object value) + private static List parseSerializedParams(QueryParamsMetadata queryParamsMetadata, Object value) throws JsonProcessingException { - List params = new ArrayList<>(); + List params = new ArrayList<>(); switch (queryParamsMetadata.serialization) { case "json": ObjectMapper mapper = JSON.getMapper(); String json = mapper.writeValueAsString(value); - params.add(new BasicNameValuePair(queryParamsMetadata.name, json)); + params.add(QueryParameter.of(queryParamsMetadata.name, json, queryParamsMetadata.allowReserved)); break; default: break; @@ -85,9 +82,9 @@ public class QueryParameters { return params; } - private static List parseDelimitedParams(QueryParamsMetadata queryParamsMetadata, Object value, String delimiter) + private static List parseDelimitedParams(QueryParamsMetadata queryParamsMetadata, Object value, String delimiter) throws IllegalArgumentException, IllegalAccessException { - List params = new ArrayList<>(); + List params = new ArrayList<>(); switch (Types.getType(value.getClass())) { case ARRAY: { @@ -107,7 +104,7 @@ public class QueryParameters { values.add(String.join(delimiter, items)); } - params.addAll(values.stream().map(v -> new BasicNameValuePair(queryParamsMetadata.name, v)) + params.addAll(values.stream().map(v -> QueryParameter.of(queryParamsMetadata.name, v, queryParamsMetadata.allowReserved)) .collect(Collectors.toList())); break; } @@ -121,20 +118,20 @@ public class QueryParameters { String val = Utils.valToString(entry.getValue()); if (queryParamsMetadata.explode) { - params.add(new BasicNameValuePair(key, val)); + params.add(QueryParameter.of(key, val, queryParamsMetadata.allowReserved)); } else { items.add(String.format("%s%s%s", key, delimiter, val)); } } if (items.size() > 0) { - params.add(new BasicNameValuePair(queryParamsMetadata.name, String.join(delimiter, items))); + params.add(QueryParameter.of(queryParamsMetadata.name, String.join(delimiter, items), queryParamsMetadata.allowReserved)); } break; } case OBJECT: { if (!Utils.allowIntrospection(value.getClass())) { - params.add(new BasicNameValuePair(queryParamsMetadata.name, Utils.valToString(value))); + params.add(QueryParameter.of(queryParamsMetadata.name, Utils.valToString(value), queryParamsMetadata.allowReserved)); break; } Field[] fields = value.getClass().getDeclaredFields(); @@ -155,29 +152,29 @@ public class QueryParameters { } if (queryParamsMetadata.explode) { - params.add(new BasicNameValuePair(metadata.name, Utils.valToString(val))); + params.add(QueryParameter.of(metadata.name, Utils.valToString(val), metadata.allowReserved)); } else { items.add(String.format("%s%s%s", metadata.name, delimiter, Utils.valToString(val))); } } if (items.size() > 0) { - params.add(new BasicNameValuePair(queryParamsMetadata.name, String.join(delimiter, items))); + params.add(QueryParameter.of(queryParamsMetadata.name, String.join(delimiter, items), queryParamsMetadata.allowReserved)); } break; } default: - params.add(new BasicNameValuePair(queryParamsMetadata.name, Utils.valToString(value))); + params.add(QueryParameter.of(queryParamsMetadata.name, Utils.valToString(value), queryParamsMetadata.allowReserved)); break; } return params; } - private static List parseDeepObjectParams(QueryParamsMetadata queryParamsMetadata, Object value) + private static List parseDeepObjectParams(QueryParamsMetadata queryParamsMetadata, Object value) throws Exception { - List params = new ArrayList<>(); + List params = new ArrayList<>(); switch (Types.getType(value.getClass())) { case MAP: { @@ -189,12 +186,12 @@ public class QueryParameters { if (val instanceof List || val.getClass().isArray()) { for (Object v : Utils.toList(val)) { - params.add(new BasicNameValuePair(String.format("%s[%s]", queryParamsMetadata.name, key), - Utils.valToString(v))); + params.add(QueryParameter.of(String.format("%s[%s]", queryParamsMetadata.name, key), + Utils.valToString(v), queryParamsMetadata.allowReserved)); } } else { - params.add(new BasicNameValuePair(String.format("%s[%s]", queryParamsMetadata.name, key), - Utils.valToString(val))); + params.add(QueryParameter.of(String.format("%s[%s]", queryParamsMetadata.name, key), + Utils.valToString(val), queryParamsMetadata.allowReserved)); } } @@ -221,14 +218,14 @@ public class QueryParameters { if (val instanceof List || val.getClass().isArray()) { for (Object v : Utils.toList(val)) { - params.add(new BasicNameValuePair( + params.add(QueryParameter.of( String.format("%s[%s]", queryParamsMetadata.name, metadata.name), - Utils.valToString(v))); + Utils.valToString(v), metadata.allowReserved)); } } else { params.add( - new BasicNameValuePair(String.format("%s[%s]", queryParamsMetadata.name, metadata.name), - Utils.valToString(val))); + QueryParameter.of(String.format("%s[%s]", queryParamsMetadata.name, metadata.name), + Utils.valToString(val), metadata.allowReserved)); } } diff --git a/src/main/java/dev/plexapi/sdk/utils/QueryParamsMetadata.java b/src/main/java/dev/plexapi/sdk/utils/QueryParamsMetadata.java index 6a5d68ee..b2bea8fc 100644 --- a/src/main/java/dev/plexapi/sdk/utils/QueryParamsMetadata.java +++ b/src/main/java/dev/plexapi/sdk/utils/QueryParamsMetadata.java @@ -8,12 +8,14 @@ import java.lang.reflect.Field; class QueryParamsMetadata { + // these parameters set via reflection + String style = "form"; boolean explode = true; String name; String serialization; + boolean allowReserved; - // queryParam:style=simple,explode=false,name=apiID static QueryParamsMetadata parse(Field field) throws IllegalArgumentException, IllegalAccessException { return Metadata.parse("queryParam", new QueryParamsMetadata(), field); } diff --git a/src/main/java/dev/plexapi/sdk/utils/RequestBody.java b/src/main/java/dev/plexapi/sdk/utils/RequestBody.java index a0af477a..970c6ea2 100644 --- a/src/main/java/dev/plexapi/sdk/utils/RequestBody.java +++ b/src/main/java/dev/plexapi/sdk/utils/RequestBody.java @@ -12,17 +12,16 @@ import java.net.http.HttpRequest.BodyPublishers; import java.util.ArrayList; import java.util.List; import java.util.Map; -import java.util.regex.Pattern; import java.util.Optional; +import java.util.regex.Pattern; -import org.apache.http.HttpEntity; -import org.apache.http.NameValuePair; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.mime.HttpMultipartMode; -import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.apache.http.message.BasicNameValuePair; - +import org.apache.hc.client5.http.entity.UrlEncodedFormEntity; +import org.apache.hc.client5.http.entity.mime.HttpMultipartMode; +import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder; +import org.apache.hc.core5.http.ContentType; +import org.apache.hc.core5.http.HttpEntity; +import org.apache.hc.core5.http.NameValuePair; +import org.apache.hc.core5.http.message.BasicNameValuePair; import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.databind.ObjectMapper; @@ -120,7 +119,7 @@ public final class RequestBody { private static SerializedBody serializeMultipart(Object value) throws IllegalArgumentException, IllegalAccessException, UnsupportedOperationException, IOException { MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE); + builder.setMode(HttpMultipartMode.EXTENDED); String boundary = "-------------" + System.currentTimeMillis(); builder.setBoundary(boundary); @@ -143,7 +142,7 @@ public final class RequestBody { } if (metadata.file) { - serializeMultipartFile(builder, val); + serializeMultipartFile(metadata.name, builder, val); } else if (metadata.json) { ObjectMapper mapper = JSON.getMapper(); String json = mapper.writeValueAsString(val); @@ -161,7 +160,7 @@ public final class RequestBody { } HttpEntity entity = builder.build(); - String ct = builder.build().getContentType().getValue(); + String ct = builder.build().getContentType(); return new SerializedBody(ct, BodyPublishers.ofInputStream(() -> { try { return entity.getContent(); @@ -171,13 +170,12 @@ public final class RequestBody { })); } - private static void serializeMultipartFile(MultipartEntityBuilder builder, Object file) + private static void serializeMultipartFile(String fieldName, MultipartEntityBuilder builder, Object file) throws IllegalArgumentException, IllegalAccessException { if (Types.getType(file.getClass()) != Types.OBJECT) { throw new RuntimeException("Invalid type for multipart file"); } - String fieldName = ""; String fileName = ""; byte[] content = null; @@ -199,12 +197,11 @@ public final class RequestBody { if (metadata.content) { content = (byte[]) val; } else { - fieldName = metadata.name; fileName = Utils.valToString(val); } } - if (fieldName.isBlank() || fileName.isBlank() || content == null) { + if (fileName.isBlank() || content == null) { throw new RuntimeException("Invalid multipart file"); } @@ -336,8 +333,9 @@ public final class RequestBody { throw new RuntimeException("Invalid type for form data"); } + @SuppressWarnings("resource") UrlEncodedFormEntity entity = new UrlEncodedFormEntity(params); - String ct = entity.getContentType().getValue(); + String ct = entity.getContentType(); // ensure that a fresh open input stream is provided every time // by the BodyPublisher return new SerializedBody(ct, BodyPublishers.ofInputStream(() -> { diff --git a/src/main/java/dev/plexapi/sdk/utils/Security.java b/src/main/java/dev/plexapi/sdk/utils/Security.java index e0c91bf2..2884e136 100644 --- a/src/main/java/dev/plexapi/sdk/utils/Security.java +++ b/src/main/java/dev/plexapi/sdk/utils/Security.java @@ -6,7 +6,11 @@ package dev.plexapi.sdk.utils; import java.lang.reflect.Field; import java.nio.charset.StandardCharsets; +import java.util.Arrays; import java.util.Base64; +import java.util.Optional; +import java.util.regex.Pattern; +import java.util.stream.Stream; public final class Security { @@ -108,7 +112,7 @@ public final class Security { break; case "query": request.addQueryParam( - securityMetadata.name, Utils.valToString(value)); + securityMetadata.name, Utils.valToString(value), false); break; case "cookie": request.addHeader("Cookie", @@ -125,7 +129,7 @@ public final class Security { case "oauth2": if (!"client_credentials".equals(schemeMetadata.subtype)) { request.addHeader(securityMetadata.name, Utils.prefixBearer(Utils.valToString(value))); - } + } break; case "http": switch (schemeMetadata.subtype) { @@ -179,4 +183,60 @@ public final class Security { .encodeToString(String.format("%s:%s", username, password) .getBytes(StandardCharsets.UTF_8))); } + + public static Stream findFieldsWhereMetadataContainsRegexes(Object o, String... regexes) { + Field[] fields = o.getClass().getDeclaredFields(); + return Arrays.stream(fields) // + .filter(f -> { + SpeakeasyMetadata[] anns = f.getDeclaredAnnotationsByType(SpeakeasyMetadata.class); + if (anns == null) { + return false; + } + return Arrays // + .stream(regexes) // + .allMatch(regex -> matches(anns, regex)); + }); + } + + public static Optional findStringValueWhereMetadataContainsRegexes(Object o, String... regexes) { + return findValueWhereMetadataContainsRegexes(o, regexes).map(x -> (String) x); + } + + public static Optional findStringValueWhereMetadataNameIs(Object o, String name) { + return Security.findStringValueWhereMetadataContainsRegexes(o, "\\bname=" + name + "\\b"); + } + + public static Optional findValueWhereMetadataContainsRegexes(Object o, String... regexes) { + return findFieldsWhereMetadataContainsRegexes(o, regexes) + .flatMap(f -> { + f.setAccessible(true); + Object result; + try { + result = f.get(o); + } catch (IllegalArgumentException | IllegalAccessException e) { + throw new RuntimeException(e); + } + if (result instanceof Optional) { + @SuppressWarnings("unchecked") + Optional r = (Optional) result; + if (r.isEmpty()) { + return Stream.empty(); + } else { + return Stream.of(r.get()); + } + } else { + return Stream.of(result); + } + }).findAny(); + } + + private static boolean matches(SpeakeasyMetadata[] anns, String regex) { + Pattern pattern = Pattern.compile(regex); + for (SpeakeasyMetadata ann : anns) { + if (pattern.matcher(ann.value()).find()) { + return true; + } + } + return false; + } } \ No newline at end of file diff --git a/src/main/java/dev/plexapi/sdk/utils/SessionManager.java b/src/main/java/dev/plexapi/sdk/utils/SessionManager.java new file mode 100644 index 00000000..e1110e66 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/SessionManager.java @@ -0,0 +1,178 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.utils; + +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.OffsetDateTime; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Function; +import java.util.stream.Collectors; + +import dev.plexapi.sdk.models.errors.AuthException; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public final class SessionManager { + + // VisibleForTesting + public static final int REFRESH_BEFORE_EXPIRY_SECONDS = 60; + + private final Map> sessions = new HashMap<>(); + + public interface HasSessionKey { + String sessionKey(); + } + + public final static class Session { + private final T credentials; + private final Optional token; + private final List scopes; + private final Optional expiresAt; + + public Session(T credentials, Optional token, List scopes, Optional expiresAt) { + this.credentials = credentials; + this.token = token; + this.scopes = scopes; + this.expiresAt = expiresAt; + } + + public T credentials() { + return credentials; + } + + public Optional token() { + return token; + } + + public List scopes() { + return scopes; + } + + public Optional expiresAt() { + return expiresAt; + } + + } + + public Session getSession(T credentials, Optional> scopes, Function, Session> tokenProvider ) { + final String sessionKey = credentials.sessionKey(); + + Optional> currentSession = Optional.ofNullable(sessions.get(sessionKey)); + final Session session; + if (shouldCreateNewSession(currentSession, scopes)) { + // note that we accumulate scopes. For example if a session existed + // for scope 'read' and this request requires scope 'write' then we + // request a new token for `read, write`. + + // TODO it may be better to rather make `sessions` a Map> + // where the none of the Session scope lists fully contains another in the same + // map value. + // This would ensure that an operation is always called with a token with the + // minimum + // permissions required and also would ensure that a token request is not + // rejected + // because of disallowed scope combinations (yet to see that in the wild). + // For the example above with `read` and `write` scoped requests we would get a + // token + // for `read` scope, and then get a token for `write` scope and store both + // tokens in separate + // Session objects in the map value list for the credential pair. + + List accumulatedScopes = accumulateScopes(scopes, currentSession); + session = tokenProvider.apply(accumulatedScopes); + sessions.put(sessionKey, session); + } else { + session = currentSession.get(); + } + return session; + } + + // VisibleForTesting + public static boolean shouldCreateNewSession(Optional> currentSession, Optional> oauthScopes) { + return !currentSession.isPresent() // + || !hasRequiredScopes(currentSession.get().scopes, oauthScopes) // + || hasTokenExpired(currentSession.get().expiresAt, OffsetDateTime.now()); + } + + + private static < T extends HasSessionKey> List accumulateScopes(Optional> requiredScopes, Optional> session) { + if (session.isPresent()) { + List scopes = new ArrayList<>(requiredScopes.orElse(Collections.emptyList())); + scopes.addAll(session.get().scopes); + return scopes.stream() // + .distinct() // + .collect(Collectors.toList()); + } else { + return requiredScopes.orElse(Collections.emptyList()); + } + } + + // VisibleForTesting + public static boolean hasTokenExpired(Optional expiresAt, OffsetDateTime now) { + return expiresAt.isEmpty() // + || now.plusSeconds(REFRESH_BEFORE_EXPIRY_SECONDS).isAfter(expiresAt.get()); + } + + // VisibleForTesting + public static boolean hasRequiredScopes(List sessionScopes, Optional> requiredScopes) { + return sessionScopes.containsAll(requiredScopes.orElse(Collections.emptyList())); + } + + public void remove(String sessionKey) { + sessions.remove(sessionKey); + } + + public static Session requestOAuth2Token(HTTPClient client, T credentials, List scopes, + Map payload, URI tokenUri) { + try { + HttpRequest request = HttpRequest // + .newBuilder(tokenUri) // + .header("Content-Type", "application/x-www-form-urlencoded") // + .POST(RequestBody.serializeFormData(payload).body()) // + .build(); + HttpResponse response = client.send(request); + if (response.statusCode() != HttpURLConnection.HTTP_OK) { + String responseBody = Utils.toUtf8AndClose(response.body()); + throw new AuthException(response.statusCode(), + "Unexpected status code " + response.statusCode() + ": " + responseBody); + } + TokenResponse t = Utils.mapper().readValue(response.body(), TokenResponse.class); + if (!t.tokenType.orElse("").equals("Bearer")) { + throw new AuthException("Expected 'Bearer' token type but was '" + t.tokenType.orElse("") + "'"); + } + final Optional expiresAt = t.expiresInMs + .map(x -> OffsetDateTime.now().plus(x, ChronoUnit.MILLIS)); + return new Session(credentials, t.accessToken, scopes, expiresAt); + } catch (IOException | IllegalArgumentException | IllegalAccessException | InterruptedException | URISyntaxException e) { + throw new RuntimeException(e); + } + } + + final static class TokenResponse { + + @JsonProperty("access_token") + Optional accessToken; + + @JsonProperty("token_type") + Optional tokenType; + + @JsonProperty("expires_in") + Optional expiresInMs; + + } + +} diff --git a/src/main/java/dev/plexapi/sdk/utils/Utf8UrlEncoder.java b/src/main/java/dev/plexapi/sdk/utils/Utf8UrlEncoder.java new file mode 100644 index 00000000..78fb8847 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/Utf8UrlEncoder.java @@ -0,0 +1,117 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.utils; + +import java.io.CharArrayWriter; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.BitSet; +import java.util.Objects; + +// Internal use only +// TODO move to an internal package +public final class Utf8UrlEncoder { + + private static final BitSet DO_NOT_ENCODE_CHARS = createDoNotEncodeChars(); + private static final int CASE_DIFF = ('a' - 'A'); + + private final BitSet safeChars; + + public static final Utf8UrlEncoder ALLOW_RESERVED = new Utf8UrlEncoder(":/?#[]@!$&'()*+,;="); + public static final Utf8UrlEncoder DEFAULT = new Utf8UrlEncoder(""); + + public static Utf8UrlEncoder allowReserved(boolean allowReserved) { + return allowReserved ? ALLOW_RESERVED : DEFAULT; + } + + private Utf8UrlEncoder(String safeCharacters) { + Objects.requireNonNull(safeCharacters, "safeCharacters"); + int max = -1; + for (int i = 0; i < safeCharacters.length(); i++) { + char ch = safeCharacters.charAt(i); + max = Math.max(ch, max); + } + BitSet safeChars = new BitSet(max + 1); + for (int i = 0; i < safeCharacters.length(); i++) { + char ch = safeCharacters.charAt(i); + safeChars.set(ch); + } + this.safeChars = safeChars; + } + + public String encode(String s) { + return encode(s, StandardCharsets.UTF_8); + } + + private String encode(String s, Charset charset) { + boolean changed = false; + StringBuilder out = new StringBuilder(s.length()); + CharArrayWriter writer = new CharArrayWriter(); + + for (int i = 0; i < s.length();) { + int c = (int) s.charAt(i); + if (DO_NOT_ENCODE_CHARS.get(c) || safeChars.get(c)) { + out.append((char) c); + i++; + } else { + // convert to external encoding before hex conversion + do { + writer.write(c); + if (c >= 0xD800 && c <= 0xDBFF) { + if ((i + 1) < s.length()) { + int d = (int) s.charAt(i + 1); + if (d >= 0xDC00 && d <= 0xDFFF) { + writer.write(d); + i++; + } + } + } + i++; + } while (i < s.length() && !DO_NOT_ENCODE_CHARS.get((c = (int) s.charAt(i)))); + + writer.flush(); + String str = new String(writer.toCharArray()); + byte[] ba = str.getBytes(charset); + for (int j = 0; j < ba.length; j++) { + out.append('%'); + char ch = Character.forDigit((ba[j] >> 4) & 0xF, 16); + // converting to use uppercase letter as part of + // the hex value if ch is a letter. + if (Character.isLetter(ch)) { + ch -= CASE_DIFF; + } + out.append(ch); + ch = Character.forDigit(ba[j] & 0xF, 16); + if (Character.isLetter(ch)) { + ch -= CASE_DIFF; + } + out.append(ch); + } + writer.reset(); + changed = true; + } + } + + return (changed ? out.toString() : s); + } + + private static BitSet createDoNotEncodeChars() { + BitSet b = new BitSet(256); + for (int i = 'a'; i <= 'z'; i++) { + b.set(i); + } + for (int i = 'A'; i <= 'Z'; i++) { + b.set(i); + } + for (int i = '0'; i <= '9'; i++) { + b.set(i); + } + b.set('-'); + b.set('_'); + b.set('.'); + b.set('*'); + return b; + } +} diff --git a/src/main/java/dev/plexapi/sdk/utils/Utils.java b/src/main/java/dev/plexapi/sdk/utils/Utils.java index ef74dc2b..cc7a82a4 100644 --- a/src/main/java/dev/plexapi/sdk/utils/Utils.java +++ b/src/main/java/dev/plexapi/sdk/utils/Utils.java @@ -15,8 +15,6 @@ import java.lang.reflect.Method; import java.math.BigDecimal; import java.math.BigInteger; import java.net.URI; -import java.net.URISyntaxException; -import java.net.URLEncoder; import java.net.http.HttpClient.Version; import java.net.http.HttpHeaders; import java.net.http.HttpRequest; @@ -25,6 +23,8 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; @@ -39,7 +39,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.NoSuchElementException; import java.util.Optional; -import java.util.UUID; import java.util.concurrent.Callable; import java.util.function.BiPredicate; import java.util.regex.Matcher; @@ -51,7 +50,6 @@ import java.util.stream.StreamSupport; import javax.net.ssl.SSLSession; import org.apache.commons.io.IOUtils; -import org.apache.http.NameValuePair; import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.core.JsonProcessingException; @@ -144,7 +142,9 @@ public final class Utils { pathParams.put(pathParamsMetadata.name, String.join(",", - array.stream().map(v -> valToString(v)) + array.stream() + .map(v -> valToString(v)) + .map(v -> pathEncode(v, pathParamsMetadata.allowReserved)) .collect(Collectors.toList()))); break; case MAP: @@ -156,17 +156,17 @@ public final class Utils { pathParams.put(pathParamsMetadata.name, String.join(",", map.entrySet().stream().map(e -> { if (pathParamsMetadata.explode) { - return String.format("%s=%s", valToString(e.getKey()), - valToString(e.getValue())); + return String.format("%s=%s", pathEncode(valToString(e.getKey()), false), + pathEncode(valToString(e.getValue()), false)); } else { - return String.format("%s,%s", valToString(e.getKey()), - valToString(e.getValue())); + return String.format("%s,%s", pathEncode(valToString(e.getKey()), false), + pathEncode(valToString(e.getValue()), false)); } }).collect(Collectors.toList()))); break; case OBJECT: if (!allowIntrospection(value.getClass())) { - pathParams.put(pathParamsMetadata.name, valToString(value)); + pathParams.put(pathParamsMetadata.name, pathEncode(valToString(value), pathParamsMetadata.allowReserved)); break; } List values = new ArrayList<>(); @@ -187,17 +187,17 @@ public final class Utils { if (pathParamsMetadata.explode) { values.add(String.format("%s=%s", valuePathParamsMetadata.name, - valToString(val))); + pathEncode(valToString(val), valuePathParamsMetadata.allowReserved))); } else { values.add(String.format("%s,%s", valuePathParamsMetadata.name, - valToString(val))); + pathEncode(valToString(val), valuePathParamsMetadata.allowReserved))); } } pathParams.put(pathParamsMetadata.name, String.join(",", values)); break; default: - pathParams.put(pathParamsMetadata.name, valToString(value)); + pathParams.put(pathParamsMetadata.name, pathEncode(valToString(value), pathParamsMetadata.allowReserved)); break; } } @@ -206,6 +206,10 @@ public final class Utils { return baseURL + templateUrl(path, pathParams); } + + private static String pathEncode(String s, boolean allowReserved) { + return Utf8UrlEncoder.allowReserved(allowReserved).encode(s); + } public static boolean contentTypeMatches(String contentType, String pattern) { if (contentType == null || contentType.isBlank()) { @@ -256,7 +260,7 @@ public final class Utils { return RequestBody.serialize(request, requestField, serializationMethod, nullable); } - public static List getQueryParams(Class type, Optional params, + public static List getQueryParams(Class type, Optional params, Map>> globals) throws Exception { if (params.isEmpty()) { return Collections.emptyList(); @@ -265,7 +269,7 @@ public final class Utils { } } - public static List getQueryParams(Class type, JsonNullable params, + public static List getQueryParams(Class type, JsonNullable params, Map>> globals) throws Exception { if (!params.isPresent() || params.get() == null) { return Collections.emptyList(); @@ -274,7 +278,7 @@ public final class Utils { } } - public static List getQueryParams(Class type, T params, + public static List getQueryParams(Class type, T params, Map>> globals) throws Exception { return QueryParameters.parseQueryParams(type, params, globals); } @@ -282,6 +286,8 @@ public final class Utils { public static HTTPRequest configureSecurity(HTTPRequest request, Object security) throws Exception { return Security.configureSecurity(request, security); } + + private static final String DOLLAR_MARKER = "D9qPtyhOYzkHGu3c"; public static String templateUrl(String url, Map params) { StringBuilder sb = new StringBuilder(); @@ -294,12 +300,16 @@ public final class Utils { String key = match.substring(1, match.length() - 1); String value = params.get(key); if (value != null) { - m.appendReplacement(sb, URLEncoder.encode(value, StandardCharsets.UTF_8)); + // note that we replace $ characters in values with a marker + // and then replace the markers at the end with the $ characters + // because the presence of dollar signs can stuff up the next + // regex find + m.appendReplacement(sb, value.replace("$", DOLLAR_MARKER)); } } m.appendTail(sb); - return sb.toString(); + return sb.toString().replace(DOLLAR_MARKER, "$"); } public static Map> getHeadersFromMetadata(Object headers, Map>> globals) throws Exception { @@ -474,7 +484,7 @@ public final class Utils { case "json": ObjectMapper mapper = JSON.getMapper(); String json = mapper.writeValueAsString(value); - params.put(pathParamsMetadata.name, json); + params.put(pathParamsMetadata.name, pathEncode(json, pathParamsMetadata.allowReserved)); break; default: break; @@ -1167,18 +1177,29 @@ public final class Utils { return x.isPresent() && x.get() != null; } - private static final String OPEN_BRACKET_MARKER = UUID.randomUUID().toString().replace("-", ""); - private static final String CLOSE_BRACKET_MARKER = UUID.randomUUID().toString().replace("-", ""); - - public static String urlEncode(String s) { - // Ensure that complies with RFC 2732 (URLEncoder does not and we don't want to - // encode [, ] chars) - return URLEncoder.encode( // - s.replace("[", OPEN_BRACKET_MARKER) // - .replace("]", CLOSE_BRACKET_MARKER), // - StandardCharsets.UTF_8) // - .replace(OPEN_BRACKET_MARKER, "[") // - .replace(CLOSE_BRACKET_MARKER, "]"); + public static void setSseSentinel(Object o, String value) { + if (o == null || value.isBlank()) { + return; + } else { + try { + Field field = o.getClass().getDeclaredField("_eventSentinel"); + field.setAccessible(true); + field.set(o, Optional.of(value)); + } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { + // ignore + } + } } + public static String sessionKey(String... items) { + try { + MessageDigest md = MessageDigest.getInstance("MD5"); + String input = Arrays.stream(items).collect(Collectors.joining(":")); + byte[] bytes = md.digest(input.getBytes(StandardCharsets.UTF_8)); + return Utils.bytesToLowerCaseHex(bytes); + } catch (NoSuchAlgorithmException e) { + // not expected, MD5 always available + throw new RuntimeException(e); + } + } }