diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index db373ce2..645a6a8d 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,21 +1,22 @@ lockVersion: 2.0.0 id: 1732900d-e173-47c1-a90d-d45182eb35d9 management: - docChecksum: 5bf578a672589649d8ed83c3927c50a6 + docChecksum: 1b63d7c28734a44b0339f405b186b290 docVersion: 0.0.3 - speakeasyVersion: 1.399.2 - generationVersion: 2.416.6 - releaseVersion: 0.3.6 - configChecksum: 106e80c4c09cf1eee551ea41f14701cc + speakeasyVersion: 1.401.2 + generationVersion: 2.421.3 + releaseVersion: 0.4.0 + configChecksum: 8e36b45a8af7b4ad5e3b9282e78c4318 repoURL: https://github.com/LukeHagar/plexjava.git published: true features: java: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.1 - core: 3.29.7 + core: 3.30.1 deprecations: 2.81.1 downloadStreams: 0.1.1 + enums: 2.81.2 errors: 0.1.3 flattening: 2.81.1 globalSecurity: 2.82.7 @@ -426,15 +427,21 @@ generatedFiles: - docs/models/operations/GetLibraryHubsWriter.md - docs/models/operations/GetLibraryItemsCountry.md - docs/models/operations/GetLibraryItemsDirector.md + - docs/models/operations/GetLibraryItemsField.md + - docs/models/operations/GetLibraryItemsFieldType.md + - docs/models/operations/GetLibraryItemsFilter.md - docs/models/operations/GetLibraryItemsGenre.md - docs/models/operations/GetLibraryItemsMedia.md - docs/models/operations/GetLibraryItemsMediaContainer.md - docs/models/operations/GetLibraryItemsMetadata.md + - docs/models/operations/GetLibraryItemsOperator.md - docs/models/operations/GetLibraryItemsPart.md - docs/models/operations/GetLibraryItemsRequest.md - docs/models/operations/GetLibraryItemsResponse.md - docs/models/operations/GetLibraryItemsResponseBody.md - docs/models/operations/GetLibraryItemsRole.md + - docs/models/operations/GetLibraryItemsSort.md + - docs/models/operations/GetLibraryItemsType.md - docs/models/operations/GetLibraryItemsWriter.md - docs/models/operations/GetMediaProvidersDirectory.md - docs/models/operations/GetMediaProvidersMediaContainer.md @@ -626,8 +633,10 @@ generatedFiles: - docs/models/operations/MarkUnplayedResponse.md - docs/models/operations/Media.md - docs/models/operations/MediaContainer.md + - docs/models/operations/MediaGuid.md - docs/models/operations/MediaProvider.md - docs/models/operations/MediaReviewsVisibility.md + - docs/models/operations/Meta.md - docs/models/operations/Metadata.md - docs/models/operations/MinSize.md - docs/models/operations/MyPlex.md @@ -654,7 +663,6 @@ generatedFiles: - docs/models/operations/PostUsersSignInDataFeatures.md - docs/models/operations/PostUsersSignInDataMailingListStatus.md - docs/models/operations/PostUsersSignInDataMediaReviewsVisibility.md - - docs/models/operations/PostUsersSignInDataRequest.md - docs/models/operations/PostUsersSignInDataRequestBody.md - docs/models/operations/PostUsersSignInDataResponse.md - docs/models/operations/PostUsersSignInDataServices.md @@ -665,6 +673,7 @@ generatedFiles: - docs/models/operations/PostUsersSignInDataUserProfile.md - docs/models/operations/PostUsersSignInDataWatchedIndicator.md - docs/models/operations/Producer.md + - docs/models/operations/Protocol.md - docs/models/operations/Provider.md - docs/models/operations/QueryParamFilter.md - docs/models/operations/QueryParamForce.md @@ -1178,16 +1187,22 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsWriter.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsCountry.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsDirector.java + - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsField.java + - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsFieldType.java + - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsFilter.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsGenre.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMedia.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMediaContainer.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMetadata.java + - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOperator.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsPart.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequest.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequestBuilder.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsResponse.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsResponseBody.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRole.java + - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsSort.java + - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsType.java - src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsWriter.java - src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersDirectory.java - src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersMediaContainer.java @@ -1418,8 +1433,10 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/models/operations/MarkUnplayedResponse.java - src/main/java/dev/plexapi/sdk/models/operations/Media.java - src/main/java/dev/plexapi/sdk/models/operations/MediaContainer.java + - src/main/java/dev/plexapi/sdk/models/operations/MediaGuid.java - src/main/java/dev/plexapi/sdk/models/operations/MediaProvider.java - src/main/java/dev/plexapi/sdk/models/operations/MediaReviewsVisibility.java + - src/main/java/dev/plexapi/sdk/models/operations/Meta.java - src/main/java/dev/plexapi/sdk/models/operations/Metadata.java - src/main/java/dev/plexapi/sdk/models/operations/MinSize.java - src/main/java/dev/plexapi/sdk/models/operations/MyPlex.java @@ -1448,7 +1465,6 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataFeatures.java - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMailingListStatus.java - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMediaReviewsVisibility.java - - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequest.java - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequestBody.java - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequestBuilder.java - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataResponse.java @@ -1460,6 +1476,7 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataUserProfile.java - src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataWatchedIndicator.java - src/main/java/dev/plexapi/sdk/models/operations/Producer.java + - src/main/java/dev/plexapi/sdk/models/operations/Protocol.java - src/main/java/dev/plexapi/sdk/models/operations/Provider.java - src/main/java/dev/plexapi/sdk/models/operations/QueryParamFilter.java - src/main/java/dev/plexapi/sdk/models/operations/QueryParamForce.java @@ -1621,7 +1638,7 @@ examples: width: 110 height: 165 opacity: 100 - blur: 20 + blur: 0 minSize: 1 upscale: 0 url: "/library/metadata/49564/thumb/1654258204" @@ -1876,10 +1893,10 @@ examples: "": parameters: query: - X-Plex-Product: Plex Web - X-Plex-Device: Linux - X-Plex-Version: 4.133.0 - X-Plex-Platform: Chrome + X-Plex-Product: "Plex Web" + X-Plex-Device: "Linux" + X-Plex-Version: "4.133.0" + X-Plex-Platform: "Chrome" responses: "200": application/json: {"id": 308667304, "code": "7RQZ", "product": "0", "trusted": false, "qr": "https://plex.tv/api/v2/pins/qr/7RQZ", "clientIdentifier": "string", "location": {"code": "VI", "continent_code": "NA", "country": "United States Virgin Islands", "city": "Amsterdam", "european_union_member": true, "time_zone": "America/St_Thomas", "postal_code": 802, "in_privacy_restricted_country": true, "in_privacy_restricted_region": true, "subdivisions": "Saint Thomas", "coordinates": "18.3381, -64.8941"}, "expiresIn": 876, "createdAt": "2024-07-16T17:03:05Z", "expiresAt": "2024-07-16T17:18:05Z", "authToken": null, "newRegistration": null} @@ -2030,6 +2047,24 @@ examples: application/json: {"errors": []} "400": application/json: {"errors": []} + speakeasy-default-get-library-items: + parameters: + path: + sectionKey: 9518 + tag: "edition" + query: + includeGuids: 1 + includeMeta: 1 + type: 2 + X-Plex-Container-Start: 0 + X-Plex-Container-Size: 50 + responses: + "200": + application/json: {"MediaContainer": {"size": 70, "allowSync": true, "art": "/:/resources/movie-fanart.jpg", "identifier": "com.plexapp.plugins.library", "librarySectionID": "", "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", "type": "movie", "title": "Avatar: The Way of Water", "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, "tagline": "Return to Pandora.", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1680457607, "updatedAt": 1703239236, "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", "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, "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "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", "videoProfile": "main 10"}, {"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", "videoProfile": "main 10"}, {"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", "videoProfile": "main 10"}]}], "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"}], "Role": [{"tag": "Sigourney Weaver"}, {"tag": "Sigourney Weaver"}, {"tag": "Sigourney Weaver"}], "Guid": [{"id": "imdb://tt13015952"}], "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", "type": "movie", "title": "Avatar: The Way of Water", "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, "tagline": "Return to Pandora.", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1680457607, "updatedAt": 1703239236, "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", "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, "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "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", "videoProfile": "main 10"}]}], "Genre": [], "Country": [{"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Role": [{"tag": "Sigourney Weaver"}, {"tag": "Sigourney Weaver"}, {"tag": "Sigourney Weaver"}], "Guid": [{"id": "imdb://tt13015952"}], "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": + application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} get-refresh-library-metadata: speakeasy-default-get-refresh-library-metadata: parameters: @@ -2275,6 +2310,7 @@ examples: query: path: "/home/barkley/playlist.m3u" force: 0 + sectionID: 1 responses: "401": application/json: {"errors": []} @@ -2295,7 +2331,7 @@ examples: speakeasy-default-get-source-connection-information: parameters: query: - source: "server://client-identifier" + source: "provider://provider-identifier" responses: "401": application/json: {"errors": []} @@ -2317,7 +2353,7 @@ examples: application/x-www-form-urlencoded: {"login": "username@email.com", "password": "password123", "verificationCode": "123456"} responses: "201": - application/json: {"adsConsent": true, "adsConsentReminderAt": "2019-08-24T14:15:22Z", "adsConsentSetAt": "2019-08-24T14:15:22Z", "anonymous": false, "authToken": "CxoUzBTSV5hsxjTpFKaf", "backupCodesCreated": false, "confirmed": false, "country": "US", "email": "username@email.com", "emailOnlyAuth": false, "experimentalFeatures": false, "friendlyName": "friendlyUsername", "entitlements": [], "guest": false, "hasPassword": true, "home": false, "homeAdmin": false, "homeSize": 1, "id": 13692262, "joinedAt": 1721154902, "locale": null, "mailingListActive": false, "mailingListStatus": "unsubscribed", "maxHomeSize": 15, "pin": "string", "profile": {"autoSelectAudio": true, "defaultAudioLanguage": "ja", "defaultSubtitleLanguage": "en", "autoSelectSubtitle": "1", "defaultSubtitleAccessibility": "1", "defaultSubtitleForced": "0", "watchedIndicator": "1", "mediaReviewsVisibility": 0}, "protected": false, "rememberExpiresAt": 1722364046, "restricted": false, "roles": ["string"], "scrobbleTypes": "", "services": [{"identifier": "metadata-dev", "endpoint": "https://epg.provider.plex.tv", "token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", "secret": "string", "status": "online"}], "subscription": {"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}, "subscriptionDescription": "string", "subscriptions": [{"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}], "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101", "title": "UsernameTitle", "twoFactorEnabled": false, "username": "Username", "uuid": "dae343c1f45beb4f", "pastSubscriptions": [{"id": "string", "mode": "string", "renewsAt": "string", "endsAt": "1556281940", "canceled": "0", "gracePeriod": "0", "onHold": "0", "canReactivate": "0", "canUpgrade": "0", "canDowngrade": "0", "canConvert": "0", "type": "plexpass", "transfer": "string", "state": "ended", "billing": {"paymentMethodId": 569045}}], "trials": [{}]} + application/json: {"adsConsent": true, "adsConsentReminderAt": "2019-08-24T14:15:22Z", "adsConsentSetAt": "2019-08-24T14:15:22Z", "anonymous": false, "authToken": "CxoUzBTSV5hsxjTpFKaf", "backupCodesCreated": false, "confirmed": false, "country": "US", "email": "username@email.com", "emailOnlyAuth": false, "experimentalFeatures": false, "friendlyName": "friendlyUsername", "entitlements": ["[]"], "guest": false, "hasPassword": true, "home": false, "homeAdmin": false, "homeSize": 1, "id": 13692262, "joinedAt": 1556281940, "locale": null, "mailingListActive": false, "mailingListStatus": "unsubscribed", "maxHomeSize": 15, "pin": "string", "profile": {"autoSelectAudio": true, "defaultAudioLanguage": "ja", "defaultSubtitleLanguage": "en", "autoSelectSubtitle": 1, "defaultSubtitleAccessibility": 1, "defaultSubtitleForced": 1, "watchedIndicator": 1, "mediaReviewsVisibility": 1}, "protected": false, "rememberExpiresAt": 1556281940, "restricted": false, "roles": ["string"], "scrobbleTypes": "", "services": [{"identifier": "metadata-dev", "endpoint": "https://epg.provider.plex.tv", "token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", "secret": "string", "status": "online"}], "subscription": {"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}, "subscriptionDescription": "string", "subscriptions": [{"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}], "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101", "title": "UsernameTitle", "twoFactorEnabled": false, "username": "Username", "uuid": "dae343c1f45beb4f", "pastSubscriptions": [{"id": "string", "mode": "string", "renewsAt": 1556281940, "endsAt": 1556281940, "canceled": false, "gracePeriod": false, "onHold": false, "canReactivate": false, "canUpgrade": false, "canDowngrade": false, "canConvert": false, "type": "plexpass", "transfer": "string", "state": "ended", "billing": {"paymentMethodId": 481656}}], "trials": [{}]} "401": application/json: {"errors": []} "400": @@ -2498,7 +2534,7 @@ examples: speakeasy-default-get-token-details: responses: "200": - application/json: {"adsConsent": true, "adsConsentReminderAt": "2019-08-24T14:15:22Z", "adsConsentSetAt": "2019-08-24T14:15:22Z", "anonymous": false, "authToken": "CxoUzBTSV5hsxjTpFKaf", "backupCodesCreated": false, "confirmed": false, "country": "US", "email": "username@email.com", "emailOnlyAuth": false, "experimentalFeatures": false, "friendlyName": "friendlyUsername", "entitlements": [], "guest": false, "hasPassword": true, "home": false, "homeAdmin": false, "homeSize": 1, "id": 13692262, "joinedAt": 1721154902, "locale": null, "mailingListActive": false, "mailingListStatus": "unsubscribed", "maxHomeSize": 15, "pin": "string", "profile": {"autoSelectAudio": true, "defaultAudioLanguage": "ja", "defaultSubtitleLanguage": "en", "autoSelectSubtitle": "1", "defaultSubtitleAccessibility": "1", "defaultSubtitleForced": "0", "watchedIndicator": "1", "mediaReviewsVisibility": 0}, "protected": false, "rememberExpiresAt": 1722364046, "restricted": false, "roles": ["string"], "scrobbleTypes": "", "services": [{"identifier": "metadata-dev", "endpoint": "https://epg.provider.plex.tv", "token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", "secret": "string", "status": "online"}], "subscription": {"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}, "subscriptionDescription": "string", "subscriptions": [{"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}], "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101", "title": "UsernameTitle", "twoFactorEnabled": false, "username": "Username", "uuid": "dae343c1f45beb4f"} + application/json: {"adsConsent": true, "adsConsentReminderAt": "2019-08-24T14:15:22Z", "adsConsentSetAt": "2019-08-24T14:15:22Z", "anonymous": false, "authToken": "CxoUzBTSV5hsxjTpFKaf", "backupCodesCreated": false, "confirmed": false, "country": "US", "email": "username@email.com", "emailOnlyAuth": false, "experimentalFeatures": false, "friendlyName": "friendlyUsername", "entitlements": ["[]"], "guest": false, "hasPassword": true, "home": false, "homeAdmin": false, "homeSize": 1, "id": 13692262, "joinedAt": 1556281940, "locale": null, "mailingListActive": false, "mailingListStatus": "unsubscribed", "maxHomeSize": 15, "pin": "string", "profile": {"autoSelectAudio": true, "defaultAudioLanguage": "ja", "defaultSubtitleLanguage": "en", "autoSelectSubtitle": 1, "defaultSubtitleAccessibility": 1, "defaultSubtitleForced": 1, "watchedIndicator": 1, "mediaReviewsVisibility": 1}, "protected": false, "rememberExpiresAt": 1556281940, "restricted": false, "roles": ["string"], "scrobbleTypes": "", "services": [{"identifier": "metadata-dev", "endpoint": "https://epg.provider.plex.tv", "token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", "secret": "string", "status": "online"}], "subscription": {"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}, "subscriptionDescription": "string", "subscriptions": [{"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}], "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101", "title": "UsernameTitle", "twoFactorEnabled": false, "username": "Username", "uuid": "dae343c1f45beb4f"} "400": application/json: {"errors": []} "401": diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index e8b63701..1f1d1b52 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true java: - version: 0.3.6 + version: 0.4.0 additionalDependencies: [] additionalPlugins: [] artifactID: plexapi diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index e920667d..a6bfabdb 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.399.2 +speakeasyVersion: 1.401.2 sources: my-source: sourceNamespace: my-source @@ -8,8 +8,8 @@ sources: - latest plexapi: sourceNamespace: plexapi - sourceRevisionDigest: sha256:31e943dab53dd0133fcd12a24e04d511637bd7f37b78fd71efded53c650bf729 - sourceBlobDigest: sha256:a652fa39754f0c22a1454f628fe84983b34662ee8a153a3461d50b833f8bc5c2 + sourceRevisionDigest: sha256:5aa71ad96ca6de91143ee513c9880e08e555e7748fb4b5f8d069c6ab0c8f3069 + sourceBlobDigest: sha256:1cbef844e2856c2eabba4bd6d677d96c572fed13b27978d0d953aa06b224c02f tags: - latest - main @@ -17,10 +17,10 @@ targets: plexjava: source: plexapi sourceNamespace: plexapi - sourceRevisionDigest: sha256:31e943dab53dd0133fcd12a24e04d511637bd7f37b78fd71efded53c650bf729 - sourceBlobDigest: sha256:a652fa39754f0c22a1454f628fe84983b34662ee8a153a3461d50b833f8bc5c2 + sourceRevisionDigest: sha256:5aa71ad96ca6de91143ee513c9880e08e555e7748fb4b5f8d069c6ab0c8f3069 + sourceBlobDigest: sha256:1cbef844e2856c2eabba4bd6d677d96c572fed13b27978d0d953aa06b224c02f codeSamplesNamespace: code-samples-java-plexjava - codeSamplesRevisionDigest: sha256:573447c09306bdcc7cfddf7a74130c0bc1d3596050a8108ad85819c2afd5efb6 + codeSamplesRevisionDigest: sha256:e98bd3fd8e811e5368343de5de5c1f0c7d154bf8ab1b56532fe72b65bc70297c workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index c523487d..f06b6175 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'dev.plexapi:plexapi:0.3.6' +implementation 'dev.plexapi:plexapi:0.4.0' ``` Maven: @@ -45,7 +45,7 @@ Maven: dev.plexapi plexapi - 0.3.6 + 0.4.0 ``` @@ -73,43 +73,30 @@ gradlew.bat publishToMavenLocal -Pskip.signing package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized; import dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() + GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -252,7 +239,7 @@ public class Application { Certain parameters are configured globally. These parameters may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, These global values will be used as defaults on the operations that use them. When such operations are called, there is a place in each to override the global value, if needed. -For example, you can set `ClientID` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getServerResources`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration. +For example, you can set `ClientID` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration. ### Available Globals @@ -277,50 +264,33 @@ This is used to track the client application and its usage package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; -import dev.plexapi.sdk.models.operations.GetServerResourcesResponse; -import dev.plexapi.sdk.models.operations.IncludeHttps; -import dev.plexapi.sdk.models.operations.IncludeIPv6; -import dev.plexapi.sdk.models.operations.IncludeRelay; +import dev.plexapi.sdk.models.errors.GetPinBadRequest; +import dev.plexapi.sdk.models.operations.GetPinRequest; +import dev.plexapi.sdk.models.operations.GetPinResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") + public static void main(String[] args) throws GetPinBadRequest, Exception { + + PlexAPI sdk = PlexAPI.builder() .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") + .build(); + + GetPinRequest req = GetPinRequest.builder() .build(); - GetServerResourcesResponse res = sdk.plex().getServerResources() - .clientID("gcgzw5rz2xovp84b4vha3a40") - .includeHttps(IncludeHttps.ONE) - .includeRelay(IncludeRelay.ONE) - .includeIPv6(IncludeIPv6.ONE) + GetPinResponse res = sdk.plex().getPin() + .request(req) .call(); - if (res.plexDevices().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetServerResourcesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetServerResourcesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.authPinContainer().isPresent()) { + // handle response } - } } ``` @@ -343,43 +313,30 @@ Handling errors in this SDK should largely match your expectations. All operati package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized; import dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() + GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -402,15 +359,16 @@ You can override the default server globally by passing a server index to the `s package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized; import dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .serverIndex(0) .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") @@ -418,28 +376,14 @@ public class Application { .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() + GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -458,15 +402,16 @@ The default server can also be overridden globally by passing a URL to the `serv package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized; import dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .serverURL("{protocol}://{ip}:{port}") .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") @@ -474,28 +419,14 @@ public class Application { .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() + GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -507,44 +438,31 @@ The server URL can also be overridden on a per-operation basis, provided a serve package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetCompanionsDataBadRequest; +import dev.plexapi.sdk.models.errors.GetCompanionsDataUnauthorized; import dev.plexapi.sdk.models.operations.GetCompanionsDataResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetCompanionsDataBadRequest, GetCompanionsDataUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetCompanionsDataResponse res = sdk.plex().getCompanionsData() + GetCompanionsDataResponse res = sdk.plex().getCompanionsData() .serverURL("https://plex.tv/api/v2/") .call(); - if (res.responseBodies().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetCompanionsDataBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetCompanionsDataUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.responseBodies().isPresent()) { + // handle response } - } } ``` @@ -566,43 +484,30 @@ To authenticate with the API the `accessToken` parameter must be set when initia package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized; import dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() + GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` diff --git a/RELEASES.md b/RELEASES.md index 3c2d7df3..83b13b6e 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -68,4 +68,14 @@ Based on: ### Generated - [java v0.3.6] . ### Releases -- [Maven Central v0.3.6] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.3.6 - . \ No newline at end of file +- [Maven Central v0.3.6] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.3.6 - . + +## 2024-09-21 00:24:14 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.401.2 (2.421.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v0.4.0] . +### Releases +- [Maven Central v0.4.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.4.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 57dd044d..64231c75 100644 --- a/USAGE.md +++ b/USAGE.md @@ -3,43 +3,30 @@ package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized; import dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() + GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` diff --git a/build.gradle b/build.gradle index 4d5325a4..18ca6da1 100644 --- a/build.gradle +++ b/build.gradle @@ -63,7 +63,7 @@ tasks.withType(Javadoc) { } group = "dev.plexapi" -version = "0.3.6" +version = "0.4.0" sourcesJar { archiveBaseName = "plexapi" @@ -101,7 +101,7 @@ publishing { maven(MavenPublication) { groupId = 'dev.plexapi' artifactId = 'plexapi' - version = '0.3.6' + version = '0.4.0' from components.java diff --git a/codeSamples.yaml b/codeSamples.yaml index 82499a53..eecfb557 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -12,43 +12,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetServerCapabilitiesBadRequest; + import dev.plexapi.plexapi.models.errors.GetServerCapabilitiesUnauthorized; import dev.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() + GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetServerCapabilitiesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetServerCapabilitiesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/:/prefs"]["get"] @@ -60,43 +47,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetServerPreferencesBadRequest; + import dev.plexapi.plexapi.models.errors.GetServerPreferencesUnauthorized; import dev.plexapi.plexapi.models.operations.GetServerPreferencesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerPreferencesBadRequest, GetServerPreferencesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerPreferencesResponse res = sdk.server().getServerPreferences() + GetServerPreferencesResponse res = sdk.server().getServerPreferences() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetServerPreferencesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetServerPreferencesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/:/progress"]["post"] @@ -108,44 +82,31 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.UpdatePlayProgressBadRequest; + import dev.plexapi.plexapi.models.errors.UpdatePlayProgressUnauthorized; import dev.plexapi.plexapi.models.operations.UpdatePlayProgressResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws UpdatePlayProgressBadRequest, UpdatePlayProgressUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - UpdatePlayProgressResponse res = sdk.media().updatePlayProgress() + UpdatePlayProgressResponse res = sdk.media().updatePlayProgress() .key("") .time(90000d) .state("played") .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.UpdatePlayProgressBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.UpdatePlayProgressUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/:/scrobble"]["get"] @@ -157,42 +118,29 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.MarkPlayedBadRequest; + import dev.plexapi.plexapi.models.errors.MarkPlayedUnauthorized; import dev.plexapi.plexapi.models.operations.MarkPlayedResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws MarkPlayedBadRequest, MarkPlayedUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - MarkPlayedResponse res = sdk.media().markPlayed() + MarkPlayedResponse res = sdk.media().markPlayed() .key(59398d) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.MarkPlayedBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.MarkPlayedUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/:/timeline"]["get"] @@ -204,7 +152,8 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetTimelineBadRequest; + import dev.plexapi.plexapi.models.errors.GetTimelineUnauthorized; import dev.plexapi.plexapi.models.operations.GetTimelineRequest; import dev.plexapi.plexapi.models.operations.GetTimelineResponse; import dev.plexapi.plexapi.models.operations.State; @@ -212,18 +161,18 @@ actions: public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetTimelineBadRequest, GetTimelineUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetTimelineRequest req = GetTimelineRequest.builder() + GetTimelineRequest req = GetTimelineRequest.builder() .ratingKey(23409d) .key("/library/metadata/23409") .state(State.PLAYING) @@ -236,25 +185,11 @@ actions: .row(1d) .build(); - GetTimelineResponse res = sdk.video().getTimeline() + GetTimelineResponse res = sdk.video().getTimeline() .request(req) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.GetTimelineBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetTimelineUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/:/unscrobble"]["get"] @@ -266,42 +201,29 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.MarkUnplayedBadRequest; + import dev.plexapi.plexapi.models.errors.MarkUnplayedUnauthorized; import dev.plexapi.plexapi.models.operations.MarkUnplayedResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws MarkUnplayedBadRequest, MarkUnplayedUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - MarkUnplayedResponse res = sdk.media().markUnplayed() + MarkUnplayedResponse res = sdk.media().markUnplayed() .key(59398d) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.MarkUnplayedBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.MarkUnplayedUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/activities"]["get"] @@ -313,43 +235,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetServerActivitiesBadRequest; + import dev.plexapi.plexapi.models.errors.GetServerActivitiesUnauthorized; import dev.plexapi.plexapi.models.operations.GetServerActivitiesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerActivitiesBadRequest, GetServerActivitiesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerActivitiesResponse res = sdk.activities().getServerActivities() + GetServerActivitiesResponse res = sdk.activities().getServerActivities() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetServerActivitiesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetServerActivitiesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/activities/{activityUUID}"]["delete"] @@ -361,42 +270,29 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.CancelServerActivitiesBadRequest; + import dev.plexapi.plexapi.models.errors.CancelServerActivitiesUnauthorized; import dev.plexapi.plexapi.models.operations.CancelServerActivitiesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws CancelServerActivitiesBadRequest, CancelServerActivitiesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities() + CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities() .activityUUID("25b71ed5-0f9d-461c-baa7-d404e9e10d3e") .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.CancelServerActivitiesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.CancelServerActivitiesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/butler"]["delete"] @@ -408,41 +304,28 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.StopAllTasksBadRequest; + import dev.plexapi.plexapi.models.errors.StopAllTasksUnauthorized; import dev.plexapi.plexapi.models.operations.StopAllTasksResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws StopAllTasksBadRequest, StopAllTasksUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - StopAllTasksResponse res = sdk.butler().stopAllTasks() + StopAllTasksResponse res = sdk.butler().stopAllTasks() .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.StopAllTasksBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.StopAllTasksUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/butler"]["get"] @@ -454,43 +337,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetButlerTasksBadRequest; + import dev.plexapi.plexapi.models.errors.GetButlerTasksUnauthorized; import dev.plexapi.plexapi.models.operations.GetButlerTasksResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetButlerTasksBadRequest, GetButlerTasksUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetButlerTasksResponse res = sdk.butler().getButlerTasks() + GetButlerTasksResponse res = sdk.butler().getButlerTasks() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetButlerTasksBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetButlerTasksUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/butler"]["post"] @@ -502,41 +372,28 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.StartAllTasksBadRequest; + import dev.plexapi.plexapi.models.errors.StartAllTasksUnauthorized; import dev.plexapi.plexapi.models.operations.StartAllTasksResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws StartAllTasksBadRequest, StartAllTasksUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - StartAllTasksResponse res = sdk.butler().startAllTasks() + StartAllTasksResponse res = sdk.butler().startAllTasks() .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.StartAllTasksBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.StartAllTasksUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/butler/{taskName}"]["delete"] @@ -548,43 +405,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.StopTaskBadRequest; + import dev.plexapi.plexapi.models.errors.StopTaskUnauthorized; import dev.plexapi.plexapi.models.operations.PathParamTaskName; import dev.plexapi.plexapi.models.operations.StopTaskResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws StopTaskBadRequest, StopTaskUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - StopTaskResponse res = sdk.butler().stopTask() + StopTaskResponse res = sdk.butler().stopTask() .taskName(PathParamTaskName.BACKUP_DATABASE) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.StopTaskBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.StopTaskUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/butler/{taskName}"]["post"] @@ -596,43 +440,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.StartTaskBadRequest; + import dev.plexapi.plexapi.models.errors.StartTaskUnauthorized; import dev.plexapi.plexapi.models.operations.StartTaskResponse; import dev.plexapi.plexapi.models.operations.TaskName; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws StartTaskBadRequest, StartTaskUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - StartTaskResponse res = sdk.butler().startTask() + StartTaskResponse res = sdk.butler().startTask() .taskName(TaskName.CLEAN_OLD_BUNDLES) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.StartTaskBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.StartTaskUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/clients"]["get"] @@ -644,43 +475,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetAvailableClientsBadRequest; + import dev.plexapi.plexapi.models.errors.GetAvailableClientsUnauthorized; import dev.plexapi.plexapi.models.operations.GetAvailableClientsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetAvailableClientsBadRequest, GetAvailableClientsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetAvailableClientsResponse res = sdk.server().getAvailableClients() + GetAvailableClientsResponse res = sdk.server().getAvailableClients() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetAvailableClientsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetAvailableClientsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/companions"]["get"] @@ -692,43 +510,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetCompanionsDataBadRequest; + import dev.plexapi.plexapi.models.errors.GetCompanionsDataUnauthorized; import dev.plexapi.plexapi.models.operations.GetCompanionsDataResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetCompanionsDataBadRequest, GetCompanionsDataUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetCompanionsDataResponse res = sdk.plex().getCompanionsData() + GetCompanionsDataResponse res = sdk.plex().getCompanionsData() .call(); - if (res.responseBodies().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetCompanionsDataBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetCompanionsDataUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.responseBodies().isPresent()) { + // handle response } - } } - target: $["paths"]["/devices"]["get"] @@ -740,43 +545,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetDevicesBadRequest; + import dev.plexapi.plexapi.models.errors.GetDevicesUnauthorized; import dev.plexapi.plexapi.models.operations.GetDevicesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetDevicesBadRequest, GetDevicesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetDevicesResponse res = sdk.server().getDevices() + GetDevicesResponse res = sdk.server().getDevices() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetDevicesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetDevicesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/friends"]["get"] @@ -788,43 +580,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetUserFriendsBadRequest; + import dev.plexapi.plexapi.models.errors.GetUserFriendsUnauthorized; import dev.plexapi.plexapi.models.operations.GetUserFriendsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetUserFriendsBadRequest, GetUserFriendsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetUserFriendsResponse res = sdk.plex().getUserFriends() + GetUserFriendsResponse res = sdk.plex().getUserFriends() .call(); - if (res.friends().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetUserFriendsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetUserFriendsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.friends().isPresent()) { + // handle response } - } } - target: $["paths"]["/geoip"]["get"] @@ -836,42 +615,29 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetGeoDataBadRequest; + import dev.plexapi.plexapi.models.errors.GetGeoDataUnauthorized; import dev.plexapi.plexapi.models.operations.GetGeoDataResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetGeoDataBadRequest, GetGeoDataUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetGeoDataResponse res = sdk.plex().getGeoData() + GetGeoDataResponse res = sdk.plex().getGeoData() .call(); - if (res.geoData().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetGeoDataBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetGeoDataUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.geoData().isPresent()) { + // handle response } - } } - target: $["paths"]["/home"]["get"] @@ -883,43 +649,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetHomeDataBadRequest; + import dev.plexapi.plexapi.models.errors.GetHomeDataUnauthorized; import dev.plexapi.plexapi.models.operations.GetHomeDataResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetHomeDataBadRequest, GetHomeDataUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetHomeDataResponse res = sdk.plex().getHomeData() + GetHomeDataResponse res = sdk.plex().getHomeData() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetHomeDataBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetHomeDataUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/hubs"]["get"] @@ -931,46 +684,33 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetGlobalHubsBadRequest; + import dev.plexapi.plexapi.models.errors.GetGlobalHubsUnauthorized; import dev.plexapi.plexapi.models.operations.GetGlobalHubsResponse; import dev.plexapi.plexapi.models.operations.OnlyTransient; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetGlobalHubsBadRequest, GetGlobalHubsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs() + GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs() .count(1262.49d) .onlyTransient(OnlyTransient.ONE) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetGlobalHubsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetGlobalHubsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/hubs/search"]["get"] @@ -982,44 +722,31 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.PerformSearchBadRequest; + import dev.plexapi.plexapi.models.errors.PerformSearchUnauthorized; import dev.plexapi.plexapi.models.operations.PerformSearchResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws PerformSearchBadRequest, PerformSearchUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - PerformSearchResponse res = sdk.search().performSearch() - .query("arnold") - .sectionId(9372.7d) + PerformSearchResponse res = sdk.search().performSearch() + .query("dylan") + .sectionId(5838.67d) .limit(5d) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.PerformSearchBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.PerformSearchUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/hubs/search/voice"]["get"] @@ -1031,44 +758,31 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.PerformVoiceSearchBadRequest; + import dev.plexapi.plexapi.models.errors.PerformVoiceSearchUnauthorized; import dev.plexapi.plexapi.models.operations.PerformVoiceSearchResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws PerformVoiceSearchBadRequest, PerformVoiceSearchUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - PerformVoiceSearchResponse res = sdk.search().performVoiceSearch() + PerformVoiceSearchResponse res = sdk.search().performVoiceSearch() .query("dead+poop") - .sectionId(4094.8d) + .sectionId(4094.80d) .limit(5d) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.PerformVoiceSearchBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.PerformVoiceSearchUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/hubs/sections/{sectionId}"]["get"] @@ -1080,47 +794,34 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetLibraryHubsBadRequest; + import dev.plexapi.plexapi.models.errors.GetLibraryHubsUnauthorized; import dev.plexapi.plexapi.models.operations.GetLibraryHubsResponse; import dev.plexapi.plexapi.models.operations.QueryParamOnlyTransient; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetLibraryHubsBadRequest, GetLibraryHubsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs() + GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs() .sectionId(6728.76d) - .count(9010.22d) - .onlyTransient(QueryParamOnlyTransient.ZERO) + .count(639.24d) + .onlyTransient(QueryParamOnlyTransient.ONE) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetLibraryHubsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetLibraryHubsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/identity"]["get"] @@ -1132,39 +833,28 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetServerIdentityRequestTimeout; import dev.plexapi.plexapi.models.operations.GetServerIdentityResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerIdentityRequestTimeout, Exception { + + PlexAPI sdk = PlexAPI.builder() .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerIdentityResponse res = sdk.server().getServerIdentity() + GetServerIdentityResponse res = sdk.server().getServerIdentity() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetServerIdentityRequestTimeout e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/library/all/top"]["get"] @@ -1176,46 +866,33 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetTopWatchedContentBadRequest; + import dev.plexapi.plexapi.models.errors.GetTopWatchedContentUnauthorized; import dev.plexapi.plexapi.models.operations.GetTopWatchedContentQueryParamType; import dev.plexapi.plexapi.models.operations.GetTopWatchedContentResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetTopWatchedContentBadRequest, GetTopWatchedContentUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent() - .type(GetTopWatchedContentQueryParamType.TWO) + GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent() + .type(GetTopWatchedContentQueryParamType.Show) .includeGuids(1L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetTopWatchedContentBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetTopWatchedContentUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/library/hashes"]["get"] @@ -1227,43 +904,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetFileHashBadRequest; + import dev.plexapi.plexapi.models.errors.GetFileHashUnauthorized; import dev.plexapi.plexapi.models.operations.GetFileHashResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetFileHashBadRequest, GetFileHashUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetFileHashResponse res = sdk.library().getFileHash() + GetFileHashResponse res = sdk.library().getFileHash() .url("file://C:\Image.png&type=13") .type(4462.17d) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.GetFileHashBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetFileHashUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/library/metadata/{ratingKey}"]["get"] @@ -1275,44 +939,31 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetMetaDataByRatingKeyBadRequest; + import dev.plexapi.plexapi.models.errors.GetMetaDataByRatingKeyUnauthorized; import dev.plexapi.plexapi.models.operations.GetMetaDataByRatingKeyResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetMetaDataByRatingKeyBadRequest, GetMetaDataByRatingKeyUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetMetaDataByRatingKeyResponse res = sdk.library().getMetaDataByRatingKey() + GetMetaDataByRatingKeyResponse res = sdk.library().getMetaDataByRatingKey() .ratingKey(9518L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetMetaDataByRatingKeyBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetMetaDataByRatingKeyUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/library/metadata/{ratingKey}/banner"]["get"] @@ -1324,25 +975,26 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetBannerImageBadRequest; + import dev.plexapi.plexapi.models.errors.GetBannerImageUnauthorized; import dev.plexapi.plexapi.models.operations.GetBannerImageRequest; import dev.plexapi.plexapi.models.operations.GetBannerImageResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetBannerImageBadRequest, GetBannerImageUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetBannerImageRequest req = GetBannerImageRequest.builder() + GetBannerImageRequest req = GetBannerImageRequest.builder() .ratingKey(9518L) .width(396L) .height(396L) @@ -1351,27 +1003,13 @@ actions: .xPlexToken("CV5xoxjTpFKUzBTShsaf") .build(); - GetBannerImageResponse res = sdk.media().getBannerImage() + GetBannerImageResponse res = sdk.media().getBannerImage() .request(req) .call(); - if (res.responseStream().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetBannerImageBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetBannerImageUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.responseStream().isPresent()) { + // handle response } - } } - target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"] @@ -1383,45 +1021,32 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetMetadataChildrenBadRequest; + import dev.plexapi.plexapi.models.errors.GetMetadataChildrenUnauthorized; import dev.plexapi.plexapi.models.operations.GetMetadataChildrenResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetMetadataChildrenBadRequest, GetMetadataChildrenUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetMetadataChildrenResponse res = sdk.library().getMetadataChildren() - .ratingKey(1539.14d) + GetMetadataChildrenResponse res = sdk.library().getMetadataChildren() + .ratingKey(1539.15d) .includeElements("") .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetMetadataChildrenBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetMetadataChildrenUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/library/metadata/{ratingKey}/thumb"]["get"] @@ -1433,25 +1058,26 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetThumbImageBadRequest; + import dev.plexapi.plexapi.models.errors.GetThumbImageUnauthorized; import dev.plexapi.plexapi.models.operations.GetThumbImageRequest; import dev.plexapi.plexapi.models.operations.GetThumbImageResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetThumbImageBadRequest, GetThumbImageUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetThumbImageRequest req = GetThumbImageRequest.builder() + GetThumbImageRequest req = GetThumbImageRequest.builder() .ratingKey(9518L) .width(396L) .height(396L) @@ -1460,27 +1086,13 @@ actions: .xPlexToken("CV5xoxjTpFKUzBTShsaf") .build(); - GetThumbImageResponse res = sdk.media().getThumbImage() + GetThumbImageResponse res = sdk.media().getThumbImage() .request(req) .call(); - if (res.responseStream().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetThumbImageBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetThumbImageUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.responseStream().isPresent()) { + // handle response } - } } - target: $["paths"]["/library/onDeck"]["get"] @@ -1492,43 +1104,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetOnDeckBadRequest; + import dev.plexapi.plexapi.models.errors.GetOnDeckUnauthorized; import dev.plexapi.plexapi.models.operations.GetOnDeckResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetOnDeckBadRequest, GetOnDeckUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetOnDeckResponse res = sdk.library().getOnDeck() + GetOnDeckResponse res = sdk.library().getOnDeck() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetOnDeckBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetOnDeckUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/library/recentlyAdded"]["get"] @@ -1540,45 +1139,32 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetRecentlyAddedBadRequest; + import dev.plexapi.plexapi.models.errors.GetRecentlyAddedUnauthorized; import dev.plexapi.plexapi.models.operations.GetRecentlyAddedResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetRecentlyAddedBadRequest, GetRecentlyAddedUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetRecentlyAddedResponse res = sdk.library().getRecentlyAdded() + GetRecentlyAddedResponse res = sdk.library().getRecentlyAdded() .xPlexContainerStart(0) .xPlexContainerSize(50) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetRecentlyAddedBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetRecentlyAddedUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/library/sections"]["get"] @@ -1590,43 +1176,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetAllLibrariesBadRequest; + import dev.plexapi.plexapi.models.errors.GetAllLibrariesUnauthorized; import dev.plexapi.plexapi.models.operations.GetAllLibrariesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetAllLibrariesBadRequest, GetAllLibrariesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetAllLibrariesResponse res = sdk.library().getAllLibraries() + GetAllLibrariesResponse res = sdk.library().getAllLibraries() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetAllLibrariesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetAllLibrariesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/library/sections/watchlist/{filter}"]["get"] @@ -1638,7 +1211,8 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetWatchListBadRequest; + import dev.plexapi.plexapi.models.errors.GetWatchListUnauthorized; import dev.plexapi.plexapi.models.operations.Filter; import dev.plexapi.plexapi.models.operations.GetWatchListRequest; import dev.plexapi.plexapi.models.operations.GetWatchListResponse; @@ -1646,45 +1220,31 @@ actions: public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetWatchListBadRequest, GetWatchListUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetWatchListRequest req = GetWatchListRequest.builder() + GetWatchListRequest req = GetWatchListRequest.builder() .filter(Filter.AVAILABLE) .xPlexToken("CV5xoxjTpFKUzBTShsaf") .xPlexContainerStart(0) .xPlexContainerSize(50) .build(); - GetWatchListResponse res = sdk.watchlist().getWatchList() + GetWatchListResponse res = sdk.watchlist().getWatchList() .request(req) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetWatchListBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetWatchListUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/library/sections/{sectionKey}"]["delete"] @@ -1696,42 +1256,29 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.DeleteLibraryBadRequest; + import dev.plexapi.plexapi.models.errors.DeleteLibraryUnauthorized; import dev.plexapi.plexapi.models.operations.DeleteLibraryResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws DeleteLibraryBadRequest, DeleteLibraryUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - DeleteLibraryResponse res = sdk.library().deleteLibrary() + DeleteLibraryResponse res = sdk.library().deleteLibrary() .sectionKey(9518) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.DeleteLibraryBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.DeleteLibraryUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/library/sections/{sectionKey}"]["get"] @@ -1743,46 +1290,33 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetLibraryDetailsBadRequest; + import dev.plexapi.plexapi.models.errors.GetLibraryDetailsUnauthorized; import dev.plexapi.plexapi.models.operations.GetLibraryDetailsResponse; import dev.plexapi.plexapi.models.operations.IncludeDetails; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetLibraryDetailsBadRequest, GetLibraryDetailsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetLibraryDetailsResponse res = sdk.library().getLibraryDetails() + GetLibraryDetailsResponse res = sdk.library().getLibraryDetails() .sectionKey(9518) .includeDetails(IncludeDetails.ZERO) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetLibraryDetailsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetLibraryDetailsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/library/sections/{sectionKey}/refresh"]["get"] @@ -1794,44 +1328,31 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetRefreshLibraryMetadataBadRequest; + import dev.plexapi.plexapi.models.errors.GetRefreshLibraryMetadataUnauthorized; import dev.plexapi.plexapi.models.operations.Force; import dev.plexapi.plexapi.models.operations.GetRefreshLibraryMetadataResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetRefreshLibraryMetadataBadRequest, GetRefreshLibraryMetadataUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata() + GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata() .sectionKey(9518) .force(Force.ONE) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.GetRefreshLibraryMetadataBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetRefreshLibraryMetadataUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/library/sections/{sectionKey}/search"]["get"] @@ -1843,46 +1364,33 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetSearchLibraryBadRequest; + import dev.plexapi.plexapi.models.errors.GetSearchLibraryUnauthorized; import dev.plexapi.plexapi.models.operations.GetSearchLibraryResponse; import dev.plexapi.plexapi.models.operations.QueryParamType; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetSearchLibraryBadRequest, GetSearchLibraryUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetSearchLibraryResponse res = sdk.library().getSearchLibrary() + GetSearchLibraryResponse res = sdk.library().getSearchLibrary() .sectionKey(9518) - .type(QueryParamType.TWO) + .type(QueryParamType.Show) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetSearchLibraryBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetSearchLibraryUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/library/sections/{sectionKey}/{tag}"]["get"] @@ -1894,7 +1402,8 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetLibraryItemsBadRequest; + import dev.plexapi.plexapi.models.errors.GetLibraryItemsUnauthorized; import dev.plexapi.plexapi.models.operations.GetLibraryItemsRequest; import dev.plexapi.plexapi.models.operations.GetLibraryItemsResponse; import dev.plexapi.plexapi.models.operations.IncludeGuids; @@ -1905,48 +1414,34 @@ actions: public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetLibraryItemsBadRequest, GetLibraryItemsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetLibraryItemsRequest req = GetLibraryItemsRequest.builder() + GetLibraryItemsRequest req = GetLibraryItemsRequest.builder() .sectionKey(9518) .tag(Tag.EDITION) - .type(Type.TWO) - .includeGuids(IncludeGuids.ONE) - .includeMeta(IncludeMeta.ONE) + .type(Type.Show) + .includeGuids(IncludeGuids.Enable) + .includeMeta(IncludeMeta.Enable) .xPlexContainerStart(0) .xPlexContainerSize(50) .build(); - GetLibraryItemsResponse res = sdk.library().getLibraryItems() + GetLibraryItemsResponse res = sdk.library().getLibraryItems() .request(req) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetLibraryItemsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetLibraryItemsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/log"]["get"] @@ -1958,45 +1453,32 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.LogLineBadRequest; + import dev.plexapi.plexapi.models.errors.LogLineUnauthorized; import dev.plexapi.plexapi.models.operations.Level; import dev.plexapi.plexapi.models.operations.LogLineResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws LogLineBadRequest, LogLineUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - LogLineResponse res = sdk.log().logLine() + LogLineResponse res = sdk.log().logLine() .level(Level.THREE) .message("Test log message") .source("Postman") .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.LogLineBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.LogLineUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/log"]["post"] @@ -2008,46 +1490,33 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.LogMultiLineBadRequest; + import dev.plexapi.plexapi.models.errors.LogMultiLineUnauthorized; import dev.plexapi.plexapi.models.operations.LogMultiLineResponse; import java.lang.Exception; import java.lang.String; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws LogMultiLineBadRequest, LogMultiLineUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - String req = "level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman + 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"; - LogMultiLineResponse res = sdk.log().logMultiLine() + LogMultiLineResponse res = sdk.log().logMultiLine() .request(req) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.LogMultiLineBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.LogMultiLineUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/log/networked"]["get"] @@ -2059,41 +1528,28 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.EnablePaperTrailBadRequest; + import dev.plexapi.plexapi.models.errors.EnablePaperTrailUnauthorized; import dev.plexapi.plexapi.models.operations.EnablePaperTrailResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws EnablePaperTrailBadRequest, EnablePaperTrailUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - EnablePaperTrailResponse res = sdk.log().enablePaperTrail() + EnablePaperTrailResponse res = sdk.log().enablePaperTrail() .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.EnablePaperTrailBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.EnablePaperTrailUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/media/providers"]["get"] @@ -2105,44 +1561,31 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetMediaProvidersBadRequest; + import dev.plexapi.plexapi.models.errors.GetMediaProvidersUnauthorized; import dev.plexapi.plexapi.models.operations.GetMediaProvidersResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetMediaProvidersBadRequest, GetMediaProvidersUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetMediaProvidersResponse res = sdk.server().getMediaProviders() + GetMediaProvidersResponse res = sdk.server().getMediaProviders() .xPlexToken("CV5xoxjTpFKUzBTShsaf") .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetMediaProvidersBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetMediaProvidersUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/myplex/account"]["get"] @@ -2154,43 +1597,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetMyPlexAccountBadRequest; + import dev.plexapi.plexapi.models.errors.GetMyPlexAccountUnauthorized; import dev.plexapi.plexapi.models.operations.GetMyPlexAccountResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetMyPlexAccountBadRequest, GetMyPlexAccountUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount() + GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetMyPlexAccountBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetMyPlexAccountUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/photo/:/transcode"]["get"] @@ -2202,7 +1632,8 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetResizedPhotoBadRequest; + import dev.plexapi.plexapi.models.errors.GetResizedPhotoUnauthorized; import dev.plexapi.plexapi.models.operations.GetResizedPhotoRequest; import dev.plexapi.plexapi.models.operations.GetResizedPhotoResponse; import dev.plexapi.plexapi.models.operations.MinSize; @@ -2211,46 +1642,32 @@ actions: public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetResizedPhotoBadRequest, GetResizedPhotoUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetResizedPhotoRequest req = GetResizedPhotoRequest.builder() + GetResizedPhotoRequest req = GetResizedPhotoRequest.builder() .width(110d) .height(165d) .opacity(100L) - .blur(4000d) - .minSize(MinSize.ZERO) - .upscale(Upscale.ZERO) + .blur(0d) + .minSize(MinSize.ONE) + .upscale(Upscale.ONE) .url("/library/metadata/49564/thumb/1654258204") .build(); - GetResizedPhotoResponse res = sdk.server().getResizedPhoto() + GetResizedPhotoResponse res = sdk.server().getResizedPhoto() .request(req) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.GetResizedPhotoBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetResizedPhotoUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/pins"]["post"] @@ -2262,44 +1679,33 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetPinBadRequest; import dev.plexapi.plexapi.models.operations.GetPinRequest; import dev.plexapi.plexapi.models.operations.GetPinResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetPinBadRequest, Exception { + + PlexAPI sdk = PlexAPI.builder() .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") + .build(); + + GetPinRequest req = GetPinRequest.builder() .build(); - GetPinRequest req = GetPinRequest.builder() - .build(); - - GetPinResponse res = sdk.plex().getPin() + GetPinResponse res = sdk.plex().getPin() .request(req) .call(); - if (res.authPinContainer().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetPinBadRequest e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.authPinContainer().isPresent()) { + // handle response } - } } - target: $["paths"]["/pins/{pinID}"]["get"] @@ -2311,44 +1717,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetTokenByPinIdBadRequest; + import dev.plexapi.plexapi.models.errors.GetTokenByPinIdResponseBody; import dev.plexapi.plexapi.models.operations.GetTokenByPinIdResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetTokenByPinIdBadRequest, GetTokenByPinIdResponseBody, Exception { + + PlexAPI sdk = PlexAPI.builder() .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId() - .clientID("gcgzw5rz2xovp84b4vha3a40") + GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId() .pinID(408895L) .call(); - if (res.authPinContainer().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetTokenByPinIdBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetTokenByPinIdResponseBody e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.authPinContainer().isPresent()) { + // handle response } - } } - target: $["paths"]["/playlists"]["get"] @@ -2360,7 +1752,8 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetPlaylistsBadRequest; + import dev.plexapi.plexapi.models.errors.GetPlaylistsUnauthorized; import dev.plexapi.plexapi.models.operations.GetPlaylistsResponse; import dev.plexapi.plexapi.models.operations.PlaylistType; import dev.plexapi.plexapi.models.operations.QueryParamSmart; @@ -2368,39 +1761,25 @@ actions: public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetPlaylistsBadRequest, GetPlaylistsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetPlaylistsResponse res = sdk.playlists().getPlaylists() + GetPlaylistsResponse res = sdk.playlists().getPlaylists() .playlistType(PlaylistType.AUDIO) .smart(QueryParamSmart.ZERO) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetPlaylistsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetPlaylistsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/playlists"]["post"] @@ -2412,7 +1791,8 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.CreatePlaylistBadRequest; + import dev.plexapi.plexapi.models.errors.CreatePlaylistUnauthorized; import dev.plexapi.plexapi.models.operations.CreatePlaylistQueryParamType; import dev.plexapi.plexapi.models.operations.CreatePlaylistRequest; import dev.plexapi.plexapi.models.operations.CreatePlaylistResponse; @@ -2421,45 +1801,31 @@ actions: public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws CreatePlaylistBadRequest, CreatePlaylistUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - CreatePlaylistRequest req = CreatePlaylistRequest.builder() + CreatePlaylistRequest req = CreatePlaylistRequest.builder() .title("") .type(CreatePlaylistQueryParamType.PHOTO) .smart(Smart.ONE) - .uri("https://inborn-brochure.biz") + .uri("https://hoarse-testing.info/") .build(); - CreatePlaylistResponse res = sdk.playlists().createPlaylist() + CreatePlaylistResponse res = sdk.playlists().createPlaylist() .request(req) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.CreatePlaylistBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.CreatePlaylistUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/playlists/upload"]["post"] @@ -2471,44 +1837,32 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.UploadPlaylistBadRequest; + import dev.plexapi.plexapi.models.errors.UploadPlaylistUnauthorized; import dev.plexapi.plexapi.models.operations.QueryParamForce; import dev.plexapi.plexapi.models.operations.UploadPlaylistResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws UploadPlaylistBadRequest, UploadPlaylistUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - UploadPlaylistResponse res = sdk.playlists().uploadPlaylist() + UploadPlaylistResponse res = sdk.playlists().uploadPlaylist() .path("/home/barkley/playlist.m3u") .force(QueryParamForce.ZERO) + .sectionID(1L) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.UploadPlaylistBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.UploadPlaylistUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/playlists/{playlistID}"]["delete"] @@ -2520,42 +1874,29 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.DeletePlaylistBadRequest; + import dev.plexapi.plexapi.models.errors.DeletePlaylistUnauthorized; import dev.plexapi.plexapi.models.operations.DeletePlaylistResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws DeletePlaylistBadRequest, DeletePlaylistUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - DeletePlaylistResponse res = sdk.playlists().deletePlaylist() + DeletePlaylistResponse res = sdk.playlists().deletePlaylist() .playlistID(216.22d) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.DeletePlaylistBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.DeletePlaylistUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/playlists/{playlistID}"]["get"] @@ -2567,44 +1908,31 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetPlaylistBadRequest; + import dev.plexapi.plexapi.models.errors.GetPlaylistUnauthorized; import dev.plexapi.plexapi.models.operations.GetPlaylistResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetPlaylistBadRequest, GetPlaylistUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetPlaylistResponse res = sdk.playlists().getPlaylist() + GetPlaylistResponse res = sdk.playlists().getPlaylist() .playlistID(4109.48d) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetPlaylistBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetPlaylistUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/playlists/{playlistID}"]["put"] @@ -2616,44 +1944,31 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.UpdatePlaylistBadRequest; + import dev.plexapi.plexapi.models.errors.UpdatePlaylistUnauthorized; import dev.plexapi.plexapi.models.operations.UpdatePlaylistResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws UpdatePlaylistBadRequest, UpdatePlaylistUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - UpdatePlaylistResponse res = sdk.playlists().updatePlaylist() - .playlistID(3915d) + UpdatePlaylistResponse res = sdk.playlists().updatePlaylist() + .playlistID(3915.00d) .title("") .summary("") .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.UpdatePlaylistBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.UpdatePlaylistUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/playlists/{playlistID}/items"]["delete"] @@ -2665,42 +1980,29 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.ClearPlaylistContentsBadRequest; + import dev.plexapi.plexapi.models.errors.ClearPlaylistContentsUnauthorized; import dev.plexapi.plexapi.models.operations.ClearPlaylistContentsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws ClearPlaylistContentsBadRequest, ClearPlaylistContentsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents() + ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents() .playlistID(1893.18d) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.ClearPlaylistContentsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.ClearPlaylistContentsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/playlists/{playlistID}/items"]["get"] @@ -2712,46 +2014,33 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetPlaylistContentsBadRequest; + import dev.plexapi.plexapi.models.errors.GetPlaylistContentsUnauthorized; import dev.plexapi.plexapi.models.operations.GetPlaylistContentsQueryParamType; import dev.plexapi.plexapi.models.operations.GetPlaylistContentsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetPlaylistContentsBadRequest, GetPlaylistContentsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents() + GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents() .playlistID(5004.46d) - .type(GetPlaylistContentsQueryParamType.TWO) + .type(GetPlaylistContentsQueryParamType.Show) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetPlaylistContentsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetPlaylistContentsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/playlists/{playlistID}/items"]["put"] @@ -2763,46 +2052,33 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.AddPlaylistContentsBadRequest; + import dev.plexapi.plexapi.models.errors.AddPlaylistContentsUnauthorized; import dev.plexapi.plexapi.models.operations.AddPlaylistContentsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws AddPlaylistContentsBadRequest, AddPlaylistContentsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents() - .playlistID(8502.01d) + AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents() + .playlistID(8502.00d) .uri("server://12345/com.plexapp.plugins.library/library/metadata/1") .playQueueID(123d) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.AddPlaylistContentsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.AddPlaylistContentsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/resources"]["get"] @@ -2814,7 +2090,8 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetServerResourcesBadRequest; + import dev.plexapi.plexapi.models.errors.GetServerResourcesUnauthorized; import dev.plexapi.plexapi.models.operations.GetServerResourcesResponse; import dev.plexapi.plexapi.models.operations.IncludeHttps; import dev.plexapi.plexapi.models.operations.IncludeIPv6; @@ -2823,41 +2100,26 @@ actions: public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerResourcesBadRequest, GetServerResourcesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerResourcesResponse res = sdk.plex().getServerResources() - .clientID("gcgzw5rz2xovp84b4vha3a40") - .includeHttps(IncludeHttps.ONE) - .includeRelay(IncludeRelay.ONE) - .includeIPv6(IncludeIPv6.ONE) + GetServerResourcesResponse res = sdk.plex().getServerResources() + .includeHttps(IncludeHttps.Enable) + .includeRelay(IncludeRelay.Enable) + .includeIPv6(IncludeIPv6.Enable) .call(); - if (res.plexDevices().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetServerResourcesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetServerResourcesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.plexDevices().isPresent()) { + // handle response } - } } - target: $["paths"]["/search"]["get"] @@ -2869,44 +2131,31 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetSearchResultsBadRequest; + import dev.plexapi.plexapi.models.errors.GetSearchResultsUnauthorized; import dev.plexapi.plexapi.models.operations.GetSearchResultsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetSearchResultsBadRequest, GetSearchResultsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetSearchResultsResponse res = sdk.search().getSearchResults() + GetSearchResultsResponse res = sdk.search().getSearchResults() .query("110") .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetSearchResultsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetSearchResultsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/security/resources"]["get"] @@ -2918,42 +2167,29 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetSourceConnectionInformationBadRequest; + import dev.plexapi.plexapi.models.errors.GetSourceConnectionInformationUnauthorized; import dev.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetSourceConnectionInformationBadRequest, GetSourceConnectionInformationUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation() - .source("server://client-identifier") + GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation() + .source("provider://provider-identifier") .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.GetSourceConnectionInformationBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetSourceConnectionInformationUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/security/token"]["get"] @@ -2965,7 +2201,8 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetTransientTokenBadRequest; + import dev.plexapi.plexapi.models.errors.GetTransientTokenUnauthorized; import dev.plexapi.plexapi.models.operations.GetTransientTokenQueryParamType; import dev.plexapi.plexapi.models.operations.GetTransientTokenResponse; import dev.plexapi.plexapi.models.operations.Scope; @@ -2973,37 +2210,23 @@ actions: public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetTransientTokenBadRequest, GetTransientTokenUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetTransientTokenResponse res = sdk.authentication().getTransientToken() + GetTransientTokenResponse res = sdk.authentication().getTransientToken() .type(GetTransientTokenQueryParamType.DELEGATION) .scope(Scope.ALL) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.GetTransientTokenBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetTransientTokenUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/servers"]["get"] @@ -3015,43 +2238,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetServerListBadRequest; + import dev.plexapi.plexapi.models.errors.GetServerListUnauthorized; import dev.plexapi.plexapi.models.operations.GetServerListResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerListBadRequest, GetServerListUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerListResponse res = sdk.server().getServerList() + GetServerListResponse res = sdk.server().getServerList() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetServerListBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetServerListUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/statistics/bandwidth"]["get"] @@ -3063,44 +2273,31 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetBandwidthStatisticsBadRequest; + import dev.plexapi.plexapi.models.errors.GetBandwidthStatisticsUnauthorized; import dev.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetBandwidthStatisticsBadRequest, GetBandwidthStatisticsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics() + GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics() .timespan(4L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetBandwidthStatisticsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetBandwidthStatisticsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/statistics/media"]["get"] @@ -3112,44 +2309,31 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetStatisticsBadRequest; + import dev.plexapi.plexapi.models.errors.GetStatisticsUnauthorized; import dev.plexapi.plexapi.models.operations.GetStatisticsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetStatisticsBadRequest, GetStatisticsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetStatisticsResponse res = sdk.statistics().getStatistics() + GetStatisticsResponse res = sdk.statistics().getStatistics() .timespan(4L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetStatisticsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetStatisticsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/statistics/resources"]["get"] @@ -3161,44 +2345,31 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetResourcesStatisticsBadRequest; + import dev.plexapi.plexapi.models.errors.GetResourcesStatisticsUnauthorized; import dev.plexapi.plexapi.models.operations.GetResourcesStatisticsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetResourcesStatisticsBadRequest, GetResourcesStatisticsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics() + GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics() .timespan(4L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetResourcesStatisticsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetResourcesStatisticsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/status/sessions"]["get"] @@ -3210,43 +2381,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetSessionsBadRequest; + import dev.plexapi.plexapi.models.errors.GetSessionsUnauthorized; import dev.plexapi.plexapi.models.operations.GetSessionsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetSessionsBadRequest, GetSessionsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetSessionsResponse res = sdk.sessions().getSessions() + GetSessionsResponse res = sdk.sessions().getSessions() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetSessionsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetSessionsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/status/sessions/history/all"]["get"] @@ -3258,25 +2416,26 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetSessionHistoryBadRequest; + import dev.plexapi.plexapi.models.errors.GetSessionHistoryUnauthorized; import dev.plexapi.plexapi.models.operations.GetSessionHistoryResponse; import dev.plexapi.plexapi.models.operations.QueryParamFilter; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetSessionHistoryBadRequest, GetSessionHistoryUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetSessionHistoryResponse res = sdk.sessions().getSessionHistory() + GetSessionHistoryResponse res = sdk.sessions().getSessionHistory() .sort("") .accountId(1L) .filter(QueryParamFilter.builder() @@ -3284,23 +2443,9 @@ actions: .librarySectionID(12L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetSessionHistoryBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetSessionHistoryUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/transcode/sessions"]["get"] @@ -3312,43 +2457,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetTranscodeSessionsBadRequest; + import dev.plexapi.plexapi.models.errors.GetTranscodeSessionsUnauthorized; import dev.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetTranscodeSessionsBadRequest, GetTranscodeSessionsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions() + GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetTranscodeSessionsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetTranscodeSessionsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"] @@ -3360,42 +2492,29 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.StopTranscodeSessionBadRequest; + import dev.plexapi.plexapi.models.errors.StopTranscodeSessionUnauthorized; import dev.plexapi.plexapi.models.operations.StopTranscodeSessionResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws StopTranscodeSessionBadRequest, StopTranscodeSessionUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession() + StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession() .sessionKey("zz7llzqlx8w9vnrsbnwhbmep") .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.StopTranscodeSessionBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.StopTranscodeSessionUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/updater/apply"]["put"] @@ -3407,7 +2526,8 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.ApplyUpdatesBadRequest; + import dev.plexapi.plexapi.models.errors.ApplyUpdatesUnauthorized; import dev.plexapi.plexapi.models.operations.ApplyUpdatesResponse; import dev.plexapi.plexapi.models.operations.Skip; import dev.plexapi.plexapi.models.operations.Tonight; @@ -3415,37 +2535,23 @@ actions: public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws ApplyUpdatesBadRequest, ApplyUpdatesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - ApplyUpdatesResponse res = sdk.updater().applyUpdates() + ApplyUpdatesResponse res = sdk.updater().applyUpdates() .tonight(Tonight.ONE) .skip(Skip.ONE) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.ApplyUpdatesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.ApplyUpdatesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/updater/check"]["put"] @@ -3457,43 +2563,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.CheckForUpdatesBadRequest; + import dev.plexapi.plexapi.models.errors.CheckForUpdatesUnauthorized; import dev.plexapi.plexapi.models.operations.CheckForUpdatesResponse; import dev.plexapi.plexapi.models.operations.Download; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws CheckForUpdatesBadRequest, CheckForUpdatesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - CheckForUpdatesResponse res = sdk.updater().checkForUpdates() + CheckForUpdatesResponse res = sdk.updater().checkForUpdates() .download(Download.ONE) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.CheckForUpdatesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.CheckForUpdatesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - target: $["paths"]["/updater/status"]["get"] @@ -3505,43 +2598,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetUpdateStatusBadRequest; + import dev.plexapi.plexapi.models.errors.GetUpdateStatusUnauthorized; import dev.plexapi.plexapi.models.operations.GetUpdateStatusResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetUpdateStatusBadRequest, GetUpdateStatusUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetUpdateStatusResponse res = sdk.updater().getUpdateStatus() + GetUpdateStatusResponse res = sdk.updater().getUpdateStatus() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetUpdateStatusBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetUpdateStatusUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - target: $["paths"]["/user"]["get"] @@ -3553,43 +2633,30 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.GetTokenDetailsBadRequest; + import dev.plexapi.plexapi.models.errors.GetTokenDetailsUnauthorized; import dev.plexapi.plexapi.models.operations.GetTokenDetailsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetTokenDetailsBadRequest, GetTokenDetailsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetTokenDetailsResponse res = sdk.authentication().getTokenDetails() + GetTokenDetailsResponse res = sdk.authentication().getTokenDetails() .call(); - if (res.userPlexAccount().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.GetTokenDetailsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.GetTokenDetailsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.userPlexAccount().isPresent()) { + // handle response } - } } - target: $["paths"]["/users/signin"]["post"] @@ -3601,49 +2668,37 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.PostUsersSignInDataBadRequest; + import dev.plexapi.plexapi.models.errors.PostUsersSignInDataUnauthorized; import dev.plexapi.plexapi.models.operations.PostUsersSignInDataRequestBody; import dev.plexapi.plexapi.models.operations.PostUsersSignInDataResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws PostUsersSignInDataBadRequest, PostUsersSignInDataUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") + .build(); + + PostUsersSignInDataRequestBody req = PostUsersSignInDataRequestBody.builder() + .login("username@email.com") + .password("password123") + .verificationCode("123456") .build(); - PostUsersSignInDataResponse res = sdk.authentication().postUsersSignInData() - .clientID("gcgzw5rz2xovp84b4vha3a40") - .requestBody(PostUsersSignInDataRequestBody.builder() - .login("username@email.com") - .password("password123") - .verificationCode("123456") - .build()) + PostUsersSignInDataResponse res = sdk.authentication().postUsersSignInData() + .request(req) .call(); - if (res.userPlexAccount().isPresent()) { - // handle response - } - } catch (dev.plexapi.plexapi.models.errors.PostUsersSignInDataBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.PostUsersSignInDataUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.userPlexAccount().isPresent()) { + // handle response } - } } - target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"] @@ -3655,25 +2710,26 @@ actions: package hello.world; import dev.plexapi.plexapi.PlexAPI; - import dev.plexapi.plexapi.models.errors.SDKError; + import dev.plexapi.plexapi.models.errors.StartUniversalTranscodeBadRequest; + import dev.plexapi.plexapi.models.errors.StartUniversalTranscodeUnauthorized; import dev.plexapi.plexapi.models.operations.StartUniversalTranscodeRequest; import dev.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws StartUniversalTranscodeBadRequest, StartUniversalTranscodeUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder() + StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder() .hasMDE(1d) .path("/library/metadata/23409") .mediaIndex(0d) @@ -3692,24 +2748,10 @@ actions: .autoAdjustQuality(0d) .build(); - StartUniversalTranscodeResponse res = sdk.video().startUniversalTranscode() + StartUniversalTranscodeResponse res = sdk.video().startUniversalTranscode() .request(req) .call(); - // handle response - } catch (dev.plexapi.plexapi.models.errors.StartUniversalTranscodeBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.plexapi.models.errors.StartUniversalTranscodeUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } diff --git a/docs/models/operations/AutoSelectSubtitle.md b/docs/models/operations/AutoSelectSubtitle.md index 3fcdee91..2104db2e 100644 --- a/docs/models/operations/AutoSelectSubtitle.md +++ b/docs/models/operations/AutoSelectSubtitle.md @@ -5,7 +5,7 @@ The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign aud ## Values -| Name | Value | -| ------ | ------ | -| `ZERO` | 0 | -| `ONE` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/Connections.md b/docs/models/operations/Connections.md index 8a1ef379..58ec0219 100644 --- a/docs/models/operations/Connections.md +++ b/docs/models/operations/Connections.md @@ -3,12 +3,12 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `protocol` | *String* | :heavy_check_mark: | N/A | -| `address` | *String* | :heavy_check_mark: | N/A | -| `port` | *double* | :heavy_check_mark: | N/A | -| `uri` | *String* | :heavy_check_mark: | N/A | -| `local` | *boolean* | :heavy_check_mark: | N/A | -| `relay` | *boolean* | :heavy_check_mark: | N/A | -| `iPv6` | *boolean* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `protocol` | [Protocol](../../models/operations/Protocol.md) | :heavy_check_mark: | The protocol used for the connection (http, https, etc) | +| `address` | *String* | :heavy_check_mark: | The (ip) address or domain name used for the connection | +| `port` | *int* | :heavy_check_mark: | The port used for the connection | +| `uri` | *String* | :heavy_check_mark: | The full URI of the connection | +| `local` | *boolean* | :heavy_check_mark: | If the connection is local address | +| `relay` | *boolean* | :heavy_check_mark: | If the connection is relayed through plex.direct | +| `iPv6` | *boolean* | :heavy_check_mark: | If the connection is using IPv6 | \ No newline at end of file diff --git a/docs/models/operations/DefaultSubtitleAccessibility.md b/docs/models/operations/DefaultSubtitleAccessibility.md index cbc38d94..592d982c 100644 --- a/docs/models/operations/DefaultSubtitleAccessibility.md +++ b/docs/models/operations/DefaultSubtitleAccessibility.md @@ -1,11 +1,11 @@ # 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 shown non-SDH subtitles) +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) ## Values -| Name | Value | -| ------ | ------ | -| `ZERO` | 0 | -| `ONE` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/DefaultSubtitleForced.md b/docs/models/operations/DefaultSubtitleForced.md index 83704a56..6270cf9f 100644 --- a/docs/models/operations/DefaultSubtitleForced.md +++ b/docs/models/operations/DefaultSubtitleForced.md @@ -5,7 +5,7 @@ The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer ## Values -| Name | Value | -| ------ | ------ | -| `ZERO` | 0 | -| `ONE` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/GetAllLibrariesDirectory.md b/docs/models/operations/GetAllLibrariesDirectory.md index c4d6aa03..13624d46 100644 --- a/docs/models/operations/GetAllLibrariesDirectory.md +++ b/docs/models/operations/GetAllLibrariesDirectory.md @@ -5,24 +5,24 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | true | -| `art` | *Optional* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg | -| `composite` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/1/composite/1705615584 | -| `filters` | *Optional* | :heavy_minus_sign: | N/A | true | -| `refreshing` | *Optional* | :heavy_minus_sign: | N/A | false | -| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /:/resources/movie.png | -| `key` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `type` | *Optional* | :heavy_minus_sign: | N/A | movie | -| `title` | *Optional* | :heavy_minus_sign: | N/A | Movies | -| `agent` | *Optional* | :heavy_minus_sign: | N/A | tv.plex.agents.movie | -| `scanner` | *Optional* | :heavy_minus_sign: | N/A | Plex Movie | -| `language` | *Optional* | :heavy_minus_sign: | N/A | en-US | -| `uuid` | *Optional* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | -| `updatedAt` | *Optional* | :heavy_minus_sign: | Unix epoch datetime | 1556281940 | -| `createdAt` | *Optional* | :heavy_minus_sign: | Unix epoch datetime | 1556281940 | -| `scannedAt` | *Optional* | :heavy_minus_sign: | Unix epoch datetime | 1556281940 | -| `content` | *Optional* | :heavy_minus_sign: | N/A | true | -| `directory` | *Optional* | :heavy_minus_sign: | N/A | true | -| `contentChangedAt` | *Optional* | :heavy_minus_sign: | N/A | 3192854 | -| `hidden` | *Optional* | :heavy_minus_sign: | N/A | 0 | -| `location` | List<[Location](../../models/operations/Location.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `allowSync` | *boolean* | :heavy_check_mark: | N/A | true | +| `art` | *String* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg | +| `composite` | *String* | :heavy_check_mark: | N/A | /library/sections/1/composite/1705615584 | +| `filters` | *boolean* | :heavy_check_mark: | N/A | true | +| `refreshing` | *boolean* | :heavy_check_mark: | N/A | false | +| `thumb` | *String* | :heavy_check_mark: | N/A | /:/resources/movie.png | +| `key` | *String* | :heavy_check_mark: | N/A | 1 | +| `type` | *String* | :heavy_check_mark: | N/A | movie | +| `title` | *String* | :heavy_check_mark: | N/A | Movies | +| `agent` | *String* | :heavy_check_mark: | N/A | tv.plex.agents.movie | +| `scanner` | *String* | :heavy_check_mark: | N/A | Plex Movie | +| `language` | *String* | :heavy_check_mark: | N/A | en-US | +| `uuid` | *String* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | +| `updatedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | +| `createdAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | +| `scannedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | +| `content` | *boolean* | :heavy_check_mark: | N/A | true | +| `directory` | *boolean* | :heavy_check_mark: | N/A | true | +| `contentChangedAt` | *int* | :heavy_check_mark: | N/A | 3192854 | +| `hidden` | *int* | :heavy_check_mark: | N/A | 0 | +| `location` | List<[Location](../../models/operations/Location.md)> | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetAllLibrariesMediaContainer.md b/docs/models/operations/GetAllLibrariesMediaContainer.md index 051ec6dd..2cc77a05 100644 --- a/docs/models/operations/GetAllLibrariesMediaContainer.md +++ b/docs/models/operations/GetAllLibrariesMediaContainer.md @@ -8,4 +8,4 @@ | `size` | *int* | :heavy_check_mark: | N/A | 5 | | `allowSync` | *boolean* | :heavy_check_mark: | N/A | false | | `title1` | *String* | :heavy_check_mark: | N/A | Plex Library | -| `directory` | List<[GetAllLibrariesDirectory](../../models/operations/GetAllLibrariesDirectory.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `directory` | List<[GetAllLibrariesDirectory](../../models/operations/GetAllLibrariesDirectory.md)> | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetAllLibrariesResponseBody.md b/docs/models/operations/GetAllLibrariesResponseBody.md index 9533cdfc..c26f66f9 100644 --- a/docs/models/operations/GetAllLibrariesResponseBody.md +++ b/docs/models/operations/GetAllLibrariesResponseBody.md @@ -5,6 +5,6 @@ The libraries available on the Server ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `mediaContainer` | [Optional](../../models/operations/GetAllLibrariesMediaContainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `mediaContainer` | [GetAllLibrariesMediaContainer](../../models/operations/GetAllLibrariesMediaContainer.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryItemsField.md b/docs/models/operations/GetLibraryItemsField.md new file mode 100644 index 00000000..547f8b59 --- /dev/null +++ b/docs/models/operations/GetLibraryItemsField.md @@ -0,0 +1,11 @@ +# GetLibraryItemsField + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `key` | *String* | :heavy_check_mark: | N/A | show.title | +| `title` | *String* | :heavy_check_mark: | N/A | Show Title | +| `type` | *String* | :heavy_check_mark: | N/A | string | +| `subType` | *Optional* | :heavy_minus_sign: | N/A | rating | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryItemsFieldType.md b/docs/models/operations/GetLibraryItemsFieldType.md new file mode 100644 index 00000000..07bad69d --- /dev/null +++ b/docs/models/operations/GetLibraryItemsFieldType.md @@ -0,0 +1,9 @@ +# GetLibraryItemsFieldType + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `type` | *String* | :heavy_check_mark: | N/A | tag | +| `operator` | List<[GetLibraryItemsOperator](../../models/operations/GetLibraryItemsOperator.md)> | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryItemsFilter.md b/docs/models/operations/GetLibraryItemsFilter.md new file mode 100644 index 00000000..50f40813 --- /dev/null +++ b/docs/models/operations/GetLibraryItemsFilter.md @@ -0,0 +1,12 @@ +# GetLibraryItemsFilter + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `filter` | *String* | :heavy_check_mark: | N/A | genre | +| `filterType` | *String* | :heavy_check_mark: | N/A | string | +| `key` | *String* | :heavy_check_mark: | N/A | /library/sections/2/genre?type=2 | +| `title` | *String* | :heavy_check_mark: | N/A | Genre | +| `type` | *String* | :heavy_check_mark: | N/A | filter | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryItemsMediaContainer.md b/docs/models/operations/GetLibraryItemsMediaContainer.md index 0eadf570..6c73c217 100644 --- a/docs/models/operations/GetLibraryItemsMediaContainer.md +++ b/docs/models/operations/GetLibraryItemsMediaContainer.md @@ -3,21 +3,22 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `size` | *Optional* | :heavy_minus_sign: | N/A | 70 | -| `allowSync` | *Optional* | :heavy_minus_sign: | N/A | true | -| `art` | *Optional* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg | -| `identifier` | *Optional* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `librarySectionID` | [Optional](../../models/operations/LibrarySectionID.md) | :heavy_minus_sign: | N/A | | -| `librarySectionTitle` | *Optional* | :heavy_minus_sign: | N/A | Movies | -| `librarySectionUUID` | *Optional* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | -| `mediaTagPrefix` | *Optional* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | -| `mediaTagVersion` | *Optional* | :heavy_minus_sign: | N/A | 1701731894 | -| `thumb` | *Optional* | :heavy_minus_sign: | N/A | /:/resources/movie.png | -| `title1` | *Optional* | :heavy_minus_sign: | N/A | Movies | -| `title2` | *Optional* | :heavy_minus_sign: | N/A | Recently Released | -| `viewGroup` | *Optional* | :heavy_minus_sign: | N/A | movie | -| `viewMode` | *Optional* | :heavy_minus_sign: | N/A | 65592 | -| `mixedParents` | *Optional* | :heavy_minus_sign: | N/A | true | -| `metadata` | List<[GetLibraryItemsMetadata](../../models/operations/GetLibraryItemsMetadata.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `size` | *int* | :heavy_check_mark: | N/A | 70 | +| `allowSync` | *boolean* | :heavy_check_mark: | N/A | true | +| `art` | *String* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg | +| `identifier` | *String* | :heavy_check_mark: | N/A | com.plexapp.plugins.library | +| `librarySectionID` | [LibrarySectionID](../../models/operations/LibrarySectionID.md) | :heavy_check_mark: | N/A | | +| `librarySectionTitle` | *String* | :heavy_check_mark: | N/A | Movies | +| `librarySectionUUID` | *String* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | +| `mediaTagPrefix` | *String* | :heavy_check_mark: | N/A | /system/bundle/media/flags/ | +| `mediaTagVersion` | *int* | :heavy_check_mark: | N/A | 1701731894 | +| `thumb` | *String* | :heavy_check_mark: | N/A | /:/resources/movie.png | +| `title1` | *String* | :heavy_check_mark: | N/A | Movies | +| `title2` | *String* | :heavy_check_mark: | N/A | Recently Released | +| `viewGroup` | *String* | :heavy_check_mark: | N/A | movie | +| `viewMode` | *Optional* | :heavy_minus_sign: | N/A | 65592 | +| `mixedParents` | *Optional* | :heavy_minus_sign: | N/A | true | +| `metadata` | List<[GetLibraryItemsMetadata](../../models/operations/GetLibraryItemsMetadata.md)> | :heavy_minus_sign: | N/A | | +| `meta` | [Optional](../../models/operations/Meta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
| | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryItemsMetadata.md b/docs/models/operations/GetLibraryItemsMetadata.md index 474dd286..e1c6e229 100644 --- a/docs/models/operations/GetLibraryItemsMetadata.md +++ b/docs/models/operations/GetLibraryItemsMetadata.md @@ -5,21 +5,21 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ratingKey` | *Optional* | :heavy_minus_sign: | N/A | 58683 | -| `key` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/58683 | -| `guid` | *Optional* | :heavy_minus_sign: | N/A | plex://movie/5d7768ba96b655001fdc0408 | +| `ratingKey` | *String* | :heavy_check_mark: | N/A | 58683 | +| `key` | *String* | :heavy_check_mark: | N/A | /library/metadata/58683 | +| `guid` | *String* | :heavy_check_mark: | N/A | plex://movie/5d7768ba96b655001fdc0408 | | `studio` | *Optional* | :heavy_minus_sign: | N/A | 20th Century Studios | -| `type` | *Optional* | :heavy_minus_sign: | N/A | movie | -| `title` | *Optional* | :heavy_minus_sign: | N/A | Avatar: The Way of Water | +| `type` | *String* | :heavy_check_mark: | N/A | movie | +| `title` | *String* | :heavy_check_mark: | N/A | Avatar: The Way of Water | | `contentRating` | *Optional* | :heavy_minus_sign: | N/A | PG-13 | | `summary` | *Optional* | :heavy_minus_sign: | N/A | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home. | | `rating` | *Optional* | :heavy_minus_sign: | N/A | 7.6 | | `audienceRating` | *Optional* | :heavy_minus_sign: | N/A | 9.2 | -| `year` | *Optional* | :heavy_minus_sign: | N/A | 2022 | +| `year` | *int* | :heavy_check_mark: | N/A | 2022 | | `tagline` | *Optional* | :heavy_minus_sign: | N/A | Return to Pandora. | | `thumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 | | `art` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 | -| `duration` | *Optional* | :heavy_minus_sign: | N/A | 11558112 | +| `duration` | *int* | :heavy_check_mark: | N/A | 11558112 | | `originallyAvailableAt` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | N/A | 2022-12-14 00:00:00 +0000 UTC | | `addedAt` | *Optional* | :heavy_minus_sign: | N/A | 1680457607 | | `updatedAt` | *Optional* | :heavy_minus_sign: | N/A | 1703239236 | @@ -34,12 +34,13 @@ | `grandparentThumb` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 | | `grandparentArt` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/art/1705716261 | | `grandparentTheme` | *Optional* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 | -| `media` | List<[GetLibraryItemsMedia](../../models/operations/GetLibraryItemsMedia.md)> | :heavy_minus_sign: | N/A | | +| `media` | List<[GetLibraryItemsMedia](../../models/operations/GetLibraryItemsMedia.md)> | :heavy_check_mark: | N/A | | | `genre` | List<[GetLibraryItemsGenre](../../models/operations/GetLibraryItemsGenre.md)> | :heavy_minus_sign: | N/A | | | `country` | List<[GetLibraryItemsCountry](../../models/operations/GetLibraryItemsCountry.md)> | :heavy_minus_sign: | N/A | | | `director` | List<[GetLibraryItemsDirector](../../models/operations/GetLibraryItemsDirector.md)> | :heavy_minus_sign: | N/A | | | `writer` | List<[GetLibraryItemsWriter](../../models/operations/GetLibraryItemsWriter.md)> | :heavy_minus_sign: | N/A | | | `role` | List<[GetLibraryItemsRole](../../models/operations/GetLibraryItemsRole.md)> | :heavy_minus_sign: | N/A | | +| `mediaGuid` | List<[MediaGuid](../../models/operations/MediaGuid.md)> | :heavy_minus_sign: | The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
| | | `titleSort` | *Optional* | :heavy_minus_sign: | N/A | Whale | | `viewCount` | *Optional* | :heavy_minus_sign: | N/A | 1 | | `lastViewedAt` | *Optional* | :heavy_minus_sign: | N/A | 1682752242 | diff --git a/docs/models/operations/GetLibraryItemsOperator.md b/docs/models/operations/GetLibraryItemsOperator.md new file mode 100644 index 00000000..0a318647 --- /dev/null +++ b/docs/models/operations/GetLibraryItemsOperator.md @@ -0,0 +1,9 @@ +# GetLibraryItemsOperator + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `key` | *String* | :heavy_check_mark: | N/A | = | +| `title` | *String* | :heavy_check_mark: | N/A | is | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryItemsSort.md b/docs/models/operations/GetLibraryItemsSort.md new file mode 100644 index 00000000..face1007 --- /dev/null +++ b/docs/models/operations/GetLibraryItemsSort.md @@ -0,0 +1,13 @@ +# GetLibraryItemsSort + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `default_` | *Optional* | :heavy_minus_sign: | N/A | asc | +| `defaultDirection` | *String* | :heavy_check_mark: | N/A | asc | +| `descKey` | *Optional* | :heavy_minus_sign: | N/A | titleSort:desc | +| `firstCharacterKey` | *Optional* | :heavy_minus_sign: | N/A | /library/sections/2/firstCharacter | +| `key` | *String* | :heavy_check_mark: | N/A | titleSort | +| `title` | *String* | :heavy_check_mark: | N/A | Title | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryItemsType.md b/docs/models/operations/GetLibraryItemsType.md new file mode 100644 index 00000000..32b2bf40 --- /dev/null +++ b/docs/models/operations/GetLibraryItemsType.md @@ -0,0 +1,14 @@ +# GetLibraryItemsType + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `key` | *String* | :heavy_check_mark: | N/A | /library/sections/2/all?type=2 | +| `type` | *String* | :heavy_check_mark: | N/A | show | +| `title` | *String* | :heavy_check_mark: | N/A | TV Shows | +| `active` | *boolean* | :heavy_check_mark: | N/A | false | +| `filter` | List<[GetLibraryItemsFilter](../../models/operations/GetLibraryItemsFilter.md)> | :heavy_minus_sign: | N/A | | +| `sort` | List<[GetLibraryItemsSort](../../models/operations/GetLibraryItemsSort.md)> | :heavy_minus_sign: | N/A | | +| `field` | List<[GetLibraryItemsField](../../models/operations/GetLibraryItemsField.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/GetPinRequest.md b/docs/models/operations/GetPinRequest.md index 6ea26022..6925802f 100644 --- a/docs/models/operations/GetPinRequest.md +++ b/docs/models/operations/GetPinRequest.md @@ -3,11 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `strong` | *Optional* | :heavy_minus_sign: | Determines the kind of code returned by the API call
Strong codes are used for Pin authentication flows
Non-Strong codes are used for `Plex.tv/link`
| | -| `clientID` | *Optional* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| gcgzw5rz2xovp84b4vha3a40 | -| `clientName` | *Optional* | :heavy_minus_sign: | N/A | Plex Web | -| `deviceName` | *Optional* | :heavy_minus_sign: | N/A | Linux | -| `clientVersion` | *Optional* | :heavy_minus_sign: | N/A | 4.133.0 | -| `clientPlatform` | *Optional* | :heavy_minus_sign: | N/A | Chrome | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `strong` | *Optional* | :heavy_minus_sign: | Determines the kind of code returned by the API call
Strong codes are used for Pin authentication flows
Non-Strong codes are used for `Plex.tv/link`
| | +| `clientName` | *Optional* | :heavy_minus_sign: | N/A | Plex Web | +| `deviceName` | *Optional* | :heavy_minus_sign: | N/A | Linux | +| `clientVersion` | *Optional* | :heavy_minus_sign: | N/A | 4.133.0 | +| `clientPlatform` | *Optional* | :heavy_minus_sign: | N/A | Chrome | \ No newline at end of file diff --git a/docs/models/operations/GetPlaylistContentsQueryParamType.md b/docs/models/operations/GetPlaylistContentsQueryParamType.md index e6e4dc86..6aa241fd 100644 --- a/docs/models/operations/GetPlaylistContentsQueryParamType.md +++ b/docs/models/operations/GetPlaylistContentsQueryParamType.md @@ -11,9 +11,9 @@ E.g. A movie library will not return anything with type 3 as there are no season ## Values -| Name | Value | -| ------- | ------- | -| `ONE` | 1 | -| `TWO` | 2 | -| `THREE` | 3 | -| `FOUR` | 4 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Movie` | 1 | +| `Show` | 2 | +| `Season` | 3 | +| `Episode` | 4 | \ No newline at end of file diff --git a/docs/models/operations/GetServerResourcesRequest.md b/docs/models/operations/GetServerResourcesRequest.md index 7c673bec..a42b1421 100644 --- a/docs/models/operations/GetServerResourcesRequest.md +++ b/docs/models/operations/GetServerResourcesRequest.md @@ -3,9 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `clientID` | *Optional* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| gcgzw5rz2xovp84b4vha3a40 | -| `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 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `includeHttps` | [Optional](../../models/operations/IncludeHttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 | +| `includeRelay` | [Optional](../../models/operations/IncludeRelay.md) | :heavy_minus_sign: | Include Relay addresses in the results
E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
| 1 | +| `includeIPv6` | [Optional](../../models/operations/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 | \ No newline at end of file diff --git a/docs/models/operations/GetTokenByPinIdRequest.md b/docs/models/operations/GetTokenByPinIdRequest.md index 784bd919..54c97fd5 100644 --- a/docs/models/operations/GetTokenByPinIdRequest.md +++ b/docs/models/operations/GetTokenByPinIdRequest.md @@ -3,7 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `clientID` | *Optional* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| gcgzw5rz2xovp84b4vha3a40 | -| `pinID` | *long* | :heavy_check_mark: | The PinID to retrieve an access token for | | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `pinID` | *long* | :heavy_check_mark: | The PinID to retrieve an access token for | \ No newline at end of file diff --git a/docs/models/operations/GetTokenDetailsUserPlexAccount.md b/docs/models/operations/GetTokenDetailsUserPlexAccount.md index 40521ffa..077a6a6b 100644 --- a/docs/models/operations/GetTokenDetailsUserPlexAccount.md +++ b/docs/models/operations/GetTokenDetailsUserPlexAccount.md @@ -26,7 +26,7 @@ Logged in user details | `homeAdmin` | *Optional* | :heavy_minus_sign: | If the account is the Plex Home admin | | | `homeSize` | *int* | :heavy_check_mark: | The number of accounts in the Plex Home | 1 | | `id` | *int* | :heavy_check_mark: | The Plex account ID | 13692262 | -| `joinedAt` | *long* | :heavy_check_mark: | Unix epoch datetime | 1556281940 | +| `joinedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | | `locale` | *Optional* | :heavy_check_mark: | The account locale | | | `mailingListActive` | *Optional* | :heavy_minus_sign: | If you are subscribed to the Plex newsletter | | | `mailingListStatus` | [MailingListStatus](../../models/operations/MailingListStatus.md) | :heavy_check_mark: | Your current mailing list status | | @@ -34,7 +34,7 @@ Logged in user details | ~~`pin`~~ | *Optional* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

[Might be removed] The hashed Plex Home PIN | | | `profile` | [UserProfile](../../models/operations/UserProfile.md) | :heavy_check_mark: | N/A | | | `protected_` | *Optional* | :heavy_minus_sign: | If the account has a Plex Home PIN enabled | | -| `rememberExpiresAt` | *long* | :heavy_check_mark: | Unix epoch datetime | 1556281940 | +| `rememberExpiresAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | | `restricted` | *Optional* | :heavy_minus_sign: | If the account is a Plex Home managed user | | | `roles` | List<*String*> | :heavy_minus_sign: | [Might be removed] List of account roles. Plexpass membership listed here | | | `scrobbleTypes` | *String* | :heavy_check_mark: | Unknown | | diff --git a/docs/models/operations/GetTopWatchedContentQueryParamType.md b/docs/models/operations/GetTopWatchedContentQueryParamType.md index 56ac05aa..e61f114e 100644 --- a/docs/models/operations/GetTopWatchedContentQueryParamType.md +++ b/docs/models/operations/GetTopWatchedContentQueryParamType.md @@ -11,9 +11,9 @@ E.g. A movie library will not return anything with type 3 as there are no season ## Values -| Name | Value | -| ------- | ------- | -| `ONE` | 1 | -| `TWO` | 2 | -| `THREE` | 3 | -| `FOUR` | 4 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Movie` | 1 | +| `Show` | 2 | +| `Season` | 3 | +| `Episode` | 4 | \ No newline at end of file diff --git a/docs/models/operations/IncludeGuids.md b/docs/models/operations/IncludeGuids.md index 47d1345d..eaba0b97 100644 --- a/docs/models/operations/IncludeGuids.md +++ b/docs/models/operations/IncludeGuids.md @@ -6,7 +6,7 @@ Adds the Guids object to the response ## Values -| Name | Value | -| ------ | ------ | -| `ZERO` | 0 | -| `ONE` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/IncludeHttps.md b/docs/models/operations/IncludeHttps.md index 5555a089..94382d40 100644 --- a/docs/models/operations/IncludeHttps.md +++ b/docs/models/operations/IncludeHttps.md @@ -5,7 +5,7 @@ Include Https entries in the results ## Values -| Name | Value | -| ------ | ------ | -| `ZERO` | 0 | -| `ONE` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/IncludeIPv6.md b/docs/models/operations/IncludeIPv6.md index 8cc0f7fc..0b70e657 100644 --- a/docs/models/operations/IncludeIPv6.md +++ b/docs/models/operations/IncludeIPv6.md @@ -5,7 +5,7 @@ Include IPv6 entries in the results ## Values -| Name | Value | -| ------ | ------ | -| `ZERO` | 0 | -| `ONE` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/IncludeMeta.md b/docs/models/operations/IncludeMeta.md index 4ef7e979..0f180ebe 100644 --- a/docs/models/operations/IncludeMeta.md +++ b/docs/models/operations/IncludeMeta.md @@ -6,7 +6,7 @@ Adds the Meta object to the response ## Values -| Name | Value | -| ------ | ------ | -| `ZERO` | 0 | -| `ONE` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/IncludeRelay.md b/docs/models/operations/IncludeRelay.md index a207a522..2136d5a1 100644 --- a/docs/models/operations/IncludeRelay.md +++ b/docs/models/operations/IncludeRelay.md @@ -7,7 +7,7 @@ E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400 ## Values -| Name | Value | -| ------ | ------ | -| `ZERO` | 0 | -| `ONE` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/Location.md b/docs/models/operations/Location.md index 1fa398fb..b49c986c 100644 --- a/docs/models/operations/Location.md +++ b/docs/models/operations/Location.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | -| `id` | *Optional* | :heavy_minus_sign: | N/A | 1 | -| `path` | *Optional* | :heavy_minus_sign: | N/A | /movies | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *int* | :heavy_check_mark: | N/A | 1 | +| `path` | *String* | :heavy_check_mark: | N/A | /movies | \ No newline at end of file diff --git a/docs/models/operations/MediaGuid.md b/docs/models/operations/MediaGuid.md new file mode 100644 index 00000000..1586aa87 --- /dev/null +++ b/docs/models/operations/MediaGuid.md @@ -0,0 +1,8 @@ +# MediaGuid + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | Can be one of the following formats:
imdb://tt13015952, tmdb://2434012, tvdb://7945991
| imdb://tt13015952 | \ No newline at end of file diff --git a/docs/models/operations/MediaReviewsVisibility.md b/docs/models/operations/MediaReviewsVisibility.md index ed29d5d6..b36e8021 100644 --- a/docs/models/operations/MediaReviewsVisibility.md +++ b/docs/models/operations/MediaReviewsVisibility.md @@ -1,9 +1,11 @@ # MediaReviewsVisibility +Whether or not the account has media reviews visibility enabled + ## Values -| Name | Value | -| ------ | ------ | -| `ZERO` | 0 | -| `ONE` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/Meta.md b/docs/models/operations/Meta.md new file mode 100644 index 00000000..597ce6ff --- /dev/null +++ b/docs/models/operations/Meta.md @@ -0,0 +1,12 @@ +# Meta + +The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `type` | List<[GetLibraryItemsType](../../models/operations/GetLibraryItemsType.md)> | :heavy_minus_sign: | N/A | +| `fieldType` | List<[GetLibraryItemsFieldType](../../models/operations/GetLibraryItemsFieldType.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/PlexDevice.md b/docs/models/operations/PlexDevice.md index 2b2cb51d..e274700b 100644 --- a/docs/models/operations/PlexDevice.md +++ b/docs/models/operations/PlexDevice.md @@ -3,29 +3,29 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `name` | *String* | :heavy_check_mark: | N/A | -| `product` | *String* | :heavy_check_mark: | N/A | -| `productVersion` | *String* | :heavy_check_mark: | N/A | -| `platform` | *Optional* | :heavy_check_mark: | N/A | -| `platformVersion` | *Optional* | :heavy_check_mark: | N/A | -| `device` | *Optional* | :heavy_check_mark: | N/A | -| `clientIdentifier` | *String* | :heavy_check_mark: | N/A | -| `createdAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | N/A | -| `lastSeenAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | N/A | -| `provides` | *String* | :heavy_check_mark: | N/A | -| `ownerId` | *Optional* | :heavy_check_mark: | ownerId is null when the device is owned by the token used to send the request | -| `sourceTitle` | *Optional* | :heavy_check_mark: | N/A | -| `publicAddress` | *String* | :heavy_check_mark: | N/A | -| `accessToken` | *String* | :heavy_check_mark: | N/A | -| `owned` | *boolean* | :heavy_check_mark: | N/A | -| `home` | *boolean* | :heavy_check_mark: | N/A | -| `synced` | *boolean* | :heavy_check_mark: | N/A | -| `relay` | *boolean* | :heavy_check_mark: | N/A | -| `presence` | *boolean* | :heavy_check_mark: | N/A | -| `httpsRequired` | *boolean* | :heavy_check_mark: | N/A | -| `publicAddressMatches` | *boolean* | :heavy_check_mark: | N/A | -| `dnsRebindingProtection` | *boolean* | :heavy_check_mark: | N/A | -| `natLoopbackSupported` | *boolean* | :heavy_check_mark: | N/A | -| `connections` | List<[Connections](../../models/operations/Connections.md)> | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `name` | *String* | :heavy_check_mark: | N/A | | +| `product` | *String* | :heavy_check_mark: | N/A | | +| `productVersion` | *String* | :heavy_check_mark: | N/A | | +| `platform` | *Optional* | :heavy_check_mark: | N/A | | +| `platformVersion` | *Optional* | :heavy_check_mark: | N/A | | +| `device` | *Optional* | :heavy_check_mark: | N/A | | +| `clientIdentifier` | *String* | :heavy_check_mark: | N/A | | +| `createdAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | N/A | 2019-06-24T11:38:02Z | +| `lastSeenAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | N/A | 2019-06-24T11:38:02Z | +| `provides` | *String* | :heavy_check_mark: | N/A | | +| `ownerId` | *Optional* | :heavy_check_mark: | ownerId is null when the device is owned by the token used to send the request | | +| `sourceTitle` | *Optional* | :heavy_check_mark: | N/A | | +| `publicAddress` | *String* | :heavy_check_mark: | N/A | | +| `accessToken` | *String* | :heavy_check_mark: | N/A | | +| `owned` | *boolean* | :heavy_check_mark: | N/A | | +| `home` | *boolean* | :heavy_check_mark: | N/A | | +| `synced` | *boolean* | :heavy_check_mark: | N/A | | +| `relay` | *boolean* | :heavy_check_mark: | N/A | | +| `presence` | *boolean* | :heavy_check_mark: | N/A | | +| `httpsRequired` | *boolean* | :heavy_check_mark: | N/A | | +| `publicAddressMatches` | *boolean* | :heavy_check_mark: | N/A | | +| `dnsRebindingProtection` | *boolean* | :heavy_check_mark: | N/A | | +| `natLoopbackSupported` | *boolean* | :heavy_check_mark: | N/A | | +| `connections` | List<[Connections](../../models/operations/Connections.md)> | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/PostUsersSignInDataAutoSelectSubtitle.md b/docs/models/operations/PostUsersSignInDataAutoSelectSubtitle.md index 110ba432..a1932db6 100644 --- a/docs/models/operations/PostUsersSignInDataAutoSelectSubtitle.md +++ b/docs/models/operations/PostUsersSignInDataAutoSelectSubtitle.md @@ -5,7 +5,7 @@ The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign aud ## Values -| Name | Value | -| ------ | ------ | -| `ZERO` | 0 | -| `ONE` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/PostUsersSignInDataDefaultSubtitleAccessibility.md b/docs/models/operations/PostUsersSignInDataDefaultSubtitleAccessibility.md index fd7aebbc..254dd69b 100644 --- a/docs/models/operations/PostUsersSignInDataDefaultSubtitleAccessibility.md +++ b/docs/models/operations/PostUsersSignInDataDefaultSubtitleAccessibility.md @@ -1,11 +1,11 @@ # 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 shown non-SDH subtitles) +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) ## Values -| Name | Value | -| ------ | ------ | -| `ZERO` | 0 | -| `ONE` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/PostUsersSignInDataDefaultSubtitleForced.md b/docs/models/operations/PostUsersSignInDataDefaultSubtitleForced.md index 7b918c1a..df668984 100644 --- a/docs/models/operations/PostUsersSignInDataDefaultSubtitleForced.md +++ b/docs/models/operations/PostUsersSignInDataDefaultSubtitleForced.md @@ -5,7 +5,7 @@ The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer ## Values -| Name | Value | -| ------ | ------ | -| `ZERO` | 0 | -| `ONE` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/PostUsersSignInDataMediaReviewsVisibility.md b/docs/models/operations/PostUsersSignInDataMediaReviewsVisibility.md index 5a357cc1..234a440f 100644 --- a/docs/models/operations/PostUsersSignInDataMediaReviewsVisibility.md +++ b/docs/models/operations/PostUsersSignInDataMediaReviewsVisibility.md @@ -1,9 +1,11 @@ # PostUsersSignInDataMediaReviewsVisibility +Whether or not the account has media reviews visibility enabled + ## Values -| Name | Value | -| ------ | ------ | -| `ZERO` | 0 | -| `ONE` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/PostUsersSignInDataRequest.md b/docs/models/operations/PostUsersSignInDataRequest.md deleted file mode 100644 index 5f103a7f..00000000 --- a/docs/models/operations/PostUsersSignInDataRequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# PostUsersSignInDataRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `clientID` | *Optional* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| gcgzw5rz2xovp84b4vha3a40 | -| `requestBody` | [Optional](../../models/operations/PostUsersSignInDataRequestBody.md) | :heavy_minus_sign: | Login credentials | | \ No newline at end of file diff --git a/docs/models/operations/PostUsersSignInDataUserPlexAccount.md b/docs/models/operations/PostUsersSignInDataUserPlexAccount.md index a5fd0808..3b4cfa65 100644 --- a/docs/models/operations/PostUsersSignInDataUserPlexAccount.md +++ b/docs/models/operations/PostUsersSignInDataUserPlexAccount.md @@ -26,7 +26,7 @@ Returns the user account data with a valid auth token | `homeAdmin` | *Optional* | :heavy_minus_sign: | If the account is the Plex Home admin | | | `homeSize` | *int* | :heavy_check_mark: | The number of accounts in the Plex Home | 1 | | `id` | *int* | :heavy_check_mark: | The Plex account ID | 13692262 | -| `joinedAt` | *long* | :heavy_check_mark: | Unix epoch datetime | 1556281940 | +| `joinedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | | `locale` | *Optional* | :heavy_check_mark: | The account locale | | | `mailingListActive` | *Optional* | :heavy_minus_sign: | If you are subscribed to the Plex newsletter | | | `mailingListStatus` | [PostUsersSignInDataMailingListStatus](../../models/operations/PostUsersSignInDataMailingListStatus.md) | :heavy_check_mark: | Your current mailing list status | | @@ -34,7 +34,7 @@ Returns the user account data with a valid auth token | ~~`pin`~~ | *Optional* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

[Might be removed] The hashed Plex Home PIN | | | `profile` | [PostUsersSignInDataUserProfile](../../models/operations/PostUsersSignInDataUserProfile.md) | :heavy_check_mark: | N/A | | | `protected_` | *Optional* | :heavy_minus_sign: | If the account has a Plex Home PIN enabled | | -| `rememberExpiresAt` | *long* | :heavy_check_mark: | Unix epoch datetime | 1556281940 | +| `rememberExpiresAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | | `restricted` | *Optional* | :heavy_minus_sign: | If the account is a Plex Home managed user | | | `roles` | List<*String*> | :heavy_minus_sign: | [Might be removed] List of account roles. Plexpass membership listed here | | | `scrobbleTypes` | *String* | :heavy_check_mark: | Unknown | | diff --git a/docs/models/operations/PostUsersSignInDataUserProfile.md b/docs/models/operations/PostUsersSignInDataUserProfile.md index 050f6ec1..e39309e4 100644 --- a/docs/models/operations/PostUsersSignInDataUserProfile.md +++ b/docs/models/operations/PostUsersSignInDataUserProfile.md @@ -3,13 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `autoSelectAudio` | *Optional* | :heavy_minus_sign: | If the account has automatically select audio and subtitle tracks enabled | true | -| `defaultAudioLanguage` | *Optional* | :heavy_check_mark: | The preferred audio language for the account | ja | -| `defaultSubtitleLanguage` | *Optional* | :heavy_check_mark: | The preferred subtitle language for the account | en | -| `autoSelectSubtitle` | [Optional](../../models/operations/PostUsersSignInDataAutoSelectSubtitle.md) | :heavy_minus_sign: | The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) | 1 | -| `defaultSubtitleAccessibility` | [Optional](../../models/operations/PostUsersSignInDataDefaultSubtitleAccessibility.md) | :heavy_minus_sign: | 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 shown non-SDH subtitles) | 1 | -| `defaultSubtitleForced` | [Optional](../../models/operations/PostUsersSignInDataDefaultSubtitleForced.md) | :heavy_minus_sign: | 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) | 0 | -| `watchedIndicator` | [Optional](../../models/operations/PostUsersSignInDataWatchedIndicator.md) | :heavy_minus_sign: | N/A | 1 | -| `mediaReviewsVisibility` | [Optional](../../models/operations/PostUsersSignInDataMediaReviewsVisibility.md) | :heavy_minus_sign: | N/A | 0 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `autoSelectAudio` | *Optional* | :heavy_minus_sign: | If the account has automatically select audio and subtitle tracks enabled | true | +| `defaultAudioLanguage` | *Optional* | :heavy_check_mark: | The preferred audio language for the account | ja | +| `defaultSubtitleLanguage` | *Optional* | :heavy_check_mark: | The preferred subtitle language for the account | en | +| `autoSelectSubtitle` | [Optional](../../models/operations/PostUsersSignInDataAutoSelectSubtitle.md) | :heavy_minus_sign: | N/A | 1 | +| `defaultSubtitleAccessibility` | [Optional](../../models/operations/PostUsersSignInDataDefaultSubtitleAccessibility.md) | :heavy_minus_sign: | N/A | 1 | +| `defaultSubtitleForced` | [Optional](../../models/operations/PostUsersSignInDataDefaultSubtitleForced.md) | :heavy_minus_sign: | N/A | 1 | +| `watchedIndicator` | [Optional](../../models/operations/PostUsersSignInDataWatchedIndicator.md) | :heavy_minus_sign: | N/A | 1 | +| `mediaReviewsVisibility` | [Optional](../../models/operations/PostUsersSignInDataMediaReviewsVisibility.md) | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/operations/PostUsersSignInDataWatchedIndicator.md b/docs/models/operations/PostUsersSignInDataWatchedIndicator.md index 005b2722..fa6d450f 100644 --- a/docs/models/operations/PostUsersSignInDataWatchedIndicator.md +++ b/docs/models/operations/PostUsersSignInDataWatchedIndicator.md @@ -1,9 +1,11 @@ # PostUsersSignInDataWatchedIndicator +Whether or not media watched indicators are enabled (little orange dot on media) + ## Values -| Name | Value | -| ------ | ------ | -| `ZERO` | 0 | -| `ONE` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/models/operations/Protocol.md b/docs/models/operations/Protocol.md new file mode 100644 index 00000000..fef75fb1 --- /dev/null +++ b/docs/models/operations/Protocol.md @@ -0,0 +1,11 @@ +# Protocol + +The protocol used for the connection (http, https, etc) + + +## Values + +| Name | Value | +| ------- | ------- | +| `HTTP` | http | +| `HTTPS` | https | \ No newline at end of file diff --git a/docs/models/operations/QueryParamType.md b/docs/models/operations/QueryParamType.md index 326cf754..65dedffc 100644 --- a/docs/models/operations/QueryParamType.md +++ b/docs/models/operations/QueryParamType.md @@ -11,9 +11,9 @@ E.g. A movie library will not return anything with type 3 as there are no season ## Values -| Name | Value | -| ------- | ------- | -| `ONE` | 1 | -| `TWO` | 2 | -| `THREE` | 3 | -| `FOUR` | 4 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Movie` | 1 | +| `Show` | 2 | +| `Season` | 3 | +| `Episode` | 4 | \ No newline at end of file diff --git a/docs/models/operations/Type.md b/docs/models/operations/Type.md index ad394078..9856d9e8 100644 --- a/docs/models/operations/Type.md +++ b/docs/models/operations/Type.md @@ -11,9 +11,9 @@ E.g. A movie library will not return anything with type 3 as there are no season ## Values -| Name | Value | -| ------- | ------- | -| `ONE` | 1 | -| `TWO` | 2 | -| `THREE` | 3 | -| `FOUR` | 4 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Movie` | 1 | +| `Show` | 2 | +| `Season` | 3 | +| `Episode` | 4 | \ No newline at end of file diff --git a/docs/models/operations/UploadPlaylistRequest.md b/docs/models/operations/UploadPlaylistRequest.md index 5b685c90..72505611 100644 --- a/docs/models/operations/UploadPlaylistRequest.md +++ b/docs/models/operations/UploadPlaylistRequest.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `path` | *String* | :heavy_check_mark: | absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
The GUID of each playlist is based on the filename.
If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.
The GUID of each playlist is based on the filename.
| /home/barkley/playlist.m3u | -| `force` | [QueryParamForce](../../models/operations/QueryParamForce.md) | :heavy_check_mark: | Force overwriting of duplicate playlists.
By default, a playlist file uploaded with the same path will overwrite the existing playlist.
The `force` argument is used to disable overwriting.
If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.
| | \ No newline at end of file +| `force` | [QueryParamForce](../../models/operations/QueryParamForce.md) | :heavy_check_mark: | Force overwriting of duplicate playlists.
By default, a playlist file uploaded with the same path will overwrite the existing playlist.
The `force` argument is used to disable overwriting.
If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.
| | +| `sectionID` | *long* | :heavy_check_mark: | Possibly the section ID to upload the playlist to, we are not certain. | 1 | \ No newline at end of file diff --git a/docs/models/operations/UserProfile.md b/docs/models/operations/UserProfile.md index 5a877fc6..d1dc176e 100644 --- a/docs/models/operations/UserProfile.md +++ b/docs/models/operations/UserProfile.md @@ -3,13 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `autoSelectAudio` | *Optional* | :heavy_minus_sign: | If the account has automatically select audio and subtitle tracks enabled | true | -| `defaultAudioLanguage` | *Optional* | :heavy_check_mark: | The preferred audio language for the account | ja | -| `defaultSubtitleLanguage` | *Optional* | :heavy_check_mark: | The preferred subtitle language for the account | en | -| `autoSelectSubtitle` | [Optional](../../models/operations/AutoSelectSubtitle.md) | :heavy_minus_sign: | The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) | 1 | -| `defaultSubtitleAccessibility` | [Optional](../../models/operations/DefaultSubtitleAccessibility.md) | :heavy_minus_sign: | 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 shown non-SDH subtitles) | 1 | -| `defaultSubtitleForced` | [Optional](../../models/operations/DefaultSubtitleForced.md) | :heavy_minus_sign: | 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) | 0 | -| `watchedIndicator` | [Optional](../../models/operations/WatchedIndicator.md) | :heavy_minus_sign: | N/A | 1 | -| `mediaReviewsVisibility` | [Optional](../../models/operations/MediaReviewsVisibility.md) | :heavy_minus_sign: | N/A | 0 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `autoSelectAudio` | *Optional* | :heavy_minus_sign: | If the account has automatically select audio and subtitle tracks enabled | true | +| `defaultAudioLanguage` | *Optional* | :heavy_check_mark: | The preferred audio language for the account | ja | +| `defaultSubtitleLanguage` | *Optional* | :heavy_check_mark: | The preferred subtitle language for the account | en | +| `autoSelectSubtitle` | [Optional](../../models/operations/AutoSelectSubtitle.md) | :heavy_minus_sign: | N/A | 1 | +| `defaultSubtitleAccessibility` | [Optional](../../models/operations/DefaultSubtitleAccessibility.md) | :heavy_minus_sign: | N/A | 1 | +| `defaultSubtitleForced` | [Optional](../../models/operations/DefaultSubtitleForced.md) | :heavy_minus_sign: | N/A | 1 | +| `watchedIndicator` | [Optional](../../models/operations/WatchedIndicator.md) | :heavy_minus_sign: | N/A | 1 | +| `mediaReviewsVisibility` | [Optional](../../models/operations/MediaReviewsVisibility.md) | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/operations/WatchedIndicator.md b/docs/models/operations/WatchedIndicator.md index 772d650f..5a931a76 100644 --- a/docs/models/operations/WatchedIndicator.md +++ b/docs/models/operations/WatchedIndicator.md @@ -1,9 +1,11 @@ # WatchedIndicator +Whether or not media watched indicators are enabled (little orange dot on media) + ## Values -| Name | Value | -| ------ | ------ | -| `ZERO` | 0 | -| `ONE` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdks/activities/README.md b/docs/sdks/activities/README.md index c3aa6570..0bab2e26 100644 --- a/docs/sdks/activities/README.md +++ b/docs/sdks/activities/README.md @@ -27,43 +27,30 @@ Get Server Activities package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetServerActivitiesBadRequest; +import dev.plexapi.sdk.models.errors.GetServerActivitiesUnauthorized; import dev.plexapi.sdk.models.operations.GetServerActivitiesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerActivitiesBadRequest, GetServerActivitiesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerActivitiesResponse res = sdk.activities().getServerActivities() + GetServerActivitiesResponse res = sdk.activities().getServerActivities() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetServerActivitiesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetServerActivitiesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -91,42 +78,29 @@ Cancel Server Activities package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.CancelServerActivitiesBadRequest; +import dev.plexapi.sdk.models.errors.CancelServerActivitiesUnauthorized; import dev.plexapi.sdk.models.operations.CancelServerActivitiesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws CancelServerActivitiesBadRequest, CancelServerActivitiesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities() + CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities() .activityUUID("25b71ed5-0f9d-461c-baa7-d404e9e10d3e") .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.CancelServerActivitiesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.CancelServerActivitiesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` diff --git a/docs/sdks/authentication/README.md b/docs/sdks/authentication/README.md index fd437398..975a1403 100644 --- a/docs/sdks/authentication/README.md +++ b/docs/sdks/authentication/README.md @@ -24,7 +24,8 @@ This endpoint provides the caller with a temporary token with the same access le package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetTransientTokenBadRequest; +import dev.plexapi.sdk.models.errors.GetTransientTokenUnauthorized; import dev.plexapi.sdk.models.operations.GetTransientTokenQueryParamType; import dev.plexapi.sdk.models.operations.GetTransientTokenResponse; import dev.plexapi.sdk.models.operations.Scope; @@ -32,37 +33,23 @@ import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetTransientTokenBadRequest, GetTransientTokenUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetTransientTokenResponse res = sdk.authentication().getTransientToken() + GetTransientTokenResponse res = sdk.authentication().getTransientToken() .type(GetTransientTokenQueryParamType.DELEGATION) .scope(Scope.ALL) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.GetTransientTokenBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetTransientTokenUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -99,42 +86,29 @@ Note: requires Plex Media Server >= 1.15.4. package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetSourceConnectionInformationBadRequest; +import dev.plexapi.sdk.models.errors.GetSourceConnectionInformationUnauthorized; import dev.plexapi.sdk.models.operations.GetSourceConnectionInformationResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetSourceConnectionInformationBadRequest, GetSourceConnectionInformationUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation() - .source("server://client-identifier") + GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation() + .source("provider://provider-identifier") .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.GetSourceConnectionInformationBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetSourceConnectionInformationUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -168,43 +142,30 @@ Get the User data from the provided X-Plex-Token package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetTokenDetailsBadRequest; +import dev.plexapi.sdk.models.errors.GetTokenDetailsUnauthorized; import dev.plexapi.sdk.models.operations.GetTokenDetailsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetTokenDetailsBadRequest, GetTokenDetailsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetTokenDetailsResponse res = sdk.authentication().getTokenDetails() + GetTokenDetailsResponse res = sdk.authentication().getTokenDetails() .call(); - if (res.userPlexAccount().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetTokenDetailsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetTokenDetailsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.userPlexAccount().isPresent()) { + // handle response } - } } ``` @@ -238,60 +199,47 @@ Sign in user with username and password and return user data with Plex authentic package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.PostUsersSignInDataBadRequest; +import dev.plexapi.sdk.models.errors.PostUsersSignInDataUnauthorized; import dev.plexapi.sdk.models.operations.PostUsersSignInDataRequestBody; import dev.plexapi.sdk.models.operations.PostUsersSignInDataResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws PostUsersSignInDataBadRequest, PostUsersSignInDataUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") + .build(); + + PostUsersSignInDataRequestBody req = PostUsersSignInDataRequestBody.builder() + .login("username@email.com") + .password("password123") + .verificationCode("123456") .build(); - PostUsersSignInDataResponse res = sdk.authentication().postUsersSignInData() - .clientID("gcgzw5rz2xovp84b4vha3a40") - .requestBody(PostUsersSignInDataRequestBody.builder() - .login("username@email.com") - .password("password123") - .verificationCode("123456") - .build()) + PostUsersSignInDataResponse res = sdk.authentication().postUsersSignInData() + .request(req) .call(); - if (res.userPlexAccount().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.PostUsersSignInDataBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.PostUsersSignInDataUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.userPlexAccount().isPresent()) { + // handle response } - } } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `clientID` | *Optional* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| gcgzw5rz2xovp84b4vha3a40 | -| `requestBody` | [Optional](../../models/operations/PostUsersSignInDataRequestBody.md) | :heavy_minus_sign: | Login credentials | | -| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `request` | [PostUsersSignInDataRequestBody](../../models/operations/PostUsersSignInDataRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | +| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | ### Response diff --git a/docs/sdks/butler/README.md b/docs/sdks/butler/README.md index e51242de..045a9b64 100644 --- a/docs/sdks/butler/README.md +++ b/docs/sdks/butler/README.md @@ -24,43 +24,30 @@ Returns a list of butler tasks package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetButlerTasksBadRequest; +import dev.plexapi.sdk.models.errors.GetButlerTasksUnauthorized; import dev.plexapi.sdk.models.operations.GetButlerTasksResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetButlerTasksBadRequest, GetButlerTasksUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetButlerTasksResponse res = sdk.butler().getButlerTasks() + GetButlerTasksResponse res = sdk.butler().getButlerTasks() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetButlerTasksBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetButlerTasksUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -93,41 +80,28 @@ This endpoint will attempt to start all Butler tasks that are enabled in the set package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.StartAllTasksBadRequest; +import dev.plexapi.sdk.models.errors.StartAllTasksUnauthorized; import dev.plexapi.sdk.models.operations.StartAllTasksResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws StartAllTasksBadRequest, StartAllTasksUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - StartAllTasksResponse res = sdk.butler().startAllTasks() + StartAllTasksResponse res = sdk.butler().startAllTasks() .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.StartAllTasksBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.StartAllTasksUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -156,41 +130,28 @@ This endpoint will stop all currently running tasks and remove any scheduled tas package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.StopAllTasksBadRequest; +import dev.plexapi.sdk.models.errors.StopAllTasksUnauthorized; import dev.plexapi.sdk.models.operations.StopAllTasksResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws StopAllTasksBadRequest, StopAllTasksUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - StopAllTasksResponse res = sdk.butler().stopAllTasks() + StopAllTasksResponse res = sdk.butler().stopAllTasks() .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.StopAllTasksBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.StopAllTasksUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -223,43 +184,30 @@ This endpoint will attempt to start a single Butler task that is enabled in the package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.StartTaskBadRequest; +import dev.plexapi.sdk.models.errors.StartTaskUnauthorized; import dev.plexapi.sdk.models.operations.StartTaskResponse; import dev.plexapi.sdk.models.operations.TaskName; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws StartTaskBadRequest, StartTaskUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - StartTaskResponse res = sdk.butler().startTask() + StartTaskResponse res = sdk.butler().startTask() .taskName(TaskName.CLEAN_OLD_BUNDLES) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.StartTaskBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.StartTaskUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -294,43 +242,30 @@ This endpoint will stop a currently running task by name, or remove it from the package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.StopTaskBadRequest; +import dev.plexapi.sdk.models.errors.StopTaskUnauthorized; import dev.plexapi.sdk.models.operations.PathParamTaskName; import dev.plexapi.sdk.models.operations.StopTaskResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws StopTaskBadRequest, StopTaskUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - StopTaskResponse res = sdk.butler().stopTask() + StopTaskResponse res = sdk.butler().stopTask() .taskName(PathParamTaskName.BACKUP_DATABASE) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.StopTaskBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.StopTaskUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` diff --git a/docs/sdks/hubs/README.md b/docs/sdks/hubs/README.md index ceb5667b..0ae96c86 100644 --- a/docs/sdks/hubs/README.md +++ b/docs/sdks/hubs/README.md @@ -21,46 +21,33 @@ Get Global Hubs filtered by the parameters provided. package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetGlobalHubsBadRequest; +import dev.plexapi.sdk.models.errors.GetGlobalHubsUnauthorized; import dev.plexapi.sdk.models.operations.GetGlobalHubsResponse; import dev.plexapi.sdk.models.operations.OnlyTransient; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetGlobalHubsBadRequest, GetGlobalHubsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs() + GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs() .count(1262.49d) .onlyTransient(OnlyTransient.ONE) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetGlobalHubsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetGlobalHubsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -96,47 +83,34 @@ This endpoint will return a list of library specific hubs package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetLibraryHubsBadRequest; +import dev.plexapi.sdk.models.errors.GetLibraryHubsUnauthorized; import dev.plexapi.sdk.models.operations.GetLibraryHubsResponse; import dev.plexapi.sdk.models.operations.QueryParamOnlyTransient; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetLibraryHubsBadRequest, GetLibraryHubsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs() + GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs() .sectionId(6728.76d) - .count(9010.22d) - .onlyTransient(QueryParamOnlyTransient.ZERO) + .count(639.24d) + .onlyTransient(QueryParamOnlyTransient.ONE) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetLibraryHubsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetLibraryHubsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` diff --git a/docs/sdks/library/README.md b/docs/sdks/library/README.md index d1c88de8..16a7eed7 100644 --- a/docs/sdks/library/README.md +++ b/docs/sdks/library/README.md @@ -31,43 +31,30 @@ This resource returns hash values for local files package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetFileHashBadRequest; +import dev.plexapi.sdk.models.errors.GetFileHashUnauthorized; import dev.plexapi.sdk.models.operations.GetFileHashResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetFileHashBadRequest, GetFileHashUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetFileHashResponse res = sdk.library().getFileHash() + GetFileHashResponse res = sdk.library().getFileHash() .url("file://C:\Image.png&type=13") .type(4462.17d) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.GetFileHashBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetFileHashUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -103,45 +90,32 @@ This endpoint will return the recently added content. package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetRecentlyAddedBadRequest; +import dev.plexapi.sdk.models.errors.GetRecentlyAddedUnauthorized; import dev.plexapi.sdk.models.operations.GetRecentlyAddedResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetRecentlyAddedBadRequest, GetRecentlyAddedUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetRecentlyAddedResponse res = sdk.library().getRecentlyAdded() + GetRecentlyAddedResponse res = sdk.library().getRecentlyAdded() .xPlexContainerStart(0) .xPlexContainerSize(50) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetRecentlyAddedBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetRecentlyAddedUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -182,43 +156,30 @@ This allows a client to provide a rich interface around the media (e.g. allow so package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetAllLibrariesBadRequest; +import dev.plexapi.sdk.models.errors.GetAllLibrariesUnauthorized; import dev.plexapi.sdk.models.operations.GetAllLibrariesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetAllLibrariesBadRequest, GetAllLibrariesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetAllLibrariesResponse res = sdk.library().getAllLibraries() + GetAllLibrariesResponse res = sdk.library().getAllLibraries() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetAllLibrariesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetAllLibrariesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -285,46 +246,33 @@ Each type in the library comes with a set of filters and sorts, aiding in buildi package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetLibraryDetailsBadRequest; +import dev.plexapi.sdk.models.errors.GetLibraryDetailsUnauthorized; import dev.plexapi.sdk.models.operations.GetLibraryDetailsResponse; import dev.plexapi.sdk.models.operations.IncludeDetails; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetLibraryDetailsBadRequest, GetLibraryDetailsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetLibraryDetailsResponse res = sdk.library().getLibraryDetails() + GetLibraryDetailsResponse res = sdk.library().getLibraryDetails() .sectionKey(9518) .includeDetails(IncludeDetails.ZERO) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetLibraryDetailsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetLibraryDetailsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -359,42 +307,29 @@ Delete a library using a specific section id package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.DeleteLibraryBadRequest; +import dev.plexapi.sdk.models.errors.DeleteLibraryUnauthorized; import dev.plexapi.sdk.models.operations.DeleteLibraryResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws DeleteLibraryBadRequest, DeleteLibraryUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - DeleteLibraryResponse res = sdk.library().deleteLibrary() + DeleteLibraryResponse res = sdk.library().deleteLibrary() .sectionKey(9518) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.DeleteLibraryBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.DeleteLibraryUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -448,7 +383,8 @@ Fetches details from a specific section of the library identified by a section k package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetLibraryItemsBadRequest; +import dev.plexapi.sdk.models.errors.GetLibraryItemsUnauthorized; import dev.plexapi.sdk.models.operations.GetLibraryItemsRequest; import dev.plexapi.sdk.models.operations.GetLibraryItemsResponse; import dev.plexapi.sdk.models.operations.IncludeGuids; @@ -459,48 +395,34 @@ import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetLibraryItemsBadRequest, GetLibraryItemsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetLibraryItemsRequest req = GetLibraryItemsRequest.builder() + GetLibraryItemsRequest req = GetLibraryItemsRequest.builder() .sectionKey(9518) .tag(Tag.EDITION) - .type(Type.TWO) - .includeGuids(IncludeGuids.ONE) - .includeMeta(IncludeMeta.ONE) + .type(Type.Show) + .includeGuids(IncludeGuids.Enable) + .includeMeta(IncludeMeta.Enable) .xPlexContainerStart(0) .xPlexContainerSize(50) .build(); - GetLibraryItemsResponse res = sdk.library().getLibraryItems() + GetLibraryItemsResponse res = sdk.library().getLibraryItems() .request(req) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetLibraryItemsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetLibraryItemsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -535,44 +457,31 @@ This endpoint Refreshes all the Metadata of the library. package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetRefreshLibraryMetadataBadRequest; +import dev.plexapi.sdk.models.errors.GetRefreshLibraryMetadataUnauthorized; import dev.plexapi.sdk.models.operations.Force; import dev.plexapi.sdk.models.operations.GetRefreshLibraryMetadataResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetRefreshLibraryMetadataBadRequest, GetRefreshLibraryMetadataUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata() + GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata() .sectionKey(9518) .force(Force.ONE) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.GetRefreshLibraryMetadataBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetRefreshLibraryMetadataUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -625,46 +534,33 @@ Each type in the library comes with a set of filters and sorts, aiding in buildi package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetSearchLibraryBadRequest; +import dev.plexapi.sdk.models.errors.GetSearchLibraryUnauthorized; import dev.plexapi.sdk.models.operations.GetSearchLibraryResponse; import dev.plexapi.sdk.models.operations.QueryParamType; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetSearchLibraryBadRequest, GetSearchLibraryUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetSearchLibraryResponse res = sdk.library().getSearchLibrary() + GetSearchLibraryResponse res = sdk.library().getSearchLibrary() .sectionKey(9518) - .type(QueryParamType.TWO) + .type(QueryParamType.Show) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetSearchLibraryBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetSearchLibraryUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -700,44 +596,31 @@ This endpoint will return the metadata of a library item specified with the rati package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetMetaDataByRatingKeyBadRequest; +import dev.plexapi.sdk.models.errors.GetMetaDataByRatingKeyUnauthorized; import dev.plexapi.sdk.models.operations.GetMetaDataByRatingKeyResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetMetaDataByRatingKeyBadRequest, GetMetaDataByRatingKeyUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetMetaDataByRatingKeyResponse res = sdk.library().getMetaDataByRatingKey() + GetMetaDataByRatingKeyResponse res = sdk.library().getMetaDataByRatingKey() .ratingKey(9518L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetMetaDataByRatingKeyBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetMetaDataByRatingKeyUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -772,45 +655,32 @@ This endpoint will return the children of of a library item specified with the r package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetMetadataChildrenBadRequest; +import dev.plexapi.sdk.models.errors.GetMetadataChildrenUnauthorized; import dev.plexapi.sdk.models.operations.GetMetadataChildrenResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetMetadataChildrenBadRequest, GetMetadataChildrenUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetMetadataChildrenResponse res = sdk.library().getMetadataChildren() - .ratingKey(1539.14d) + GetMetadataChildrenResponse res = sdk.library().getMetadataChildren() + .ratingKey(1539.15d) .includeElements("") .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetMetadataChildrenBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetMetadataChildrenUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -846,46 +716,33 @@ This endpoint will return the top watched content from libraries of a certain ty package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetTopWatchedContentBadRequest; +import dev.plexapi.sdk.models.errors.GetTopWatchedContentUnauthorized; import dev.plexapi.sdk.models.operations.GetTopWatchedContentQueryParamType; import dev.plexapi.sdk.models.operations.GetTopWatchedContentResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetTopWatchedContentBadRequest, GetTopWatchedContentUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent() - .type(GetTopWatchedContentQueryParamType.TWO) + GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent() + .type(GetTopWatchedContentQueryParamType.Show) .includeGuids(1L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetTopWatchedContentBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetTopWatchedContentUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -921,43 +778,30 @@ This endpoint will return the on deck content. package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetOnDeckBadRequest; +import dev.plexapi.sdk.models.errors.GetOnDeckUnauthorized; import dev.plexapi.sdk.models.operations.GetOnDeckResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetOnDeckBadRequest, GetOnDeckUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetOnDeckResponse res = sdk.library().getOnDeck() + GetOnDeckResponse res = sdk.library().getOnDeck() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetOnDeckBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetOnDeckUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` diff --git a/docs/sdks/log/README.md b/docs/sdks/log/README.md index 96fe7bd1..9ae96717 100644 --- a/docs/sdks/log/README.md +++ b/docs/sdks/log/README.md @@ -23,45 +23,32 @@ This endpoint will write a single-line log message, including a level and source package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.LogLineBadRequest; +import dev.plexapi.sdk.models.errors.LogLineUnauthorized; import dev.plexapi.sdk.models.operations.Level; import dev.plexapi.sdk.models.operations.LogLineResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws LogLineBadRequest, LogLineUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - LogLineResponse res = sdk.log().logLine() + LogLineResponse res = sdk.log().logLine() .level(Level.THREE) .message("Test log message") .source("Postman") .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.LogLineBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.LogLineUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -118,46 +105,33 @@ Ensure each parameter is properly URL-encoded to avoid interpretation issues. package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.LogMultiLineBadRequest; +import dev.plexapi.sdk.models.errors.LogMultiLineUnauthorized; import dev.plexapi.sdk.models.operations.LogMultiLineResponse; import java.lang.Exception; import java.lang.String; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws LogMultiLineBadRequest, LogMultiLineUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - String req = "level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman + 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"; - LogMultiLineResponse res = sdk.log().logMultiLine() + LogMultiLineResponse res = sdk.log().logMultiLine() .request(req) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.LogMultiLineBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.LogMultiLineUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -192,41 +166,28 @@ This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.EnablePaperTrailBadRequest; +import dev.plexapi.sdk.models.errors.EnablePaperTrailUnauthorized; import dev.plexapi.sdk.models.operations.EnablePaperTrailResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws EnablePaperTrailBadRequest, EnablePaperTrailUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - EnablePaperTrailResponse res = sdk.log().enablePaperTrail() + EnablePaperTrailResponse res = sdk.log().enablePaperTrail() .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.EnablePaperTrailBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.EnablePaperTrailUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` diff --git a/docs/sdks/media/README.md b/docs/sdks/media/README.md index 6f9453f4..1b103868 100644 --- a/docs/sdks/media/README.md +++ b/docs/sdks/media/README.md @@ -24,42 +24,29 @@ This will mark the provided media key as Played. package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.MarkPlayedBadRequest; +import dev.plexapi.sdk.models.errors.MarkPlayedUnauthorized; import dev.plexapi.sdk.models.operations.MarkPlayedResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws MarkPlayedBadRequest, MarkPlayedUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - MarkPlayedResponse res = sdk.media().markPlayed() + MarkPlayedResponse res = sdk.media().markPlayed() .key(59398d) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.MarkPlayedBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.MarkPlayedUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -93,42 +80,29 @@ This will mark the provided media key as Unplayed. package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.MarkUnplayedBadRequest; +import dev.plexapi.sdk.models.errors.MarkUnplayedUnauthorized; import dev.plexapi.sdk.models.operations.MarkUnplayedResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws MarkUnplayedBadRequest, MarkUnplayedUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - MarkUnplayedResponse res = sdk.media().markUnplayed() + MarkUnplayedResponse res = sdk.media().markUnplayed() .key(59398d) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.MarkUnplayedBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.MarkUnplayedUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -163,44 +137,31 @@ This API command can be used to update the play progress of a media item. package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.UpdatePlayProgressBadRequest; +import dev.plexapi.sdk.models.errors.UpdatePlayProgressUnauthorized; import dev.plexapi.sdk.models.operations.UpdatePlayProgressResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws UpdatePlayProgressBadRequest, UpdatePlayProgressUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - UpdatePlayProgressResponse res = sdk.media().updatePlayProgress() + UpdatePlayProgressResponse res = sdk.media().updatePlayProgress() .key("") .time(90000d) .state("played") .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.UpdatePlayProgressBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.UpdatePlayProgressUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -236,25 +197,26 @@ Gets the banner image of the media item package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetBannerImageBadRequest; +import dev.plexapi.sdk.models.errors.GetBannerImageUnauthorized; import dev.plexapi.sdk.models.operations.GetBannerImageRequest; import dev.plexapi.sdk.models.operations.GetBannerImageResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetBannerImageBadRequest, GetBannerImageUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetBannerImageRequest req = GetBannerImageRequest.builder() + GetBannerImageRequest req = GetBannerImageRequest.builder() .ratingKey(9518L) .width(396L) .height(396L) @@ -263,27 +225,13 @@ public class Application { .xPlexToken("CV5xoxjTpFKUzBTShsaf") .build(); - GetBannerImageResponse res = sdk.media().getBannerImage() + GetBannerImageResponse res = sdk.media().getBannerImage() .request(req) .call(); - if (res.responseStream().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetBannerImageBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetBannerImageUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.responseStream().isPresent()) { + // handle response } - } } ``` @@ -317,25 +265,26 @@ Gets the thumbnail image of the media item package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetThumbImageBadRequest; +import dev.plexapi.sdk.models.errors.GetThumbImageUnauthorized; import dev.plexapi.sdk.models.operations.GetThumbImageRequest; import dev.plexapi.sdk.models.operations.GetThumbImageResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetThumbImageBadRequest, GetThumbImageUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetThumbImageRequest req = GetThumbImageRequest.builder() + GetThumbImageRequest req = GetThumbImageRequest.builder() .ratingKey(9518L) .width(396L) .height(396L) @@ -344,27 +293,13 @@ public class Application { .xPlexToken("CV5xoxjTpFKUzBTShsaf") .build(); - GetThumbImageResponse res = sdk.media().getThumbImage() + GetThumbImageResponse res = sdk.media().getThumbImage() .request(req) .call(); - if (res.responseStream().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetThumbImageBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetThumbImageUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.responseStream().isPresent()) { + // handle response } - } } ``` diff --git a/docs/sdks/playlists/README.md b/docs/sdks/playlists/README.md index 9c5f4caa..1b4219ef 100644 --- a/docs/sdks/playlists/README.md +++ b/docs/sdks/playlists/README.md @@ -34,7 +34,8 @@ Create a new playlist. By default the playlist is blank. To create a playlist al package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.CreatePlaylistBadRequest; +import dev.plexapi.sdk.models.errors.CreatePlaylistUnauthorized; import dev.plexapi.sdk.models.operations.CreatePlaylistQueryParamType; import dev.plexapi.sdk.models.operations.CreatePlaylistRequest; import dev.plexapi.sdk.models.operations.CreatePlaylistResponse; @@ -43,45 +44,31 @@ import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws CreatePlaylistBadRequest, CreatePlaylistUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - CreatePlaylistRequest req = CreatePlaylistRequest.builder() + CreatePlaylistRequest req = CreatePlaylistRequest.builder() .title("") .type(CreatePlaylistQueryParamType.PHOTO) .smart(Smart.ONE) - .uri("https://inborn-brochure.biz") + .uri("https://hoarse-testing.info/") .build(); - CreatePlaylistResponse res = sdk.playlists().createPlaylist() + CreatePlaylistResponse res = sdk.playlists().createPlaylist() .request(req) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.CreatePlaylistBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.CreatePlaylistUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -115,7 +102,8 @@ Get All Playlists given the specified filters. package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetPlaylistsBadRequest; +import dev.plexapi.sdk.models.errors.GetPlaylistsUnauthorized; import dev.plexapi.sdk.models.operations.GetPlaylistsResponse; import dev.plexapi.sdk.models.operations.PlaylistType; import dev.plexapi.sdk.models.operations.QueryParamSmart; @@ -123,39 +111,25 @@ import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetPlaylistsBadRequest, GetPlaylistsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetPlaylistsResponse res = sdk.playlists().getPlaylists() + GetPlaylistsResponse res = sdk.playlists().getPlaylists() .playlistType(PlaylistType.AUDIO) .smart(QueryParamSmart.ZERO) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetPlaylistsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetPlaylistsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -192,44 +166,31 @@ Smart playlist details contain the `content` attribute. This is the content URI package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetPlaylistBadRequest; +import dev.plexapi.sdk.models.errors.GetPlaylistUnauthorized; import dev.plexapi.sdk.models.operations.GetPlaylistResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetPlaylistBadRequest, GetPlaylistUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetPlaylistResponse res = sdk.playlists().getPlaylist() + GetPlaylistResponse res = sdk.playlists().getPlaylist() .playlistID(4109.48d) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetPlaylistBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetPlaylistUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -264,42 +225,29 @@ This endpoint will delete a playlist package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.DeletePlaylistBadRequest; +import dev.plexapi.sdk.models.errors.DeletePlaylistUnauthorized; import dev.plexapi.sdk.models.operations.DeletePlaylistResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws DeletePlaylistBadRequest, DeletePlaylistUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - DeletePlaylistResponse res = sdk.playlists().deletePlaylist() + DeletePlaylistResponse res = sdk.playlists().deletePlaylist() .playlistID(216.22d) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.DeletePlaylistBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.DeletePlaylistUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -334,44 +282,31 @@ From PMS version 1.9.1 clients can also edit playlist metadata using this endpoi package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.UpdatePlaylistBadRequest; +import dev.plexapi.sdk.models.errors.UpdatePlaylistUnauthorized; import dev.plexapi.sdk.models.operations.UpdatePlaylistResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws UpdatePlaylistBadRequest, UpdatePlaylistUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - UpdatePlaylistResponse res = sdk.playlists().updatePlaylist() - .playlistID(3915d) + UpdatePlaylistResponse res = sdk.playlists().updatePlaylist() + .playlistID(3915.00d) .title("") .summary("") .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.UpdatePlaylistBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.UpdatePlaylistUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -411,46 +346,33 @@ Note that for dumb playlists, items have a `playlistItemID` attribute which is u package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetPlaylistContentsBadRequest; +import dev.plexapi.sdk.models.errors.GetPlaylistContentsUnauthorized; import dev.plexapi.sdk.models.operations.GetPlaylistContentsQueryParamType; import dev.plexapi.sdk.models.operations.GetPlaylistContentsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetPlaylistContentsBadRequest, GetPlaylistContentsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents() + GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents() .playlistID(5004.46d) - .type(GetPlaylistContentsQueryParamType.TWO) + .type(GetPlaylistContentsQueryParamType.Show) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetPlaylistContentsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetPlaylistContentsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -486,42 +408,29 @@ Clears a playlist, only works with dumb playlists. Returns the playlist. package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.ClearPlaylistContentsBadRequest; +import dev.plexapi.sdk.models.errors.ClearPlaylistContentsUnauthorized; import dev.plexapi.sdk.models.operations.ClearPlaylistContentsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws ClearPlaylistContentsBadRequest, ClearPlaylistContentsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents() + ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents() .playlistID(1893.18d) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.ClearPlaylistContentsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.ClearPlaylistContentsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -557,46 +466,33 @@ With a smart playlist, passing a new `uri` parameter replaces the rules for the package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.AddPlaylistContentsBadRequest; +import dev.plexapi.sdk.models.errors.AddPlaylistContentsUnauthorized; import dev.plexapi.sdk.models.operations.AddPlaylistContentsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws AddPlaylistContentsBadRequest, AddPlaylistContentsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents() - .playlistID(8502.01d) + AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents() + .playlistID(8502.00d) .uri("server://12345/com.plexapp.plugins.library/library/metadata/1") .playQueueID(123d) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.AddPlaylistContentsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.AddPlaylistContentsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -633,44 +529,32 @@ Imports m3u playlists by passing a path on the server to scan for m3u-formatted package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.UploadPlaylistBadRequest; +import dev.plexapi.sdk.models.errors.UploadPlaylistUnauthorized; import dev.plexapi.sdk.models.operations.QueryParamForce; import dev.plexapi.sdk.models.operations.UploadPlaylistResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws UploadPlaylistBadRequest, UploadPlaylistUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - UploadPlaylistResponse res = sdk.playlists().uploadPlaylist() + UploadPlaylistResponse res = sdk.playlists().uploadPlaylist() .path("/home/barkley/playlist.m3u") .force(QueryParamForce.ZERO) + .sectionID(1L) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.UploadPlaylistBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.UploadPlaylistUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -681,6 +565,7 @@ public class Application { | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `path` | *String* | :heavy_check_mark: | absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
The GUID of each playlist is based on the filename.
If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.
The GUID of each playlist is based on the filename.
| /home/barkley/playlist.m3u | | `force` | [QueryParamForce](../../models/operations/QueryParamForce.md) | :heavy_check_mark: | Force overwriting of duplicate playlists.
By default, a playlist file uploaded with the same path will overwrite the existing playlist.
The `force` argument is used to disable overwriting.
If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.
| | +| `sectionID` | *long* | :heavy_check_mark: | Possibly the section ID to upload the playlist to, we are not certain. | 1 | ### Response diff --git a/docs/sdks/plex/README.md b/docs/sdks/plex/README.md index 834f941b..994b0a05 100644 --- a/docs/sdks/plex/README.md +++ b/docs/sdks/plex/README.md @@ -26,43 +26,30 @@ Get Companions Data package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetCompanionsDataBadRequest; +import dev.plexapi.sdk.models.errors.GetCompanionsDataUnauthorized; import dev.plexapi.sdk.models.operations.GetCompanionsDataResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetCompanionsDataBadRequest, GetCompanionsDataUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetCompanionsDataResponse res = sdk.plex().getCompanionsData() + GetCompanionsDataResponse res = sdk.plex().getCompanionsData() .call(); - if (res.responseBodies().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetCompanionsDataBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetCompanionsDataUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.responseBodies().isPresent()) { + // handle response } - } } ``` @@ -96,43 +83,30 @@ Get friends of provided auth token. package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetUserFriendsBadRequest; +import dev.plexapi.sdk.models.errors.GetUserFriendsUnauthorized; import dev.plexapi.sdk.models.operations.GetUserFriendsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetUserFriendsBadRequest, GetUserFriendsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetUserFriendsResponse res = sdk.plex().getUserFriends() + GetUserFriendsResponse res = sdk.plex().getUserFriends() .call(); - if (res.friends().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetUserFriendsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetUserFriendsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.friends().isPresent()) { + // handle response } - } } ``` @@ -166,42 +140,29 @@ Returns the geolocation and locale data of the caller package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetGeoDataBadRequest; +import dev.plexapi.sdk.models.errors.GetGeoDataUnauthorized; import dev.plexapi.sdk.models.operations.GetGeoDataResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetGeoDataBadRequest, GetGeoDataUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetGeoDataResponse res = sdk.plex().getGeoData() + GetGeoDataResponse res = sdk.plex().getGeoData() .call(); - if (res.geoData().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetGeoDataBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetGeoDataUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.geoData().isPresent()) { + // handle response } - } } ``` @@ -235,43 +196,30 @@ Retrieves the home data for the authenticated user, including details like home package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetHomeDataBadRequest; +import dev.plexapi.sdk.models.errors.GetHomeDataUnauthorized; import dev.plexapi.sdk.models.operations.GetHomeDataResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetHomeDataBadRequest, GetHomeDataUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetHomeDataResponse res = sdk.plex().getHomeData() + GetHomeDataResponse res = sdk.plex().getHomeData() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetHomeDataBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetHomeDataUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -299,7 +247,8 @@ Get Plex server access tokens and server connections package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetServerResourcesBadRequest; +import dev.plexapi.sdk.models.errors.GetServerResourcesUnauthorized; import dev.plexapi.sdk.models.operations.GetServerResourcesResponse; import dev.plexapi.sdk.models.operations.IncludeHttps; import dev.plexapi.sdk.models.operations.IncludeIPv6; @@ -308,54 +257,38 @@ import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerResourcesBadRequest, GetServerResourcesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerResourcesResponse res = sdk.plex().getServerResources() - .clientID("gcgzw5rz2xovp84b4vha3a40") - .includeHttps(IncludeHttps.ONE) - .includeRelay(IncludeRelay.ONE) - .includeIPv6(IncludeIPv6.ONE) + GetServerResourcesResponse res = sdk.plex().getServerResources() + .includeHttps(IncludeHttps.Enable) + .includeRelay(IncludeRelay.Enable) + .includeIPv6(IncludeIPv6.Enable) .call(); - if (res.plexDevices().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetServerResourcesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetServerResourcesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.plexDevices().isPresent()) { + // handle response } - } } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `clientID` | *Optional* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| gcgzw5rz2xovp84b4vha3a40 | -| `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 | -| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `includeHttps` | [Optional](../../models/operations/IncludeHttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 | +| `includeRelay` | [Optional](../../models/operations/IncludeRelay.md) | :heavy_minus_sign: | Include Relay addresses in the results
E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
| 1 | +| `includeIPv6` | [Optional](../../models/operations/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 | +| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | ### Response @@ -380,44 +313,33 @@ Retrieve a Pin ID from Plex.tv to use for authentication flows package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetPinBadRequest; import dev.plexapi.sdk.models.operations.GetPinRequest; import dev.plexapi.sdk.models.operations.GetPinResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetPinBadRequest, Exception { + + PlexAPI sdk = PlexAPI.builder() .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") + .build(); + + GetPinRequest req = GetPinRequest.builder() .build(); - GetPinRequest req = GetPinRequest.builder() - .build(); - - GetPinResponse res = sdk.plex().getPin() + GetPinResponse res = sdk.plex().getPin() .request(req) .call(); - if (res.authPinContainer().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetPinBadRequest e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.authPinContainer().isPresent()) { + // handle response } - } } ``` @@ -451,55 +373,40 @@ Retrieve an Access Token from Plex.tv after the Pin has been authenticated package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetTokenByPinIdBadRequest; +import dev.plexapi.sdk.models.errors.GetTokenByPinIdResponseBody; import dev.plexapi.sdk.models.operations.GetTokenByPinIdResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetTokenByPinIdBadRequest, GetTokenByPinIdResponseBody, Exception { + + PlexAPI sdk = PlexAPI.builder() .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId() - .clientID("gcgzw5rz2xovp84b4vha3a40") + GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId() .pinID(408895L) .call(); - if (res.authPinContainer().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetTokenByPinIdBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetTokenByPinIdResponseBody e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.authPinContainer().isPresent()) { + // handle response } - } } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `clientID` | *Optional* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| gcgzw5rz2xovp84b4vha3a40 | -| `pinID` | *long* | :heavy_check_mark: | The PinID to retrieve an access token for | | -| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | +| Parameter | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `pinID` | *long* | :heavy_check_mark: | The PinID to retrieve an access token for | +| `serverURL` | *String* | :heavy_minus_sign: | An optional server URL to use. | ### Response diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index ebe49944..609fde6a 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -34,44 +34,31 @@ This request is intended to be very fast, and called as the user types. package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.PerformSearchBadRequest; +import dev.plexapi.sdk.models.errors.PerformSearchUnauthorized; import dev.plexapi.sdk.models.operations.PerformSearchResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws PerformSearchBadRequest, PerformSearchUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - PerformSearchResponse res = sdk.search().performSearch() - .query("arnold") - .sectionId(9372.7d) + PerformSearchResponse res = sdk.search().performSearch() + .query("dylan") + .sectionId(5838.67d) .limit(5d) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.PerformSearchBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.PerformSearchUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -111,44 +98,31 @@ Results, as well as their containing per-type hubs, contain a `distance` attribu package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.PerformVoiceSearchBadRequest; +import dev.plexapi.sdk.models.errors.PerformVoiceSearchUnauthorized; import dev.plexapi.sdk.models.operations.PerformVoiceSearchResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws PerformVoiceSearchBadRequest, PerformVoiceSearchUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - PerformVoiceSearchResponse res = sdk.search().performVoiceSearch() + PerformVoiceSearchResponse res = sdk.search().performVoiceSearch() .query("dead+poop") - .sectionId(4094.8d) + .sectionId(4094.80d) .limit(5d) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.PerformVoiceSearchBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.PerformVoiceSearchUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -184,44 +158,31 @@ This will search the database for the string provided. package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetSearchResultsBadRequest; +import dev.plexapi.sdk.models.errors.GetSearchResultsUnauthorized; import dev.plexapi.sdk.models.operations.GetSearchResultsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetSearchResultsBadRequest, GetSearchResultsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetSearchResultsResponse res = sdk.search().getSearchResults() + GetSearchResultsResponse res = sdk.search().getSearchResults() .query("110") .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetSearchResultsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetSearchResultsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` diff --git a/docs/sdks/server/README.md b/docs/sdks/server/README.md index d345cf25..c6003ace 100644 --- a/docs/sdks/server/README.md +++ b/docs/sdks/server/README.md @@ -28,43 +28,30 @@ Get Server Capabilities package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized; import dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() + GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -92,43 +79,30 @@ Get Server Preferences package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetServerPreferencesBadRequest; +import dev.plexapi.sdk.models.errors.GetServerPreferencesUnauthorized; import dev.plexapi.sdk.models.operations.GetServerPreferencesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerPreferencesBadRequest, GetServerPreferencesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerPreferencesResponse res = sdk.server().getServerPreferences() + GetServerPreferencesResponse res = sdk.server().getServerPreferences() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetServerPreferencesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetServerPreferencesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -156,43 +130,30 @@ Get Available Clients package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetAvailableClientsBadRequest; +import dev.plexapi.sdk.models.errors.GetAvailableClientsUnauthorized; import dev.plexapi.sdk.models.operations.GetAvailableClientsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetAvailableClientsBadRequest, GetAvailableClientsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetAvailableClientsResponse res = sdk.server().getAvailableClients() + GetAvailableClientsResponse res = sdk.server().getAvailableClients() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetAvailableClientsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetAvailableClientsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -220,43 +181,30 @@ Get Devices package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetDevicesBadRequest; +import dev.plexapi.sdk.models.errors.GetDevicesUnauthorized; import dev.plexapi.sdk.models.operations.GetDevicesResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetDevicesBadRequest, GetDevicesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetDevicesResponse res = sdk.server().getDevices() + GetDevicesResponse res = sdk.server().getDevices() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetDevicesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetDevicesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -284,39 +232,28 @@ This request is useful to determine if the server is online or offline package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetServerIdentityRequestTimeout; import dev.plexapi.sdk.models.operations.GetServerIdentityResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerIdentityRequestTimeout, Exception { + + PlexAPI sdk = PlexAPI.builder() .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerIdentityResponse res = sdk.server().getServerIdentity() + GetServerIdentityResponse res = sdk.server().getServerIdentity() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetServerIdentityRequestTimeout e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -343,43 +280,30 @@ Returns MyPlex Account Information package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetMyPlexAccountBadRequest; +import dev.plexapi.sdk.models.errors.GetMyPlexAccountUnauthorized; import dev.plexapi.sdk.models.operations.GetMyPlexAccountResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetMyPlexAccountBadRequest, GetMyPlexAccountUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount() + GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetMyPlexAccountBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetMyPlexAccountUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -408,7 +332,8 @@ Plex's Photo transcoder is used throughout the service to serve images at specif package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetResizedPhotoBadRequest; +import dev.plexapi.sdk.models.errors.GetResizedPhotoUnauthorized; import dev.plexapi.sdk.models.operations.GetResizedPhotoRequest; import dev.plexapi.sdk.models.operations.GetResizedPhotoResponse; import dev.plexapi.sdk.models.operations.MinSize; @@ -417,46 +342,32 @@ import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetResizedPhotoBadRequest, GetResizedPhotoUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetResizedPhotoRequest req = GetResizedPhotoRequest.builder() + GetResizedPhotoRequest req = GetResizedPhotoRequest.builder() .width(110d) .height(165d) .opacity(100L) - .blur(4000d) - .minSize(MinSize.ZERO) - .upscale(Upscale.ZERO) + .blur(0d) + .minSize(MinSize.ONE) + .upscale(Upscale.ONE) .url("/library/metadata/49564/thumb/1654258204") .build(); - GetResizedPhotoResponse res = sdk.server().getResizedPhoto() + GetResizedPhotoResponse res = sdk.server().getResizedPhoto() .request(req) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.GetResizedPhotoBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetResizedPhotoUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -490,44 +401,31 @@ Retrieves media providers and their features from the Plex server. package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetMediaProvidersBadRequest; +import dev.plexapi.sdk.models.errors.GetMediaProvidersUnauthorized; import dev.plexapi.sdk.models.operations.GetMediaProvidersResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetMediaProvidersBadRequest, GetMediaProvidersUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetMediaProvidersResponse res = sdk.server().getMediaProviders() + GetMediaProvidersResponse res = sdk.server().getMediaProviders() .xPlexToken("CV5xoxjTpFKUzBTShsaf") .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetMediaProvidersBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetMediaProvidersUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -561,43 +459,30 @@ Get Server List package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetServerListBadRequest; +import dev.plexapi.sdk.models.errors.GetServerListUnauthorized; import dev.plexapi.sdk.models.operations.GetServerListResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetServerListBadRequest, GetServerListUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetServerListResponse res = sdk.server().getServerList() + GetServerListResponse res = sdk.server().getServerList() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetServerListBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetServerListUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md index 37c96a8b..96aaf5d0 100644 --- a/docs/sdks/sessions/README.md +++ b/docs/sdks/sessions/README.md @@ -23,43 +23,30 @@ This will retrieve the "Now Playing" Information of the PMS. package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetSessionsBadRequest; +import dev.plexapi.sdk.models.errors.GetSessionsUnauthorized; import dev.plexapi.sdk.models.operations.GetSessionsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetSessionsBadRequest, GetSessionsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetSessionsResponse res = sdk.sessions().getSessions() + GetSessionsResponse res = sdk.sessions().getSessions() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetSessionsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetSessionsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -87,25 +74,26 @@ This will Retrieve a listing of all history views. package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetSessionHistoryBadRequest; +import dev.plexapi.sdk.models.errors.GetSessionHistoryUnauthorized; import dev.plexapi.sdk.models.operations.GetSessionHistoryResponse; import dev.plexapi.sdk.models.operations.QueryParamFilter; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetSessionHistoryBadRequest, GetSessionHistoryUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetSessionHistoryResponse res = sdk.sessions().getSessionHistory() + GetSessionHistoryResponse res = sdk.sessions().getSessionHistory() .sort("") .accountId(1L) .filter(QueryParamFilter.builder() @@ -113,23 +101,9 @@ public class Application { .librarySectionID(12L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetSessionHistoryBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetSessionHistoryUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -166,43 +140,30 @@ Get Transcode Sessions package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetTranscodeSessionsBadRequest; +import dev.plexapi.sdk.models.errors.GetTranscodeSessionsUnauthorized; import dev.plexapi.sdk.models.operations.GetTranscodeSessionsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetTranscodeSessionsBadRequest, GetTranscodeSessionsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions() + GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetTranscodeSessionsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetTranscodeSessionsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -230,42 +191,29 @@ Stop a Transcode Session package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.StopTranscodeSessionBadRequest; +import dev.plexapi.sdk.models.errors.StopTranscodeSessionUnauthorized; import dev.plexapi.sdk.models.operations.StopTranscodeSessionResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws StopTranscodeSessionBadRequest, StopTranscodeSessionUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession() + StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession() .sessionKey("zz7llzqlx8w9vnrsbnwhbmep") .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.StopTranscodeSessionBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.StopTranscodeSessionUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` diff --git a/docs/sdks/statistics/README.md b/docs/sdks/statistics/README.md index 31eb176a..bfdd27e2 100644 --- a/docs/sdks/statistics/README.md +++ b/docs/sdks/statistics/README.md @@ -22,44 +22,31 @@ This will return the media statistics for the server package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetStatisticsBadRequest; +import dev.plexapi.sdk.models.errors.GetStatisticsUnauthorized; import dev.plexapi.sdk.models.operations.GetStatisticsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetStatisticsBadRequest, GetStatisticsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetStatisticsResponse res = sdk.statistics().getStatistics() + GetStatisticsResponse res = sdk.statistics().getStatistics() .timespan(4L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetStatisticsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetStatisticsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -93,44 +80,31 @@ This will return the resources for the server package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetResourcesStatisticsBadRequest; +import dev.plexapi.sdk.models.errors.GetResourcesStatisticsUnauthorized; import dev.plexapi.sdk.models.operations.GetResourcesStatisticsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetResourcesStatisticsBadRequest, GetResourcesStatisticsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics() + GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics() .timespan(4L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetResourcesStatisticsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetResourcesStatisticsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -164,44 +138,31 @@ This will return the bandwidth statistics for the server package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetBandwidthStatisticsBadRequest; +import dev.plexapi.sdk.models.errors.GetBandwidthStatisticsUnauthorized; import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetBandwidthStatisticsBadRequest, GetBandwidthStatisticsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics() + GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics() .timespan(4L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetBandwidthStatisticsBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetBandwidthStatisticsUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` diff --git a/docs/sdks/updater/README.md b/docs/sdks/updater/README.md index 799055d8..46c467a1 100644 --- a/docs/sdks/updater/README.md +++ b/docs/sdks/updater/README.md @@ -23,43 +23,30 @@ Querying status of updates package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetUpdateStatusBadRequest; +import dev.plexapi.sdk.models.errors.GetUpdateStatusUnauthorized; import dev.plexapi.sdk.models.operations.GetUpdateStatusResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetUpdateStatusBadRequest, GetUpdateStatusUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetUpdateStatusResponse res = sdk.updater().getUpdateStatus() + GetUpdateStatusResponse res = sdk.updater().getUpdateStatus() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetUpdateStatusBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetUpdateStatusUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` @@ -87,43 +74,30 @@ Checking for updates package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.CheckForUpdatesBadRequest; +import dev.plexapi.sdk.models.errors.CheckForUpdatesUnauthorized; import dev.plexapi.sdk.models.operations.CheckForUpdatesResponse; import dev.plexapi.sdk.models.operations.Download; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws CheckForUpdatesBadRequest, CheckForUpdatesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - CheckForUpdatesResponse res = sdk.updater().checkForUpdates() + CheckForUpdatesResponse res = sdk.updater().checkForUpdates() .download(Download.ONE) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.CheckForUpdatesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.CheckForUpdatesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -158,7 +132,8 @@ Note that these two parameters are effectively mutually exclusive. The `tonight` package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.ApplyUpdatesBadRequest; +import dev.plexapi.sdk.models.errors.ApplyUpdatesUnauthorized; import dev.plexapi.sdk.models.operations.ApplyUpdatesResponse; import dev.plexapi.sdk.models.operations.Skip; import dev.plexapi.sdk.models.operations.Tonight; @@ -166,37 +141,23 @@ import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws ApplyUpdatesBadRequest, ApplyUpdatesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - ApplyUpdatesResponse res = sdk.updater().applyUpdates() + ApplyUpdatesResponse res = sdk.updater().applyUpdates() .tonight(Tonight.ONE) .skip(Skip.ONE) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.ApplyUpdatesBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.ApplyUpdatesUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` diff --git a/docs/sdks/video/README.md b/docs/sdks/video/README.md index 377fcc82..d9b56e16 100644 --- a/docs/sdks/video/README.md +++ b/docs/sdks/video/README.md @@ -21,7 +21,8 @@ Get the timeline for a media item package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetTimelineBadRequest; +import dev.plexapi.sdk.models.errors.GetTimelineUnauthorized; import dev.plexapi.sdk.models.operations.GetTimelineRequest; import dev.plexapi.sdk.models.operations.GetTimelineResponse; import dev.plexapi.sdk.models.operations.State; @@ -29,18 +30,18 @@ import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetTimelineBadRequest, GetTimelineUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetTimelineRequest req = GetTimelineRequest.builder() + GetTimelineRequest req = GetTimelineRequest.builder() .ratingKey(23409d) .key("/library/metadata/23409") .state(State.PLAYING) @@ -53,25 +54,11 @@ public class Application { .row(1d) .build(); - GetTimelineResponse res = sdk.video().getTimeline() + GetTimelineResponse res = sdk.video().getTimeline() .request(req) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.GetTimelineBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetTimelineUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` @@ -105,25 +92,26 @@ Begin a Universal Transcode Session package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.StartUniversalTranscodeBadRequest; +import dev.plexapi.sdk.models.errors.StartUniversalTranscodeUnauthorized; import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequest; import dev.plexapi.sdk.models.operations.StartUniversalTranscodeResponse; import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws StartUniversalTranscodeBadRequest, StartUniversalTranscodeUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder() + StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder() .hasMDE(1d) .path("/library/metadata/23409") .mediaIndex(0d) @@ -142,25 +130,11 @@ public class Application { .autoAdjustQuality(0d) .build(); - StartUniversalTranscodeResponse res = sdk.video().startUniversalTranscode() + StartUniversalTranscodeResponse res = sdk.video().startUniversalTranscode() .request(req) .call(); - // handle response - } catch (dev.plexapi.sdk.models.errors.StartUniversalTranscodeBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.StartUniversalTranscodeUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } ``` diff --git a/docs/sdks/watchlist/README.md b/docs/sdks/watchlist/README.md index 7a030a5f..ccc54eed 100644 --- a/docs/sdks/watchlist/README.md +++ b/docs/sdks/watchlist/README.md @@ -20,7 +20,8 @@ Get User Watchlist package hello.world; import dev.plexapi.sdk.PlexAPI; -import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.errors.GetWatchListBadRequest; +import dev.plexapi.sdk.models.errors.GetWatchListUnauthorized; import dev.plexapi.sdk.models.operations.Filter; import dev.plexapi.sdk.models.operations.GetWatchListRequest; import dev.plexapi.sdk.models.operations.GetWatchListResponse; @@ -28,45 +29,31 @@ import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetWatchListBadRequest, GetWatchListUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") .clientID("gcgzw5rz2xovp84b4vha3a40") .clientName("Plex Web") .clientVersion("4.133.0") .clientPlatform("Chrome") .deviceName("Linux") - .build(); + .build(); - GetWatchListRequest req = GetWatchListRequest.builder() + GetWatchListRequest req = GetWatchListRequest.builder() .filter(Filter.AVAILABLE) .xPlexToken("CV5xoxjTpFKUzBTShsaf") .xPlexContainerStart(0) .xPlexContainerSize(50) .build(); - GetWatchListResponse res = sdk.watchlist().getWatchList() + GetWatchListResponse res = sdk.watchlist().getWatchList() .request(req) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (dev.plexapi.sdk.models.errors.GetWatchListBadRequest e) { - // handle exception - throw e; - } catch (dev.plexapi.sdk.models.errors.GetWatchListUnauthorized e) { - // handle exception - throw e; - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } ``` diff --git a/src/main/java/dev/plexapi/sdk/Activities.java b/src/main/java/dev/plexapi/sdk/Activities.java index fda6805e..aada74ce 100644 --- a/src/main/java/dev/plexapi/sdk/Activities.java +++ b/src/main/java/dev/plexapi/sdk/Activities.java @@ -77,7 +77,7 @@ public class Activities implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -234,7 +234,7 @@ public class Activities implements HTTPRequest _req = new HTTPRequest(_url, "DELETE"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); diff --git a/src/main/java/dev/plexapi/sdk/Authentication.java b/src/main/java/dev/plexapi/sdk/Authentication.java index 4a40f2d9..550cda51 100644 --- a/src/main/java/dev/plexapi/sdk/Authentication.java +++ b/src/main/java/dev/plexapi/sdk/Authentication.java @@ -24,7 +24,6 @@ import dev.plexapi.sdk.models.operations.GetTransientTokenQueryParamType; import dev.plexapi.sdk.models.operations.GetTransientTokenRequest; import dev.plexapi.sdk.models.operations.GetTransientTokenRequestBuilder; import dev.plexapi.sdk.models.operations.GetTransientTokenResponse; -import dev.plexapi.sdk.models.operations.PostUsersSignInDataRequest; import dev.plexapi.sdk.models.operations.PostUsersSignInDataRequestBody; import dev.plexapi.sdk.models.operations.PostUsersSignInDataRequestBuilder; import dev.plexapi.sdk.models.operations.PostUsersSignInDataResponse; @@ -118,7 +117,7 @@ public class Authentication implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetTransientTokenRequest.class, @@ -271,7 +270,7 @@ public class Authentication implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetSourceConnectionInformationRequest.class, @@ -426,7 +425,7 @@ public class Authentication implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -564,32 +563,20 @@ public class Authentication implements * @throws Exception if the API call fails */ public PostUsersSignInDataResponse postUsersSignInDataDirect() throws Exception { - return postUsersSignInData(Optional.empty(), Optional.empty(), Optional.empty()); + return postUsersSignInData(Optional.empty(), Optional.empty()); } /** * Get User Sign In Data * Sign in user with username and password and return user data with Plex authentication token - * @param clientID The unique identifier for the client application - This is used to track the client application and its usage - (UUID, serial number, or other number unique per device) - - * @param requestBody Login credentials + * @param request The request object containing all of the parameters for the API call. * @param serverURL Overrides the server URL. * @return The response from the API call * @throws Exception if the API call fails */ public PostUsersSignInDataResponse postUsersSignInData( - Optional clientID, - Optional requestBody, + Optional request, Optional serverURL) throws Exception { - PostUsersSignInDataRequest request = - PostUsersSignInDataRequest - .builder() - .clientID(clientID) - .requestBody(requestBody) - .build(); - String _baseUrl = Utils.templateUrl(POST_USERS_SIGN_IN_DATA_SERVERS[0], new HashMap()); if (serverURL.isPresent() && !serverURL.get().isBlank()) { _baseUrl = serverURL.get(); @@ -602,21 +589,16 @@ public class Authentication implements Object _convertedRequest = Utils.convertToShape( request, JsonShape.DEFAULT, - new TypeReference() {}); + new TypeReference>() {}); SerializedBody _serializedRequestBody = Utils.serializeRequestBody( _convertedRequest, - "requestBody", + "request", "form", false); _req.setBody(Optional.ofNullable(_serializedRequestBody)); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); - - _req.addQueryParams(Utils.getQueryParams( - PostUsersSignInDataRequest.class, - request, - this.sdkConfiguration.globals)); + SDKConfiguration.USER_AGENT); HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = diff --git a/src/main/java/dev/plexapi/sdk/Butler.java b/src/main/java/dev/plexapi/sdk/Butler.java index 91693074..03491621 100644 --- a/src/main/java/dev/plexapi/sdk/Butler.java +++ b/src/main/java/dev/plexapi/sdk/Butler.java @@ -89,7 +89,7 @@ public class Butler implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -246,7 +246,7 @@ public class Butler implements HTTPRequest _req = new HTTPRequest(_url, "POST"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -384,7 +384,7 @@ public class Butler implements HTTPRequest _req = new HTTPRequest(_url, "DELETE"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -540,7 +540,7 @@ public class Butler implements HTTPRequest _req = new HTTPRequest(_url, "POST"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -688,7 +688,7 @@ public class Butler implements HTTPRequest _req = new HTTPRequest(_url, "DELETE"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); diff --git a/src/main/java/dev/plexapi/sdk/Hubs.java b/src/main/java/dev/plexapi/sdk/Hubs.java index 069e1672..2ae4ed2b 100644 --- a/src/main/java/dev/plexapi/sdk/Hubs.java +++ b/src/main/java/dev/plexapi/sdk/Hubs.java @@ -97,7 +97,7 @@ public class Hubs implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetGlobalHubsRequest.class, @@ -280,7 +280,7 @@ public class Hubs implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetLibraryHubsRequest.class, diff --git a/src/main/java/dev/plexapi/sdk/Library.java b/src/main/java/dev/plexapi/sdk/Library.java index 570e6f48..6798e804 100644 --- a/src/main/java/dev/plexapi/sdk/Library.java +++ b/src/main/java/dev/plexapi/sdk/Library.java @@ -168,7 +168,7 @@ public class Library implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetFileHashRequest.class, @@ -339,7 +339,7 @@ public class Library implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetRecentlyAddedRequest.class, @@ -503,7 +503,7 @@ public class Library implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -798,7 +798,7 @@ public class Library implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetLibraryDetailsRequest.class, @@ -962,7 +962,7 @@ public class Library implements HTTPRequest _req = new HTTPRequest(_url, "DELETE"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -1142,7 +1142,7 @@ public class Library implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetLibraryItemsRequest.class, @@ -1326,7 +1326,7 @@ public class Library implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetRefreshLibraryMetadataRequest.class, @@ -1524,7 +1524,7 @@ public class Library implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetSearchLibraryRequest.class, @@ -1688,7 +1688,7 @@ public class Library implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -1864,7 +1864,7 @@ public class Library implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetMetadataChildrenRequest.class, @@ -2055,7 +2055,7 @@ public class Library implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetTopWatchedContentRequest.class, @@ -2209,7 +2209,7 @@ public class Library implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); diff --git a/src/main/java/dev/plexapi/sdk/Log.java b/src/main/java/dev/plexapi/sdk/Log.java index 0be2a085..28ca5d90 100644 --- a/src/main/java/dev/plexapi/sdk/Log.java +++ b/src/main/java/dev/plexapi/sdk/Log.java @@ -101,7 +101,7 @@ public class Log implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( LogLineRequest.class, @@ -299,7 +299,7 @@ public class Log implements _req.setBody(Optional.ofNullable(_serializedRequestBody)); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -437,7 +437,7 @@ public class Log implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); diff --git a/src/main/java/dev/plexapi/sdk/Media.java b/src/main/java/dev/plexapi/sdk/Media.java index cdcc2759..ce4c711e 100644 --- a/src/main/java/dev/plexapi/sdk/Media.java +++ b/src/main/java/dev/plexapi/sdk/Media.java @@ -97,7 +97,7 @@ public class Media implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( MarkPlayedRequest.class, @@ -246,7 +246,7 @@ public class Media implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( MarkUnplayedRequest.class, @@ -403,7 +403,7 @@ public class Media implements HTTPRequest _req = new HTTPRequest(_url, "POST"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( UpdatePlayProgressRequest.class, @@ -548,7 +548,7 @@ public class Media implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "image/jpeg") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetBannerImageRequest.class, @@ -704,7 +704,7 @@ public class Media implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "image/jpeg") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetThumbImageRequest.class, diff --git a/src/main/java/dev/plexapi/sdk/Playlists.java b/src/main/java/dev/plexapi/sdk/Playlists.java index 893e13ab..3fd57515 100644 --- a/src/main/java/dev/plexapi/sdk/Playlists.java +++ b/src/main/java/dev/plexapi/sdk/Playlists.java @@ -134,7 +134,7 @@ public class Playlists implements HTTPRequest _req = new HTTPRequest(_url, "POST"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( CreatePlaylistRequest.class, @@ -307,7 +307,7 @@ public class Playlists implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetPlaylistsRequest.class, @@ -473,7 +473,7 @@ public class Playlists implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -632,7 +632,7 @@ public class Playlists implements HTTPRequest _req = new HTTPRequest(_url, "DELETE"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -799,7 +799,7 @@ public class Playlists implements HTTPRequest _req = new HTTPRequest(_url, "PUT"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( UpdatePlaylistRequest.class, @@ -967,7 +967,7 @@ public class Playlists implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetPlaylistContentsRequest.class, @@ -1131,7 +1131,7 @@ public class Playlists implements HTTPRequest _req = new HTTPRequest(_url, "DELETE"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -1303,7 +1303,7 @@ public class Playlists implements HTTPRequest _req = new HTTPRequest(_url, "PUT"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( AddPlaylistContentsRequest.class, @@ -1456,17 +1456,20 @@ public class Playlists implements The `force` argument is used to disable overwriting. If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded. + * @param sectionID Possibly the section ID to upload the playlist to, we are not certain. * @return The response from the API call * @throws Exception if the API call fails */ public UploadPlaylistResponse uploadPlaylist( String path, - QueryParamForce force) throws Exception { + QueryParamForce force, + long sectionID) throws Exception { UploadPlaylistRequest request = UploadPlaylistRequest .builder() .path(path) .force(force) + .sectionID(sectionID) .build(); String _baseUrl = Utils.templateUrl( @@ -1478,7 +1481,7 @@ public class Playlists implements HTTPRequest _req = new HTTPRequest(_url, "POST"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( UploadPlaylistRequest.class, diff --git a/src/main/java/dev/plexapi/sdk/Plex.java b/src/main/java/dev/plexapi/sdk/Plex.java index 8706df44..0ed09434 100644 --- a/src/main/java/dev/plexapi/sdk/Plex.java +++ b/src/main/java/dev/plexapi/sdk/Plex.java @@ -163,7 +163,7 @@ public class Plex implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -324,7 +324,7 @@ public class Plex implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -485,7 +485,7 @@ public class Plex implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = @@ -629,7 +629,7 @@ public class Plex implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -767,16 +767,12 @@ public class Plex implements * @throws Exception if the API call fails */ public GetServerResourcesResponse getServerResourcesDirect() throws Exception { - return getServerResources(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + return getServerResources(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } /** * Get Server Resources * Get Plex server access tokens and server connections - * @param clientID The unique identifier for the client application - This is used to track the client application and its usage - (UUID, serial number, or other number unique per device) - * @param includeHttps Include Https entries in the results * @param includeRelay Include Relay addresses in the results E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400 @@ -787,7 +783,6 @@ public class Plex implements * @throws Exception if the API call fails */ public GetServerResourcesResponse getServerResources( - Optional clientID, Optional includeHttps, Optional includeRelay, Optional includeIPv6, @@ -795,7 +790,6 @@ public class Plex implements GetServerResourcesRequest request = GetServerResourcesRequest .builder() - .clientID(clientID) .includeHttps(includeHttps) .includeRelay(includeRelay) .includeIPv6(includeIPv6) @@ -812,7 +806,7 @@ public class Plex implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetServerResourcesRequest.class, @@ -982,7 +976,7 @@ public class Plex implements HTTPRequest _req = new HTTPRequest(_url, "POST"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetPinRequest.class, @@ -1108,29 +1102,23 @@ public class Plex implements */ public GetTokenByPinIdResponse getTokenByPinId( long pinID) throws Exception { - return getTokenByPinId(Optional.empty(), pinID, Optional.empty()); + return getTokenByPinId(pinID, Optional.empty()); } /** * Get Access Token by PinId * Retrieve an Access Token from Plex.tv after the Pin has been authenticated - * @param clientID The unique identifier for the client application - This is used to track the client application and its usage - (UUID, serial number, or other number unique per device) - * @param pinID The PinID to retrieve an access token for * @param serverURL Overrides the server URL. * @return The response from the API call * @throws Exception if the API call fails */ public GetTokenByPinIdResponse getTokenByPinId( - Optional clientID, long pinID, Optional serverURL) throws Exception { GetTokenByPinIdRequest request = GetTokenByPinIdRequest .builder() - .clientID(clientID) .pinID(pinID) .build(); @@ -1147,12 +1135,7 @@ public class Plex implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); - - _req.addQueryParams(Utils.getQueryParams( - GetTokenByPinIdRequest.class, - request, - this.sdkConfiguration.globals)); + SDKConfiguration.USER_AGENT); HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = diff --git a/src/main/java/dev/plexapi/sdk/PlexAPI.java b/src/main/java/dev/plexapi/sdk/PlexAPI.java index 377c5f30..99cc2daf 100644 --- a/src/main/java/dev/plexapi/sdk/PlexAPI.java +++ b/src/main/java/dev/plexapi/sdk/PlexAPI.java @@ -9,6 +9,7 @@ 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; +import dev.plexapi.sdk.utils.Utils; import java.lang.String; import java.util.Map; import java.util.Optional; @@ -337,7 +338,7 @@ public class PlexAPI { * @return The builder instance. */ public Builder serverURL(String serverUrl, Map params) { - this.sdkConfiguration.serverUrl = dev.plexapi.sdk.utils.Utils.templateUrl(serverUrl, params); + this.sdkConfiguration.serverUrl = Utils.templateUrl(serverUrl, params); return this; } diff --git a/src/main/java/dev/plexapi/sdk/SDKConfiguration.java b/src/main/java/dev/plexapi/sdk/SDKConfiguration.java index 3138266e..197aafb2 100644 --- a/src/main/java/dev/plexapi/sdk/SDKConfiguration.java +++ b/src/main/java/dev/plexapi/sdk/SDKConfiguration.java @@ -34,11 +34,14 @@ class SDKConfiguration { put("port", "32400"); } }); } }; - public String language = "java"; - public String openapiDocVersion = "0.0.3"; - public String sdkVersion = "0.3.6"; - public String genVersion = "2.416.6"; - public String userAgent = "speakeasy-sdk/java 0.3.6 2.416.6 0.0.3 dev.plexapi.sdk"; + private static final String LANGUAGE = "java"; + public static final String OPENAPI_DOC_VERSION = "0.0.3"; + public static final String SDK_VERSION = "0.4.0"; + public static final String GEN_VERSION = "2.421.3"; + private static final String BASE_PACKAGE = "dev.plexapi.sdk"; + public static final String USER_AGENT = + String.format("speakeasy-sdk/%s %s %s %s %s", + LANGUAGE, SDK_VERSION, GEN_VERSION, OPENAPI_DOC_VERSION, BASE_PACKAGE); private Hooks _hooks = createHooks(); diff --git a/src/main/java/dev/plexapi/sdk/Search.java b/src/main/java/dev/plexapi/sdk/Search.java index 00bc1ccf..79fa01f5 100644 --- a/src/main/java/dev/plexapi/sdk/Search.java +++ b/src/main/java/dev/plexapi/sdk/Search.java @@ -141,7 +141,7 @@ public class Search implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( PerformSearchRequest.class, @@ -320,7 +320,7 @@ public class Search implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( PerformVoiceSearchRequest.class, @@ -469,7 +469,7 @@ public class Search implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetSearchResultsRequest.class, diff --git a/src/main/java/dev/plexapi/sdk/Server.java b/src/main/java/dev/plexapi/sdk/Server.java index 26d6caf6..e093e156 100644 --- a/src/main/java/dev/plexapi/sdk/Server.java +++ b/src/main/java/dev/plexapi/sdk/Server.java @@ -113,7 +113,7 @@ public class Server implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -260,7 +260,7 @@ public class Server implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -407,7 +407,7 @@ public class Server implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -554,7 +554,7 @@ public class Server implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -701,7 +701,7 @@ public class Server implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); HTTPClient _client = this.sdkConfiguration.defaultClient; HttpRequest _r = @@ -829,7 +829,7 @@ public class Server implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -980,7 +980,7 @@ public class Server implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetResizedPhotoRequest.class, @@ -1129,7 +1129,7 @@ public class Server implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetMediaProvidersRequest.class, @@ -1281,7 +1281,7 @@ public class Server implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); diff --git a/src/main/java/dev/plexapi/sdk/Sessions.java b/src/main/java/dev/plexapi/sdk/Sessions.java index a0ef451e..403ede4d 100644 --- a/src/main/java/dev/plexapi/sdk/Sessions.java +++ b/src/main/java/dev/plexapi/sdk/Sessions.java @@ -86,7 +86,7 @@ public class Sessions implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -265,7 +265,7 @@ public class Sessions implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetSessionHistoryRequest.class, @@ -417,7 +417,7 @@ public class Sessions implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -574,7 +574,7 @@ public class Sessions implements HTTPRequest _req = new HTTPRequest(_url, "DELETE"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); diff --git a/src/main/java/dev/plexapi/sdk/Statistics.java b/src/main/java/dev/plexapi/sdk/Statistics.java index 1a5192fe..f0873e0b 100644 --- a/src/main/java/dev/plexapi/sdk/Statistics.java +++ b/src/main/java/dev/plexapi/sdk/Statistics.java @@ -101,7 +101,7 @@ public class Statistics implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetStatisticsRequest.class, @@ -273,7 +273,7 @@ public class Statistics implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetResourcesStatisticsRequest.class, @@ -445,7 +445,7 @@ public class Statistics implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetBandwidthStatisticsRequest.class, diff --git a/src/main/java/dev/plexapi/sdk/Updater.java b/src/main/java/dev/plexapi/sdk/Updater.java index b1789b06..14e60e8c 100644 --- a/src/main/java/dev/plexapi/sdk/Updater.java +++ b/src/main/java/dev/plexapi/sdk/Updater.java @@ -81,7 +81,7 @@ public class Updater implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); Utils.configureSecurity(_req, this.sdkConfiguration.securitySource.getSecurity()); @@ -246,7 +246,7 @@ public class Updater implements HTTPRequest _req = new HTTPRequest(_url, "PUT"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( CheckForUpdatesRequest.class, @@ -411,7 +411,7 @@ public class Updater implements HTTPRequest _req = new HTTPRequest(_url, "PUT"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( ApplyUpdatesRequest.class, diff --git a/src/main/java/dev/plexapi/sdk/Video.java b/src/main/java/dev/plexapi/sdk/Video.java index 110a8e33..19699f3d 100644 --- a/src/main/java/dev/plexapi/sdk/Video.java +++ b/src/main/java/dev/plexapi/sdk/Video.java @@ -73,7 +73,7 @@ public class Video implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetTimelineRequest.class, @@ -216,7 +216,7 @@ public class Video implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( StartUniversalTranscodeRequest.class, diff --git a/src/main/java/dev/plexapi/sdk/Watchlist.java b/src/main/java/dev/plexapi/sdk/Watchlist.java index 1317e3c4..b6bc3503 100644 --- a/src/main/java/dev/plexapi/sdk/Watchlist.java +++ b/src/main/java/dev/plexapi/sdk/Watchlist.java @@ -97,7 +97,7 @@ public class Watchlist implements HTTPRequest _req = new HTTPRequest(_url, "GET"); _req.addHeader("Accept", "application/json") .addHeader("user-agent", - this.sdkConfiguration.userAgent); + SDKConfiguration.USER_AGENT); _req.addQueryParams(Utils.getQueryParams( GetWatchListRequest.class, diff --git a/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsRequestBuilder.java index c5e886b5..1758781b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsRequestBuilder.java @@ -26,7 +26,7 @@ public class AddPlaylistContentsRequestBuilder { return this; } - public AddPlaylistContentsRequestBuilder uri(java.lang.String uri) { + public AddPlaylistContentsRequestBuilder uri(String uri) { Utils.checkNotNull(uri, "uri"); this.uri = uri; return this; @@ -38,7 +38,7 @@ public class AddPlaylistContentsRequestBuilder { return this; } - public AddPlaylistContentsRequestBuilder playQueueID(java.util.Optional playQueueID) { + public AddPlaylistContentsRequestBuilder playQueueID(Optional playQueueID) { Utils.checkNotNull(playQueueID, "playQueueID"); this.playQueueID = playQueueID; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesRequestBuilder.java index cf12fc43..afa2efd7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesRequestBuilder.java @@ -17,25 +17,25 @@ public class ApplyUpdatesRequestBuilder { this.sdk = sdk; } - public ApplyUpdatesRequestBuilder tonight(dev.plexapi.sdk.models.operations.Tonight tonight) { + public ApplyUpdatesRequestBuilder tonight(Tonight tonight) { Utils.checkNotNull(tonight, "tonight"); this.tonight = Optional.of(tonight); return this; } - public ApplyUpdatesRequestBuilder tonight(java.util.Optional tonight) { + public ApplyUpdatesRequestBuilder tonight(Optional tonight) { Utils.checkNotNull(tonight, "tonight"); this.tonight = tonight; return this; } - public ApplyUpdatesRequestBuilder skip(dev.plexapi.sdk.models.operations.Skip skip) { + public ApplyUpdatesRequestBuilder skip(Skip skip) { Utils.checkNotNull(skip, "skip"); this.skip = Optional.of(skip); return this; } - public ApplyUpdatesRequestBuilder skip(java.util.Optional skip) { + public ApplyUpdatesRequestBuilder skip(Optional skip) { Utils.checkNotNull(skip, "skip"); this.skip = skip; return this; 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 204bd3a0..d98bc549 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/AutoSelectSubtitle.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/AutoSelectSubtitle.java @@ -5,23 +5,22 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; -import java.lang.String; /** * AutoSelectSubtitle - The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) */ public enum AutoSelectSubtitle { - ZERO("0"), - ONE("1"); + Disable(0), + Enable(1); @JsonValue - private final String value; + private final int value; - private AutoSelectSubtitle(String value) { + private AutoSelectSubtitle(int value) { this.value = value; } - public String value() { + public int value() { return value; } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesRequestBuilder.java index 0b8f713a..c1297b2a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesRequestBuilder.java @@ -16,7 +16,7 @@ public class CancelServerActivitiesRequestBuilder { this.sdk = sdk; } - public CancelServerActivitiesRequestBuilder activityUUID(java.lang.String activityUUID) { + public CancelServerActivitiesRequestBuilder activityUUID(String activityUUID) { Utils.checkNotNull(activityUUID, "activityUUID"); this.activityUUID = activityUUID; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesRequestBuilder.java index ab034bcc..b0a8f421 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesRequestBuilder.java @@ -16,13 +16,13 @@ public class CheckForUpdatesRequestBuilder { this.sdk = sdk; } - public CheckForUpdatesRequestBuilder download(dev.plexapi.sdk.models.operations.Download download) { + public CheckForUpdatesRequestBuilder download(Download download) { Utils.checkNotNull(download, "download"); this.download = Optional.of(download); return this; } - public CheckForUpdatesRequestBuilder download(java.util.Optional download) { + public CheckForUpdatesRequestBuilder download(Optional download) { Utils.checkNotNull(download, "download"); this.download = download; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Connections.java b/src/main/java/dev/plexapi/sdk/models/operations/Connections.java index 225c6e23..fe464ea3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Connections.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Connections.java @@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import dev.plexapi.sdk.utils.Utils; import java.lang.Boolean; -import java.lang.Double; +import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.util.Objects; @@ -18,32 +18,53 @@ import java.util.Objects; public class Connections { + /** + * The protocol used for the connection (http, https, etc) + */ @JsonProperty("protocol") - private String protocol; + private Protocol protocol; + /** + * The (ip) address or domain name used for the connection + */ @JsonProperty("address") private String address; + /** + * The port used for the connection + */ @JsonProperty("port") - private double port; + private int port; + /** + * The full URI of the connection + */ @JsonProperty("uri") private String uri; + /** + * If the connection is local address + */ @JsonProperty("local") private boolean local; + /** + * If the connection is relayed through plex.direct + */ @JsonProperty("relay") private boolean relay; + /** + * If the connection is using IPv6 + */ @JsonProperty("IPv6") private boolean iPv6; @JsonCreator public Connections( - @JsonProperty("protocol") String protocol, + @JsonProperty("protocol") Protocol protocol, @JsonProperty("address") String address, - @JsonProperty("port") double port, + @JsonProperty("port") int port, @JsonProperty("uri") String uri, @JsonProperty("local") boolean local, @JsonProperty("relay") boolean relay, @@ -64,36 +85,57 @@ public class Connections { this.iPv6 = iPv6; } + /** + * The protocol used for the connection (http, https, etc) + */ @JsonIgnore - public String protocol() { + public Protocol protocol() { return protocol; } + /** + * The (ip) address or domain name used for the connection + */ @JsonIgnore public String address() { return address; } + /** + * The port used for the connection + */ @JsonIgnore - public double port() { + public int port() { return port; } + /** + * The full URI of the connection + */ @JsonIgnore public String uri() { return uri; } + /** + * If the connection is local address + */ @JsonIgnore public boolean local() { return local; } + /** + * If the connection is relayed through plex.direct + */ @JsonIgnore public boolean relay() { return relay; } + /** + * If the connection is using IPv6 + */ @JsonIgnore public boolean iPv6() { return iPv6; @@ -103,42 +145,63 @@ public class Connections { return new Builder(); } - public Connections withProtocol(String protocol) { + /** + * The protocol used for the connection (http, https, etc) + */ + public Connections withProtocol(Protocol protocol) { Utils.checkNotNull(protocol, "protocol"); this.protocol = protocol; return this; } + /** + * The (ip) address or domain name used for the connection + */ public Connections withAddress(String address) { Utils.checkNotNull(address, "address"); this.address = address; return this; } - public Connections withPort(double port) { + /** + * The port used for the connection + */ + public Connections withPort(int port) { Utils.checkNotNull(port, "port"); this.port = port; return this; } + /** + * The full URI of the connection + */ public Connections withUri(String uri) { Utils.checkNotNull(uri, "uri"); this.uri = uri; return this; } + /** + * If the connection is local address + */ public Connections withLocal(boolean local) { Utils.checkNotNull(local, "local"); this.local = local; return this; } + /** + * If the connection is relayed through plex.direct + */ public Connections withRelay(boolean relay) { Utils.checkNotNull(relay, "relay"); this.relay = relay; return this; } + /** + * If the connection is using IPv6 + */ public Connections withIPv6(boolean iPv6) { Utils.checkNotNull(iPv6, "iPv6"); this.iPv6 = iPv6; @@ -190,11 +253,11 @@ public class Connections { public final static class Builder { - private String protocol; + private Protocol protocol; private String address; - private Double port; + private Integer port; private String uri; @@ -208,42 +271,63 @@ public class Connections { // force use of static builder() method } - public Builder protocol(String protocol) { + /** + * The protocol used for the connection (http, https, etc) + */ + public Builder protocol(Protocol protocol) { Utils.checkNotNull(protocol, "protocol"); this.protocol = protocol; return this; } + /** + * The (ip) address or domain name used for the connection + */ public Builder address(String address) { Utils.checkNotNull(address, "address"); this.address = address; return this; } - public Builder port(double port) { + /** + * The port used for the connection + */ + public Builder port(int port) { Utils.checkNotNull(port, "port"); this.port = port; return this; } + /** + * The full URI of the connection + */ public Builder uri(String uri) { Utils.checkNotNull(uri, "uri"); this.uri = uri; return this; } + /** + * If the connection is local address + */ public Builder local(boolean local) { Utils.checkNotNull(local, "local"); this.local = local; return this; } + /** + * If the connection is relayed through plex.direct + */ public Builder relay(boolean relay) { Utils.checkNotNull(relay, "relay"); this.relay = relay; return this; } + /** + * If the connection is using IPv6 + */ public Builder iPv6(boolean iPv6) { Utils.checkNotNull(iPv6, "iPv6"); this.iPv6 = iPv6; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistRequestBuilder.java index 4bb062e9..187b5ae7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistRequestBuilder.java @@ -15,7 +15,7 @@ public class CreatePlaylistRequestBuilder { this.sdk = sdk; } - public CreatePlaylistRequestBuilder request(dev.plexapi.sdk.models.operations.CreatePlaylistRequest request) { + public CreatePlaylistRequestBuilder request(CreatePlaylistRequest request) { Utils.checkNotNull(request, "request"); this.request = request; return this; 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 af50d7e0..3681b1d0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/DefaultSubtitleAccessibility.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/DefaultSubtitleAccessibility.java @@ -5,23 +5,22 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; -import java.lang.String; /** - * 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 shown non-SDH subtitles) + * 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) */ public enum DefaultSubtitleAccessibility { - ZERO("0"), - ONE("1"); + Disable(0), + Enable(1); @JsonValue - private final String value; + private final int value; - private DefaultSubtitleAccessibility(String value) { + private DefaultSubtitleAccessibility(int value) { this.value = value; } - public String value() { + public int value() { return value; } } 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 993322d3..1b224caf 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/DefaultSubtitleForced.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/DefaultSubtitleForced.java @@ -5,23 +5,22 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; -import java.lang.String; /** * 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) */ public enum DefaultSubtitleForced { - ZERO("0"), - ONE("1"); + Disable(0), + Enable(1); @JsonValue - private final String value; + private final int value; - private DefaultSubtitleForced(String value) { + private DefaultSubtitleForced(int value) { this.value = value; } - public String value() { + public int value() { return value; } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesDirectory.java b/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesDirectory.java index 8602e53c..8c98ab33 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesDirectory.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesDirectory.java @@ -7,8 +7,6 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import dev.plexapi.sdk.utils.Utils; import java.lang.Boolean; @@ -16,130 +14,107 @@ import java.lang.Integer; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Objects; -import java.util.Optional; public class GetAllLibrariesDirectory { - @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowSync") - private Optional allowSync; + private boolean allowSync; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("art") - private Optional art; + private String art; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("composite") - private Optional composite; + private String composite; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("filters") - private Optional filters; + private boolean filters; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("refreshing") - private Optional refreshing; + private boolean refreshing; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") - private Optional thumb; + private String thumb; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") - private Optional key; + private String key; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private String type; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") - private Optional title; + private String title; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("agent") - private Optional agent; + private String agent; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("scanner") - private Optional scanner; + private String scanner; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("language") - private Optional language; + private String language; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("uuid") - private Optional uuid; + private String uuid; /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ - @JsonInclude(Include.NON_ABSENT) @JsonProperty("updatedAt") - private Optional updatedAt; + private long updatedAt; /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ - @JsonInclude(Include.NON_ABSENT) @JsonProperty("createdAt") - private Optional createdAt; + private long createdAt; /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ - @JsonInclude(Include.NON_ABSENT) @JsonProperty("scannedAt") - private Optional scannedAt; + private long scannedAt; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("content") - private Optional content; + private boolean content; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("directory") - private Optional directory; + private boolean directory; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("contentChangedAt") - private Optional contentChangedAt; + private int contentChangedAt; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("hidden") - private Optional hidden; + private int hidden; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("Location") - private Optional> location; + private List location; @JsonCreator public GetAllLibrariesDirectory( - @JsonProperty("allowSync") Optional allowSync, - @JsonProperty("art") Optional art, - @JsonProperty("composite") Optional composite, - @JsonProperty("filters") Optional filters, - @JsonProperty("refreshing") Optional refreshing, - @JsonProperty("thumb") Optional thumb, - @JsonProperty("key") Optional key, - @JsonProperty("type") Optional type, - @JsonProperty("title") Optional title, - @JsonProperty("agent") Optional agent, - @JsonProperty("scanner") Optional scanner, - @JsonProperty("language") Optional language, - @JsonProperty("uuid") Optional uuid, - @JsonProperty("updatedAt") Optional updatedAt, - @JsonProperty("createdAt") Optional createdAt, - @JsonProperty("scannedAt") Optional scannedAt, - @JsonProperty("content") Optional content, - @JsonProperty("directory") Optional directory, - @JsonProperty("contentChangedAt") Optional contentChangedAt, - @JsonProperty("hidden") Optional hidden, - @JsonProperty("Location") Optional> location) { + @JsonProperty("allowSync") boolean allowSync, + @JsonProperty("art") String art, + @JsonProperty("composite") String composite, + @JsonProperty("filters") boolean filters, + @JsonProperty("refreshing") boolean refreshing, + @JsonProperty("thumb") String thumb, + @JsonProperty("key") String key, + @JsonProperty("type") String type, + @JsonProperty("title") String title, + @JsonProperty("agent") String agent, + @JsonProperty("scanner") String scanner, + @JsonProperty("language") String language, + @JsonProperty("uuid") String uuid, + @JsonProperty("updatedAt") long updatedAt, + @JsonProperty("createdAt") long createdAt, + @JsonProperty("scannedAt") long scannedAt, + @JsonProperty("content") boolean content, + @JsonProperty("directory") boolean directory, + @JsonProperty("contentChangedAt") int contentChangedAt, + @JsonProperty("hidden") int hidden, + @JsonProperty("Location") List location) { Utils.checkNotNull(allowSync, "allowSync"); Utils.checkNotNull(art, "art"); Utils.checkNotNull(composite, "composite"); @@ -183,124 +158,119 @@ public class GetAllLibrariesDirectory { this.hidden = hidden; this.location = location; } - - public GetAllLibrariesDirectory() { - 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()); - } @JsonIgnore - public Optional allowSync() { + public boolean allowSync() { return allowSync; } @JsonIgnore - public Optional art() { + public String art() { return art; } @JsonIgnore - public Optional composite() { + public String composite() { return composite; } @JsonIgnore - public Optional filters() { + public boolean filters() { return filters; } @JsonIgnore - public Optional refreshing() { + public boolean refreshing() { return refreshing; } @JsonIgnore - public Optional thumb() { + public String thumb() { return thumb; } @JsonIgnore - public Optional key() { + public String key() { return key; } @JsonIgnore - public Optional type() { + public String type() { return type; } @JsonIgnore - public Optional title() { + public String title() { return title; } @JsonIgnore - public Optional agent() { + public String agent() { return agent; } @JsonIgnore - public Optional scanner() { + public String scanner() { return scanner; } @JsonIgnore - public Optional language() { + public String language() { return language; } @JsonIgnore - public Optional uuid() { + public String uuid() { return uuid; } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ @JsonIgnore - public Optional updatedAt() { + public long updatedAt() { return updatedAt; } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ @JsonIgnore - public Optional createdAt() { + public long createdAt() { return createdAt; } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ @JsonIgnore - public Optional scannedAt() { + public long scannedAt() { return scannedAt; } @JsonIgnore - public Optional content() { + public boolean content() { return content; } @JsonIgnore - public Optional directory() { + public boolean directory() { return directory; } @JsonIgnore - public Optional contentChangedAt() { + public int contentChangedAt() { return contentChangedAt; } @JsonIgnore - public Optional hidden() { + public int hidden() { return hidden; } - @SuppressWarnings("unchecked") @JsonIgnore - public Optional> location() { - return (Optional>) location; + public List location() { + return location; } public final static Builder builder() { @@ -308,270 +278,135 @@ public class GetAllLibrariesDirectory { } public GetAllLibrariesDirectory withAllowSync(boolean allowSync) { - Utils.checkNotNull(allowSync, "allowSync"); - this.allowSync = Optional.ofNullable(allowSync); - return this; - } - - public GetAllLibrariesDirectory withAllowSync(Optional allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = allowSync; return this; } public GetAllLibrariesDirectory withArt(String art) { - Utils.checkNotNull(art, "art"); - this.art = Optional.ofNullable(art); - return this; - } - - public GetAllLibrariesDirectory withArt(Optional art) { Utils.checkNotNull(art, "art"); this.art = art; return this; } public GetAllLibrariesDirectory withComposite(String composite) { - Utils.checkNotNull(composite, "composite"); - this.composite = Optional.ofNullable(composite); - return this; - } - - public GetAllLibrariesDirectory withComposite(Optional composite) { Utils.checkNotNull(composite, "composite"); this.composite = composite; return this; } public GetAllLibrariesDirectory withFilters(boolean filters) { - Utils.checkNotNull(filters, "filters"); - this.filters = Optional.ofNullable(filters); - return this; - } - - public GetAllLibrariesDirectory withFilters(Optional filters) { Utils.checkNotNull(filters, "filters"); this.filters = filters; return this; } public GetAllLibrariesDirectory withRefreshing(boolean refreshing) { - Utils.checkNotNull(refreshing, "refreshing"); - this.refreshing = Optional.ofNullable(refreshing); - return this; - } - - public GetAllLibrariesDirectory withRefreshing(Optional refreshing) { Utils.checkNotNull(refreshing, "refreshing"); this.refreshing = refreshing; return this; } public GetAllLibrariesDirectory withThumb(String thumb) { - Utils.checkNotNull(thumb, "thumb"); - this.thumb = Optional.ofNullable(thumb); - return this; - } - - public GetAllLibrariesDirectory withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; return this; } public GetAllLibrariesDirectory withKey(String key) { - Utils.checkNotNull(key, "key"); - this.key = Optional.ofNullable(key); - return this; - } - - public GetAllLibrariesDirectory withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; return this; } public GetAllLibrariesDirectory withType(String type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - public GetAllLibrariesDirectory withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } public GetAllLibrariesDirectory withTitle(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - - public GetAllLibrariesDirectory withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; return this; } public GetAllLibrariesDirectory withAgent(String agent) { - Utils.checkNotNull(agent, "agent"); - this.agent = Optional.ofNullable(agent); - return this; - } - - public GetAllLibrariesDirectory withAgent(Optional agent) { Utils.checkNotNull(agent, "agent"); this.agent = agent; return this; } public GetAllLibrariesDirectory withScanner(String scanner) { - Utils.checkNotNull(scanner, "scanner"); - this.scanner = Optional.ofNullable(scanner); - return this; - } - - public GetAllLibrariesDirectory withScanner(Optional scanner) { Utils.checkNotNull(scanner, "scanner"); this.scanner = scanner; return this; } public GetAllLibrariesDirectory withLanguage(String language) { - Utils.checkNotNull(language, "language"); - this.language = Optional.ofNullable(language); - return this; - } - - public GetAllLibrariesDirectory withLanguage(Optional language) { Utils.checkNotNull(language, "language"); this.language = language; return this; } public GetAllLibrariesDirectory withUuid(String uuid) { - Utils.checkNotNull(uuid, "uuid"); - this.uuid = Optional.ofNullable(uuid); - return this; - } - - public GetAllLibrariesDirectory withUuid(Optional uuid) { Utils.checkNotNull(uuid, "uuid"); this.uuid = uuid; return this; } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ public GetAllLibrariesDirectory withUpdatedAt(long updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = Optional.ofNullable(updatedAt); - return this; - } - - /** - * Unix epoch datetime - */ - public GetAllLibrariesDirectory withUpdatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; return this; } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ public GetAllLibrariesDirectory withCreatedAt(long createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - /** - * Unix epoch datetime - */ - public GetAllLibrariesDirectory withCreatedAt(Optional createdAt) { Utils.checkNotNull(createdAt, "createdAt"); this.createdAt = createdAt; return this; } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ public GetAllLibrariesDirectory withScannedAt(long scannedAt) { - Utils.checkNotNull(scannedAt, "scannedAt"); - this.scannedAt = Optional.ofNullable(scannedAt); - return this; - } - - /** - * Unix epoch datetime - */ - public GetAllLibrariesDirectory withScannedAt(Optional scannedAt) { Utils.checkNotNull(scannedAt, "scannedAt"); this.scannedAt = scannedAt; return this; } public GetAllLibrariesDirectory withContent(boolean content) { - Utils.checkNotNull(content, "content"); - this.content = Optional.ofNullable(content); - return this; - } - - public GetAllLibrariesDirectory withContent(Optional content) { Utils.checkNotNull(content, "content"); this.content = content; return this; } public GetAllLibrariesDirectory withDirectory(boolean directory) { - Utils.checkNotNull(directory, "directory"); - this.directory = Optional.ofNullable(directory); - return this; - } - - public GetAllLibrariesDirectory withDirectory(Optional directory) { Utils.checkNotNull(directory, "directory"); this.directory = directory; return this; } public GetAllLibrariesDirectory withContentChangedAt(int contentChangedAt) { - Utils.checkNotNull(contentChangedAt, "contentChangedAt"); - this.contentChangedAt = Optional.ofNullable(contentChangedAt); - return this; - } - - public GetAllLibrariesDirectory withContentChangedAt(Optional contentChangedAt) { Utils.checkNotNull(contentChangedAt, "contentChangedAt"); this.contentChangedAt = contentChangedAt; return this; } public GetAllLibrariesDirectory withHidden(int hidden) { - Utils.checkNotNull(hidden, "hidden"); - this.hidden = Optional.ofNullable(hidden); - return this; - } - - public GetAllLibrariesDirectory withHidden(Optional hidden) { Utils.checkNotNull(hidden, "hidden"); this.hidden = hidden; return this; } public GetAllLibrariesDirectory withLocation(List location) { - Utils.checkNotNull(location, "location"); - this.location = Optional.ofNullable(location); - return this; - } - - public GetAllLibrariesDirectory withLocation(Optional> location) { Utils.checkNotNull(location, "location"); this.location = location; return this; @@ -664,317 +499,182 @@ public class GetAllLibrariesDirectory { public final static class Builder { - private Optional allowSync = Optional.empty(); + private Boolean allowSync; - private Optional art = Optional.empty(); + private String art; - private Optional composite = Optional.empty(); + private String composite; - private Optional filters = Optional.empty(); + private Boolean filters; - private Optional refreshing = Optional.empty(); + private Boolean refreshing; - private Optional thumb = Optional.empty(); + private String thumb; - private Optional key = Optional.empty(); + private String key; - private Optional type = Optional.empty(); + private String type; - private Optional title = Optional.empty(); + private String title; - private Optional agent = Optional.empty(); + private String agent; - private Optional scanner = Optional.empty(); + private String scanner; - private Optional language = Optional.empty(); + private String language; - private Optional uuid = Optional.empty(); + private String uuid; - private Optional updatedAt = Optional.empty(); + private Long updatedAt; - private Optional createdAt = Optional.empty(); + private Long createdAt; - private Optional scannedAt = Optional.empty(); + private Long scannedAt; - private Optional content = Optional.empty(); + private Boolean content; - private Optional directory = Optional.empty(); + private Boolean directory; - private Optional contentChangedAt = Optional.empty(); + private Integer contentChangedAt; - private Optional hidden = Optional.empty(); + private Integer hidden; - private Optional> location = Optional.empty(); + private List location; private Builder() { // force use of static builder() method } public Builder allowSync(boolean allowSync) { - Utils.checkNotNull(allowSync, "allowSync"); - this.allowSync = Optional.ofNullable(allowSync); - return this; - } - - public Builder allowSync(Optional allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = allowSync; return this; } public Builder art(String art) { - Utils.checkNotNull(art, "art"); - this.art = Optional.ofNullable(art); - return this; - } - - public Builder art(Optional art) { Utils.checkNotNull(art, "art"); this.art = art; return this; } public Builder composite(String composite) { - Utils.checkNotNull(composite, "composite"); - this.composite = Optional.ofNullable(composite); - return this; - } - - public Builder composite(Optional composite) { Utils.checkNotNull(composite, "composite"); this.composite = composite; return this; } public Builder filters(boolean filters) { - Utils.checkNotNull(filters, "filters"); - this.filters = Optional.ofNullable(filters); - return this; - } - - public Builder filters(Optional filters) { Utils.checkNotNull(filters, "filters"); this.filters = filters; return this; } public Builder refreshing(boolean refreshing) { - Utils.checkNotNull(refreshing, "refreshing"); - this.refreshing = Optional.ofNullable(refreshing); - return this; - } - - public Builder refreshing(Optional refreshing) { Utils.checkNotNull(refreshing, "refreshing"); this.refreshing = refreshing; return this; } public Builder thumb(String thumb) { - Utils.checkNotNull(thumb, "thumb"); - this.thumb = Optional.ofNullable(thumb); - return this; - } - - public Builder thumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; return this; } public Builder key(String key) { - Utils.checkNotNull(key, "key"); - this.key = Optional.ofNullable(key); - return this; - } - - public Builder key(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; return this; } public Builder type(String type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - public Builder type(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } public Builder title(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - - public Builder title(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; return this; } public Builder agent(String agent) { - Utils.checkNotNull(agent, "agent"); - this.agent = Optional.ofNullable(agent); - return this; - } - - public Builder agent(Optional agent) { Utils.checkNotNull(agent, "agent"); this.agent = agent; return this; } public Builder scanner(String scanner) { - Utils.checkNotNull(scanner, "scanner"); - this.scanner = Optional.ofNullable(scanner); - return this; - } - - public Builder scanner(Optional scanner) { Utils.checkNotNull(scanner, "scanner"); this.scanner = scanner; return this; } public Builder language(String language) { - Utils.checkNotNull(language, "language"); - this.language = Optional.ofNullable(language); - return this; - } - - public Builder language(Optional language) { Utils.checkNotNull(language, "language"); this.language = language; return this; } public Builder uuid(String uuid) { - Utils.checkNotNull(uuid, "uuid"); - this.uuid = Optional.ofNullable(uuid); - return this; - } - - public Builder uuid(Optional uuid) { Utils.checkNotNull(uuid, "uuid"); this.uuid = uuid; return this; } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ public Builder updatedAt(long updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = Optional.ofNullable(updatedAt); - return this; - } - - /** - * Unix epoch datetime - */ - public Builder updatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; return this; } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ public Builder createdAt(long createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - /** - * Unix epoch datetime - */ - public Builder createdAt(Optional createdAt) { Utils.checkNotNull(createdAt, "createdAt"); this.createdAt = createdAt; return this; } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ public Builder scannedAt(long scannedAt) { - Utils.checkNotNull(scannedAt, "scannedAt"); - this.scannedAt = Optional.ofNullable(scannedAt); - return this; - } - - /** - * Unix epoch datetime - */ - public Builder scannedAt(Optional scannedAt) { Utils.checkNotNull(scannedAt, "scannedAt"); this.scannedAt = scannedAt; return this; } public Builder content(boolean content) { - Utils.checkNotNull(content, "content"); - this.content = Optional.ofNullable(content); - return this; - } - - public Builder content(Optional content) { Utils.checkNotNull(content, "content"); this.content = content; return this; } public Builder directory(boolean directory) { - Utils.checkNotNull(directory, "directory"); - this.directory = Optional.ofNullable(directory); - return this; - } - - public Builder directory(Optional directory) { Utils.checkNotNull(directory, "directory"); this.directory = directory; return this; } public Builder contentChangedAt(int contentChangedAt) { - Utils.checkNotNull(contentChangedAt, "contentChangedAt"); - this.contentChangedAt = Optional.ofNullable(contentChangedAt); - return this; - } - - public Builder contentChangedAt(Optional contentChangedAt) { Utils.checkNotNull(contentChangedAt, "contentChangedAt"); this.contentChangedAt = contentChangedAt; return this; } public Builder hidden(int hidden) { - Utils.checkNotNull(hidden, "hidden"); - this.hidden = Optional.ofNullable(hidden); - return this; - } - - public Builder hidden(Optional hidden) { Utils.checkNotNull(hidden, "hidden"); this.hidden = hidden; return this; } public Builder location(List location) { - Utils.checkNotNull(location, "location"); - this.location = Optional.ofNullable(location); - return this; - } - - public Builder location(Optional> location) { Utils.checkNotNull(location, "location"); this.location = location; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesMediaContainer.java index e4b81195..d9953735 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesMediaContainer.java @@ -7,18 +7,14 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import dev.plexapi.sdk.utils.Utils; import java.lang.Boolean; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Objects; -import java.util.Optional; public class GetAllLibrariesMediaContainer { @@ -32,16 +28,15 @@ public class GetAllLibrariesMediaContainer { @JsonProperty("title1") private String title1; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("Directory") - private Optional> directory; + private List directory; @JsonCreator public GetAllLibrariesMediaContainer( @JsonProperty("size") int size, @JsonProperty("allowSync") boolean allowSync, @JsonProperty("title1") String title1, - @JsonProperty("Directory") Optional> directory) { + @JsonProperty("Directory") List directory) { Utils.checkNotNull(size, "size"); Utils.checkNotNull(allowSync, "allowSync"); Utils.checkNotNull(title1, "title1"); @@ -51,13 +46,6 @@ public class GetAllLibrariesMediaContainer { this.title1 = title1; this.directory = directory; } - - public GetAllLibrariesMediaContainer( - int size, - boolean allowSync, - String title1) { - this(size, allowSync, title1, Optional.empty()); - } @JsonIgnore public int size() { @@ -74,10 +62,9 @@ public class GetAllLibrariesMediaContainer { return title1; } - @SuppressWarnings("unchecked") @JsonIgnore - public Optional> directory() { - return (Optional>) directory; + public List directory() { + return directory; } public final static Builder builder() { @@ -103,12 +90,6 @@ public class GetAllLibrariesMediaContainer { } public GetAllLibrariesMediaContainer withDirectory(List directory) { - Utils.checkNotNull(directory, "directory"); - this.directory = Optional.ofNullable(directory); - return this; - } - - public GetAllLibrariesMediaContainer withDirectory(Optional> directory) { Utils.checkNotNull(directory, "directory"); this.directory = directory; return this; @@ -156,7 +137,7 @@ public class GetAllLibrariesMediaContainer { private String title1; - private Optional> directory = Optional.empty(); + private List directory; private Builder() { // force use of static builder() method @@ -181,12 +162,6 @@ public class GetAllLibrariesMediaContainer { } public Builder directory(List directory) { - Utils.checkNotNull(directory, "directory"); - this.directory = Optional.ofNullable(directory); - return this; - } - - public Builder directory(Optional> directory) { Utils.checkNotNull(directory, "directory"); this.directory = directory; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesResponseBody.java index c748ee5f..702228e7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesResponseBody.java @@ -7,15 +7,11 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Objects; -import java.util.Optional; /** * GetAllLibrariesResponseBody - The libraries available on the Server @@ -23,25 +19,19 @@ import java.util.Optional; public class GetAllLibrariesResponseBody { - @JsonInclude(Include.NON_ABSENT) @JsonProperty("MediaContainer") - private Optional mediaContainer; + private GetAllLibrariesMediaContainer mediaContainer; @JsonCreator public GetAllLibrariesResponseBody( - @JsonProperty("MediaContainer") Optional mediaContainer) { + @JsonProperty("MediaContainer") GetAllLibrariesMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; } - - public GetAllLibrariesResponseBody() { - this(Optional.empty()); - } - @SuppressWarnings("unchecked") @JsonIgnore - public Optional mediaContainer() { - return (Optional) mediaContainer; + public GetAllLibrariesMediaContainer mediaContainer() { + return mediaContainer; } public final static Builder builder() { @@ -49,12 +39,6 @@ public class GetAllLibrariesResponseBody { } public GetAllLibrariesResponseBody withMediaContainer(GetAllLibrariesMediaContainer mediaContainer) { - Utils.checkNotNull(mediaContainer, "mediaContainer"); - this.mediaContainer = Optional.ofNullable(mediaContainer); - return this; - } - - public GetAllLibrariesResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; @@ -87,19 +71,13 @@ public class GetAllLibrariesResponseBody { public final static class Builder { - private Optional mediaContainer = Optional.empty(); + private GetAllLibrariesMediaContainer mediaContainer; private Builder() { // force use of static builder() method } public Builder mediaContainer(GetAllLibrariesMediaContainer mediaContainer) { - Utils.checkNotNull(mediaContainer, "mediaContainer"); - this.mediaContainer = Optional.ofNullable(mediaContainer); - return this; - } - - public Builder mediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetBandwidthStatisticsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetBandwidthStatisticsRequestBuilder.java index 8ed888bc..46adc70d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetBandwidthStatisticsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetBandwidthStatisticsRequestBuilder.java @@ -23,7 +23,7 @@ public class GetBandwidthStatisticsRequestBuilder { return this; } - public GetBandwidthStatisticsRequestBuilder timespan(java.util.Optional timespan) { + public GetBandwidthStatisticsRequestBuilder timespan(Optional timespan) { Utils.checkNotNull(timespan, "timespan"); this.timespan = timespan; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetBannerImageRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetBannerImageRequestBuilder.java index 0af62625..7cd6b8f6 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetBannerImageRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetBannerImageRequestBuilder.java @@ -15,7 +15,7 @@ public class GetBannerImageRequestBuilder { this.sdk = sdk; } - public GetBannerImageRequestBuilder request(dev.plexapi.sdk.models.operations.GetBannerImageRequest request) { + public GetBannerImageRequestBuilder request(GetBannerImageRequest request) { Utils.checkNotNull(request, "request"); this.request = request; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetCompanionsDataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetCompanionsDataRequestBuilder.java index 15113066..cdbb8870 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetCompanionsDataRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetCompanionsDataRequestBuilder.java @@ -17,13 +17,13 @@ public class GetCompanionsDataRequestBuilder { this.sdk = sdk; } - public GetCompanionsDataRequestBuilder serverURL(java.lang.String serverURL) { + public GetCompanionsDataRequestBuilder serverURL(String serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = Optional.of(serverURL); return this; } - public GetCompanionsDataRequestBuilder serverURL(java.util.Optional serverURL) { + public GetCompanionsDataRequestBuilder serverURL(Optional serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = serverURL; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetFileHashRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetFileHashRequestBuilder.java index 0915387e..ad431d38 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetFileHashRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetFileHashRequestBuilder.java @@ -19,7 +19,7 @@ public class GetFileHashRequestBuilder { this.sdk = sdk; } - public GetFileHashRequestBuilder url(java.lang.String url) { + public GetFileHashRequestBuilder url(String url) { Utils.checkNotNull(url, "url"); this.url = url; return this; @@ -31,7 +31,7 @@ public class GetFileHashRequestBuilder { return this; } - public GetFileHashRequestBuilder type(java.util.Optional type) { + public GetFileHashRequestBuilder type(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetGeoDataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetGeoDataRequestBuilder.java index 9381a877..d37c1bed 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetGeoDataRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetGeoDataRequestBuilder.java @@ -17,13 +17,13 @@ public class GetGeoDataRequestBuilder { this.sdk = sdk; } - public GetGeoDataRequestBuilder serverURL(java.lang.String serverURL) { + public GetGeoDataRequestBuilder serverURL(String serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = Optional.of(serverURL); return this; } - public GetGeoDataRequestBuilder serverURL(java.util.Optional serverURL) { + public GetGeoDataRequestBuilder serverURL(Optional serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = serverURL; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsRequestBuilder.java index de01765c..35b22bb3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsRequestBuilder.java @@ -24,19 +24,19 @@ public class GetGlobalHubsRequestBuilder { return this; } - public GetGlobalHubsRequestBuilder count(java.util.Optional count) { + public GetGlobalHubsRequestBuilder count(Optional count) { Utils.checkNotNull(count, "count"); this.count = count; return this; } - public GetGlobalHubsRequestBuilder onlyTransient(dev.plexapi.sdk.models.operations.OnlyTransient onlyTransient) { + public GetGlobalHubsRequestBuilder onlyTransient(OnlyTransient onlyTransient) { Utils.checkNotNull(onlyTransient, "onlyTransient"); this.onlyTransient = Optional.of(onlyTransient); return this; } - public GetGlobalHubsRequestBuilder onlyTransient(java.util.Optional onlyTransient) { + public GetGlobalHubsRequestBuilder onlyTransient(Optional onlyTransient) { Utils.checkNotNull(onlyTransient, "onlyTransient"); this.onlyTransient = onlyTransient; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequestBuilder.java index a5f0f54d..a9721778 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequestBuilder.java @@ -29,13 +29,13 @@ public class GetLibraryDetailsRequestBuilder { return this; } - public GetLibraryDetailsRequestBuilder includeDetails(dev.plexapi.sdk.models.operations.IncludeDetails includeDetails) { + public GetLibraryDetailsRequestBuilder includeDetails(IncludeDetails includeDetails) { Utils.checkNotNull(includeDetails, "includeDetails"); this.includeDetails = Optional.of(includeDetails); return this; } - public GetLibraryDetailsRequestBuilder includeDetails(java.util.Optional includeDetails) { + public GetLibraryDetailsRequestBuilder includeDetails(Optional includeDetails) { Utils.checkNotNull(includeDetails, "includeDetails"); this.includeDetails = includeDetails; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRequestBuilder.java index 8ffb0dc9..09e90e4e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRequestBuilder.java @@ -31,19 +31,19 @@ public class GetLibraryHubsRequestBuilder { return this; } - public GetLibraryHubsRequestBuilder count(java.util.Optional count) { + public GetLibraryHubsRequestBuilder count(Optional count) { Utils.checkNotNull(count, "count"); this.count = count; return this; } - public GetLibraryHubsRequestBuilder onlyTransient(dev.plexapi.sdk.models.operations.QueryParamOnlyTransient onlyTransient) { + public GetLibraryHubsRequestBuilder onlyTransient(QueryParamOnlyTransient onlyTransient) { Utils.checkNotNull(onlyTransient, "onlyTransient"); this.onlyTransient = Optional.of(onlyTransient); return this; } - public GetLibraryHubsRequestBuilder onlyTransient(java.util.Optional onlyTransient) { + public GetLibraryHubsRequestBuilder onlyTransient(Optional onlyTransient) { Utils.checkNotNull(onlyTransient, "onlyTransient"); this.onlyTransient = onlyTransient; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsField.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsField.java new file mode 100644 index 00000000..86b2e9be --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsField.java @@ -0,0 +1,199 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; + + +public class GetLibraryItemsField { + + @JsonProperty("key") + private String key; + + @JsonProperty("title") + private String title; + + @JsonProperty("type") + private String type; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subType") + private Optional subType; + + @JsonCreator + public GetLibraryItemsField( + @JsonProperty("key") String key, + @JsonProperty("title") String title, + @JsonProperty("type") String type, + @JsonProperty("subType") Optional subType) { + Utils.checkNotNull(key, "key"); + Utils.checkNotNull(title, "title"); + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(subType, "subType"); + this.key = key; + this.title = title; + this.type = type; + this.subType = subType; + } + + public GetLibraryItemsField( + String key, + String title, + String type) { + this(key, title, type, Optional.empty()); + } + + @JsonIgnore + public String key() { + return key; + } + + @JsonIgnore + public String title() { + return title; + } + + @JsonIgnore + public String type() { + return type; + } + + @JsonIgnore + public Optional subType() { + return subType; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetLibraryItemsField withKey(String key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public GetLibraryItemsField withTitle(String title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public GetLibraryItemsField withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public GetLibraryItemsField withSubType(String subType) { + Utils.checkNotNull(subType, "subType"); + this.subType = Optional.ofNullable(subType); + return this; + } + + public GetLibraryItemsField withSubType(Optional subType) { + Utils.checkNotNull(subType, "subType"); + this.subType = subType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryItemsField other = (GetLibraryItemsField) o; + return + Objects.deepEquals(this.key, other.key) && + Objects.deepEquals(this.title, other.title) && + Objects.deepEquals(this.type, other.type) && + Objects.deepEquals(this.subType, other.subType); + } + + @Override + public int hashCode() { + return Objects.hash( + key, + title, + type, + subType); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryItemsField.class, + "key", key, + "title", title, + "type", type, + "subType", subType); + } + + public final static class Builder { + + private String key; + + private String title; + + private String type; + + private Optional subType = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder key(String key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public Builder title(String title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public Builder subType(String subType) { + Utils.checkNotNull(subType, "subType"); + this.subType = Optional.ofNullable(subType); + return this; + } + + public Builder subType(Optional subType) { + Utils.checkNotNull(subType, "subType"); + this.subType = subType; + return this; + } + + public GetLibraryItemsField build() { + return new GetLibraryItemsField( + key, + title, + type, + subType); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsFieldType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsFieldType.java new file mode 100644 index 00000000..0bdd7bba --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsFieldType.java @@ -0,0 +1,119 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Objects; + + +public class GetLibraryItemsFieldType { + + @JsonProperty("type") + private String type; + + @JsonProperty("Operator") + private List operator; + + @JsonCreator + public GetLibraryItemsFieldType( + @JsonProperty("type") String type, + @JsonProperty("Operator") List operator) { + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(operator, "operator"); + this.type = type; + this.operator = operator; + } + + @JsonIgnore + public String type() { + return type; + } + + @JsonIgnore + public List operator() { + return operator; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetLibraryItemsFieldType withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public GetLibraryItemsFieldType withOperator(List operator) { + Utils.checkNotNull(operator, "operator"); + this.operator = operator; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryItemsFieldType other = (GetLibraryItemsFieldType) o; + return + Objects.deepEquals(this.type, other.type) && + Objects.deepEquals(this.operator, other.operator); + } + + @Override + public int hashCode() { + return Objects.hash( + type, + operator); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryItemsFieldType.class, + "type", type, + "operator", operator); + } + + public final static class Builder { + + private String type; + + private List operator; + + private Builder() { + // force use of static builder() method + } + + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public Builder operator(List operator) { + Utils.checkNotNull(operator, "operator"); + this.operator = operator; + return this; + } + + public GetLibraryItemsFieldType build() { + return new GetLibraryItemsFieldType( + type, + operator); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsFilter.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsFilter.java new file mode 100644 index 00000000..dbcde601 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsFilter.java @@ -0,0 +1,205 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; + + +public class GetLibraryItemsFilter { + + @JsonProperty("filter") + private String filter; + + @JsonProperty("filterType") + private String filterType; + + @JsonProperty("key") + private String key; + + @JsonProperty("title") + private String title; + + @JsonProperty("type") + private String type; + + @JsonCreator + public GetLibraryItemsFilter( + @JsonProperty("filter") String filter, + @JsonProperty("filterType") String filterType, + @JsonProperty("key") String key, + @JsonProperty("title") String title, + @JsonProperty("type") String type) { + Utils.checkNotNull(filter, "filter"); + Utils.checkNotNull(filterType, "filterType"); + Utils.checkNotNull(key, "key"); + Utils.checkNotNull(title, "title"); + Utils.checkNotNull(type, "type"); + this.filter = filter; + this.filterType = filterType; + this.key = key; + this.title = title; + this.type = type; + } + + @JsonIgnore + public String filter() { + return filter; + } + + @JsonIgnore + public String filterType() { + return filterType; + } + + @JsonIgnore + public String key() { + return key; + } + + @JsonIgnore + public String title() { + return title; + } + + @JsonIgnore + public String type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetLibraryItemsFilter withFilter(String filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + public GetLibraryItemsFilter withFilterType(String filterType) { + Utils.checkNotNull(filterType, "filterType"); + this.filterType = filterType; + return this; + } + + public GetLibraryItemsFilter withKey(String key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public GetLibraryItemsFilter withTitle(String title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public GetLibraryItemsFilter withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryItemsFilter other = (GetLibraryItemsFilter) o; + return + Objects.deepEquals(this.filter, other.filter) && + Objects.deepEquals(this.filterType, other.filterType) && + Objects.deepEquals(this.key, other.key) && + Objects.deepEquals(this.title, other.title) && + Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return Objects.hash( + filter, + filterType, + key, + title, + type); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryItemsFilter.class, + "filter", filter, + "filterType", filterType, + "key", key, + "title", title, + "type", type); + } + + public final static class Builder { + + private String filter; + + private String filterType; + + private String key; + + private String title; + + private String type; + + private Builder() { + // force use of static builder() method + } + + public Builder filter(String filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + public Builder filterType(String filterType) { + Utils.checkNotNull(filterType, "filterType"); + this.filterType = filterType; + return this; + } + + public Builder key(String key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public Builder title(String title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public GetLibraryItemsFilter build() { + return new GetLibraryItemsFilter( + filter, + filterType, + key, + title, + type); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMediaContainer.java index 3d221230..9517c4d5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMediaContainer.java @@ -23,57 +23,44 @@ import java.util.Optional; public class GetLibraryItemsMediaContainer { - @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") - private Optional size; + private int size; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowSync") - private Optional allowSync; + private boolean allowSync; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("art") - private Optional art; + private String art; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("identifier") - private Optional identifier; + private String identifier; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionID") - private Optional librarySectionID; + private LibrarySectionID librarySectionID; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionTitle") - private Optional librarySectionTitle; + private String librarySectionTitle; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionUUID") - private Optional librarySectionUUID; + private String librarySectionUUID; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("mediaTagPrefix") - private Optional mediaTagPrefix; + private String mediaTagPrefix; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("mediaTagVersion") - private Optional mediaTagVersion; + private int mediaTagVersion; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") - private Optional thumb; + private String thumb; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("title1") - private Optional title1; + private String title1; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("title2") - private Optional title2; + private String title2; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewGroup") - private Optional viewGroup; + private String viewGroup; @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewMode") @@ -87,24 +74,33 @@ public class GetLibraryItemsMediaContainer { @JsonProperty("Metadata") private Optional> metadata; + /** + * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Meta") + private Optional meta; + @JsonCreator public GetLibraryItemsMediaContainer( - @JsonProperty("size") Optional size, - @JsonProperty("allowSync") Optional allowSync, - @JsonProperty("art") Optional art, - @JsonProperty("identifier") Optional identifier, - @JsonProperty("librarySectionID") Optional librarySectionID, - @JsonProperty("librarySectionTitle") Optional librarySectionTitle, - @JsonProperty("librarySectionUUID") Optional librarySectionUUID, - @JsonProperty("mediaTagPrefix") Optional mediaTagPrefix, - @JsonProperty("mediaTagVersion") Optional mediaTagVersion, - @JsonProperty("thumb") Optional thumb, - @JsonProperty("title1") Optional title1, - @JsonProperty("title2") Optional title2, - @JsonProperty("viewGroup") Optional viewGroup, + @JsonProperty("size") int size, + @JsonProperty("allowSync") boolean allowSync, + @JsonProperty("art") String art, + @JsonProperty("identifier") String identifier, + @JsonProperty("librarySectionID") LibrarySectionID librarySectionID, + @JsonProperty("librarySectionTitle") String librarySectionTitle, + @JsonProperty("librarySectionUUID") String librarySectionUUID, + @JsonProperty("mediaTagPrefix") String mediaTagPrefix, + @JsonProperty("mediaTagVersion") int mediaTagVersion, + @JsonProperty("thumb") String thumb, + @JsonProperty("title1") String title1, + @JsonProperty("title2") String title2, + @JsonProperty("viewGroup") String viewGroup, @JsonProperty("viewMode") Optional viewMode, @JsonProperty("mixedParents") Optional mixedParents, - @JsonProperty("Metadata") Optional> metadata) { + @JsonProperty("Metadata") Optional> metadata, + @JsonProperty("Meta") Optional meta) { Utils.checkNotNull(size, "size"); Utils.checkNotNull(allowSync, "allowSync"); Utils.checkNotNull(art, "art"); @@ -121,6 +117,7 @@ public class GetLibraryItemsMediaContainer { Utils.checkNotNull(viewMode, "viewMode"); Utils.checkNotNull(mixedParents, "mixedParents"); Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(meta, "meta"); this.size = size; this.allowSync = allowSync; this.art = art; @@ -137,75 +134,88 @@ public class GetLibraryItemsMediaContainer { this.viewMode = viewMode; this.mixedParents = mixedParents; this.metadata = metadata; + this.meta = meta; } - public GetLibraryItemsMediaContainer() { - 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()); + public GetLibraryItemsMediaContainer( + int size, + boolean allowSync, + String art, + String identifier, + LibrarySectionID librarySectionID, + String librarySectionTitle, + String librarySectionUUID, + String mediaTagPrefix, + int mediaTagVersion, + String thumb, + String title1, + String title2, + String viewGroup) { + this(size, allowSync, art, identifier, librarySectionID, librarySectionTitle, librarySectionUUID, mediaTagPrefix, mediaTagVersion, thumb, title1, title2, viewGroup, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore - public Optional size() { + public int size() { return size; } @JsonIgnore - public Optional allowSync() { + public boolean allowSync() { return allowSync; } @JsonIgnore - public Optional art() { + public String art() { return art; } @JsonIgnore - public Optional identifier() { + public String identifier() { return identifier; } - @SuppressWarnings("unchecked") @JsonIgnore - public Optional librarySectionID() { - return (Optional) librarySectionID; + public LibrarySectionID librarySectionID() { + return librarySectionID; } @JsonIgnore - public Optional librarySectionTitle() { + public String librarySectionTitle() { return librarySectionTitle; } @JsonIgnore - public Optional librarySectionUUID() { + public String librarySectionUUID() { return librarySectionUUID; } @JsonIgnore - public Optional mediaTagPrefix() { + public String mediaTagPrefix() { return mediaTagPrefix; } @JsonIgnore - public Optional mediaTagVersion() { + public int mediaTagVersion() { return mediaTagVersion; } @JsonIgnore - public Optional thumb() { + public String thumb() { return thumb; } @JsonIgnore - public Optional title1() { + public String title1() { return title1; } @JsonIgnore - public Optional title2() { + public String title2() { return title2; } @JsonIgnore - public Optional viewGroup() { + public String viewGroup() { return viewGroup; } @@ -225,161 +235,93 @@ public class GetLibraryItemsMediaContainer { return (Optional>) metadata; } + /** + * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional meta() { + return (Optional) meta; + } + public final static Builder builder() { return new Builder(); } public GetLibraryItemsMediaContainer withSize(int size) { - Utils.checkNotNull(size, "size"); - this.size = Optional.ofNullable(size); - return this; - } - - public GetLibraryItemsMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; return this; } public GetLibraryItemsMediaContainer withAllowSync(boolean allowSync) { - Utils.checkNotNull(allowSync, "allowSync"); - this.allowSync = Optional.ofNullable(allowSync); - return this; - } - - public GetLibraryItemsMediaContainer withAllowSync(Optional allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = allowSync; return this; } public GetLibraryItemsMediaContainer withArt(String art) { - Utils.checkNotNull(art, "art"); - this.art = Optional.ofNullable(art); - return this; - } - - public GetLibraryItemsMediaContainer withArt(Optional art) { Utils.checkNotNull(art, "art"); this.art = art; return this; } public GetLibraryItemsMediaContainer withIdentifier(String identifier) { - Utils.checkNotNull(identifier, "identifier"); - this.identifier = Optional.ofNullable(identifier); - return this; - } - - public GetLibraryItemsMediaContainer withIdentifier(Optional identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = identifier; return this; } public GetLibraryItemsMediaContainer withLibrarySectionID(LibrarySectionID librarySectionID) { - Utils.checkNotNull(librarySectionID, "librarySectionID"); - this.librarySectionID = Optional.ofNullable(librarySectionID); - return this; - } - - public GetLibraryItemsMediaContainer withLibrarySectionID(Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; return this; } public GetLibraryItemsMediaContainer withLibrarySectionTitle(String librarySectionTitle) { - Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); - this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); - return this; - } - - public GetLibraryItemsMediaContainer withLibrarySectionTitle(Optional librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = librarySectionTitle; return this; } public GetLibraryItemsMediaContainer withLibrarySectionUUID(String librarySectionUUID) { - Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); - this.librarySectionUUID = Optional.ofNullable(librarySectionUUID); - return this; - } - - public GetLibraryItemsMediaContainer withLibrarySectionUUID(Optional librarySectionUUID) { Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); this.librarySectionUUID = librarySectionUUID; return this; } public GetLibraryItemsMediaContainer withMediaTagPrefix(String mediaTagPrefix) { - Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); - this.mediaTagPrefix = Optional.ofNullable(mediaTagPrefix); - return this; - } - - public GetLibraryItemsMediaContainer withMediaTagPrefix(Optional mediaTagPrefix) { Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); this.mediaTagPrefix = mediaTagPrefix; return this; } public GetLibraryItemsMediaContainer withMediaTagVersion(int mediaTagVersion) { - Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); - this.mediaTagVersion = Optional.ofNullable(mediaTagVersion); - return this; - } - - public GetLibraryItemsMediaContainer withMediaTagVersion(Optional mediaTagVersion) { Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); this.mediaTagVersion = mediaTagVersion; return this; } public GetLibraryItemsMediaContainer withThumb(String thumb) { - Utils.checkNotNull(thumb, "thumb"); - this.thumb = Optional.ofNullable(thumb); - return this; - } - - public GetLibraryItemsMediaContainer withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; return this; } public GetLibraryItemsMediaContainer withTitle1(String title1) { - Utils.checkNotNull(title1, "title1"); - this.title1 = Optional.ofNullable(title1); - return this; - } - - public GetLibraryItemsMediaContainer withTitle1(Optional title1) { Utils.checkNotNull(title1, "title1"); this.title1 = title1; return this; } public GetLibraryItemsMediaContainer withTitle2(String title2) { - Utils.checkNotNull(title2, "title2"); - this.title2 = Optional.ofNullable(title2); - return this; - } - - public GetLibraryItemsMediaContainer withTitle2(Optional title2) { Utils.checkNotNull(title2, "title2"); this.title2 = title2; return this; } public GetLibraryItemsMediaContainer withViewGroup(String viewGroup) { - Utils.checkNotNull(viewGroup, "viewGroup"); - this.viewGroup = Optional.ofNullable(viewGroup); - return this; - } - - public GetLibraryItemsMediaContainer withViewGroup(Optional viewGroup) { Utils.checkNotNull(viewGroup, "viewGroup"); this.viewGroup = viewGroup; return this; @@ -420,6 +362,26 @@ public class GetLibraryItemsMediaContainer { this.metadata = metadata; return this; } + + /** + * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + * + */ + public GetLibraryItemsMediaContainer withMeta(Meta meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = Optional.ofNullable(meta); + return this; + } + + /** + * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + * + */ + public GetLibraryItemsMediaContainer withMeta(Optional meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = meta; + return this; + } @Override public boolean equals(java.lang.Object o) { @@ -446,7 +408,8 @@ public class GetLibraryItemsMediaContainer { Objects.deepEquals(this.viewGroup, other.viewGroup) && Objects.deepEquals(this.viewMode, other.viewMode) && Objects.deepEquals(this.mixedParents, other.mixedParents) && - Objects.deepEquals(this.metadata, other.metadata); + Objects.deepEquals(this.metadata, other.metadata) && + Objects.deepEquals(this.meta, other.meta); } @Override @@ -467,7 +430,8 @@ public class GetLibraryItemsMediaContainer { viewGroup, viewMode, mixedParents, - metadata); + metadata, + meta); } @Override @@ -488,198 +452,123 @@ public class GetLibraryItemsMediaContainer { "viewGroup", viewGroup, "viewMode", viewMode, "mixedParents", mixedParents, - "metadata", metadata); + "metadata", metadata, + "meta", meta); } public final static class Builder { - private Optional size = Optional.empty(); + private Integer size; - private Optional allowSync = Optional.empty(); + private Boolean allowSync; - private Optional art = Optional.empty(); + private String art; - private Optional identifier = Optional.empty(); + private String identifier; - private Optional librarySectionID = Optional.empty(); + private LibrarySectionID librarySectionID; - private Optional librarySectionTitle = Optional.empty(); + private String librarySectionTitle; - private Optional librarySectionUUID = Optional.empty(); + private String librarySectionUUID; - private Optional mediaTagPrefix = Optional.empty(); + private String mediaTagPrefix; - private Optional mediaTagVersion = Optional.empty(); + private Integer mediaTagVersion; - private Optional thumb = Optional.empty(); + private String thumb; - private Optional title1 = Optional.empty(); + private String title1; - private Optional title2 = Optional.empty(); + private String title2; - private Optional viewGroup = Optional.empty(); + private String viewGroup; private Optional viewMode = Optional.empty(); private Optional mixedParents = Optional.empty(); - private Optional> metadata = Optional.empty(); + private Optional> metadata = Optional.empty(); + + private Optional meta = Optional.empty(); private Builder() { // force use of static builder() method } public Builder size(int size) { - Utils.checkNotNull(size, "size"); - this.size = Optional.ofNullable(size); - return this; - } - - public Builder size(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; return this; } public Builder allowSync(boolean allowSync) { - Utils.checkNotNull(allowSync, "allowSync"); - this.allowSync = Optional.ofNullable(allowSync); - return this; - } - - public Builder allowSync(Optional allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = allowSync; return this; } public Builder art(String art) { - Utils.checkNotNull(art, "art"); - this.art = Optional.ofNullable(art); - return this; - } - - public Builder art(Optional art) { Utils.checkNotNull(art, "art"); this.art = art; return this; } public Builder identifier(String identifier) { - Utils.checkNotNull(identifier, "identifier"); - this.identifier = Optional.ofNullable(identifier); - return this; - } - - public Builder identifier(Optional identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = identifier; return this; } public Builder librarySectionID(LibrarySectionID librarySectionID) { - Utils.checkNotNull(librarySectionID, "librarySectionID"); - this.librarySectionID = Optional.ofNullable(librarySectionID); - return this; - } - - public Builder librarySectionID(Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; return this; } public Builder librarySectionTitle(String librarySectionTitle) { - Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); - this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); - return this; - } - - public Builder librarySectionTitle(Optional librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = librarySectionTitle; return this; } public Builder librarySectionUUID(String librarySectionUUID) { - Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); - this.librarySectionUUID = Optional.ofNullable(librarySectionUUID); - return this; - } - - public Builder librarySectionUUID(Optional librarySectionUUID) { Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); this.librarySectionUUID = librarySectionUUID; return this; } public Builder mediaTagPrefix(String mediaTagPrefix) { - Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); - this.mediaTagPrefix = Optional.ofNullable(mediaTagPrefix); - return this; - } - - public Builder mediaTagPrefix(Optional mediaTagPrefix) { Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); this.mediaTagPrefix = mediaTagPrefix; return this; } public Builder mediaTagVersion(int mediaTagVersion) { - Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); - this.mediaTagVersion = Optional.ofNullable(mediaTagVersion); - return this; - } - - public Builder mediaTagVersion(Optional mediaTagVersion) { Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); this.mediaTagVersion = mediaTagVersion; return this; } public Builder thumb(String thumb) { - Utils.checkNotNull(thumb, "thumb"); - this.thumb = Optional.ofNullable(thumb); - return this; - } - - public Builder thumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; return this; } public Builder title1(String title1) { - Utils.checkNotNull(title1, "title1"); - this.title1 = Optional.ofNullable(title1); - return this; - } - - public Builder title1(Optional title1) { Utils.checkNotNull(title1, "title1"); this.title1 = title1; return this; } public Builder title2(String title2) { - Utils.checkNotNull(title2, "title2"); - this.title2 = Optional.ofNullable(title2); - return this; - } - - public Builder title2(Optional title2) { Utils.checkNotNull(title2, "title2"); this.title2 = title2; return this; } public Builder viewGroup(String viewGroup) { - Utils.checkNotNull(viewGroup, "viewGroup"); - this.viewGroup = Optional.ofNullable(viewGroup); - return this; - } - - public Builder viewGroup(Optional viewGroup) { Utils.checkNotNull(viewGroup, "viewGroup"); this.viewGroup = viewGroup; return this; @@ -720,6 +609,26 @@ public class GetLibraryItemsMediaContainer { this.metadata = metadata; return this; } + + /** + * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + * + */ + public Builder meta(Meta meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = Optional.ofNullable(meta); + return this; + } + + /** + * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + * + */ + public Builder meta(Optional meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = meta; + return this; + } public GetLibraryItemsMediaContainer build() { return new GetLibraryItemsMediaContainer( @@ -738,7 +647,8 @@ public class GetLibraryItemsMediaContainer { viewGroup, viewMode, mixedParents, - metadata); + metadata, + meta); } } } 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 b0629ddf..757df943 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMetadata.java @@ -24,29 +24,24 @@ import java.util.Optional; public class GetLibraryItemsMetadata { - @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingKey") - private Optional ratingKey; + private String ratingKey; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") - private Optional key; + private String key; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("guid") - private Optional guid; + private String guid; @JsonInclude(Include.NON_ABSENT) @JsonProperty("studio") private Optional studio; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private String type; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") - private Optional title; + private String title; @JsonInclude(Include.NON_ABSENT) @JsonProperty("contentRating") @@ -64,9 +59,8 @@ public class GetLibraryItemsMetadata { @JsonProperty("audienceRating") private Optional audienceRating; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("year") - private Optional year; + private int year; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tagline") @@ -80,9 +74,8 @@ public class GetLibraryItemsMetadata { @JsonProperty("art") private Optional art; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") - private Optional duration; + private int duration; @JsonInclude(Include.NON_ABSENT) @JsonProperty("originallyAvailableAt") @@ -140,9 +133,8 @@ public class GetLibraryItemsMetadata { @JsonProperty("grandparentTheme") private Optional grandparentTheme; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("Media") - private Optional> media; + private List media; @JsonInclude(Include.NON_ABSENT) @JsonProperty("Genre") @@ -164,6 +156,14 @@ public class GetLibraryItemsMetadata { @JsonProperty("Role") private Optional> role; + /** + * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Guid") + private Optional> mediaGuid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("titleSort") private Optional titleSort; @@ -254,21 +254,21 @@ public class GetLibraryItemsMetadata { @JsonCreator public GetLibraryItemsMetadata( - @JsonProperty("ratingKey") Optional ratingKey, - @JsonProperty("key") Optional key, - @JsonProperty("guid") Optional guid, + @JsonProperty("ratingKey") String ratingKey, + @JsonProperty("key") String key, + @JsonProperty("guid") String guid, @JsonProperty("studio") Optional studio, - @JsonProperty("type") Optional type, - @JsonProperty("title") Optional title, + @JsonProperty("type") String type, + @JsonProperty("title") String title, @JsonProperty("contentRating") Optional contentRating, @JsonProperty("summary") Optional summary, @JsonProperty("rating") Optional rating, @JsonProperty("audienceRating") Optional audienceRating, - @JsonProperty("year") Optional year, + @JsonProperty("year") int year, @JsonProperty("tagline") Optional tagline, @JsonProperty("thumb") Optional thumb, @JsonProperty("art") Optional art, - @JsonProperty("duration") Optional duration, + @JsonProperty("duration") int duration, @JsonProperty("originallyAvailableAt") Optional originallyAvailableAt, @JsonProperty("addedAt") Optional addedAt, @JsonProperty("updatedAt") Optional updatedAt, @@ -283,12 +283,13 @@ public class GetLibraryItemsMetadata { @JsonProperty("grandparentThumb") Optional grandparentThumb, @JsonProperty("grandparentArt") Optional grandparentArt, @JsonProperty("grandparentTheme") Optional grandparentTheme, - @JsonProperty("Media") Optional> media, + @JsonProperty("Media") List media, @JsonProperty("Genre") Optional> genre, @JsonProperty("Country") Optional> country, @JsonProperty("Director") Optional> director, @JsonProperty("Writer") Optional> writer, @JsonProperty("Role") Optional> role, + @JsonProperty("Guid") Optional> mediaGuid, @JsonProperty("titleSort") Optional titleSort, @JsonProperty("viewCount") Optional viewCount, @JsonProperty("lastViewedAt") Optional lastViewedAt, @@ -346,6 +347,7 @@ public class GetLibraryItemsMetadata { Utils.checkNotNull(director, "director"); Utils.checkNotNull(writer, "writer"); Utils.checkNotNull(role, "role"); + Utils.checkNotNull(mediaGuid, "mediaGuid"); Utils.checkNotNull(titleSort, "titleSort"); Utils.checkNotNull(viewCount, "viewCount"); Utils.checkNotNull(lastViewedAt, "lastViewedAt"); @@ -403,6 +405,7 @@ public class GetLibraryItemsMetadata { this.director = director; this.writer = writer; this.role = role; + this.mediaGuid = mediaGuid; this.titleSort = titleSort; this.viewCount = viewCount; this.lastViewedAt = lastViewedAt; @@ -427,22 +430,30 @@ public class GetLibraryItemsMetadata { this.parentTheme = parentTheme; } - public GetLibraryItemsMetadata() { - 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(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + public GetLibraryItemsMetadata( + String ratingKey, + String key, + String guid, + String type, + String title, + int year, + int duration, + List media) { + this(ratingKey, key, guid, Optional.empty(), type, title, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), year, Optional.empty(), Optional.empty(), Optional.empty(), duration, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), media, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore - public Optional ratingKey() { + public String ratingKey() { return ratingKey; } @JsonIgnore - public Optional key() { + public String key() { return key; } @JsonIgnore - public Optional guid() { + public String guid() { return guid; } @@ -452,12 +463,12 @@ public class GetLibraryItemsMetadata { } @JsonIgnore - public Optional type() { + public String type() { return type; } @JsonIgnore - public Optional title() { + public String title() { return title; } @@ -482,7 +493,7 @@ public class GetLibraryItemsMetadata { } @JsonIgnore - public Optional year() { + public int year() { return year; } @@ -502,7 +513,7 @@ public class GetLibraryItemsMetadata { } @JsonIgnore - public Optional duration() { + public int duration() { return duration; } @@ -576,10 +587,9 @@ public class GetLibraryItemsMetadata { return grandparentTheme; } - @SuppressWarnings("unchecked") @JsonIgnore - public Optional> media() { - return (Optional>) media; + public List media() { + return media; } @SuppressWarnings("unchecked") @@ -612,6 +622,16 @@ public class GetLibraryItemsMetadata { return (Optional>) role; } + /** + * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> mediaGuid() { + return (Optional>) mediaGuid; + } + @JsonIgnore public Optional titleSort() { return titleSort; @@ -727,36 +747,18 @@ public class GetLibraryItemsMetadata { } public GetLibraryItemsMetadata withRatingKey(String ratingKey) { - Utils.checkNotNull(ratingKey, "ratingKey"); - this.ratingKey = Optional.ofNullable(ratingKey); - return this; - } - - public GetLibraryItemsMetadata withRatingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; return this; } public GetLibraryItemsMetadata withKey(String key) { - Utils.checkNotNull(key, "key"); - this.key = Optional.ofNullable(key); - return this; - } - - public GetLibraryItemsMetadata withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; return this; } public GetLibraryItemsMetadata withGuid(String guid) { - Utils.checkNotNull(guid, "guid"); - this.guid = Optional.ofNullable(guid); - return this; - } - - public GetLibraryItemsMetadata withGuid(Optional guid) { Utils.checkNotNull(guid, "guid"); this.guid = guid; return this; @@ -775,24 +777,12 @@ public class GetLibraryItemsMetadata { } public GetLibraryItemsMetadata withType(String type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - public GetLibraryItemsMetadata withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } public GetLibraryItemsMetadata withTitle(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - - public GetLibraryItemsMetadata withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; return this; @@ -847,12 +837,6 @@ public class GetLibraryItemsMetadata { } public GetLibraryItemsMetadata withYear(int year) { - Utils.checkNotNull(year, "year"); - this.year = Optional.ofNullable(year); - return this; - } - - public GetLibraryItemsMetadata withYear(Optional year) { Utils.checkNotNull(year, "year"); this.year = year; return this; @@ -895,12 +879,6 @@ public class GetLibraryItemsMetadata { } public GetLibraryItemsMetadata withDuration(int duration) { - Utils.checkNotNull(duration, "duration"); - this.duration = Optional.ofNullable(duration); - return this; - } - - public GetLibraryItemsMetadata withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; return this; @@ -1075,12 +1053,6 @@ public class GetLibraryItemsMetadata { } public GetLibraryItemsMetadata withMedia(List media) { - Utils.checkNotNull(media, "media"); - this.media = Optional.ofNullable(media); - return this; - } - - public GetLibraryItemsMetadata withMedia(Optional> media) { Utils.checkNotNull(media, "media"); this.media = media; return this; @@ -1146,6 +1118,26 @@ public class GetLibraryItemsMetadata { return this; } + /** + * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + * + */ + public GetLibraryItemsMetadata withMediaGuid(List mediaGuid) { + Utils.checkNotNull(mediaGuid, "mediaGuid"); + this.mediaGuid = Optional.ofNullable(mediaGuid); + return this; + } + + /** + * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + * + */ + public GetLibraryItemsMetadata withMediaGuid(Optional> mediaGuid) { + Utils.checkNotNull(mediaGuid, "mediaGuid"); + this.mediaGuid = mediaGuid; + return this; + } + public GetLibraryItemsMetadata withTitleSort(String titleSort) { Utils.checkNotNull(titleSort, "titleSort"); this.titleSort = Optional.ofNullable(titleSort); @@ -1455,6 +1447,7 @@ public class GetLibraryItemsMetadata { Objects.deepEquals(this.director, other.director) && Objects.deepEquals(this.writer, other.writer) && Objects.deepEquals(this.role, other.role) && + Objects.deepEquals(this.mediaGuid, other.mediaGuid) && Objects.deepEquals(this.titleSort, other.titleSort) && Objects.deepEquals(this.viewCount, other.viewCount) && Objects.deepEquals(this.lastViewedAt, other.lastViewedAt) && @@ -1517,6 +1510,7 @@ public class GetLibraryItemsMetadata { director, writer, role, + mediaGuid, titleSort, viewCount, lastViewedAt, @@ -1579,6 +1573,7 @@ public class GetLibraryItemsMetadata { "director", director, "writer", writer, "role", role, + "mediaGuid", mediaGuid, "titleSort", titleSort, "viewCount", viewCount, "lastViewedAt", lastViewedAt, @@ -1605,17 +1600,17 @@ public class GetLibraryItemsMetadata { public final static class Builder { - private Optional ratingKey = Optional.empty(); + private String ratingKey; - private Optional key = Optional.empty(); + private String key; - private Optional guid = Optional.empty(); + private String guid; private Optional studio = Optional.empty(); - private Optional type = Optional.empty(); + private String type; - private Optional title = Optional.empty(); + private String title; private Optional contentRating = Optional.empty(); @@ -1625,7 +1620,7 @@ public class GetLibraryItemsMetadata { private Optional audienceRating = Optional.empty(); - private Optional year = Optional.empty(); + private Integer year; private Optional tagline = Optional.empty(); @@ -1633,7 +1628,7 @@ public class GetLibraryItemsMetadata { private Optional art = Optional.empty(); - private Optional duration = Optional.empty(); + private Integer duration; private Optional originallyAvailableAt = Optional.empty(); @@ -1663,7 +1658,7 @@ public class GetLibraryItemsMetadata { private Optional grandparentTheme = Optional.empty(); - private Optional> media = Optional.empty(); + private List media; private Optional> genre = Optional.empty(); @@ -1675,6 +1670,8 @@ public class GetLibraryItemsMetadata { private Optional> role = Optional.empty(); + private Optional> mediaGuid = Optional.empty(); + private Optional titleSort = Optional.empty(); private Optional viewCount = Optional.empty(); @@ -1724,36 +1721,18 @@ public class GetLibraryItemsMetadata { } public Builder ratingKey(String ratingKey) { - Utils.checkNotNull(ratingKey, "ratingKey"); - this.ratingKey = Optional.ofNullable(ratingKey); - return this; - } - - public Builder ratingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; return this; } public Builder key(String key) { - Utils.checkNotNull(key, "key"); - this.key = Optional.ofNullable(key); - return this; - } - - public Builder key(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; return this; } public Builder guid(String guid) { - Utils.checkNotNull(guid, "guid"); - this.guid = Optional.ofNullable(guid); - return this; - } - - public Builder guid(Optional guid) { Utils.checkNotNull(guid, "guid"); this.guid = guid; return this; @@ -1772,24 +1751,12 @@ public class GetLibraryItemsMetadata { } public Builder type(String type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - public Builder type(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } public Builder title(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - - public Builder title(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; return this; @@ -1844,12 +1811,6 @@ public class GetLibraryItemsMetadata { } public Builder year(int year) { - Utils.checkNotNull(year, "year"); - this.year = Optional.ofNullable(year); - return this; - } - - public Builder year(Optional year) { Utils.checkNotNull(year, "year"); this.year = year; return this; @@ -1892,12 +1853,6 @@ public class GetLibraryItemsMetadata { } public Builder duration(int duration) { - Utils.checkNotNull(duration, "duration"); - this.duration = Optional.ofNullable(duration); - return this; - } - - public Builder duration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; return this; @@ -2072,12 +2027,6 @@ public class GetLibraryItemsMetadata { } public Builder media(List media) { - Utils.checkNotNull(media, "media"); - this.media = Optional.ofNullable(media); - return this; - } - - public Builder media(Optional> media) { Utils.checkNotNull(media, "media"); this.media = media; return this; @@ -2143,6 +2092,26 @@ public class GetLibraryItemsMetadata { return this; } + /** + * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + * + */ + public Builder mediaGuid(List mediaGuid) { + Utils.checkNotNull(mediaGuid, "mediaGuid"); + this.mediaGuid = Optional.ofNullable(mediaGuid); + return this; + } + + /** + * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + * + */ + public Builder mediaGuid(Optional> mediaGuid) { + Utils.checkNotNull(mediaGuid, "mediaGuid"); + this.mediaGuid = mediaGuid; + return this; + } + public Builder titleSort(String titleSort) { Utils.checkNotNull(titleSort, "titleSort"); this.titleSort = Optional.ofNullable(titleSort); @@ -2444,6 +2413,7 @@ public class GetLibraryItemsMetadata { director, writer, role, + mediaGuid, titleSort, viewCount, lastViewedAt, diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOperator.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOperator.java new file mode 100644 index 00000000..3d225502 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOperator.java @@ -0,0 +1,118 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; + + +public class GetLibraryItemsOperator { + + @JsonProperty("key") + private String key; + + @JsonProperty("title") + private String title; + + @JsonCreator + public GetLibraryItemsOperator( + @JsonProperty("key") String key, + @JsonProperty("title") String title) { + Utils.checkNotNull(key, "key"); + Utils.checkNotNull(title, "title"); + this.key = key; + this.title = title; + } + + @JsonIgnore + public String key() { + return key; + } + + @JsonIgnore + public String title() { + return title; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetLibraryItemsOperator withKey(String key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public GetLibraryItemsOperator withTitle(String title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryItemsOperator other = (GetLibraryItemsOperator) o; + return + Objects.deepEquals(this.key, other.key) && + Objects.deepEquals(this.title, other.title); + } + + @Override + public int hashCode() { + return Objects.hash( + key, + title); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryItemsOperator.class, + "key", key, + "title", title); + } + + public final static class Builder { + + private String key; + + private String title; + + private Builder() { + // force use of static builder() method + } + + public Builder key(String key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public Builder title(String title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public GetLibraryItemsOperator build() { + return new GetLibraryItemsOperator( + key, + title); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequest.java index d88c7ac9..03a1749f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequest.java @@ -361,9 +361,9 @@ public class GetLibraryItemsRequest { private Tag tag; - private Optional includeGuids = Optional.empty(); + private Optional includeGuids; - private Optional includeMeta = Optional.empty(); + private Optional includeMeta; private Type type; @@ -499,6 +499,12 @@ public class GetLibraryItemsRequest { } public GetLibraryItemsRequest build() { + if (includeGuids == null) { + includeGuids = _SINGLETON_VALUE_IncludeGuids.value(); + } + if (includeMeta == null) { + includeMeta = _SINGLETON_VALUE_IncludeMeta.value(); + } if (xPlexContainerStart == null) { xPlexContainerStart = _SINGLETON_VALUE_XPlexContainerStart.value(); } @@ -514,6 +520,18 @@ public class GetLibraryItemsRequest { xPlexContainerSize); } + private static final LazySingletonValue> _SINGLETON_VALUE_IncludeGuids = + new LazySingletonValue<>( + "includeGuids", + "0", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_IncludeMeta = + new LazySingletonValue<>( + "includeMeta", + "0", + new TypeReference>() {}); + private static final LazySingletonValue> _SINGLETON_VALUE_XPlexContainerStart = new LazySingletonValue<>( "X-Plex-Container-Start", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequestBuilder.java index 866ca99a..e10e71d7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequestBuilder.java @@ -15,7 +15,7 @@ public class GetLibraryItemsRequestBuilder { this.sdk = sdk; } - public GetLibraryItemsRequestBuilder request(dev.plexapi.sdk.models.operations.GetLibraryItemsRequest request) { + public GetLibraryItemsRequestBuilder request(GetLibraryItemsRequest request) { Utils.checkNotNull(request, "request"); this.request = request; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsSort.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsSort.java new file mode 100644 index 00000000..c975a1fd --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsSort.java @@ -0,0 +1,283 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; + + +public class GetLibraryItemsSort { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("default") + private Optional default_; + + @JsonProperty("defaultDirection") + private String defaultDirection; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("descKey") + private Optional descKey; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("firstCharacterKey") + private Optional firstCharacterKey; + + @JsonProperty("key") + private String key; + + @JsonProperty("title") + private String title; + + @JsonCreator + public GetLibraryItemsSort( + @JsonProperty("default") Optional default_, + @JsonProperty("defaultDirection") String defaultDirection, + @JsonProperty("descKey") Optional descKey, + @JsonProperty("firstCharacterKey") Optional firstCharacterKey, + @JsonProperty("key") String key, + @JsonProperty("title") String title) { + Utils.checkNotNull(default_, "default_"); + Utils.checkNotNull(defaultDirection, "defaultDirection"); + Utils.checkNotNull(descKey, "descKey"); + Utils.checkNotNull(firstCharacterKey, "firstCharacterKey"); + Utils.checkNotNull(key, "key"); + Utils.checkNotNull(title, "title"); + this.default_ = default_; + this.defaultDirection = defaultDirection; + this.descKey = descKey; + this.firstCharacterKey = firstCharacterKey; + this.key = key; + this.title = title; + } + + public GetLibraryItemsSort( + String defaultDirection, + String key, + String title) { + this(Optional.empty(), defaultDirection, Optional.empty(), Optional.empty(), key, title); + } + + @JsonIgnore + public Optional default_() { + return default_; + } + + @JsonIgnore + public String defaultDirection() { + return defaultDirection; + } + + @JsonIgnore + public Optional descKey() { + return descKey; + } + + @JsonIgnore + public Optional firstCharacterKey() { + return firstCharacterKey; + } + + @JsonIgnore + public String key() { + return key; + } + + @JsonIgnore + public String title() { + return title; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetLibraryItemsSort withDefault(String default_) { + Utils.checkNotNull(default_, "default_"); + this.default_ = Optional.ofNullable(default_); + return this; + } + + public GetLibraryItemsSort withDefault(Optional default_) { + Utils.checkNotNull(default_, "default_"); + this.default_ = default_; + return this; + } + + public GetLibraryItemsSort withDefaultDirection(String defaultDirection) { + Utils.checkNotNull(defaultDirection, "defaultDirection"); + this.defaultDirection = defaultDirection; + return this; + } + + public GetLibraryItemsSort withDescKey(String descKey) { + Utils.checkNotNull(descKey, "descKey"); + this.descKey = Optional.ofNullable(descKey); + return this; + } + + public GetLibraryItemsSort withDescKey(Optional descKey) { + Utils.checkNotNull(descKey, "descKey"); + this.descKey = descKey; + return this; + } + + public GetLibraryItemsSort withFirstCharacterKey(String firstCharacterKey) { + Utils.checkNotNull(firstCharacterKey, "firstCharacterKey"); + this.firstCharacterKey = Optional.ofNullable(firstCharacterKey); + return this; + } + + public GetLibraryItemsSort withFirstCharacterKey(Optional firstCharacterKey) { + Utils.checkNotNull(firstCharacterKey, "firstCharacterKey"); + this.firstCharacterKey = firstCharacterKey; + return this; + } + + public GetLibraryItemsSort withKey(String key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public GetLibraryItemsSort withTitle(String title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryItemsSort other = (GetLibraryItemsSort) o; + return + Objects.deepEquals(this.default_, other.default_) && + Objects.deepEquals(this.defaultDirection, other.defaultDirection) && + Objects.deepEquals(this.descKey, other.descKey) && + Objects.deepEquals(this.firstCharacterKey, other.firstCharacterKey) && + Objects.deepEquals(this.key, other.key) && + Objects.deepEquals(this.title, other.title); + } + + @Override + public int hashCode() { + return Objects.hash( + default_, + defaultDirection, + descKey, + firstCharacterKey, + key, + title); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryItemsSort.class, + "default_", default_, + "defaultDirection", defaultDirection, + "descKey", descKey, + "firstCharacterKey", firstCharacterKey, + "key", key, + "title", title); + } + + public final static class Builder { + + private Optional default_ = Optional.empty(); + + private String defaultDirection; + + private Optional descKey = Optional.empty(); + + private Optional firstCharacterKey = Optional.empty(); + + private String key; + + private String title; + + private Builder() { + // force use of static builder() method + } + + public Builder default_(String default_) { + Utils.checkNotNull(default_, "default_"); + this.default_ = Optional.ofNullable(default_); + return this; + } + + public Builder default_(Optional default_) { + Utils.checkNotNull(default_, "default_"); + this.default_ = default_; + return this; + } + + public Builder defaultDirection(String defaultDirection) { + Utils.checkNotNull(defaultDirection, "defaultDirection"); + this.defaultDirection = defaultDirection; + return this; + } + + public Builder descKey(String descKey) { + Utils.checkNotNull(descKey, "descKey"); + this.descKey = Optional.ofNullable(descKey); + return this; + } + + public Builder descKey(Optional descKey) { + Utils.checkNotNull(descKey, "descKey"); + this.descKey = descKey; + return this; + } + + public Builder firstCharacterKey(String firstCharacterKey) { + Utils.checkNotNull(firstCharacterKey, "firstCharacterKey"); + this.firstCharacterKey = Optional.ofNullable(firstCharacterKey); + return this; + } + + public Builder firstCharacterKey(Optional firstCharacterKey) { + Utils.checkNotNull(firstCharacterKey, "firstCharacterKey"); + this.firstCharacterKey = firstCharacterKey; + return this; + } + + public Builder key(String key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public Builder title(String title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public GetLibraryItemsSort build() { + return new GetLibraryItemsSort( + default_, + defaultDirection, + descKey, + firstCharacterKey, + key, + title); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsType.java new file mode 100644 index 00000000..258dc82b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsType.java @@ -0,0 +1,319 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + + +public class GetLibraryItemsType { + + @JsonProperty("key") + private String key; + + @JsonProperty("type") + private String type; + + @JsonProperty("title") + private String title; + + @JsonProperty("active") + private boolean active; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Filter") + private Optional> filter; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Sort") + private Optional> sort; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Field") + private Optional> field; + + @JsonCreator + public GetLibraryItemsType( + @JsonProperty("key") String key, + @JsonProperty("type") String type, + @JsonProperty("title") String title, + @JsonProperty("active") boolean active, + @JsonProperty("Filter") Optional> filter, + @JsonProperty("Sort") Optional> sort, + @JsonProperty("Field") Optional> field) { + Utils.checkNotNull(key, "key"); + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(title, "title"); + Utils.checkNotNull(active, "active"); + Utils.checkNotNull(filter, "filter"); + Utils.checkNotNull(sort, "sort"); + Utils.checkNotNull(field, "field"); + this.key = key; + this.type = type; + this.title = title; + this.active = active; + this.filter = filter; + this.sort = sort; + this.field = field; + } + + public GetLibraryItemsType( + String key, + String type, + String title, + boolean active) { + this(key, type, title, active, Optional.empty(), Optional.empty(), Optional.empty()); + } + + @JsonIgnore + public String key() { + return key; + } + + @JsonIgnore + public String type() { + return type; + } + + @JsonIgnore + public String title() { + return title; + } + + @JsonIgnore + public boolean active() { + return active; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> filter() { + return (Optional>) filter; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> sort() { + return (Optional>) sort; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> field() { + return (Optional>) field; + } + + public final static Builder builder() { + return new Builder(); + } + + public GetLibraryItemsType withKey(String key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public GetLibraryItemsType withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public GetLibraryItemsType withTitle(String title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public GetLibraryItemsType withActive(boolean active) { + Utils.checkNotNull(active, "active"); + this.active = active; + return this; + } + + public GetLibraryItemsType withFilter(List filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + public GetLibraryItemsType withFilter(Optional> filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + public GetLibraryItemsType withSort(List sort) { + Utils.checkNotNull(sort, "sort"); + this.sort = Optional.ofNullable(sort); + return this; + } + + public GetLibraryItemsType withSort(Optional> sort) { + Utils.checkNotNull(sort, "sort"); + this.sort = sort; + return this; + } + + public GetLibraryItemsType withField(List field) { + Utils.checkNotNull(field, "field"); + this.field = Optional.ofNullable(field); + return this; + } + + public GetLibraryItemsType withField(Optional> field) { + Utils.checkNotNull(field, "field"); + this.field = field; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryItemsType other = (GetLibraryItemsType) o; + return + Objects.deepEquals(this.key, other.key) && + Objects.deepEquals(this.type, other.type) && + Objects.deepEquals(this.title, other.title) && + Objects.deepEquals(this.active, other.active) && + Objects.deepEquals(this.filter, other.filter) && + Objects.deepEquals(this.sort, other.sort) && + Objects.deepEquals(this.field, other.field); + } + + @Override + public int hashCode() { + return Objects.hash( + key, + type, + title, + active, + filter, + sort, + field); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryItemsType.class, + "key", key, + "type", type, + "title", title, + "active", active, + "filter", filter, + "sort", sort, + "field", field); + } + + public final static class Builder { + + private String key; + + private String type; + + private String title; + + private Boolean active; + + private Optional> filter = Optional.empty(); + + private Optional> sort = Optional.empty(); + + private Optional> field = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder key(String key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public Builder title(String title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public Builder active(boolean active) { + Utils.checkNotNull(active, "active"); + this.active = active; + return this; + } + + public Builder filter(List filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + public Builder filter(Optional> filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + public Builder sort(List sort) { + Utils.checkNotNull(sort, "sort"); + this.sort = Optional.ofNullable(sort); + return this; + } + + public Builder sort(Optional> sort) { + Utils.checkNotNull(sort, "sort"); + this.sort = sort; + return this; + } + + public Builder field(List field) { + Utils.checkNotNull(field, "field"); + this.field = Optional.ofNullable(field); + return this; + } + + public Builder field(Optional> field) { + Utils.checkNotNull(field, "field"); + this.field = field; + return this; + } + + public GetLibraryItemsType build() { + return new GetLibraryItemsType( + key, + type, + title, + active, + filter, + sort, + field); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequestBuilder.java index 9648466a..15d64b60 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequestBuilder.java @@ -16,7 +16,7 @@ public class GetMediaProvidersRequestBuilder { this.sdk = sdk; } - public GetMediaProvidersRequestBuilder xPlexToken(java.lang.String xPlexToken) { + public GetMediaProvidersRequestBuilder xPlexToken(String xPlexToken) { Utils.checkNotNull(xPlexToken, "xPlexToken"); this.xPlexToken = xPlexToken; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenRequestBuilder.java index c85c1f75..1404d80b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenRequestBuilder.java @@ -25,13 +25,13 @@ public class GetMetadataChildrenRequestBuilder { return this; } - public GetMetadataChildrenRequestBuilder includeElements(java.lang.String includeElements) { + public GetMetadataChildrenRequestBuilder includeElements(String includeElements) { Utils.checkNotNull(includeElements, "includeElements"); this.includeElements = Optional.of(includeElements); return this; } - public GetMetadataChildrenRequestBuilder includeElements(java.util.Optional includeElements) { + public GetMetadataChildrenRequestBuilder includeElements(Optional includeElements) { Utils.checkNotNull(includeElements, "includeElements"); this.includeElements = includeElements; return this; 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 62d2f9cd..5501f5a2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequest.java @@ -29,15 +29,6 @@ public class GetPinRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=strong") private Optional strong; - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Client-Identifier") - private Optional clientID; - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Product") private Optional clientName; @@ -53,19 +44,16 @@ public class GetPinRequest { @JsonCreator public GetPinRequest( Optional strong, - Optional clientID, Optional clientName, Optional deviceName, Optional clientVersion, Optional clientPlatform) { Utils.checkNotNull(strong, "strong"); - Utils.checkNotNull(clientID, "clientID"); Utils.checkNotNull(clientName, "clientName"); Utils.checkNotNull(deviceName, "deviceName"); Utils.checkNotNull(clientVersion, "clientVersion"); Utils.checkNotNull(clientPlatform, "clientPlatform"); this.strong = strong; - this.clientID = clientID; this.clientName = clientName; this.deviceName = deviceName; this.clientVersion = clientVersion; @@ -73,7 +61,7 @@ public class GetPinRequest { } public GetPinRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -87,17 +75,6 @@ public class GetPinRequest { return strong; } - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - @JsonIgnore - public Optional clientID() { - return clientID; - } - @JsonIgnore public Optional clientName() { return clientName; @@ -146,30 +123,6 @@ public class GetPinRequest { return this; } - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - public GetPinRequest withClientID(String clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = Optional.ofNullable(clientID); - return this; - } - - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - public GetPinRequest withClientID(Optional clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = clientID; - return this; - } - public GetPinRequest withClientName(String clientName) { Utils.checkNotNull(clientName, "clientName"); this.clientName = Optional.ofNullable(clientName); @@ -229,7 +182,6 @@ public class GetPinRequest { GetPinRequest other = (GetPinRequest) o; return Objects.deepEquals(this.strong, other.strong) && - Objects.deepEquals(this.clientID, other.clientID) && Objects.deepEquals(this.clientName, other.clientName) && Objects.deepEquals(this.deviceName, other.deviceName) && Objects.deepEquals(this.clientVersion, other.clientVersion) && @@ -240,7 +192,6 @@ public class GetPinRequest { public int hashCode() { return Objects.hash( strong, - clientID, clientName, deviceName, clientVersion, @@ -251,7 +202,6 @@ public class GetPinRequest { public String toString() { return Utils.toString(GetPinRequest.class, "strong", strong, - "clientID", clientID, "clientName", clientName, "deviceName", deviceName, "clientVersion", clientVersion, @@ -262,8 +212,6 @@ public class GetPinRequest { private Optional strong; - private Optional clientID = Optional.empty(); - private Optional clientName = Optional.empty(); private Optional deviceName = Optional.empty(); @@ -300,30 +248,6 @@ public class GetPinRequest { return this; } - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - public Builder clientID(String clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = Optional.ofNullable(clientID); - return this; - } - - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - public Builder clientID(Optional clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = clientID; - return this; - } - public Builder clientName(String clientName) { Utils.checkNotNull(clientName, "clientName"); this.clientName = Optional.ofNullable(clientName); @@ -377,7 +301,6 @@ public class GetPinRequest { strong = _SINGLETON_VALUE_Strong.value(); } return new GetPinRequest( strong, - clientID, clientName, deviceName, clientVersion, diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequestBuilder.java index 45d3b037..d7a9516b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequestBuilder.java @@ -18,19 +18,19 @@ public class GetPinRequestBuilder { this.sdk = sdk; } - public GetPinRequestBuilder request(dev.plexapi.sdk.models.operations.GetPinRequest request) { + public GetPinRequestBuilder request(GetPinRequest request) { Utils.checkNotNull(request, "request"); this.request = request; return this; } - public GetPinRequestBuilder serverURL(java.lang.String serverURL) { + public GetPinRequestBuilder serverURL(String serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = Optional.of(serverURL); return this; } - public GetPinRequestBuilder serverURL(java.util.Optional serverURL) { + public GetPinRequestBuilder serverURL(Optional serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = serverURL; 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 f1a910d6..f3760624 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsQueryParamType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsQueryParamType.java @@ -16,10 +16,10 @@ import com.fasterxml.jackson.annotation.JsonValue; * */ public enum GetPlaylistContentsQueryParamType { - ONE(1L), - TWO(2L), - THREE(3L), - FOUR(4L); + Movie(1L), + Show(2L), + Season(3L), + Episode(4L); @JsonValue private final long value; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRequestBuilder.java index 270fe15a..37cf4497 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRequestBuilder.java @@ -23,7 +23,7 @@ public class GetPlaylistContentsRequestBuilder { return this; } - public GetPlaylistContentsRequestBuilder type(dev.plexapi.sdk.models.operations.GetPlaylistContentsQueryParamType type) { + public GetPlaylistContentsRequestBuilder type(GetPlaylistContentsQueryParamType type) { Utils.checkNotNull(type, "type"); this.type = type; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsRequestBuilder.java index 7ca3fded..c4ae92e4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsRequestBuilder.java @@ -17,25 +17,25 @@ public class GetPlaylistsRequestBuilder { this.sdk = sdk; } - public GetPlaylistsRequestBuilder playlistType(dev.plexapi.sdk.models.operations.PlaylistType playlistType) { + public GetPlaylistsRequestBuilder playlistType(PlaylistType playlistType) { Utils.checkNotNull(playlistType, "playlistType"); this.playlistType = Optional.of(playlistType); return this; } - public GetPlaylistsRequestBuilder playlistType(java.util.Optional playlistType) { + public GetPlaylistsRequestBuilder playlistType(Optional playlistType) { Utils.checkNotNull(playlistType, "playlistType"); this.playlistType = playlistType; return this; } - public GetPlaylistsRequestBuilder smart(dev.plexapi.sdk.models.operations.QueryParamSmart smart) { + public GetPlaylistsRequestBuilder smart(QueryParamSmart smart) { Utils.checkNotNull(smart, "smart"); this.smart = Optional.of(smart); return this; } - public GetPlaylistsRequestBuilder smart(java.util.Optional smart) { + public GetPlaylistsRequestBuilder smart(Optional smart) { Utils.checkNotNull(smart, "smart"); this.smart = smart; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedRequestBuilder.java index e8854a12..ae791fa3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedRequestBuilder.java @@ -32,7 +32,7 @@ public class GetRecentlyAddedRequestBuilder { return this; } - public GetRecentlyAddedRequestBuilder xPlexContainerStart(java.util.Optional xPlexContainerStart) { + public GetRecentlyAddedRequestBuilder xPlexContainerStart(Optional xPlexContainerStart) { Utils.checkNotNull(xPlexContainerStart, "xPlexContainerStart"); this.xPlexContainerStart = xPlexContainerStart; return this; @@ -44,7 +44,7 @@ public class GetRecentlyAddedRequestBuilder { return this; } - public GetRecentlyAddedRequestBuilder xPlexContainerSize(java.util.Optional xPlexContainerSize) { + public GetRecentlyAddedRequestBuilder xPlexContainerSize(Optional xPlexContainerSize) { Utils.checkNotNull(xPlexContainerSize, "xPlexContainerSize"); this.xPlexContainerSize = xPlexContainerSize; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequestBuilder.java index 00607898..5b9a8c1c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequestBuilder.java @@ -24,13 +24,13 @@ public class GetRefreshLibraryMetadataRequestBuilder { return this; } - public GetRefreshLibraryMetadataRequestBuilder force(dev.plexapi.sdk.models.operations.Force force) { + public GetRefreshLibraryMetadataRequestBuilder force(Force force) { Utils.checkNotNull(force, "force"); this.force = Optional.of(force); return this; } - public GetRefreshLibraryMetadataRequestBuilder force(java.util.Optional force) { + public GetRefreshLibraryMetadataRequestBuilder force(Optional force) { Utils.checkNotNull(force, "force"); this.force = force; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoRequestBuilder.java index aaf1f87a..bc5b65f0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoRequestBuilder.java @@ -15,7 +15,7 @@ public class GetResizedPhotoRequestBuilder { this.sdk = sdk; } - public GetResizedPhotoRequestBuilder request(dev.plexapi.sdk.models.operations.GetResizedPhotoRequest request) { + public GetResizedPhotoRequestBuilder request(GetResizedPhotoRequest request) { Utils.checkNotNull(request, "request"); this.request = request; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsRequestBuilder.java index 1000ecad..60bcfd7f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsRequestBuilder.java @@ -23,7 +23,7 @@ public class GetResourcesStatisticsRequestBuilder { return this; } - public GetResourcesStatisticsRequestBuilder timespan(java.util.Optional timespan) { + public GetResourcesStatisticsRequestBuilder timespan(Optional timespan) { Utils.checkNotNull(timespan, "timespan"); this.timespan = timespan; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryRequestBuilder.java index e59c7d11..89b9c509 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryRequestBuilder.java @@ -23,7 +23,7 @@ public class GetSearchLibraryRequestBuilder { return this; } - public GetSearchLibraryRequestBuilder type(dev.plexapi.sdk.models.operations.QueryParamType type) { + public GetSearchLibraryRequestBuilder type(QueryParamType type) { Utils.checkNotNull(type, "type"); this.type = type; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRequestBuilder.java index 591ea5a5..873bddf6 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRequestBuilder.java @@ -16,7 +16,7 @@ public class GetSearchResultsRequestBuilder { this.sdk = sdk; } - public GetSearchResultsRequestBuilder query(java.lang.String query) { + public GetSearchResultsRequestBuilder query(String query) { Utils.checkNotNull(query, "query"); this.query = query; return this; 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 30d96a32..9fc4a9ab 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequest.java @@ -20,15 +20,6 @@ import java.util.Optional; public class GetServerResourcesRequest { - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Client-Identifier") - private Optional clientID; - /** * Include Https entries in the results */ @@ -51,33 +42,19 @@ public class GetServerResourcesRequest { @JsonCreator public GetServerResourcesRequest( - Optional clientID, Optional includeHttps, Optional includeRelay, Optional includeIPv6) { - Utils.checkNotNull(clientID, "clientID"); Utils.checkNotNull(includeHttps, "includeHttps"); Utils.checkNotNull(includeRelay, "includeRelay"); Utils.checkNotNull(includeIPv6, "includeIPv6"); - this.clientID = clientID; this.includeHttps = includeHttps; this.includeRelay = includeRelay; this.includeIPv6 = includeIPv6; } public GetServerResourcesRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); - } - - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - @JsonIgnore - public Optional clientID() { - return clientID; + this(Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -113,30 +90,6 @@ public class GetServerResourcesRequest { return new Builder(); } - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - public GetServerResourcesRequest withClientID(String clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = Optional.ofNullable(clientID); - return this; - } - - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - public GetServerResourcesRequest withClientID(Optional clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = clientID; - return this; - } - /** * Include Https entries in the results */ @@ -205,7 +158,6 @@ public class GetServerResourcesRequest { } GetServerResourcesRequest other = (GetServerResourcesRequest) o; return - Objects.deepEquals(this.clientID, other.clientID) && Objects.deepEquals(this.includeHttps, other.includeHttps) && Objects.deepEquals(this.includeRelay, other.includeRelay) && Objects.deepEquals(this.includeIPv6, other.includeIPv6); @@ -214,7 +166,6 @@ public class GetServerResourcesRequest { @Override public int hashCode() { return Objects.hash( - clientID, includeHttps, includeRelay, includeIPv6); @@ -223,7 +174,6 @@ public class GetServerResourcesRequest { @Override public String toString() { return Utils.toString(GetServerResourcesRequest.class, - "clientID", clientID, "includeHttps", includeHttps, "includeRelay", includeRelay, "includeIPv6", includeIPv6); @@ -231,8 +181,6 @@ public class GetServerResourcesRequest { public final static class Builder { - private Optional clientID = Optional.empty(); - private Optional includeHttps; private Optional includeRelay; @@ -243,30 +191,6 @@ public class GetServerResourcesRequest { // force use of static builder() method } - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - public Builder clientID(String clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = Optional.ofNullable(clientID); - return this; - } - - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - public Builder clientID(Optional clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = clientID; - return this; - } - /** * Include Https entries in the results */ @@ -335,7 +259,6 @@ public class GetServerResourcesRequest { if (includeIPv6 == null) { includeIPv6 = _SINGLETON_VALUE_IncludeIPv6.value(); } return new GetServerResourcesRequest( - clientID, includeHttps, includeRelay, includeIPv6); 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 d9123f43..20677164 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequestBuilder.java @@ -12,7 +12,6 @@ import java.util.Optional; public class GetServerResourcesRequestBuilder { - private Optional clientID = Optional.empty(); private Optional includeHttps = Utils.readDefaultOrConstValue( "includeHttps", "0", @@ -32,61 +31,49 @@ public class GetServerResourcesRequestBuilder { this.sdk = sdk; } - public GetServerResourcesRequestBuilder clientID(java.lang.String clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = Optional.of(clientID); - return this; - } - - public GetServerResourcesRequestBuilder clientID(java.util.Optional clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = clientID; - return this; - } - - public GetServerResourcesRequestBuilder includeHttps(dev.plexapi.sdk.models.operations.IncludeHttps includeHttps) { + public GetServerResourcesRequestBuilder includeHttps(IncludeHttps includeHttps) { Utils.checkNotNull(includeHttps, "includeHttps"); this.includeHttps = Optional.of(includeHttps); return this; } - public GetServerResourcesRequestBuilder includeHttps(java.util.Optional includeHttps) { + public GetServerResourcesRequestBuilder includeHttps(Optional includeHttps) { Utils.checkNotNull(includeHttps, "includeHttps"); this.includeHttps = includeHttps; return this; } - public GetServerResourcesRequestBuilder includeRelay(dev.plexapi.sdk.models.operations.IncludeRelay includeRelay) { + public GetServerResourcesRequestBuilder includeRelay(IncludeRelay includeRelay) { Utils.checkNotNull(includeRelay, "includeRelay"); this.includeRelay = Optional.of(includeRelay); return this; } - public GetServerResourcesRequestBuilder includeRelay(java.util.Optional includeRelay) { + public GetServerResourcesRequestBuilder includeRelay(Optional includeRelay) { Utils.checkNotNull(includeRelay, "includeRelay"); this.includeRelay = includeRelay; return this; } - public GetServerResourcesRequestBuilder includeIPv6(dev.plexapi.sdk.models.operations.IncludeIPv6 includeIPv6) { + public GetServerResourcesRequestBuilder includeIPv6(IncludeIPv6 includeIPv6) { Utils.checkNotNull(includeIPv6, "includeIPv6"); this.includeIPv6 = Optional.of(includeIPv6); return this; } - public GetServerResourcesRequestBuilder includeIPv6(java.util.Optional includeIPv6) { + public GetServerResourcesRequestBuilder includeIPv6(Optional includeIPv6) { Utils.checkNotNull(includeIPv6, "includeIPv6"); this.includeIPv6 = includeIPv6; return this; } - public GetServerResourcesRequestBuilder serverURL(java.lang.String serverURL) { + public GetServerResourcesRequestBuilder serverURL(String serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = Optional.of(serverURL); return this; } - public GetServerResourcesRequestBuilder serverURL(java.util.Optional serverURL) { + public GetServerResourcesRequestBuilder serverURL(Optional serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = serverURL; return this; @@ -103,7 +90,6 @@ public class GetServerResourcesRequestBuilder { includeIPv6 = _SINGLETON_VALUE_IncludeIPv6.value(); } return sdk.getServerResources( - clientID, includeHttps, includeRelay, includeIPv6, diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryRequestBuilder.java index 1b7cfe19..e21a82ba 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryRequestBuilder.java @@ -21,13 +21,13 @@ public class GetSessionHistoryRequestBuilder { this.sdk = sdk; } - public GetSessionHistoryRequestBuilder sort(java.lang.String sort) { + public GetSessionHistoryRequestBuilder sort(String sort) { Utils.checkNotNull(sort, "sort"); this.sort = Optional.of(sort); return this; } - public GetSessionHistoryRequestBuilder sort(java.util.Optional sort) { + public GetSessionHistoryRequestBuilder sort(Optional sort) { Utils.checkNotNull(sort, "sort"); this.sort = sort; return this; @@ -39,19 +39,19 @@ public class GetSessionHistoryRequestBuilder { return this; } - public GetSessionHistoryRequestBuilder accountId(java.util.Optional accountId) { + public GetSessionHistoryRequestBuilder accountId(Optional accountId) { Utils.checkNotNull(accountId, "accountId"); this.accountId = accountId; return this; } - public GetSessionHistoryRequestBuilder filter(dev.plexapi.sdk.models.operations.QueryParamFilter filter) { + public GetSessionHistoryRequestBuilder filter(QueryParamFilter filter) { Utils.checkNotNull(filter, "filter"); this.filter = Optional.of(filter); return this; } - public GetSessionHistoryRequestBuilder filter(java.util.Optional filter) { + public GetSessionHistoryRequestBuilder filter(Optional filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; return this; @@ -63,7 +63,7 @@ public class GetSessionHistoryRequestBuilder { return this; } - public GetSessionHistoryRequestBuilder librarySectionID(java.util.Optional librarySectionID) { + public GetSessionHistoryRequestBuilder librarySectionID(Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationRequestBuilder.java index 3fe5f990..048c52ea 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationRequestBuilder.java @@ -16,7 +16,7 @@ public class GetSourceConnectionInformationRequestBuilder { this.sdk = sdk; } - public GetSourceConnectionInformationRequestBuilder source(java.lang.String source) { + public GetSourceConnectionInformationRequestBuilder source(String source) { Utils.checkNotNull(source, "source"); this.source = source; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsRequestBuilder.java index 4a492593..febdc0d9 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsRequestBuilder.java @@ -23,7 +23,7 @@ public class GetStatisticsRequestBuilder { return this; } - public GetStatisticsRequestBuilder timespan(java.util.Optional timespan) { + public GetStatisticsRequestBuilder timespan(Optional timespan) { Utils.checkNotNull(timespan, "timespan"); this.timespan = timespan; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequestBuilder.java index 9c3a33b4..a6144eb5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequestBuilder.java @@ -15,7 +15,7 @@ public class GetThumbImageRequestBuilder { this.sdk = sdk; } - public GetThumbImageRequestBuilder request(dev.plexapi.sdk.models.operations.GetThumbImageRequest request) { + public GetThumbImageRequestBuilder request(GetThumbImageRequest request) { Utils.checkNotNull(request, "request"); this.request = request; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineRequestBuilder.java index 5c2c272f..64339916 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineRequestBuilder.java @@ -15,7 +15,7 @@ public class GetTimelineRequestBuilder { this.sdk = sdk; } - public GetTimelineRequestBuilder request(dev.plexapi.sdk.models.operations.GetTimelineRequest request) { + public GetTimelineRequestBuilder request(GetTimelineRequest request) { Utils.checkNotNull(request, "request"); this.request = request; 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 0d482c91..17c8a081 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequest.java @@ -13,20 +13,10 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; import java.util.Objects; -import java.util.Optional; public class GetTokenByPinIdRequest { - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Client-Identifier") - private Optional clientID; - /** * The PinID to retrieve an access token for */ @@ -35,29 +25,10 @@ public class GetTokenByPinIdRequest { @JsonCreator public GetTokenByPinIdRequest( - Optional clientID, long pinID) { - Utils.checkNotNull(clientID, "clientID"); Utils.checkNotNull(pinID, "pinID"); - this.clientID = clientID; this.pinID = pinID; } - - public GetTokenByPinIdRequest( - long pinID) { - this(Optional.empty(), pinID); - } - - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - @JsonIgnore - public Optional clientID() { - return clientID; - } /** * The PinID to retrieve an access token for @@ -71,30 +42,6 @@ public class GetTokenByPinIdRequest { return new Builder(); } - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - public GetTokenByPinIdRequest withClientID(String clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = Optional.ofNullable(clientID); - return this; - } - - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - public GetTokenByPinIdRequest withClientID(Optional clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = clientID; - return this; - } - /** * The PinID to retrieve an access token for */ @@ -114,58 +61,29 @@ public class GetTokenByPinIdRequest { } GetTokenByPinIdRequest other = (GetTokenByPinIdRequest) o; return - Objects.deepEquals(this.clientID, other.clientID) && Objects.deepEquals(this.pinID, other.pinID); } @Override public int hashCode() { return Objects.hash( - clientID, pinID); } @Override public String toString() { return Utils.toString(GetTokenByPinIdRequest.class, - "clientID", clientID, "pinID", pinID); } public final static class Builder { - private Optional clientID = Optional.empty(); - private Long pinID; private Builder() { // force use of static builder() method } - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - public Builder clientID(String clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = Optional.ofNullable(clientID); - return this; - } - - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - public Builder clientID(Optional clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = clientID; - return this; - } - /** * The PinID to retrieve an access token for */ @@ -177,7 +95,6 @@ public class GetTokenByPinIdRequest { public GetTokenByPinIdRequest build() { return new GetTokenByPinIdRequest( - clientID, pinID); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequestBuilder.java index f7004bfa..9e564bf6 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequestBuilder.java @@ -11,7 +11,6 @@ import java.util.Optional; public class GetTokenByPinIdRequestBuilder { - private Optional clientID = Optional.empty(); private Long pinID; private Optional serverURL = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetTokenByPinId sdk; @@ -19,18 +18,6 @@ public class GetTokenByPinIdRequestBuilder { public GetTokenByPinIdRequestBuilder(SDKMethodInterfaces.MethodCallGetTokenByPinId sdk) { this.sdk = sdk; } - - public GetTokenByPinIdRequestBuilder clientID(java.lang.String clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = Optional.of(clientID); - return this; - } - - public GetTokenByPinIdRequestBuilder clientID(java.util.Optional clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = clientID; - return this; - } public GetTokenByPinIdRequestBuilder pinID(long pinID) { Utils.checkNotNull(pinID, "pinID"); @@ -38,13 +25,13 @@ public class GetTokenByPinIdRequestBuilder { return this; } - public GetTokenByPinIdRequestBuilder serverURL(java.lang.String serverURL) { + public GetTokenByPinIdRequestBuilder serverURL(String serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = Optional.of(serverURL); return this; } - public GetTokenByPinIdRequestBuilder serverURL(java.util.Optional serverURL) { + public GetTokenByPinIdRequestBuilder serverURL(Optional serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = serverURL; return this; @@ -53,7 +40,6 @@ public class GetTokenByPinIdRequestBuilder { public GetTokenByPinIdResponse call() throws Exception { return sdk.getTokenByPinId( - clientID, pinID, serverURL); } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsRequestBuilder.java index 4ff44115..61fa32fb 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsRequestBuilder.java @@ -17,13 +17,13 @@ public class GetTokenDetailsRequestBuilder { this.sdk = sdk; } - public GetTokenDetailsRequestBuilder serverURL(java.lang.String serverURL) { + public GetTokenDetailsRequestBuilder serverURL(String serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = Optional.of(serverURL); return this; } - public GetTokenDetailsRequestBuilder serverURL(java.util.Optional serverURL) { + public GetTokenDetailsRequestBuilder serverURL(Optional serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = serverURL; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsUserPlexAccount.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsUserPlexAccount.java index 72878363..4d4bb56d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsUserPlexAccount.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsUserPlexAccount.java @@ -159,7 +159,7 @@ public class GetTokenDetailsUserPlexAccount { private int id; /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ @JsonProperty("joinedAt") private long joinedAt; @@ -210,7 +210,7 @@ public class GetTokenDetailsUserPlexAccount { private Optional protected_; /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ @JsonProperty("rememberExpiresAt") private long rememberExpiresAt; @@ -586,7 +586,7 @@ public class GetTokenDetailsUserPlexAccount { } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ @JsonIgnore public long joinedAt() { @@ -649,7 +649,7 @@ public class GetTokenDetailsUserPlexAccount { } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ @JsonIgnore public long rememberExpiresAt() { @@ -1031,7 +1031,7 @@ public class GetTokenDetailsUserPlexAccount { } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ public GetTokenDetailsUserPlexAccount withJoinedAt(long joinedAt) { Utils.checkNotNull(joinedAt, "joinedAt"); @@ -1140,7 +1140,7 @@ public class GetTokenDetailsUserPlexAccount { } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ public GetTokenDetailsUserPlexAccount withRememberExpiresAt(long rememberExpiresAt) { Utils.checkNotNull(rememberExpiresAt, "rememberExpiresAt"); @@ -1795,7 +1795,7 @@ public class GetTokenDetailsUserPlexAccount { } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ public Builder joinedAt(long joinedAt) { Utils.checkNotNull(joinedAt, "joinedAt"); @@ -1904,7 +1904,7 @@ public class GetTokenDetailsUserPlexAccount { } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ public Builder rememberExpiresAt(long rememberExpiresAt) { Utils.checkNotNull(rememberExpiresAt, "rememberExpiresAt"); 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 eeae2f08..2976a8ad 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentQueryParamType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentQueryParamType.java @@ -16,10 +16,10 @@ import com.fasterxml.jackson.annotation.JsonValue; * */ public enum GetTopWatchedContentQueryParamType { - ONE(1L), - TWO(2L), - THREE(3L), - FOUR(4L); + Movie(1L), + Show(2L), + Season(3L), + Episode(4L); @JsonValue private final long value; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequestBuilder.java index fd5be585..d910dfac 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequestBuilder.java @@ -18,7 +18,7 @@ public class GetTopWatchedContentRequestBuilder { this.sdk = sdk; } - public GetTopWatchedContentRequestBuilder type(dev.plexapi.sdk.models.operations.GetTopWatchedContentQueryParamType type) { + public GetTopWatchedContentRequestBuilder type(GetTopWatchedContentQueryParamType type) { Utils.checkNotNull(type, "type"); this.type = type; return this; @@ -30,7 +30,7 @@ public class GetTopWatchedContentRequestBuilder { return this; } - public GetTopWatchedContentRequestBuilder includeGuids(java.util.Optional includeGuids) { + public GetTopWatchedContentRequestBuilder includeGuids(Optional includeGuids) { Utils.checkNotNull(includeGuids, "includeGuids"); this.includeGuids = includeGuids; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenRequestBuilder.java index 7a042490..ad320b7d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenRequestBuilder.java @@ -16,13 +16,13 @@ public class GetTransientTokenRequestBuilder { this.sdk = sdk; } - public GetTransientTokenRequestBuilder type(dev.plexapi.sdk.models.operations.GetTransientTokenQueryParamType type) { + public GetTransientTokenRequestBuilder type(GetTransientTokenQueryParamType type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } - public GetTransientTokenRequestBuilder scope(dev.plexapi.sdk.models.operations.Scope scope) { + public GetTransientTokenRequestBuilder scope(Scope scope) { Utils.checkNotNull(scope, "scope"); this.scope = scope; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetUserFriendsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetUserFriendsRequestBuilder.java index af3328ca..5a6c3c26 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetUserFriendsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetUserFriendsRequestBuilder.java @@ -17,13 +17,13 @@ public class GetUserFriendsRequestBuilder { this.sdk = sdk; } - public GetUserFriendsRequestBuilder serverURL(java.lang.String serverURL) { + public GetUserFriendsRequestBuilder serverURL(String serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = Optional.of(serverURL); return this; } - public GetUserFriendsRequestBuilder serverURL(java.util.Optional serverURL) { + public GetUserFriendsRequestBuilder serverURL(Optional serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = serverURL; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequestBuilder.java index 6fba15a0..96dc4189 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequestBuilder.java @@ -18,19 +18,19 @@ public class GetWatchListRequestBuilder { this.sdk = sdk; } - public GetWatchListRequestBuilder request(dev.plexapi.sdk.models.operations.GetWatchListRequest request) { + public GetWatchListRequestBuilder request(GetWatchListRequest request) { Utils.checkNotNull(request, "request"); this.request = request; return this; } - public GetWatchListRequestBuilder serverURL(java.lang.String serverURL) { + public GetWatchListRequestBuilder serverURL(String serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = Optional.of(serverURL); return this; } - public GetWatchListRequestBuilder serverURL(java.util.Optional serverURL) { + public GetWatchListRequestBuilder serverURL(Optional serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = serverURL; return this; 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 556b9a9a..35722afd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeGuids.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeGuids.java @@ -11,17 +11,17 @@ import com.fasterxml.jackson.annotation.JsonValue; * */ public enum IncludeGuids { - ZERO(0L), - ONE(1L); + Disable(0), + Enable(1); @JsonValue - private final long value; + private final int value; - private IncludeGuids(long value) { + private IncludeGuids(int value) { this.value = value; } - public long value() { + public int value() { return value; } } 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 99bd3313..c14c7211 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeHttps.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeHttps.java @@ -10,8 +10,8 @@ import com.fasterxml.jackson.annotation.JsonValue; * IncludeHttps - Include Https entries in the results */ public enum IncludeHttps { - ZERO(0), - ONE(1); + Disable(0), + Enable(1); @JsonValue private final int value; 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 9d4a9003..625b6107 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeIPv6.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeIPv6.java @@ -10,8 +10,8 @@ import com.fasterxml.jackson.annotation.JsonValue; * IncludeIPv6 - Include IPv6 entries in the results */ public enum IncludeIPv6 { - ZERO(0), - ONE(1); + Disable(0), + Enable(1); @JsonValue private final int value; 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 25fdafec..390803ae 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeMeta.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeMeta.java @@ -11,17 +11,17 @@ import com.fasterxml.jackson.annotation.JsonValue; * */ public enum IncludeMeta { - ZERO(0L), - ONE(1L); + Disable(0), + Enable(1); @JsonValue - private final long value; + private final int value; - private IncludeMeta(long value) { + private IncludeMeta(int value) { this.value = value; } - public long value() { + public int value() { return value; } } 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 dbaa384a..38ffa732 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeRelay.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeRelay.java @@ -12,8 +12,8 @@ import com.fasterxml.jackson.annotation.JsonValue; * */ public enum IncludeRelay { - ZERO(0), - ONE(1); + Disable(0), + Enable(1); @JsonValue private final int value; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/LibrarySectionID.java b/src/main/java/dev/plexapi/sdk/models/operations/LibrarySectionID.java index 14daf7cd..bacb40bf 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/LibrarySectionID.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/LibrarySectionID.java @@ -13,6 +13,7 @@ import dev.plexapi.sdk.utils.TypedObject; import dev.plexapi.sdk.utils.Utils.JsonShape; import dev.plexapi.sdk.utils.Utils.TypeReferenceWithShape; import dev.plexapi.sdk.utils.Utils; +import java.lang.Long; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; @@ -83,8 +84,8 @@ public class LibrarySectionID { public _Deserializer() { super(LibrarySectionID.class, false, - TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT), - TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT)); + TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT), + TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Location.java b/src/main/java/dev/plexapi/sdk/models/operations/Location.java index 44a77c14..fc4499d2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Location.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Location.java @@ -7,48 +7,39 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.util.Objects; -import java.util.Optional; public class Location { - @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private int id; - @JsonInclude(Include.NON_ABSENT) @JsonProperty("path") - private Optional path; + private String path; @JsonCreator public Location( - @JsonProperty("id") Optional id, - @JsonProperty("path") Optional path) { + @JsonProperty("id") int id, + @JsonProperty("path") String path) { Utils.checkNotNull(id, "id"); Utils.checkNotNull(path, "path"); this.id = id; this.path = path; } - - public Location() { - this(Optional.empty(), Optional.empty()); - } @JsonIgnore - public Optional id() { + public int id() { return id; } @JsonIgnore - public Optional path() { + public String path() { return path; } @@ -57,24 +48,12 @@ public class Location { } public Location withId(int id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - public Location withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } public Location withPath(String path) { - Utils.checkNotNull(path, "path"); - this.path = Optional.ofNullable(path); - return this; - } - - public Location withPath(Optional path) { Utils.checkNotNull(path, "path"); this.path = path; return this; @@ -110,33 +89,21 @@ public class Location { public final static class Builder { - private Optional id = Optional.empty(); + private Integer id; - private Optional path = Optional.empty(); + private String path; private Builder() { // force use of static builder() method } public Builder id(int id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - public Builder id(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } public Builder path(String path) { - Utils.checkNotNull(path, "path"); - this.path = Optional.ofNullable(path); - return this; - } - - public Builder path(Optional path) { Utils.checkNotNull(path, "path"); this.path = path; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/LogLineRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/LogLineRequestBuilder.java index 181303bc..01fa9fc3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/LogLineRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/LogLineRequestBuilder.java @@ -18,19 +18,19 @@ public class LogLineRequestBuilder { this.sdk = sdk; } - public LogLineRequestBuilder level(dev.plexapi.sdk.models.operations.Level level) { + public LogLineRequestBuilder level(Level level) { Utils.checkNotNull(level, "level"); this.level = level; return this; } - public LogLineRequestBuilder message(java.lang.String message) { + public LogLineRequestBuilder message(String message) { Utils.checkNotNull(message, "message"); this.message = message; return this; } - public LogLineRequestBuilder source(java.lang.String source) { + public LogLineRequestBuilder source(String source) { Utils.checkNotNull(source, "source"); this.source = source; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/LogMultiLineRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/LogMultiLineRequestBuilder.java index adeece41..222c736b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/LogMultiLineRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/LogMultiLineRequestBuilder.java @@ -16,7 +16,7 @@ public class LogMultiLineRequestBuilder { this.sdk = sdk; } - public LogMultiLineRequestBuilder request(java.lang.String request) { + public LogMultiLineRequestBuilder request(String request) { Utils.checkNotNull(request, "request"); this.request = request; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/MediaGuid.java b/src/main/java/dev/plexapi/sdk/models/operations/MediaGuid.java new file mode 100644 index 00000000..7020f000 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/MediaGuid.java @@ -0,0 +1,109 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; + + +public class MediaGuid { + + /** + * Can be one of the following formats: + * imdb://tt13015952, tmdb://2434012, tvdb://7945991 + * + */ + @JsonProperty("id") + private String id; + + @JsonCreator + public MediaGuid( + @JsonProperty("id") String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + } + + /** + * Can be one of the following formats: + * imdb://tt13015952, tmdb://2434012, tvdb://7945991 + * + */ + @JsonIgnore + public String id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Can be one of the following formats: + * imdb://tt13015952, tmdb://2434012, tvdb://7945991 + * + */ + public MediaGuid withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaGuid other = (MediaGuid) o; + return + Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return Objects.hash( + id); + } + + @Override + public String toString() { + return Utils.toString(MediaGuid.class, + "id", id); + } + + public final static class Builder { + + private String id; + + private Builder() { + // force use of static builder() method + } + + /** + * Can be one of the following formats: + * imdb://tt13015952, tmdb://2434012, tvdb://7945991 + * + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public MediaGuid build() { + return new MediaGuid( + id); + } + } +} + 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 09946909..3e28b40a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/MediaReviewsVisibility.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/MediaReviewsVisibility.java @@ -6,18 +6,21 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +/** + * MediaReviewsVisibility - Whether or not the account has media reviews visibility enabled + */ public enum MediaReviewsVisibility { - ZERO(0L), - ONE(1L); + Disable(0), + Enable(1); @JsonValue - private final long value; + private final int value; - private MediaReviewsVisibility(long value) { + private MediaReviewsVisibility(int value) { this.value = value; } - public long value() { + public int value() { return value; } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Meta.java b/src/main/java/dev/plexapi/sdk/models/operations/Meta.java new file mode 100644 index 00000000..710b6186 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/Meta.java @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +/** + * Meta - The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + * + */ + +public class Meta { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Type") + private Optional> type; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("FieldType") + private Optional> fieldType; + + @JsonCreator + public Meta( + @JsonProperty("Type") Optional> type, + @JsonProperty("FieldType") Optional> fieldType) { + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(fieldType, "fieldType"); + this.type = type; + this.fieldType = fieldType; + } + + public Meta() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> type() { + return (Optional>) type; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> fieldType() { + return (Optional>) fieldType; + } + + public final static Builder builder() { + return new Builder(); + } + + public Meta withType(List type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + public Meta withType(Optional> type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public Meta withFieldType(List fieldType) { + Utils.checkNotNull(fieldType, "fieldType"); + this.fieldType = Optional.ofNullable(fieldType); + return this; + } + + public Meta withFieldType(Optional> fieldType) { + Utils.checkNotNull(fieldType, "fieldType"); + this.fieldType = fieldType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Meta other = (Meta) o; + return + Objects.deepEquals(this.type, other.type) && + Objects.deepEquals(this.fieldType, other.fieldType); + } + + @Override + public int hashCode() { + return Objects.hash( + type, + fieldType); + } + + @Override + public String toString() { + return Utils.toString(Meta.class, + "type", type, + "fieldType", fieldType); + } + + public final static class Builder { + + private Optional> type = Optional.empty(); + + private Optional> fieldType = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder type(List type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + public Builder type(Optional> type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public Builder fieldType(List fieldType) { + Utils.checkNotNull(fieldType, "fieldType"); + this.fieldType = Optional.ofNullable(fieldType); + return this; + } + + public Builder fieldType(Optional> fieldType) { + Utils.checkNotNull(fieldType, "fieldType"); + this.fieldType = fieldType; + return this; + } + + public Meta build() { + return new Meta( + type, + fieldType); + } + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchRequestBuilder.java index 132da765..942bc359 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchRequestBuilder.java @@ -25,7 +25,7 @@ public class PerformSearchRequestBuilder { this.sdk = sdk; } - public PerformSearchRequestBuilder query(java.lang.String query) { + public PerformSearchRequestBuilder query(String query) { Utils.checkNotNull(query, "query"); this.query = query; return this; @@ -37,7 +37,7 @@ public class PerformSearchRequestBuilder { return this; } - public PerformSearchRequestBuilder sectionId(java.util.Optional sectionId) { + public PerformSearchRequestBuilder sectionId(Optional sectionId) { Utils.checkNotNull(sectionId, "sectionId"); this.sectionId = sectionId; return this; @@ -49,7 +49,7 @@ public class PerformSearchRequestBuilder { return this; } - public PerformSearchRequestBuilder limit(java.util.Optional limit) { + public PerformSearchRequestBuilder limit(Optional limit) { Utils.checkNotNull(limit, "limit"); this.limit = limit; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchRequestBuilder.java index f2c1bddc..05dd0cdc 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchRequestBuilder.java @@ -25,7 +25,7 @@ public class PerformVoiceSearchRequestBuilder { this.sdk = sdk; } - public PerformVoiceSearchRequestBuilder query(java.lang.String query) { + public PerformVoiceSearchRequestBuilder query(String query) { Utils.checkNotNull(query, "query"); this.query = query; return this; @@ -37,7 +37,7 @@ public class PerformVoiceSearchRequestBuilder { return this; } - public PerformVoiceSearchRequestBuilder sectionId(java.util.Optional sectionId) { + public PerformVoiceSearchRequestBuilder sectionId(Optional sectionId) { Utils.checkNotNull(sectionId, "sectionId"); this.sectionId = sectionId; return this; @@ -49,7 +49,7 @@ public class PerformVoiceSearchRequestBuilder { return this; } - public PerformVoiceSearchRequestBuilder limit(java.util.Optional limit) { + public PerformVoiceSearchRequestBuilder limit(Optional limit) { Utils.checkNotNull(limit, "limit"); this.limit = limit; return this; 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 c6820785..9d89e346 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAutoSelectSubtitle.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAutoSelectSubtitle.java @@ -5,23 +5,22 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; -import java.lang.String; /** * PostUsersSignInDataAutoSelectSubtitle - The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) */ public enum PostUsersSignInDataAutoSelectSubtitle { - ZERO("0"), - ONE("1"); + Disable(0), + Enable(1); @JsonValue - private final String value; + private final int value; - private PostUsersSignInDataAutoSelectSubtitle(String value) { + private PostUsersSignInDataAutoSelectSubtitle(int value) { this.value = value; } - public String value() { + public int value() { return value; } } 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 c7cc2b3a..5ed6be52 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleAccessibility.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleAccessibility.java @@ -5,23 +5,22 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; -import java.lang.String; /** - * 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 shown non-SDH subtitles) + * 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) */ public enum PostUsersSignInDataDefaultSubtitleAccessibility { - ZERO("0"), - ONE("1"); + Disable(0), + Enable(1); @JsonValue - private final String value; + private final int value; - private PostUsersSignInDataDefaultSubtitleAccessibility(String value) { + private PostUsersSignInDataDefaultSubtitleAccessibility(int value) { this.value = value; } - public String value() { + public int value() { return value; } } 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 45e151f6..ba222abc 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleForced.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleForced.java @@ -5,23 +5,22 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; -import java.lang.String; /** * 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) */ public enum PostUsersSignInDataDefaultSubtitleForced { - ZERO("0"), - ONE("1"); + Disable(0), + Enable(1); @JsonValue - private final String value; + private final int value; - private PostUsersSignInDataDefaultSubtitleForced(String value) { + private PostUsersSignInDataDefaultSubtitleForced(int value) { this.value = value; } - public String value() { + public int value() { return value; } } 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 cef52bce..7fc07441 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMediaReviewsVisibility.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMediaReviewsVisibility.java @@ -6,18 +6,21 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; +/** + * PostUsersSignInDataMediaReviewsVisibility - Whether or not the account has media reviews visibility enabled + */ public enum PostUsersSignInDataMediaReviewsVisibility { - ZERO(0L), - ONE(1L); + Disable(0), + Enable(1); @JsonValue - private final long value; + private final int value; - private PostUsersSignInDataMediaReviewsVisibility(long value) { + private PostUsersSignInDataMediaReviewsVisibility(int value) { this.value = value; } - public long value() { + public int value() { return value; } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequest.java deleted file mode 100644 index c1756f63..00000000 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequest.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -package dev.plexapi.sdk.models.operations; - - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import dev.plexapi.sdk.utils.SpeakeasyMetadata; -import dev.plexapi.sdk.utils.Utils; -import java.lang.Override; -import java.lang.String; -import java.lang.SuppressWarnings; -import java.util.Objects; -import java.util.Optional; - - -public class PostUsersSignInDataRequest { - - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Client-Identifier") - private Optional clientID; - - /** - * Login credentials - */ - @SpeakeasyMetadata("request:mediaType=application/x-www-form-urlencoded") - private Optional requestBody; - - @JsonCreator - public PostUsersSignInDataRequest( - Optional clientID, - Optional requestBody) { - Utils.checkNotNull(clientID, "clientID"); - Utils.checkNotNull(requestBody, "requestBody"); - this.clientID = clientID; - this.requestBody = requestBody; - } - - public PostUsersSignInDataRequest() { - this(Optional.empty(), Optional.empty()); - } - - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - @JsonIgnore - public Optional clientID() { - return clientID; - } - - /** - * Login credentials - */ - @SuppressWarnings("unchecked") - @JsonIgnore - public Optional requestBody() { - return (Optional) requestBody; - } - - public final static Builder builder() { - return new Builder(); - } - - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - public PostUsersSignInDataRequest withClientID(String clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = Optional.ofNullable(clientID); - return this; - } - - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - public PostUsersSignInDataRequest withClientID(Optional clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = clientID; - return this; - } - - /** - * Login credentials - */ - public PostUsersSignInDataRequest withRequestBody(PostUsersSignInDataRequestBody requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); - this.requestBody = Optional.ofNullable(requestBody); - return this; - } - - /** - * Login credentials - */ - public PostUsersSignInDataRequest withRequestBody(Optional requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); - this.requestBody = requestBody; - return this; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PostUsersSignInDataRequest other = (PostUsersSignInDataRequest) o; - return - Objects.deepEquals(this.clientID, other.clientID) && - Objects.deepEquals(this.requestBody, other.requestBody); - } - - @Override - public int hashCode() { - return Objects.hash( - clientID, - requestBody); - } - - @Override - public String toString() { - return Utils.toString(PostUsersSignInDataRequest.class, - "clientID", clientID, - "requestBody", requestBody); - } - - public final static class Builder { - - private Optional clientID = Optional.empty(); - - private Optional requestBody = Optional.empty(); - - private Builder() { - // force use of static builder() method - } - - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - public Builder clientID(String clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = Optional.ofNullable(clientID); - return this; - } - - /** - * The unique identifier for the client application - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - * - */ - public Builder clientID(Optional clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = clientID; - return this; - } - - /** - * Login credentials - */ - public Builder requestBody(PostUsersSignInDataRequestBody requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); - this.requestBody = Optional.ofNullable(requestBody); - return this; - } - - /** - * Login credentials - */ - public Builder requestBody(Optional requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); - this.requestBody = requestBody; - return this; - } - - public PostUsersSignInDataRequest build() { - return new PostUsersSignInDataRequest( - clientID, - requestBody); - } - } -} - diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequestBuilder.java index ccb8694d..161d5c21 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequestBuilder.java @@ -10,8 +10,7 @@ import java.util.Optional; public class PostUsersSignInDataRequestBuilder { - private Optional clientID = Optional.empty(); - private Optional requestBody = Optional.empty(); + private Optional request = Optional.empty(); private Optional serverURL = Optional.empty(); private final SDKMethodInterfaces.MethodCallPostUsersSignInData sdk; @@ -19,37 +18,25 @@ public class PostUsersSignInDataRequestBuilder { this.sdk = sdk; } - public PostUsersSignInDataRequestBuilder clientID(java.lang.String clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = Optional.of(clientID); + public PostUsersSignInDataRequestBuilder request(PostUsersSignInDataRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); return this; } - public PostUsersSignInDataRequestBuilder clientID(java.util.Optional clientID) { - Utils.checkNotNull(clientID, "clientID"); - this.clientID = clientID; + public PostUsersSignInDataRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; return this; } - public PostUsersSignInDataRequestBuilder requestBody(dev.plexapi.sdk.models.operations.PostUsersSignInDataRequestBody requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); - this.requestBody = Optional.of(requestBody); - return this; - } - - public PostUsersSignInDataRequestBuilder requestBody(java.util.Optional requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); - this.requestBody = requestBody; - return this; - } - - public PostUsersSignInDataRequestBuilder serverURL(java.lang.String serverURL) { + public PostUsersSignInDataRequestBuilder serverURL(String serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = Optional.of(serverURL); return this; } - public PostUsersSignInDataRequestBuilder serverURL(java.util.Optional serverURL) { + public PostUsersSignInDataRequestBuilder serverURL(Optional serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = serverURL; return this; @@ -58,8 +45,7 @@ public class PostUsersSignInDataRequestBuilder { public PostUsersSignInDataResponse call() throws Exception { return sdk.postUsersSignInData( - clientID, - requestBody, + request, serverURL); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataUserPlexAccount.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataUserPlexAccount.java index b81e44b0..e9695490 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataUserPlexAccount.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataUserPlexAccount.java @@ -159,7 +159,7 @@ public class PostUsersSignInDataUserPlexAccount { private int id; /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ @JsonProperty("joinedAt") private long joinedAt; @@ -210,7 +210,7 @@ public class PostUsersSignInDataUserPlexAccount { private Optional protected_; /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ @JsonProperty("rememberExpiresAt") private long rememberExpiresAt; @@ -600,7 +600,7 @@ public class PostUsersSignInDataUserPlexAccount { } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ @JsonIgnore public long joinedAt() { @@ -663,7 +663,7 @@ public class PostUsersSignInDataUserPlexAccount { } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ @JsonIgnore public long rememberExpiresAt() { @@ -1055,7 +1055,7 @@ public class PostUsersSignInDataUserPlexAccount { } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ public PostUsersSignInDataUserPlexAccount withJoinedAt(long joinedAt) { Utils.checkNotNull(joinedAt, "joinedAt"); @@ -1164,7 +1164,7 @@ public class PostUsersSignInDataUserPlexAccount { } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ public PostUsersSignInDataUserPlexAccount withRememberExpiresAt(long rememberExpiresAt) { Utils.checkNotNull(rememberExpiresAt, "rememberExpiresAt"); @@ -1841,7 +1841,7 @@ public class PostUsersSignInDataUserPlexAccount { } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ public Builder joinedAt(long joinedAt) { Utils.checkNotNull(joinedAt, "joinedAt"); @@ -1950,7 +1950,7 @@ public class PostUsersSignInDataUserPlexAccount { } /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ public Builder rememberExpiresAt(long rememberExpiresAt) { Utils.checkNotNull(rememberExpiresAt, "rememberExpiresAt"); diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataUserProfile.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataUserProfile.java index 6616036c..abd8d2e5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataUserProfile.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataUserProfile.java @@ -44,23 +44,14 @@ public class PostUsersSignInDataUserProfile { @JsonProperty("defaultSubtitleLanguage") private Optional defaultSubtitleLanguage; - /** - * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) - */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("autoSelectSubtitle") private Optional autoSelectSubtitle; - /** - * 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 shown non-SDH subtitles) - */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("defaultSubtitleAccessibility") private Optional defaultSubtitleAccessibility; - /** - * 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) - */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("defaultSubtitleForced") private Optional defaultSubtitleForced; @@ -129,27 +120,18 @@ public class PostUsersSignInDataUserProfile { return defaultSubtitleLanguage; } - /** - * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) - */ @SuppressWarnings("unchecked") @JsonIgnore public Optional autoSelectSubtitle() { return (Optional) autoSelectSubtitle; } - /** - * 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 shown non-SDH subtitles) - */ @SuppressWarnings("unchecked") @JsonIgnore public Optional defaultSubtitleAccessibility() { return (Optional) defaultSubtitleAccessibility; } - /** - * 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) - */ @SuppressWarnings("unchecked") @JsonIgnore public Optional defaultSubtitleForced() { @@ -226,54 +208,36 @@ public class PostUsersSignInDataUserProfile { return this; } - /** - * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) - */ public PostUsersSignInDataUserProfile withAutoSelectSubtitle(PostUsersSignInDataAutoSelectSubtitle autoSelectSubtitle) { Utils.checkNotNull(autoSelectSubtitle, "autoSelectSubtitle"); this.autoSelectSubtitle = Optional.ofNullable(autoSelectSubtitle); return this; } - /** - * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) - */ public PostUsersSignInDataUserProfile withAutoSelectSubtitle(Optional autoSelectSubtitle) { Utils.checkNotNull(autoSelectSubtitle, "autoSelectSubtitle"); this.autoSelectSubtitle = autoSelectSubtitle; return this; } - /** - * 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 shown non-SDH subtitles) - */ public PostUsersSignInDataUserProfile withDefaultSubtitleAccessibility(PostUsersSignInDataDefaultSubtitleAccessibility defaultSubtitleAccessibility) { Utils.checkNotNull(defaultSubtitleAccessibility, "defaultSubtitleAccessibility"); this.defaultSubtitleAccessibility = Optional.ofNullable(defaultSubtitleAccessibility); return this; } - /** - * 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 shown non-SDH subtitles) - */ public PostUsersSignInDataUserProfile withDefaultSubtitleAccessibility(Optional defaultSubtitleAccessibility) { Utils.checkNotNull(defaultSubtitleAccessibility, "defaultSubtitleAccessibility"); this.defaultSubtitleAccessibility = defaultSubtitleAccessibility; return this; } - /** - * 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) - */ public PostUsersSignInDataUserProfile withDefaultSubtitleForced(PostUsersSignInDataDefaultSubtitleForced defaultSubtitleForced) { Utils.checkNotNull(defaultSubtitleForced, "defaultSubtitleForced"); this.defaultSubtitleForced = Optional.ofNullable(defaultSubtitleForced); return this; } - /** - * 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) - */ public PostUsersSignInDataUserProfile withDefaultSubtitleForced(Optional defaultSubtitleForced) { Utils.checkNotNull(defaultSubtitleForced, "defaultSubtitleForced"); this.defaultSubtitleForced = defaultSubtitleForced; @@ -358,15 +322,15 @@ public class PostUsersSignInDataUserProfile { private Optional defaultSubtitleLanguage = Optional.empty(); - private Optional autoSelectSubtitle = Optional.empty(); + private Optional autoSelectSubtitle; - private Optional defaultSubtitleAccessibility = Optional.empty(); + private Optional defaultSubtitleAccessibility; - private Optional defaultSubtitleForced = Optional.empty(); + private Optional defaultSubtitleForced; - private Optional watchedIndicator = Optional.empty(); + private Optional watchedIndicator; - private Optional mediaReviewsVisibility = Optional.empty(); + private Optional mediaReviewsVisibility; private Builder() { // force use of static builder() method @@ -426,54 +390,36 @@ public class PostUsersSignInDataUserProfile { return this; } - /** - * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) - */ public Builder autoSelectSubtitle(PostUsersSignInDataAutoSelectSubtitle autoSelectSubtitle) { Utils.checkNotNull(autoSelectSubtitle, "autoSelectSubtitle"); this.autoSelectSubtitle = Optional.ofNullable(autoSelectSubtitle); return this; } - /** - * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) - */ public Builder autoSelectSubtitle(Optional autoSelectSubtitle) { Utils.checkNotNull(autoSelectSubtitle, "autoSelectSubtitle"); this.autoSelectSubtitle = autoSelectSubtitle; return this; } - /** - * 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 shown non-SDH subtitles) - */ public Builder defaultSubtitleAccessibility(PostUsersSignInDataDefaultSubtitleAccessibility defaultSubtitleAccessibility) { Utils.checkNotNull(defaultSubtitleAccessibility, "defaultSubtitleAccessibility"); this.defaultSubtitleAccessibility = Optional.ofNullable(defaultSubtitleAccessibility); return this; } - /** - * 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 shown non-SDH subtitles) - */ public Builder defaultSubtitleAccessibility(Optional defaultSubtitleAccessibility) { Utils.checkNotNull(defaultSubtitleAccessibility, "defaultSubtitleAccessibility"); this.defaultSubtitleAccessibility = defaultSubtitleAccessibility; return this; } - /** - * 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) - */ public Builder defaultSubtitleForced(PostUsersSignInDataDefaultSubtitleForced defaultSubtitleForced) { Utils.checkNotNull(defaultSubtitleForced, "defaultSubtitleForced"); this.defaultSubtitleForced = Optional.ofNullable(defaultSubtitleForced); return this; } - /** - * 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) - */ public Builder defaultSubtitleForced(Optional defaultSubtitleForced) { Utils.checkNotNull(defaultSubtitleForced, "defaultSubtitleForced"); this.defaultSubtitleForced = defaultSubtitleForced; @@ -507,6 +453,21 @@ public class PostUsersSignInDataUserProfile { public PostUsersSignInDataUserProfile build() { if (autoSelectAudio == null) { autoSelectAudio = _SINGLETON_VALUE_AutoSelectAudio.value(); + } + if (autoSelectSubtitle == null) { + autoSelectSubtitle = _SINGLETON_VALUE_AutoSelectSubtitle.value(); + } + if (defaultSubtitleAccessibility == null) { + defaultSubtitleAccessibility = _SINGLETON_VALUE_DefaultSubtitleAccessibility.value(); + } + if (defaultSubtitleForced == null) { + defaultSubtitleForced = _SINGLETON_VALUE_DefaultSubtitleForced.value(); + } + if (watchedIndicator == null) { + watchedIndicator = _SINGLETON_VALUE_WatchedIndicator.value(); + } + if (mediaReviewsVisibility == null) { + mediaReviewsVisibility = _SINGLETON_VALUE_MediaReviewsVisibility.value(); } return new PostUsersSignInDataUserProfile( autoSelectAudio, defaultAudioLanguage, @@ -523,6 +484,36 @@ public class PostUsersSignInDataUserProfile { "autoSelectAudio", "true", new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_AutoSelectSubtitle = + new LazySingletonValue<>( + "autoSelectSubtitle", + "0", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_DefaultSubtitleAccessibility = + new LazySingletonValue<>( + "defaultSubtitleAccessibility", + "0", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_DefaultSubtitleForced = + new LazySingletonValue<>( + "defaultSubtitleForced", + "0", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_WatchedIndicator = + new LazySingletonValue<>( + "watchedIndicator", + "0", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_MediaReviewsVisibility = + new LazySingletonValue<>( + "mediaReviewsVisibility", + "0", + new TypeReference>() {}); } } 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 ad4e3d34..97c7de16 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataWatchedIndicator.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataWatchedIndicator.java @@ -5,20 +5,22 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; -import java.lang.String; +/** + * PostUsersSignInDataWatchedIndicator - Whether or not media watched indicators are enabled (little orange dot on media) + */ public enum PostUsersSignInDataWatchedIndicator { - ZERO("0"), - ONE("1"); + Disable(0), + Enable(1); @JsonValue - private final String value; + private final int value; - private PostUsersSignInDataWatchedIndicator(String value) { + private PostUsersSignInDataWatchedIndicator(int value) { this.value = value; } - public String value() { + public int value() { return value; } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Protocol.java b/src/main/java/dev/plexapi/sdk/models/operations/Protocol.java new file mode 100644 index 00000000..ad1d4444 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/Protocol.java @@ -0,0 +1,27 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package dev.plexapi.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.String; + +/** + * Protocol - The protocol used for the connection (http, https, etc) + */ +public enum Protocol { + HTTP("http"), + HTTPS("https"); + + @JsonValue + private final String value; + + private Protocol(String value) { + this.value = value; + } + + public String value() { + return value; + } +} 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 b293ae34..3ffa3eb9 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamType.java @@ -16,10 +16,10 @@ import com.fasterxml.jackson.annotation.JsonValue; * */ public enum QueryParamType { - ONE(1L), - TWO(2L), - THREE(3L), - FOUR(4L); + Movie(1L), + Show(2L), + Season(3L), + Episode(4L); @JsonValue private final long value; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java b/src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java index 937ab924..b2575d03 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java @@ -5,6 +5,7 @@ package dev.plexapi.sdk.models.operations; import java.lang.Double; +import java.lang.Exception; import java.lang.Integer; import java.lang.Long; import java.lang.String; @@ -14,66 +15,66 @@ public class SDKMethodInterfaces { public interface MethodCallGetServerCapabilities { - dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponse getServerCapabilitiesDirect() throws Exception; + GetServerCapabilitiesResponse getServerCapabilitiesDirect() throws Exception; } public interface MethodCallGetServerPreferences { - dev.plexapi.sdk.models.operations.GetServerPreferencesResponse getServerPreferencesDirect() throws Exception; + GetServerPreferencesResponse getServerPreferencesDirect() throws Exception; } public interface MethodCallGetAvailableClients { - dev.plexapi.sdk.models.operations.GetAvailableClientsResponse getAvailableClientsDirect() throws Exception; + GetAvailableClientsResponse getAvailableClientsDirect() throws Exception; } public interface MethodCallGetDevices { - dev.plexapi.sdk.models.operations.GetDevicesResponse getDevicesDirect() throws Exception; + GetDevicesResponse getDevicesDirect() throws Exception; } public interface MethodCallGetServerIdentity { - dev.plexapi.sdk.models.operations.GetServerIdentityResponse getServerIdentityDirect() throws Exception; + GetServerIdentityResponse getServerIdentityDirect() throws Exception; } public interface MethodCallGetMyPlexAccount { - dev.plexapi.sdk.models.operations.GetMyPlexAccountResponse getMyPlexAccountDirect() throws Exception; + GetMyPlexAccountResponse getMyPlexAccountDirect() throws Exception; } public interface MethodCallGetResizedPhoto { - dev.plexapi.sdk.models.operations.GetResizedPhotoResponse getResizedPhoto( + GetResizedPhotoResponse getResizedPhoto( GetResizedPhotoRequest request) throws Exception; } public interface MethodCallGetMediaProviders { - dev.plexapi.sdk.models.operations.GetMediaProvidersResponse getMediaProviders( + GetMediaProvidersResponse getMediaProviders( String xPlexToken) throws Exception; } public interface MethodCallGetServerList { - dev.plexapi.sdk.models.operations.GetServerListResponse getServerListDirect() throws Exception; + GetServerListResponse getServerListDirect() throws Exception; } public interface MethodCallMarkPlayed { - dev.plexapi.sdk.models.operations.MarkPlayedResponse markPlayed( + MarkPlayedResponse markPlayed( double key) throws Exception; } public interface MethodCallMarkUnplayed { - dev.plexapi.sdk.models.operations.MarkUnplayedResponse markUnplayed( + MarkUnplayedResponse markUnplayed( double key) throws Exception; } public interface MethodCallUpdatePlayProgress { - dev.plexapi.sdk.models.operations.UpdatePlayProgressResponse updatePlayProgress( + UpdatePlayProgressResponse updatePlayProgress( String key, double time, String state) throws Exception; @@ -81,93 +82,92 @@ public class SDKMethodInterfaces { public interface MethodCallGetBannerImage { - dev.plexapi.sdk.models.operations.GetBannerImageResponse getBannerImage( + GetBannerImageResponse getBannerImage( GetBannerImageRequest request) throws Exception; } public interface MethodCallGetThumbImage { - dev.plexapi.sdk.models.operations.GetThumbImageResponse getThumbImage( + GetThumbImageResponse getThumbImage( GetThumbImageRequest request) throws Exception; } public interface MethodCallGetTimeline { - dev.plexapi.sdk.models.operations.GetTimelineResponse getTimeline( + GetTimelineResponse getTimeline( GetTimelineRequest request) throws Exception; } public interface MethodCallStartUniversalTranscode { - dev.plexapi.sdk.models.operations.StartUniversalTranscodeResponse startUniversalTranscode( + StartUniversalTranscodeResponse startUniversalTranscode( StartUniversalTranscodeRequest request) throws Exception; } public interface MethodCallGetServerActivities { - dev.plexapi.sdk.models.operations.GetServerActivitiesResponse getServerActivitiesDirect() throws Exception; + GetServerActivitiesResponse getServerActivitiesDirect() throws Exception; } public interface MethodCallCancelServerActivities { - dev.plexapi.sdk.models.operations.CancelServerActivitiesResponse cancelServerActivities( + CancelServerActivitiesResponse cancelServerActivities( String activityUUID) throws Exception; } public interface MethodCallGetButlerTasks { - dev.plexapi.sdk.models.operations.GetButlerTasksResponse getButlerTasksDirect() throws Exception; + GetButlerTasksResponse getButlerTasksDirect() throws Exception; } public interface MethodCallStartAllTasks { - dev.plexapi.sdk.models.operations.StartAllTasksResponse startAllTasksDirect() throws Exception; + StartAllTasksResponse startAllTasksDirect() throws Exception; } public interface MethodCallStopAllTasks { - dev.plexapi.sdk.models.operations.StopAllTasksResponse stopAllTasksDirect() throws Exception; + StopAllTasksResponse stopAllTasksDirect() throws Exception; } public interface MethodCallStartTask { - dev.plexapi.sdk.models.operations.StartTaskResponse startTask( + StartTaskResponse startTask( TaskName taskName) throws Exception; } public interface MethodCallStopTask { - dev.plexapi.sdk.models.operations.StopTaskResponse stopTask( + StopTaskResponse stopTask( PathParamTaskName taskName) throws Exception; } public interface MethodCallGetCompanionsData { - dev.plexapi.sdk.models.operations.GetCompanionsDataResponse getCompanionsData( + GetCompanionsDataResponse getCompanionsData( Optional serverURL) throws Exception; } public interface MethodCallGetUserFriends { - dev.plexapi.sdk.models.operations.GetUserFriendsResponse getUserFriends( + GetUserFriendsResponse getUserFriends( Optional serverURL) throws Exception; } public interface MethodCallGetGeoData { - dev.plexapi.sdk.models.operations.GetGeoDataResponse getGeoData( + GetGeoDataResponse getGeoData( Optional serverURL) throws Exception; } public interface MethodCallGetHomeData { - dev.plexapi.sdk.models.operations.GetHomeDataResponse getHomeDataDirect() throws Exception; + GetHomeDataResponse getHomeDataDirect() throws Exception; } public interface MethodCallGetServerResources { - dev.plexapi.sdk.models.operations.GetServerResourcesResponse getServerResources( - Optional clientID, + GetServerResourcesResponse getServerResources( Optional includeHttps, Optional includeRelay, Optional includeIPv6, @@ -176,29 +176,28 @@ public class SDKMethodInterfaces { public interface MethodCallGetPin { - dev.plexapi.sdk.models.operations.GetPinResponse getPin( + GetPinResponse getPin( GetPinRequest request, Optional serverURL) throws Exception; } public interface MethodCallGetTokenByPinId { - dev.plexapi.sdk.models.operations.GetTokenByPinIdResponse getTokenByPinId( - Optional clientID, + GetTokenByPinIdResponse getTokenByPinId( long pinID, Optional serverURL) throws Exception; } public interface MethodCallGetGlobalHubs { - dev.plexapi.sdk.models.operations.GetGlobalHubsResponse getGlobalHubs( + GetGlobalHubsResponse getGlobalHubs( Optional count, Optional onlyTransient) throws Exception; } public interface MethodCallGetLibraryHubs { - dev.plexapi.sdk.models.operations.GetLibraryHubsResponse getLibraryHubs( + GetLibraryHubsResponse getLibraryHubs( double sectionId, Optional count, Optional onlyTransient) throws Exception; @@ -206,7 +205,7 @@ public class SDKMethodInterfaces { public interface MethodCallPerformSearch { - dev.plexapi.sdk.models.operations.PerformSearchResponse performSearch( + PerformSearchResponse performSearch( String query, Optional sectionId, Optional limit) throws Exception; @@ -214,7 +213,7 @@ public class SDKMethodInterfaces { public interface MethodCallPerformVoiceSearch { - dev.plexapi.sdk.models.operations.PerformVoiceSearchResponse performVoiceSearch( + PerformVoiceSearchResponse performVoiceSearch( String query, Optional sectionId, Optional limit) throws Exception; @@ -222,97 +221,97 @@ public class SDKMethodInterfaces { public interface MethodCallGetSearchResults { - dev.plexapi.sdk.models.operations.GetSearchResultsResponse getSearchResults( + GetSearchResultsResponse getSearchResults( String query) throws Exception; } public interface MethodCallGetFileHash { - dev.plexapi.sdk.models.operations.GetFileHashResponse getFileHash( + GetFileHashResponse getFileHash( String url, Optional type) throws Exception; } public interface MethodCallGetRecentlyAdded { - dev.plexapi.sdk.models.operations.GetRecentlyAddedResponse getRecentlyAdded( + GetRecentlyAddedResponse getRecentlyAdded( Optional xPlexContainerStart, Optional xPlexContainerSize) throws Exception; } public interface MethodCallGetAllLibraries { - dev.plexapi.sdk.models.operations.GetAllLibrariesResponse getAllLibrariesDirect() throws Exception; + GetAllLibrariesResponse getAllLibrariesDirect() throws Exception; } public interface MethodCallGetLibraryDetails { - dev.plexapi.sdk.models.operations.GetLibraryDetailsResponse getLibraryDetails( + GetLibraryDetailsResponse getLibraryDetails( int sectionKey, Optional includeDetails) throws Exception; } public interface MethodCallDeleteLibrary { - dev.plexapi.sdk.models.operations.DeleteLibraryResponse deleteLibrary( + DeleteLibraryResponse deleteLibrary( int sectionKey) throws Exception; } public interface MethodCallGetLibraryItems { - dev.plexapi.sdk.models.operations.GetLibraryItemsResponse getLibraryItems( + GetLibraryItemsResponse getLibraryItems( GetLibraryItemsRequest request) throws Exception; } public interface MethodCallGetRefreshLibraryMetadata { - dev.plexapi.sdk.models.operations.GetRefreshLibraryMetadataResponse getRefreshLibraryMetadata( + GetRefreshLibraryMetadataResponse getRefreshLibraryMetadata( int sectionKey, Optional force) throws Exception; } public interface MethodCallGetSearchLibrary { - dev.plexapi.sdk.models.operations.GetSearchLibraryResponse getSearchLibrary( + GetSearchLibraryResponse getSearchLibrary( int sectionKey, QueryParamType type) throws Exception; } public interface MethodCallGetMetaDataByRatingKey { - dev.plexapi.sdk.models.operations.GetMetaDataByRatingKeyResponse getMetaDataByRatingKey( + GetMetaDataByRatingKeyResponse getMetaDataByRatingKey( long ratingKey) throws Exception; } public interface MethodCallGetMetadataChildren { - dev.plexapi.sdk.models.operations.GetMetadataChildrenResponse getMetadataChildren( + GetMetadataChildrenResponse getMetadataChildren( double ratingKey, Optional includeElements) throws Exception; } public interface MethodCallGetTopWatchedContent { - dev.plexapi.sdk.models.operations.GetTopWatchedContentResponse getTopWatchedContent( + GetTopWatchedContentResponse getTopWatchedContent( GetTopWatchedContentQueryParamType type, Optional includeGuids) throws Exception; } public interface MethodCallGetOnDeck { - dev.plexapi.sdk.models.operations.GetOnDeckResponse getOnDeckDirect() throws Exception; + GetOnDeckResponse getOnDeckDirect() throws Exception; } public interface MethodCallGetWatchList { - dev.plexapi.sdk.models.operations.GetWatchListResponse getWatchList( + GetWatchListResponse getWatchList( GetWatchListRequest request, Optional serverURL) throws Exception; } public interface MethodCallLogLine { - dev.plexapi.sdk.models.operations.LogLineResponse logLine( + LogLineResponse logLine( Level level, String message, String source) throws Exception; @@ -320,43 +319,43 @@ public class SDKMethodInterfaces { public interface MethodCallLogMultiLine { - dev.plexapi.sdk.models.operations.LogMultiLineResponse logMultiLine( + LogMultiLineResponse logMultiLine( String request) throws Exception; } public interface MethodCallEnablePaperTrail { - dev.plexapi.sdk.models.operations.EnablePaperTrailResponse enablePaperTrailDirect() throws Exception; + EnablePaperTrailResponse enablePaperTrailDirect() throws Exception; } public interface MethodCallCreatePlaylist { - dev.plexapi.sdk.models.operations.CreatePlaylistResponse createPlaylist( + CreatePlaylistResponse createPlaylist( CreatePlaylistRequest request) throws Exception; } public interface MethodCallGetPlaylists { - dev.plexapi.sdk.models.operations.GetPlaylistsResponse getPlaylists( + GetPlaylistsResponse getPlaylists( Optional playlistType, Optional smart) throws Exception; } public interface MethodCallGetPlaylist { - dev.plexapi.sdk.models.operations.GetPlaylistResponse getPlaylist( + GetPlaylistResponse getPlaylist( double playlistID) throws Exception; } public interface MethodCallDeletePlaylist { - dev.plexapi.sdk.models.operations.DeletePlaylistResponse deletePlaylist( + DeletePlaylistResponse deletePlaylist( double playlistID) throws Exception; } public interface MethodCallUpdatePlaylist { - dev.plexapi.sdk.models.operations.UpdatePlaylistResponse updatePlaylist( + UpdatePlaylistResponse updatePlaylist( double playlistID, Optional title, Optional summary) throws Exception; @@ -364,20 +363,20 @@ public class SDKMethodInterfaces { public interface MethodCallGetPlaylistContents { - dev.plexapi.sdk.models.operations.GetPlaylistContentsResponse getPlaylistContents( + GetPlaylistContentsResponse getPlaylistContents( double playlistID, GetPlaylistContentsQueryParamType type) throws Exception; } public interface MethodCallClearPlaylistContents { - dev.plexapi.sdk.models.operations.ClearPlaylistContentsResponse clearPlaylistContents( + ClearPlaylistContentsResponse clearPlaylistContents( double playlistID) throws Exception; } public interface MethodCallAddPlaylistContents { - dev.plexapi.sdk.models.operations.AddPlaylistContentsResponse addPlaylistContents( + AddPlaylistContentsResponse addPlaylistContents( double playlistID, String uri, Optional playQueueID) throws Exception; @@ -385,64 +384,64 @@ public class SDKMethodInterfaces { public interface MethodCallUploadPlaylist { - dev.plexapi.sdk.models.operations.UploadPlaylistResponse uploadPlaylist( + UploadPlaylistResponse uploadPlaylist( String path, - QueryParamForce force) throws Exception; + QueryParamForce force, + long sectionID) throws Exception; } public interface MethodCallGetTransientToken { - dev.plexapi.sdk.models.operations.GetTransientTokenResponse getTransientToken( + GetTransientTokenResponse getTransientToken( GetTransientTokenQueryParamType type, Scope scope) throws Exception; } public interface MethodCallGetSourceConnectionInformation { - dev.plexapi.sdk.models.operations.GetSourceConnectionInformationResponse getSourceConnectionInformation( + GetSourceConnectionInformationResponse getSourceConnectionInformation( String source) throws Exception; } public interface MethodCallGetTokenDetails { - dev.plexapi.sdk.models.operations.GetTokenDetailsResponse getTokenDetails( + GetTokenDetailsResponse getTokenDetails( Optional serverURL) throws Exception; } public interface MethodCallPostUsersSignInData { - dev.plexapi.sdk.models.operations.PostUsersSignInDataResponse postUsersSignInData( - Optional clientID, - Optional requestBody, + PostUsersSignInDataResponse postUsersSignInData( + Optional request, Optional serverURL) throws Exception; } public interface MethodCallGetStatistics { - dev.plexapi.sdk.models.operations.GetStatisticsResponse getStatistics( + GetStatisticsResponse getStatistics( Optional timespan) throws Exception; } public interface MethodCallGetResourcesStatistics { - dev.plexapi.sdk.models.operations.GetResourcesStatisticsResponse getResourcesStatistics( + GetResourcesStatisticsResponse getResourcesStatistics( Optional timespan) throws Exception; } public interface MethodCallGetBandwidthStatistics { - dev.plexapi.sdk.models.operations.GetBandwidthStatisticsResponse getBandwidthStatistics( + GetBandwidthStatisticsResponse getBandwidthStatistics( Optional timespan) throws Exception; } public interface MethodCallGetSessions { - dev.plexapi.sdk.models.operations.GetSessionsResponse getSessionsDirect() throws Exception; + GetSessionsResponse getSessionsDirect() throws Exception; } public interface MethodCallGetSessionHistory { - dev.plexapi.sdk.models.operations.GetSessionHistoryResponse getSessionHistory( + GetSessionHistoryResponse getSessionHistory( Optional sort, Optional accountId, Optional filter, @@ -451,29 +450,29 @@ public class SDKMethodInterfaces { public interface MethodCallGetTranscodeSessions { - dev.plexapi.sdk.models.operations.GetTranscodeSessionsResponse getTranscodeSessionsDirect() throws Exception; + GetTranscodeSessionsResponse getTranscodeSessionsDirect() throws Exception; } public interface MethodCallStopTranscodeSession { - dev.plexapi.sdk.models.operations.StopTranscodeSessionResponse stopTranscodeSession( + StopTranscodeSessionResponse stopTranscodeSession( String sessionKey) throws Exception; } public interface MethodCallGetUpdateStatus { - dev.plexapi.sdk.models.operations.GetUpdateStatusResponse getUpdateStatusDirect() throws Exception; + GetUpdateStatusResponse getUpdateStatusDirect() throws Exception; } public interface MethodCallCheckForUpdates { - dev.plexapi.sdk.models.operations.CheckForUpdatesResponse checkForUpdates( + CheckForUpdatesResponse checkForUpdates( Optional download) throws Exception; } public interface MethodCallApplyUpdates { - dev.plexapi.sdk.models.operations.ApplyUpdatesResponse applyUpdates( + ApplyUpdatesResponse applyUpdates( Optional tonight, Optional skip) throws Exception; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StartTaskRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/StartTaskRequestBuilder.java index 03cbf215..5d4c7e01 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StartTaskRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StartTaskRequestBuilder.java @@ -15,7 +15,7 @@ public class StartTaskRequestBuilder { this.sdk = sdk; } - public StartTaskRequestBuilder taskName(dev.plexapi.sdk.models.operations.TaskName taskName) { + public StartTaskRequestBuilder taskName(TaskName taskName) { Utils.checkNotNull(taskName, "taskName"); this.taskName = taskName; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeRequestBuilder.java index feef219b..dadcbc18 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeRequestBuilder.java @@ -15,7 +15,7 @@ public class StartUniversalTranscodeRequestBuilder { this.sdk = sdk; } - public StartUniversalTranscodeRequestBuilder request(dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequest request) { + public StartUniversalTranscodeRequestBuilder request(StartUniversalTranscodeRequest request) { Utils.checkNotNull(request, "request"); this.request = request; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StopTaskRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/StopTaskRequestBuilder.java index 216bf8c5..dd143045 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StopTaskRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StopTaskRequestBuilder.java @@ -15,7 +15,7 @@ public class StopTaskRequestBuilder { this.sdk = sdk; } - public StopTaskRequestBuilder taskName(dev.plexapi.sdk.models.operations.PathParamTaskName taskName) { + public StopTaskRequestBuilder taskName(PathParamTaskName taskName) { Utils.checkNotNull(taskName, "taskName"); this.taskName = taskName; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionRequestBuilder.java index cda1199e..cf76f9c7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionRequestBuilder.java @@ -16,7 +16,7 @@ public class StopTranscodeSessionRequestBuilder { this.sdk = sdk; } - public StopTranscodeSessionRequestBuilder sessionKey(java.lang.String sessionKey) { + public StopTranscodeSessionRequestBuilder sessionKey(String sessionKey) { Utils.checkNotNull(sessionKey, "sessionKey"); this.sessionKey = sessionKey; return this; 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 0c900e46..c88c7493 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Type.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Type.java @@ -16,10 +16,10 @@ import com.fasterxml.jackson.annotation.JsonValue; * */ public enum Type { - ONE(1L), - TWO(2L), - THREE(3L), - FOUR(4L); + Movie(1L), + Show(2L), + Season(3L), + Episode(4L); @JsonValue private final long value; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressRequestBuilder.java index 9e4cbfd3..2eb6fb03 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressRequestBuilder.java @@ -19,7 +19,7 @@ public class UpdatePlayProgressRequestBuilder { this.sdk = sdk; } - public UpdatePlayProgressRequestBuilder key(java.lang.String key) { + public UpdatePlayProgressRequestBuilder key(String key) { Utils.checkNotNull(key, "key"); this.key = key; return this; @@ -31,7 +31,7 @@ public class UpdatePlayProgressRequestBuilder { return this; } - public UpdatePlayProgressRequestBuilder state(java.lang.String state) { + public UpdatePlayProgressRequestBuilder state(String state) { Utils.checkNotNull(state, "state"); this.state = state; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistRequestBuilder.java index 7bd4b939..7d2b3cdd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistRequestBuilder.java @@ -26,25 +26,25 @@ public class UpdatePlaylistRequestBuilder { return this; } - public UpdatePlaylistRequestBuilder title(java.lang.String title) { + public UpdatePlaylistRequestBuilder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.of(title); return this; } - public UpdatePlaylistRequestBuilder title(java.util.Optional title) { + public UpdatePlaylistRequestBuilder title(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; return this; } - public UpdatePlaylistRequestBuilder summary(java.lang.String summary) { + public UpdatePlaylistRequestBuilder summary(String summary) { Utils.checkNotNull(summary, "summary"); this.summary = Optional.of(summary); return this; } - public UpdatePlaylistRequestBuilder summary(java.util.Optional summary) { + public UpdatePlaylistRequestBuilder summary(Optional summary) { Utils.checkNotNull(summary, "summary"); this.summary = summary; return this; diff --git a/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistRequest.java index 069fa506..366804fe 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistRequest.java @@ -7,8 +7,11 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.utils.LazySingletonValue; import dev.plexapi.sdk.utils.SpeakeasyMetadata; import dev.plexapi.sdk.utils.Utils; +import java.lang.Long; import java.lang.Override; import java.lang.String; import java.util.Objects; @@ -38,14 +41,23 @@ public class UploadPlaylistRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=force") private QueryParamForce force; + /** + * Possibly the section ID to upload the playlist to, we are not certain. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=sectionID") + private long sectionID; + @JsonCreator public UploadPlaylistRequest( String path, - QueryParamForce force) { + QueryParamForce force, + long sectionID) { Utils.checkNotNull(path, "path"); Utils.checkNotNull(force, "force"); + Utils.checkNotNull(sectionID, "sectionID"); this.path = path; this.force = force; + this.sectionID = sectionID; } /** @@ -74,6 +86,14 @@ public class UploadPlaylistRequest { return force; } + /** + * Possibly the section ID to upload the playlist to, we are not certain. + */ + @JsonIgnore + public long sectionID() { + return sectionID; + } + public final static Builder builder() { return new Builder(); } @@ -105,6 +125,15 @@ public class UploadPlaylistRequest { this.force = force; return this; } + + /** + * Possibly the section ID to upload the playlist to, we are not certain. + */ + public UploadPlaylistRequest withSectionID(long sectionID) { + Utils.checkNotNull(sectionID, "sectionID"); + this.sectionID = sectionID; + return this; + } @Override public boolean equals(java.lang.Object o) { @@ -117,28 +146,33 @@ public class UploadPlaylistRequest { UploadPlaylistRequest other = (UploadPlaylistRequest) o; return Objects.deepEquals(this.path, other.path) && - Objects.deepEquals(this.force, other.force); + Objects.deepEquals(this.force, other.force) && + Objects.deepEquals(this.sectionID, other.sectionID); } @Override public int hashCode() { return Objects.hash( path, - force); + force, + sectionID); } @Override public String toString() { return Utils.toString(UploadPlaylistRequest.class, "path", path, - "force", force); + "force", force, + "sectionID", sectionID); } public final static class Builder { private String path; - private QueryParamForce force; + private QueryParamForce force; + + private Long sectionID; private Builder() { // force use of static builder() method @@ -171,12 +205,30 @@ public class UploadPlaylistRequest { this.force = force; return this; } + + /** + * Possibly the section ID to upload the playlist to, we are not certain. + */ + public Builder sectionID(long sectionID) { + Utils.checkNotNull(sectionID, "sectionID"); + this.sectionID = sectionID; + return this; + } public UploadPlaylistRequest build() { - return new UploadPlaylistRequest( + if (sectionID == null) { + sectionID = _SINGLETON_VALUE_SectionID.value(); + } return new UploadPlaylistRequest( path, - force); + force, + sectionID); } + + private static final LazySingletonValue _SINGLETON_VALUE_SectionID = + new LazySingletonValue<>( + "sectionID", + "1", + new TypeReference() {}); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistRequestBuilder.java index 4a6f939a..2739c987 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistRequestBuilder.java @@ -4,35 +4,54 @@ package dev.plexapi.sdk.models.operations; +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.utils.LazySingletonValue; import dev.plexapi.sdk.utils.Utils; +import java.lang.Long; import java.lang.String; public class UploadPlaylistRequestBuilder { private String path; private QueryParamForce force; + private Long sectionID; private final SDKMethodInterfaces.MethodCallUploadPlaylist sdk; public UploadPlaylistRequestBuilder(SDKMethodInterfaces.MethodCallUploadPlaylist sdk) { this.sdk = sdk; } - public UploadPlaylistRequestBuilder path(java.lang.String path) { + public UploadPlaylistRequestBuilder path(String path) { Utils.checkNotNull(path, "path"); this.path = path; return this; } - public UploadPlaylistRequestBuilder force(dev.plexapi.sdk.models.operations.QueryParamForce force) { + public UploadPlaylistRequestBuilder force(QueryParamForce force) { Utils.checkNotNull(force, "force"); this.force = force; return this; } - public UploadPlaylistResponse call() throws Exception { + public UploadPlaylistRequestBuilder sectionID(long sectionID) { + Utils.checkNotNull(sectionID, "sectionID"); + this.sectionID = sectionID; + return this; + } + public UploadPlaylistResponse call() throws Exception { + if (sectionID == null) { + sectionID = _SINGLETON_VALUE_SectionID.value(); + } return sdk.uploadPlaylist( path, - force); + force, + sectionID); } + + private static final LazySingletonValue _SINGLETON_VALUE_SectionID = + new LazySingletonValue<>( + "sectionID", + "1", + new TypeReference() {}); } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/UserProfile.java b/src/main/java/dev/plexapi/sdk/models/operations/UserProfile.java index 1b97c8d2..a918bf6a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UserProfile.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UserProfile.java @@ -44,23 +44,14 @@ public class UserProfile { @JsonProperty("defaultSubtitleLanguage") private Optional defaultSubtitleLanguage; - /** - * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) - */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("autoSelectSubtitle") private Optional autoSelectSubtitle; - /** - * 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 shown non-SDH subtitles) - */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("defaultSubtitleAccessibility") private Optional defaultSubtitleAccessibility; - /** - * 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) - */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("defaultSubtitleForced") private Optional defaultSubtitleForced; @@ -129,27 +120,18 @@ public class UserProfile { return defaultSubtitleLanguage; } - /** - * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) - */ @SuppressWarnings("unchecked") @JsonIgnore public Optional autoSelectSubtitle() { return (Optional) autoSelectSubtitle; } - /** - * 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 shown non-SDH subtitles) - */ @SuppressWarnings("unchecked") @JsonIgnore public Optional defaultSubtitleAccessibility() { return (Optional) defaultSubtitleAccessibility; } - /** - * 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) - */ @SuppressWarnings("unchecked") @JsonIgnore public Optional defaultSubtitleForced() { @@ -226,54 +208,36 @@ public class UserProfile { return this; } - /** - * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) - */ public UserProfile withAutoSelectSubtitle(AutoSelectSubtitle autoSelectSubtitle) { Utils.checkNotNull(autoSelectSubtitle, "autoSelectSubtitle"); this.autoSelectSubtitle = Optional.ofNullable(autoSelectSubtitle); return this; } - /** - * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) - */ public UserProfile withAutoSelectSubtitle(Optional autoSelectSubtitle) { Utils.checkNotNull(autoSelectSubtitle, "autoSelectSubtitle"); this.autoSelectSubtitle = autoSelectSubtitle; return this; } - /** - * 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 shown non-SDH subtitles) - */ public UserProfile withDefaultSubtitleAccessibility(DefaultSubtitleAccessibility defaultSubtitleAccessibility) { Utils.checkNotNull(defaultSubtitleAccessibility, "defaultSubtitleAccessibility"); this.defaultSubtitleAccessibility = Optional.ofNullable(defaultSubtitleAccessibility); return this; } - /** - * 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 shown non-SDH subtitles) - */ public UserProfile withDefaultSubtitleAccessibility(Optional defaultSubtitleAccessibility) { Utils.checkNotNull(defaultSubtitleAccessibility, "defaultSubtitleAccessibility"); this.defaultSubtitleAccessibility = defaultSubtitleAccessibility; return this; } - /** - * 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) - */ public UserProfile withDefaultSubtitleForced(DefaultSubtitleForced defaultSubtitleForced) { Utils.checkNotNull(defaultSubtitleForced, "defaultSubtitleForced"); this.defaultSubtitleForced = Optional.ofNullable(defaultSubtitleForced); return this; } - /** - * 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) - */ public UserProfile withDefaultSubtitleForced(Optional defaultSubtitleForced) { Utils.checkNotNull(defaultSubtitleForced, "defaultSubtitleForced"); this.defaultSubtitleForced = defaultSubtitleForced; @@ -358,15 +322,15 @@ public class UserProfile { private Optional defaultSubtitleLanguage = Optional.empty(); - private Optional autoSelectSubtitle = Optional.empty(); + private Optional autoSelectSubtitle; - private Optional defaultSubtitleAccessibility = Optional.empty(); + private Optional defaultSubtitleAccessibility; - private Optional defaultSubtitleForced = Optional.empty(); + private Optional defaultSubtitleForced; - private Optional watchedIndicator = Optional.empty(); + private Optional watchedIndicator; - private Optional mediaReviewsVisibility = Optional.empty(); + private Optional mediaReviewsVisibility; private Builder() { // force use of static builder() method @@ -426,54 +390,36 @@ public class UserProfile { return this; } - /** - * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) - */ public Builder autoSelectSubtitle(AutoSelectSubtitle autoSelectSubtitle) { Utils.checkNotNull(autoSelectSubtitle, "autoSelectSubtitle"); this.autoSelectSubtitle = Optional.ofNullable(autoSelectSubtitle); return this; } - /** - * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) - */ public Builder autoSelectSubtitle(Optional autoSelectSubtitle) { Utils.checkNotNull(autoSelectSubtitle, "autoSelectSubtitle"); this.autoSelectSubtitle = autoSelectSubtitle; return this; } - /** - * 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 shown non-SDH subtitles) - */ public Builder defaultSubtitleAccessibility(DefaultSubtitleAccessibility defaultSubtitleAccessibility) { Utils.checkNotNull(defaultSubtitleAccessibility, "defaultSubtitleAccessibility"); this.defaultSubtitleAccessibility = Optional.ofNullable(defaultSubtitleAccessibility); return this; } - /** - * 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 shown non-SDH subtitles) - */ public Builder defaultSubtitleAccessibility(Optional defaultSubtitleAccessibility) { Utils.checkNotNull(defaultSubtitleAccessibility, "defaultSubtitleAccessibility"); this.defaultSubtitleAccessibility = defaultSubtitleAccessibility; return this; } - /** - * 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) - */ public Builder defaultSubtitleForced(DefaultSubtitleForced defaultSubtitleForced) { Utils.checkNotNull(defaultSubtitleForced, "defaultSubtitleForced"); this.defaultSubtitleForced = Optional.ofNullable(defaultSubtitleForced); return this; } - /** - * 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) - */ public Builder defaultSubtitleForced(Optional defaultSubtitleForced) { Utils.checkNotNull(defaultSubtitleForced, "defaultSubtitleForced"); this.defaultSubtitleForced = defaultSubtitleForced; @@ -507,6 +453,21 @@ public class UserProfile { public UserProfile build() { if (autoSelectAudio == null) { autoSelectAudio = _SINGLETON_VALUE_AutoSelectAudio.value(); + } + if (autoSelectSubtitle == null) { + autoSelectSubtitle = _SINGLETON_VALUE_AutoSelectSubtitle.value(); + } + if (defaultSubtitleAccessibility == null) { + defaultSubtitleAccessibility = _SINGLETON_VALUE_DefaultSubtitleAccessibility.value(); + } + if (defaultSubtitleForced == null) { + defaultSubtitleForced = _SINGLETON_VALUE_DefaultSubtitleForced.value(); + } + if (watchedIndicator == null) { + watchedIndicator = _SINGLETON_VALUE_WatchedIndicator.value(); + } + if (mediaReviewsVisibility == null) { + mediaReviewsVisibility = _SINGLETON_VALUE_MediaReviewsVisibility.value(); } return new UserProfile( autoSelectAudio, defaultAudioLanguage, @@ -523,6 +484,36 @@ public class UserProfile { "autoSelectAudio", "true", new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_AutoSelectSubtitle = + new LazySingletonValue<>( + "autoSelectSubtitle", + "0", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_DefaultSubtitleAccessibility = + new LazySingletonValue<>( + "defaultSubtitleAccessibility", + "0", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_DefaultSubtitleForced = + new LazySingletonValue<>( + "defaultSubtitleForced", + "0", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_WatchedIndicator = + new LazySingletonValue<>( + "watchedIndicator", + "0", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_MediaReviewsVisibility = + new LazySingletonValue<>( + "mediaReviewsVisibility", + "0", + new TypeReference>() {}); } } 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 0a3f6c72..dd8e057d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/WatchedIndicator.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/WatchedIndicator.java @@ -5,20 +5,22 @@ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.annotation.JsonValue; -import java.lang.String; +/** + * WatchedIndicator - Whether or not media watched indicators are enabled (little orange dot on media) + */ public enum WatchedIndicator { - ZERO("0"), - ONE("1"); + Disable(0), + Enable(1); @JsonValue - private final String value; + private final int value; - private WatchedIndicator(String value) { + private WatchedIndicator(int value) { this.value = value; } - public String value() { + public int value() { return value; } } diff --git a/src/main/java/dev/plexapi/sdk/models/shared/Security.java b/src/main/java/dev/plexapi/sdk/models/shared/Security.java index 73fd797d..f6a2b95f 100644 --- a/src/main/java/dev/plexapi/sdk/models/shared/Security.java +++ b/src/main/java/dev/plexapi/sdk/models/shared/Security.java @@ -17,7 +17,7 @@ import java.util.Optional; public class Security { - @SpeakeasyMetadata("security:scheme=true,type=apiKey,subtype=query,name=X-Plex-Token") + @SpeakeasyMetadata("security:scheme=true,type=apiKey,subtype=header,name=X-Plex-Token") private Optional accessToken; @JsonCreator diff --git a/src/main/java/dev/plexapi/sdk/utils/OneOfDeserializer.java b/src/main/java/dev/plexapi/sdk/utils/OneOfDeserializer.java index ad13038d..a5dfbd4e 100644 --- a/src/main/java/dev/plexapi/sdk/utils/OneOfDeserializer.java +++ b/src/main/java/dev/plexapi/sdk/utils/OneOfDeserializer.java @@ -35,7 +35,7 @@ public class OneOfDeserializer extends StdDeserializer { private static final long serialVersionUID = -1; - private final List typeReferences; // oneOf subschemas + private final transient List typeReferences; // oneOf subschemas private final Class cls; private final boolean strict; private final ObjectMapper mapper; diff --git a/src/main/java/dev/plexapi/sdk/utils/Options.java b/src/main/java/dev/plexapi/sdk/utils/Options.java index 2977182d..5fc5a702 100644 --- a/src/main/java/dev/plexapi/sdk/utils/Options.java +++ b/src/main/java/dev/plexapi/sdk/utils/Options.java @@ -13,14 +13,14 @@ public class Options { RETRY_CONFIG; } - private Optional retryConfig = Optional.empty(); + private Optional retryConfig = Optional.empty(); - private Options(Optional retryConfig) { + private Options(Optional retryConfig) { Utils.checkNotNull(retryConfig, "retryConfig"); this.retryConfig = retryConfig; } - public Optional retryConfig() { + public Optional retryConfig() { return retryConfig; } @@ -36,17 +36,17 @@ public class Options { public final static class Builder { - private Optional retryConfig = Optional.empty(); + private Optional retryConfig = Optional.empty(); private Builder() {} - public Builder retryConfig(dev.plexapi.sdk.utils.RetryConfig retryConfig) throws IllegalArgumentException { + public Builder retryConfig(RetryConfig retryConfig) throws IllegalArgumentException { Utils.checkNotNull(retryConfig, "retryConfig"); this.retryConfig = Optional.of(retryConfig); return this; } - public Builder retryConfig(Optional retryConfig) throws IllegalArgumentException { + public Builder retryConfig(Optional retryConfig) throws IllegalArgumentException { Utils.checkNotNull(retryConfig, "retryConfig"); this.retryConfig = retryConfig; return this; diff --git a/src/main/java/dev/plexapi/sdk/utils/QueryParameters.java b/src/main/java/dev/plexapi/sdk/utils/QueryParameters.java index 534d7a65..51ff2adf 100644 --- a/src/main/java/dev/plexapi/sdk/utils/QueryParameters.java +++ b/src/main/java/dev/plexapi/sdk/utils/QueryParameters.java @@ -61,6 +61,8 @@ public class QueryParameters { List pipeDelimitedParams = parseDelimitedParams(queryParamsMetadata, value, "|"); allParams.addAll(pipeDelimitedParams); break; + default: + break; } } } @@ -71,16 +73,15 @@ public class QueryParameters { private static List parseSerializedParams(QueryParamsMetadata queryParamsMetadata, Object value) throws JsonProcessingException { 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)); break; + default: + break; } - return params; } diff --git a/src/main/java/dev/plexapi/sdk/utils/Security.java b/src/main/java/dev/plexapi/sdk/utils/Security.java index 8fe871ad..e6dc43dc 100644 --- a/src/main/java/dev/plexapi/sdk/utils/Security.java +++ b/src/main/java/dev/plexapi/sdk/utils/Security.java @@ -5,6 +5,7 @@ package dev.plexapi.sdk.utils; import java.lang.reflect.Field; +import java.nio.charset.StandardCharsets; import java.util.Base64; public final class Security { @@ -171,6 +172,9 @@ public final class Security { } requestBuilder.addHeader("Authorization", - "Basic " + Base64.getEncoder().encodeToString(String.format("%s:%s", username, password).getBytes())); + "Basic " + + Base64.getEncoder() + .encodeToString(String.format("%s:%s", username, password) + .getBytes(StandardCharsets.UTF_8))); } } \ No newline at end of file diff --git a/src/main/java/dev/plexapi/sdk/utils/TypedObject.java b/src/main/java/dev/plexapi/sdk/utils/TypedObject.java index e456a20f..a39cc660 100644 --- a/src/main/java/dev/plexapi/sdk/utils/TypedObject.java +++ b/src/main/java/dev/plexapi/sdk/utils/TypedObject.java @@ -37,7 +37,12 @@ public class TypedObject { public JsonShape shape() { return shape; } - + + @Override + public String toString() { + return String.valueOf(value); + } + public static TypedObject of(T value, JsonShape shape, TypeReference typeReference) { return new TypedObject(value, shape, typeReference); } diff --git a/src/main/java/dev/plexapi/sdk/utils/Utils.java b/src/main/java/dev/plexapi/sdk/utils/Utils.java index efd3ca98..ef74dc2b 100644 --- a/src/main/java/dev/plexapi/sdk/utils/Utils.java +++ b/src/main/java/dev/plexapi/sdk/utils/Utils.java @@ -4,36 +4,44 @@ package dev.plexapi.sdk.utils; -import java.io.InputStream; import java.io.ByteArrayInputStream; +import java.io.File; import java.io.IOException; +import java.io.InputStream; +import java.io.UncheckedIOException; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; 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; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.concurrent.Callable; -import java.util.function.BiPredicate; import java.util.HashMap; import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.List; import java.util.Locale; 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; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -44,7 +52,6 @@ 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; @@ -137,7 +144,7 @@ public final class Utils { pathParams.put(pathParamsMetadata.name, String.join(",", - array.stream().map(v -> Utils.valToString(v)) + array.stream().map(v -> valToString(v)) .collect(Collectors.toList()))); break; case MAP: @@ -149,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", Utils.valToString(e.getKey()), - Utils.valToString(e.getValue())); + return String.format("%s=%s", valToString(e.getKey()), + valToString(e.getValue())); } else { - return String.format("%s,%s", Utils.valToString(e.getKey()), - Utils.valToString(e.getValue())); + return String.format("%s,%s", valToString(e.getKey()), + valToString(e.getValue())); } }).collect(Collectors.toList()))); break; case OBJECT: if (!allowIntrospection(value.getClass())) { - pathParams.put(pathParamsMetadata.name, Utils.valToString(value)); + pathParams.put(pathParamsMetadata.name, valToString(value)); break; } List values = new ArrayList<>(); @@ -180,17 +187,17 @@ public final class Utils { if (pathParamsMetadata.explode) { values.add(String.format("%s=%s", valuePathParamsMetadata.name, - Utils.valToString(val))); + valToString(val))); } else { values.add(String.format("%s,%s", valuePathParamsMetadata.name, - Utils.valToString(val))); + valToString(val))); } } pathParams.put(pathParamsMetadata.name, String.join(",", values)); break; default: - pathParams.put(pathParamsMetadata.name, Utils.valToString(value)); + pathParams.put(pathParamsMetadata.name, valToString(value)); break; } } @@ -287,7 +294,7 @@ public final class Utils { String key = match.substring(1, match.length() - 1); String value = params.get(key); if (value != null) { - m.appendReplacement(sb, value); + m.appendReplacement(sb, URLEncoder.encode(value, StandardCharsets.UTF_8)); } } m.appendTail(sb); @@ -344,10 +351,10 @@ public final class Utils { if (headerMetadata.explode) { items.add( String.format("%s=%s", valueHeaderMetadata.name, - Utils.valToString(valueFieldValue))); + valToString(valueFieldValue))); } else { items.add(valueHeaderMetadata.name); - items.add(Utils.valToString(valueFieldValue)); + items.add(valToString(valueFieldValue)); } } @@ -370,11 +377,11 @@ public final class Utils { for (Map.Entry entry : map.entrySet()) { if (headerMetadata.explode) { - items.add(String.format("%s=%s", Utils.valToString(entry.getKey()), - Utils.valToString(entry.getValue()))); + items.add(String.format("%s=%s", valToString(entry.getKey()), + valToString(entry.getValue()))); } else { - items.add(Utils.valToString(entry.getKey())); - items.add(Utils.valToString(entry.getValue())); + items.add(valToString(entry.getKey())); + items.add(valToString(entry.getValue())); } } @@ -397,7 +404,7 @@ public final class Utils { List items = new ArrayList<>(); for (Object item : array) { - items.add(Utils.valToString(item)); + items.add(valToString(item)); } if (!result.containsKey(headerMetadata.name)) { @@ -415,7 +422,7 @@ public final class Utils { } List values = result.get(headerMetadata.name); - values.add(Utils.valToString(value)); + values.add(valToString(value)); break; } } @@ -425,17 +432,16 @@ public final class Utils { } public static String valToString(Object value) { - switch (Types.getType(value.getClass())) { - case ENUM: - try { - Field field = value.getClass().getDeclaredField("value"); - field.setAccessible(true); - return String.valueOf(field.get(value)); - } catch (Exception e) { - return "ERROR_UNKNOWN_VALUE"; - } - default: - return String.valueOf(resolveOptionals(value)); + if (value.getClass().isEnum()) { + try { + Field field = value.getClass().getDeclaredField("value"); + field.setAccessible(true); + return String.valueOf(field.get(value)); + } catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException e) { + return "ERROR_UNKNOWN_VALUE"; + } + } else { + return String.valueOf(resolveOptionals(value)); } } @@ -464,16 +470,15 @@ public final class Utils { private static Map parseSerializedParams(PathParamsMetadata pathParamsMetadata, Object value) throws JsonProcessingException { Map params = new HashMap<>(); - switch (pathParamsMetadata.serialization) { case "json": ObjectMapper mapper = JSON.getMapper(); String json = mapper.writeValueAsString(value); - - params.put(pathParamsMetadata.name, URLEncoder.encode(json, StandardCharsets.UTF_8)); + params.put(pathParamsMetadata.name, json); + break; + default: break; } - return params; } @@ -961,7 +966,7 @@ public final class Utils { public HttpResponseCached(HttpResponse response) throws IOException { this.response = response; - this.bytes = Utils.toByteArrayAndClose(response.body()); + this.bytes = toByteArrayAndClose(response.body()); } public String bodyAsUtf8() { @@ -1050,4 +1055,130 @@ public final class Utils { return (String) o; } } + + public static void recordTest(String id) { + try { + new File("build").mkdir(); + Files.writeString(Paths.get("build/test-javav2-record.txt"), id + "\n", StandardOpenOption.CREATE, + StandardOpenOption.APPEND); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + /** + * Returns an equivalent url with query parameters sorted by name. Sort is + * stable in that parameters with the same name will not be reordered. + * + * @param url input + * @return url with query parameters sorted by name + */ + public static String sortQueryParameters(String url) { + if (url == null || url.isBlank()) { + return ""; + } + String[] parts = url.split("\\?"); + if (parts.length == 1) { + return url; + } + String query = parts[1]; + String[] params = query.split("&"); + sortByDelimitedKey(params, "="); + return parts[0] + "?" + Arrays.stream(params).collect(Collectors.joining("&")); + } + + public static Object sortSerializedMaps(Object input, String regex, String delim) { + if (input == null) { + return input; + } else if (input instanceof String) { + return sortMapString((String) input, regex, delim); + } else if (input.getClass().isArray()) { + Object[] a = (Object[]) input; + String[] b = new String[a.length]; + for (int i = 0; i < a.length; i++) { + if (!(a[i] instanceof String)) { + throw new IllegalArgumentException("expected array item type of String, found " + a[i]); + } + b[i] = sortMapString((String) a[i], regex, delim); + } + return b; + } else if (input instanceof Map) { + @SuppressWarnings("unchecked") + Map a = (Map) input; + Map b = new LinkedHashMap<>(); + for (Entry entry: a.entrySet()) { + if (!(entry.getKey() instanceof String)) { + throw new IllegalArgumentException("expected map key type of String, found " + entry.getKey()); + } + if (!(entry.getValue() instanceof String)) { + throw new IllegalArgumentException("expected map value type of String, found " + entry.getValue()); + } + b.put((String) entry.getKey(), sortMapString((String) entry.getValue(), regex, delim)); + } + return b; + } else { + throw new IllegalArgumentException("unexpected type: " + input.getClass()); + } + } + + private static String sortMapString(String input, String regex, String delim) { + return Pattern.compile(regex).matcher(input).replaceAll(m -> { + String escapedDelim = Pattern.quote(delim); + String result = m.group(); + for (int i = 1; i <= m.groupCount(); i++) { + final String match = m.group(i); + String[] pairs; + if (match.contains("=")) { + pairs = match.split(escapedDelim); + sortByDelimitedKey(pairs, "="); + } else { + String[] values = match.split(escapedDelim); + if (values.length == 1) { + pairs = values; + } else { + pairs = new String[values.length / 2]; + for (int j = 0; j < values.length; j += 2) { + pairs[j / 2] = values[j] + delim + values[j + 1]; + } + } + sortByDelimitedKey(pairs, delim); + } + String joined = Arrays.stream(pairs).collect(Collectors.joining(delim)); + result = result.replace(m.group(i), joined); + } + return result; + }); + } + + private static void sortByDelimitedKey(String[] array, String delim) { + Arrays.sort(array, (a, b) -> { + String escapedDelim = Pattern.quote(delim); + String aKey = a.split(escapedDelim)[0]; + String bKey = b.split(escapedDelim)[0]; + return aKey.compareTo(bKey); + }); + } + + public static boolean isPresentAndNotNull(Optional x) { + return x.isPresent(); + } + + public static boolean isPresentAndNotNull(JsonNullable x) { + 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, "]"); + } + }